Skip to content

Commit

Permalink
add print columns for GameServerSet and GameServer (openkruise#48)
Browse files Browse the repository at this point in the history
* add print columns for GameServerSet and GameServer
Signed-off-by: ChrisLiu <[email protected]>
  • Loading branch information
chrisliu1995 authored Apr 4, 2023
1 parent 9e5bbde commit 9204359
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
jobs:

golangci-lint:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -50,7 +50,7 @@ jobs:
skip-pkg-cache: true

markdownlint-misspell-shellcheck:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
# this image is build from Dockerfile
# https://github.com/pouchcontainer/pouchlinter/blob/master/Dockerfile
container: pouchcontainer/pouchlinter:v0.1.2
Expand All @@ -63,7 +63,7 @@ jobs:
run: find ./ -name "*.sh" | grep -v vendor | xargs shellcheck

unit-tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-1.24.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:

game-kruise:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
Expand Down
1 change: 1 addition & 0 deletions apis/v1alpha1/gameserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ type NetworkPortRange struct {
//+kubebuilder:printcolumn:name="OPSSTATE",type="string",JSONPath=".spec.opsState",description="The operations state of GameServer"
//+kubebuilder:printcolumn:name="DP",type="string",JSONPath=".status.deletionPriority",description="The current deletionPriority of GameServer"
//+kubebuilder:printcolumn:name="UP",type="string",JSONPath=".status.updatePriority",description="The current updatePriority of GameServer"
//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp",description="The age of GameServer"
//+kubebuilder:resource:shortName=gs

// GameServer is the Schema for the gameservers API
Expand Down
7 changes: 7 additions & 0 deletions apis/v1alpha1/gameserverset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ type GameServerSetStatus struct {

//+genclient
//+kubebuilder:object:root=true
//+kubebuilder:printcolumn:name="DESIRED",type="integer",JSONPath=".spec.replicas",description="The desired number of GameServers."
//+kubebuilder:printcolumn:name="CURRENT",type="integer",JSONPath=".status.replicas",description="The number of currently all GameServers."
//+kubebuilder:printcolumn:name="UPDATED",type="integer",JSONPath=".status.updatedReplicas",description="The number of GameServers updated."
//+kubebuilder:printcolumn:name="READY",type="integer",JSONPath=".status.readyReplicas",description="The number of GameServers ready."
//+kubebuilder:printcolumn:name="Maintaining",type="integer",JSONPath=".status.maintainingReplicas",description="The number of GameServers Maintaining."
//+kubebuilder:printcolumn:name="WaitToBeDeleted",type="integer",JSONPath=".status.waitToBeDeletedReplicas",description="The number of GameServers WaitToBeDeleted."
//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp",description="The age of GameServerSet."
//+kubebuilder:subresource:status
//+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector
//+kubebuilder:resource:shortName=gss
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/game.kruise.io_gameservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ spec:
jsonPath: .status.updatePriority
name: UP
type: string
- description: The age of GameServer
jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
31 changes: 30 additions & 1 deletion config/crd/bases/game.kruise.io_gameserversets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,36 @@ spec:
singular: gameserverset
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: The desired number of GameServers.
jsonPath: .spec.replicas
name: DESIRED
type: integer
- description: The number of currently all GameServers.
jsonPath: .status.replicas
name: CURRENT
type: integer
- description: The number of GameServers updated.
jsonPath: .status.updatedReplicas
name: UPDATED
type: integer
- description: The number of GameServers ready.
jsonPath: .status.readyReplicas
name: READY
type: integer
- description: The number of GameServers Maintaining.
jsonPath: .status.maintainingReplicas
name: Maintaining
type: integer
- description: The number of GameServers WaitToBeDeleted.
jsonPath: .status.waitToBeDeletedReplicas
name: WaitToBeDeleted
type: integer
- description: The age of GameServerSet.
jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: GameServerSet is the Schema for the gameserversets API
Expand Down

0 comments on commit 9204359

Please sign in to comment.