Skip to content

Commit

Permalink
Use status.ports rather spec.ports with Agones (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky committed Aug 22, 2022
1 parent 376ce09 commit 10dda03
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/config/watch/agones/crd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,11 @@ impl TryFrom<GameServer> for Endpoint {
};

let address = status.address.clone();
let port = server
.spec
let port = status
.ports
.first()
.ok_or_else(|| tonic::Status::internal("No port found for game server"))?
.container_port;
.as_ref()
.and_then(|ports| ports.first().map(|status| status.port))
.ok_or_else(|| tonic::Status::internal("No port found for game server"))?;
let filter_metadata = crate::endpoint::Metadata { tokens };
Ok(Self::with_metadata((address, port).into(), filter_metadata))
}
Expand Down

0 comments on commit 10dda03

Please sign in to comment.