diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c0bf0de..beed37e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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: diff --git a/.github/workflows/e2e-1.24.yaml b/.github/workflows/e2e-1.24.yaml index 4deb6de..ea8fad2 100644 --- a/.github/workflows/e2e-1.24.yaml +++ b/.github/workflows/e2e-1.24.yaml @@ -19,7 +19,7 @@ env: jobs: game-kruise: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: diff --git a/apis/v1alpha1/gameserver_types.go b/apis/v1alpha1/gameserver_types.go index b0e7b0e..9861a43 100644 --- a/apis/v1alpha1/gameserver_types.go +++ b/apis/v1alpha1/gameserver_types.go @@ -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 diff --git a/apis/v1alpha1/gameserverset_types.go b/apis/v1alpha1/gameserverset_types.go index bfd83eb..f37fda9 100644 --- a/apis/v1alpha1/gameserverset_types.go +++ b/apis/v1alpha1/gameserverset_types.go @@ -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 diff --git a/config/crd/bases/game.kruise.io_gameservers.yaml b/config/crd/bases/game.kruise.io_gameservers.yaml index abd95b3..69fbfbe 100644 --- a/config/crd/bases/game.kruise.io_gameservers.yaml +++ b/config/crd/bases/game.kruise.io_gameservers.yaml @@ -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: diff --git a/config/crd/bases/game.kruise.io_gameserversets.yaml b/config/crd/bases/game.kruise.io_gameserversets.yaml index 1035f5f..51f32fe 100644 --- a/config/crd/bases/game.kruise.io_gameserversets.yaml +++ b/config/crd/bases/game.kruise.io_gameserversets.yaml @@ -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