add print columns for GameServerSet and GameServer (#48)

* add print columns for GameServerSet and GameServer
Signed-off-by: ChrisLiu <chrisliu1995@163.com>
This commit is contained in:
ChrisLiu 2023-04-04 16:16:38 +08:00 committed by GitHub
parent 9e5bbde674
commit 92043599cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 5 deletions

View File

@ -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:

View File

@ -19,7 +19,7 @@ env:
jobs:
game-kruise:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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