Skip to content

Commit

Permalink
chore: show cluster installation state details for get and list metho…
Browse files Browse the repository at this point in the history
…ds (#216)

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-game-servers/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [X] Ensure the tests and linter pass
- [X] Code coverage does not decrease (if any source code was changed)
- [X] Appropriate docs were updated (if necessary)

Fixes b:179738605 🦕
  • Loading branch information
irataxy authored and NimJay committed Nov 11, 2022
1 parent c4716ea commit da80359
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions game-servers/snippets/get_cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,23 @@ async function main(
realmId,
gameClusterId
),
view: 'FULL',
};

const [cluster] = await client.getGameServerCluster(request);

console.log('Game Server Cluster:');
console.log(`\tCluster name: ${cluster.name}`);
console.log(`\tCluster description: ${cluster.description}`);
console.log(
`\tCluster installed Agones version: ${cluster.clusterState.agonesVersionInstalled}`
);
console.log(
`\tCluster installed Kubernetes version: ${cluster.clusterState.kubernetesVersionInstalled}`
);
console.log(
`\tCluster installation state: ${cluster.clusterState.installationState}`
);
console.log(
`\tGKE cluster: ${cluster.connectionInfo.gkeClusterReference.cluster}`
);
Expand Down
10 changes: 10 additions & 0 deletions game-servers/snippets/list_clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async function main(
const request = {
// Provide full resource name of a Game Server Realm
parent: client.realmPath(projectId, location, realmId),
view: 'FULL',
};

const results = await client.listGameServerClusters(request);
Expand All @@ -50,6 +51,15 @@ async function main(
console.log('Game Server Cluster:');
console.log(`\tCluster name: ${cluster.name}`);
console.log(`\tCluster description: ${cluster.description}`);
console.log(
`\tCluster installed Agones version: ${cluster.clusterState.agonesVersionInstalled}`
);
console.log(
`\tCluster installed Kubernetes version: ${cluster.clusterState.kubernetesVersionInstalled}`
);
console.log(
`\tCluster installation state: ${cluster.clusterState.installationState}`
);
console.log(
`\tGKE cluster: ${cluster.connectionInfo.gkeClusterReference.cluster}`
);
Expand Down

0 comments on commit da80359

Please sign in to comment.