diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index 8dc35d8ee4..a36898c9a6 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -44,7 +44,7 @@ ENV PATH /usr/local/go/bin:/go/bin:$PATH RUN go install golang.org/x/tools/cmd/goimports@latest # the kubernetes version for the file -ENV KUBERNETES_VER 1.26.6 +ENV KUBERNETES_VER 1.27.6 # overwrite kubectl as we want a specific version RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VER}/bin/linux/amd64/kubectl && \ diff --git a/build/e2e-image/Dockerfile b/build/e2e-image/Dockerfile index 96b8fe2800..7239ae9423 100644 --- a/build/e2e-image/Dockerfile +++ b/build/e2e-image/Dockerfile @@ -15,7 +15,7 @@ RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \ ENV PATH /usr/local/go/bin:/go/bin:$PATH # install kubectl without gcloud as we want the last version -ENV KUBECTL_VER 1.26.6 +ENV KUBECTL_VER 1.27.6 RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VER}/bin/linux/amd64/kubectl && \ chmod go+rx ./kubectl && \ mv ./kubectl /usr/local/bin/kubectl diff --git a/build/includes/kind.mk b/build/includes/kind.mk index 646c4ca36d..1409dab6e6 100644 --- a/build/includes/kind.mk +++ b/build/includes/kind.mk @@ -26,7 +26,7 @@ kind-test-cluster: DOCKER_RUN_ARGS+=--network=host kind-test-cluster: $(ensure-build-image) @if [ -z $$(kind get clusters | grep $(KIND_PROFILE)) ]; then\ echo "Could not find $(KIND_PROFILE) cluster. Creating...";\ - kind create cluster --name $(KIND_PROFILE) --image kindest/node:v1.26.6 --wait 5m;\ + kind create cluster --name $(KIND_PROFILE) --image kindest/node:v1.27.3 --wait 5m;\ fi # deletes the kind agones cluster diff --git a/build/includes/minikube.mk b/build/includes/minikube.mk index 14dce7cb0f..5a2eb9e2a1 100644 --- a/build/includes/minikube.mk +++ b/build/includes/minikube.mk @@ -28,7 +28,7 @@ minikube_cert_mount := ~/.minikube:$(HOME)/.minikube # of the right version. minikube-test-cluster: DOCKER_RUN_ARGS+=--network=host -v $(minikube_cert_mount) minikube-test-cluster: $(ensure-build-image) - $(MINIKUBE) start --kubernetes-version v1.26.6 -p $(MINIKUBE_PROFILE) --driver $(MINIKUBE_DRIVER) + $(MINIKUBE) start --kubernetes-version v1.27.6 -p $(MINIKUBE_PROFILE) --driver $(MINIKUBE_DRIVER) # Connecting to minikube requires so enhanced permissions, so use this target # instead of `make shell` to start an interactive shell for development on minikube. diff --git a/build/terraform/e2e/module.tf b/build/terraform/e2e/module.tf index 80b73df844..1d23bb5853 100644 --- a/build/terraform/e2e/module.tf +++ b/build/terraform/e2e/module.tf @@ -40,7 +40,8 @@ variable "kubernetes_versions" { default = { "1.25" = ["us-central1", "REGULAR"] "1.26" = ["asia-east1", "REGULAR"] - "1.27" = ["us-east1", "RAPID"] + "1.27" = ["us-east1", "REGULAR"] + "1.28" = ["us-west1", "RAPID"] } } diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 37bc94a2ea..042e857949 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -288,7 +288,7 @@ steps: set -o pipefail pids=() cloudProducts=("generic" "gke-autopilot") - declare -A versionsAndRegions=( [1.25]=us-central1 [1.26]=asia-east1 [1.27]=us-east1 ) + declare -A versionsAndRegions=( [1.26]=asia-east1 [1.27]=us-east1 [1.28]=us-west1 ) for cloudProduct in ${cloudProducts[@]} do for version in "${!versionsAndRegions[@]}" diff --git a/cmd/ping/udp_test.go b/cmd/ping/udp_test.go index ee3592950e..b8bc44e713 100644 --- a/cmd/ping/udp_test.go +++ b/cmd/ping/udp_test.go @@ -114,7 +114,7 @@ func TestUDPServerHealth(t *testing.T) { cancel() - err = wait.PollImmediate(time.Second, 5*time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Second, true, func(ctx context.Context) (bool, error) { return u.Health() != nil, nil }) diff --git a/go.mod b/go.mod index 8ef4c310ab..97b1ca64cf 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.0 github.com/stretchr/testify v1.8.1 - github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 + github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 go.opencensus.io v0.24.0 golang.org/x/net v0.17.0 golang.org/x/oauth2 v0.12.0 @@ -39,12 +39,13 @@ require ( google.golang.org/protobuf v1.31.0 gopkg.in/fsnotify.v1 v1.4.7 gopkg.in/natefinch/lumberjack.v2 v2.0.0 - k8s.io/api v0.26.6 - k8s.io/apiextensions-apiserver v0.26.6 - k8s.io/apimachinery v0.26.6 - k8s.io/client-go v0.26.6 - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 - k8s.io/utils v0.0.0-20221107191617-1a15be271d1d + k8s.io/api v0.27.6 + k8s.io/apiextensions-apiserver v0.27.6 + k8s.io/apimachinery v0.27.6 + k8s.io/client-go v0.27.6 + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f + k8s.io/utils v0.0.0-20230209194617-a36077c30491 + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 ) require ( @@ -60,9 +61,9 @@ require ( github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -78,7 +79,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/magiconair/properties v1.8.1 // indirect - github.com/mailru/easyjson v0.7.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -88,7 +89,6 @@ require ( github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/afero v1.9.2 // indirect github.com/spf13/cast v1.3.0 // indirect @@ -111,7 +111,6 @@ require ( k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect k8s.io/klog v1.0.0 // indirect k8s.io/klog/v2 v2.90.1 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 9c7819bf88..34968aee1d 100644 --- a/go.sum +++ b/go.sum @@ -148,18 +148,19 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.19.5 h1:Xm0Ao53uqnk9QE/LlYV5DEU09UAgpliA85QoT9LzqPw= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -232,6 +233,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.5 h1:8IYp3w9nysqv3JH+NJgXJzGbDHzLOTj43BmSkp+O7qg= github.com/google/s2a-go v0.1.5/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= @@ -313,6 +315,7 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -322,8 +325,8 @@ github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzR github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91 h1:JnZSkFP1/GLwKCEuuWVhsacvbDQIVa5BRwAwd+9k2Vw= github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -356,10 +359,9 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -409,7 +411,6 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -419,6 +420,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= @@ -448,7 +450,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -457,8 +458,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -569,6 +570,7 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -618,6 +620,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -646,6 +649,7 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -857,8 +861,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -890,14 +894,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.6 h1:RZsJGP5p/qdWuFVqj/JFyt+6ttfgL+8/K8gtyi7riuo= -k8s.io/api v0.26.6/go.mod h1:Z+i6M3de4+LJiXtIiWSz/yLpnG+YjxAkeW6cgZqoxn4= -k8s.io/apiextensions-apiserver v0.26.6 h1:BrrWb5gQlWuwvqGJs1xMV1Qtr+xQS6ri6A1QBT4rnz8= -k8s.io/apiextensions-apiserver v0.26.6/go.mod h1:T6zbudRhmwN0sxg9lD51co/3Ah3JuCduz0nbtxyRXrk= -k8s.io/apimachinery v0.26.6 h1:OT04J9US8G+AqfqvcJZZ8s3WUQkWbc3t6ePPWieDN6I= -k8s.io/apimachinery v0.26.6/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= -k8s.io/client-go v0.26.6 h1:CtC0wOxkAwjYyG2URGzdEKo0nLILopSDYn5AmzOkdi4= -k8s.io/client-go v0.26.6/go.mod h1:HDjbQGY7XzFYFUWOPAfAsIYhvFXyc9l6Ne0pO0bOQ7o= +k8s.io/api v0.27.6 h1:PBWu/lywJe2qQcshMjubzcBg7+XDZOo7O8JJAWuYtUo= +k8s.io/api v0.27.6/go.mod h1:AQYj0UsFCp3qJE7bOVnUuy4orCsXVkvHefnbYQiNWgk= +k8s.io/apiextensions-apiserver v0.27.6 h1:mOwSBJtThZhpJr+8gEkc3wFDIjq87E3JspR5mtZxIg8= +k8s.io/apiextensions-apiserver v0.27.6/go.mod h1:AVNlLYRrESG5Poo6ASRUhY2pvoKPcNt8y/IuZ4lx3o8= +k8s.io/apimachinery v0.27.6 h1:mGU8jmBq5o8mWBov+mLjdTBcU+etTE19waies4AQ6NE= +k8s.io/apimachinery v0.27.6/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/client-go v0.27.6 h1:vzI8804gpUtpMCNaFjIFyJrifH7u//LJCJPy8fQuYQg= +k8s.io/client-go v0.27.6/go.mod h1:PMsXcDKiJTW7PHJ64oEsIUJF319wm+EFlCj76oE5QXM= k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 h1:iu3o/SxaHVI7tKPtkGzD3M9IzrE21j+CUKH98NQJ8Ms= k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -907,15 +911,15 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= -k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= +k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/install/helm/agones/templates/hooks/pre_delete_hook.yaml b/install/helm/agones/templates/hooks/pre_delete_hook.yaml index 75cb0b43af..46b60e6133 100644 --- a/install/helm/agones/templates/hooks/pre_delete_hook.yaml +++ b/install/helm/agones/templates/hooks/pre_delete_hook.yaml @@ -41,7 +41,7 @@ spec: restartPolicy: Never containers: - name: pre-delete-delete-agones-resources - image: "bitnami/kubectl:1.26.6" + image: "bitnami/kubectl:1.27.7" command: - "/bin/sh" - "/scripts/delete_agones_resources.sh" diff --git a/install/terraform/modules/aks/variables.tf b/install/terraform/modules/aks/variables.tf index 2fd7002622..80d38fe179 100644 --- a/install/terraform/modules/aks/variables.tf +++ b/install/terraform/modules/aks/variables.tf @@ -34,7 +34,7 @@ variable "enable_node_public_ip" { } variable "kubernetes_version" { - default = "1.27.1" + default = "1.28.0" } variable "machine_type" { diff --git a/install/terraform/modules/eks/eks.tf b/install/terraform/modules/eks/eks.tf index 6381bbd953..07b0e1b40c 100644 --- a/install/terraform/modules/eks/eks.tf +++ b/install/terraform/modules/eks/eks.tf @@ -100,7 +100,7 @@ module "eks" { cluster_name = var.cluster_name subnets = module.vpc.public_subnets vpc_id = module.vpc.vpc_id - cluster_version = "1.27" + cluster_version = "1.28" worker_groups_launch_template = [ { diff --git a/install/terraform/modules/gke-autopilot/cluster.tf b/install/terraform/modules/gke-autopilot/cluster.tf index 5fc9ecb03d..050aa5c2dc 100644 --- a/install/terraform/modules/gke-autopilot/cluster.tf +++ b/install/terraform/modules/gke-autopilot/cluster.tf @@ -28,7 +28,7 @@ locals { network = lookup(var.cluster, "network", "default") subnetwork = lookup(var.cluster, "subnetwork", "") releaseChannel = lookup(var.cluster, "releaseChannel", "REGULAR") - kubernetesVersion = lookup(var.cluster, "kubernetesVersion", "1.26") + kubernetesVersion = lookup(var.cluster, "kubernetesVersion", "1.27") maintenanceExclusionStartTime = lookup(var.cluster, "maintenanceExclusionStartTime", timestamp()) maintenanceExclusionEndTime = lookup(var.cluster, "maintenanceExclusionEndTime", timeadd(timestamp(), "4080h")) # 170 days } diff --git a/install/terraform/modules/gke-autopilot/variables.tf b/install/terraform/modules/gke-autopilot/variables.tf index 868a2968af..27c9b5500c 100644 --- a/install/terraform/modules/gke-autopilot/variables.tf +++ b/install/terraform/modules/gke-autopilot/variables.tf @@ -26,7 +26,7 @@ variable "cluster" { "network" = "default" "subnetwork" = "" "releaseChannel" = "REGULAR" - "kubernetesVersion" = "1.26" + "kubernetesVersion" = "1.27" } } diff --git a/install/terraform/modules/gke/cluster.tf b/install/terraform/modules/gke/cluster.tf index 281b693f6e..7af76cd3d7 100644 --- a/install/terraform/modules/gke/cluster.tf +++ b/install/terraform/modules/gke/cluster.tf @@ -32,7 +32,7 @@ locals { network = lookup(var.cluster, "network", "default") subnetwork = lookup(var.cluster, "subnetwork", "") releaseChannel = lookup(var.cluster, "releaseChannel", "UNSPECIFIED") - kubernetesVersion = lookup(var.cluster, "kubernetesVersion", "1.26") + kubernetesVersion = lookup(var.cluster, "kubernetesVersion", "1.27") windowsInitialNodeCount = lookup(var.cluster, "windowsInitialNodeCount", "0") windowsMachineType = lookup(var.cluster, "windowsMachineType", "e2-standard-4") autoscale = lookup(var.cluster, "autoscale", false) @@ -40,8 +40,8 @@ locals { minNodeCount = lookup(var.cluster, "minNodeCount", "1") maxNodeCount = lookup(var.cluster, "maxNodeCount", "5") maintenanceExclusionStartTime = lookup(var.cluster, "maintenanceExclusionStartTime", timestamp()) - maintenanceExclusionEndTime = lookup(var.cluster, "maintenanceExclusionEndTime", timeadd(timestamp(), "4080h")) - # 170 days + maintenanceExclusionEndTime = lookup(var.cluster, "maintenanceExclusionEndTime", timeadd(timestamp(), "2640h")) + # 110 days } data "google_container_engine_versions" "version" { diff --git a/install/terraform/modules/gke/variables.tf b/install/terraform/modules/gke/variables.tf index 9d4cdc7bd5..55acdbaf93 100644 --- a/install/terraform/modules/gke/variables.tf +++ b/install/terraform/modules/gke/variables.tf @@ -28,7 +28,7 @@ variable "cluster" { "network" = "default" "subnetwork" = "" "releaseChannel" = "UNSPECIFIED" - "kubernetesVersion" = "1.26" + "kubernetesVersion" = "1.27" "windowsInitialNodeCount" = "0" "windowsMachineType" = "e2-standard-4" "autoscale" = false diff --git a/pkg/client/applyconfiguration/agones/v1/aggregatedcounterstatus.go b/pkg/client/applyconfiguration/agones/v1/aggregatedcounterstatus.go new file mode 100644 index 0000000000..2608a8393b --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/aggregatedcounterstatus.go @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AggregatedCounterStatusApplyConfiguration represents an declarative configuration of the AggregatedCounterStatus type for use +// with apply. +type AggregatedCounterStatusApplyConfiguration struct { + AllocatedCount *int64 `json:"allocatedCount,omitempty"` + AllocatedCapacity *int64 `json:"allocatedCapacity,omitempty"` + Count *int64 `json:"count,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` +} + +// AggregatedCounterStatusApplyConfiguration constructs an declarative configuration of the AggregatedCounterStatus type for use with +// apply. +func AggregatedCounterStatus() *AggregatedCounterStatusApplyConfiguration { + return &AggregatedCounterStatusApplyConfiguration{} +} + +// WithAllocatedCount sets the AllocatedCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedCount field is set to the value of the last call. +func (b *AggregatedCounterStatusApplyConfiguration) WithAllocatedCount(value int64) *AggregatedCounterStatusApplyConfiguration { + b.AllocatedCount = &value + return b +} + +// WithAllocatedCapacity sets the AllocatedCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedCapacity field is set to the value of the last call. +func (b *AggregatedCounterStatusApplyConfiguration) WithAllocatedCapacity(value int64) *AggregatedCounterStatusApplyConfiguration { + b.AllocatedCapacity = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *AggregatedCounterStatusApplyConfiguration) WithCount(value int64) *AggregatedCounterStatusApplyConfiguration { + b.Count = &value + return b +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *AggregatedCounterStatusApplyConfiguration) WithCapacity(value int64) *AggregatedCounterStatusApplyConfiguration { + b.Capacity = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/aggregatedliststatus.go b/pkg/client/applyconfiguration/agones/v1/aggregatedliststatus.go new file mode 100644 index 0000000000..41f291d715 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/aggregatedliststatus.go @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AggregatedListStatusApplyConfiguration represents an declarative configuration of the AggregatedListStatus type for use +// with apply. +type AggregatedListStatusApplyConfiguration struct { + AllocatedCount *int64 `json:"allocatedCount,omitempty"` + AllocatedCapacity *int64 `json:"allocatedCapacity,omitempty"` + Count *int64 `json:"count,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` +} + +// AggregatedListStatusApplyConfiguration constructs an declarative configuration of the AggregatedListStatus type for use with +// apply. +func AggregatedListStatus() *AggregatedListStatusApplyConfiguration { + return &AggregatedListStatusApplyConfiguration{} +} + +// WithAllocatedCount sets the AllocatedCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedCount field is set to the value of the last call. +func (b *AggregatedListStatusApplyConfiguration) WithAllocatedCount(value int64) *AggregatedListStatusApplyConfiguration { + b.AllocatedCount = &value + return b +} + +// WithAllocatedCapacity sets the AllocatedCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedCapacity field is set to the value of the last call. +func (b *AggregatedListStatusApplyConfiguration) WithAllocatedCapacity(value int64) *AggregatedListStatusApplyConfiguration { + b.AllocatedCapacity = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *AggregatedListStatusApplyConfiguration) WithCount(value int64) *AggregatedListStatusApplyConfiguration { + b.Count = &value + return b +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *AggregatedListStatusApplyConfiguration) WithCapacity(value int64) *AggregatedListStatusApplyConfiguration { + b.Capacity = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/aggregatedplayerstatus.go b/pkg/client/applyconfiguration/agones/v1/aggregatedplayerstatus.go new file mode 100644 index 0000000000..71775c245f --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/aggregatedplayerstatus.go @@ -0,0 +1,48 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AggregatedPlayerStatusApplyConfiguration represents an declarative configuration of the AggregatedPlayerStatus type for use +// with apply. +type AggregatedPlayerStatusApplyConfiguration struct { + Count *int64 `json:"count,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` +} + +// AggregatedPlayerStatusApplyConfiguration constructs an declarative configuration of the AggregatedPlayerStatus type for use with +// apply. +func AggregatedPlayerStatus() *AggregatedPlayerStatusApplyConfiguration { + return &AggregatedPlayerStatusApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *AggregatedPlayerStatusApplyConfiguration) WithCount(value int64) *AggregatedPlayerStatusApplyConfiguration { + b.Count = &value + return b +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *AggregatedPlayerStatusApplyConfiguration) WithCapacity(value int64) *AggregatedPlayerStatusApplyConfiguration { + b.Capacity = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/allocationoverflow.go b/pkg/client/applyconfiguration/agones/v1/allocationoverflow.go new file mode 100644 index 0000000000..4c7f6573e0 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/allocationoverflow.go @@ -0,0 +1,60 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AllocationOverflowApplyConfiguration represents an declarative configuration of the AllocationOverflow type for use +// with apply. +type AllocationOverflowApplyConfiguration struct { + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` +} + +// AllocationOverflowApplyConfiguration constructs an declarative configuration of the AllocationOverflow type for use with +// apply. +func AllocationOverflow() *AllocationOverflowApplyConfiguration { + return &AllocationOverflowApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *AllocationOverflowApplyConfiguration) WithLabels(entries map[string]string) *AllocationOverflowApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *AllocationOverflowApplyConfiguration) WithAnnotations(entries map[string]string) *AllocationOverflowApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/counterstatus.go b/pkg/client/applyconfiguration/agones/v1/counterstatus.go new file mode 100644 index 0000000000..aff52b4815 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/counterstatus.go @@ -0,0 +1,48 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CounterStatusApplyConfiguration represents an declarative configuration of the CounterStatus type for use +// with apply. +type CounterStatusApplyConfiguration struct { + Count *int64 `json:"count,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` +} + +// CounterStatusApplyConfiguration constructs an declarative configuration of the CounterStatus type for use with +// apply. +func CounterStatus() *CounterStatusApplyConfiguration { + return &CounterStatusApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *CounterStatusApplyConfiguration) WithCount(value int64) *CounterStatusApplyConfiguration { + b.Count = &value + return b +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *CounterStatusApplyConfiguration) WithCapacity(value int64) *CounterStatusApplyConfiguration { + b.Capacity = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/eviction.go b/pkg/client/applyconfiguration/agones/v1/eviction.go new file mode 100644 index 0000000000..a1fcc5a888 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/eviction.go @@ -0,0 +1,43 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "agones.dev/agones/pkg/apis/agones/v1" +) + +// EvictionApplyConfiguration represents an declarative configuration of the Eviction type for use +// with apply. +type EvictionApplyConfiguration struct { + Safe *v1.EvictionSafe `json:"safe,omitempty"` +} + +// EvictionApplyConfiguration constructs an declarative configuration of the Eviction type for use with +// apply. +func Eviction() *EvictionApplyConfiguration { + return &EvictionApplyConfiguration{} +} + +// WithSafe sets the Safe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Safe field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithSafe(value v1.EvictionSafe) *EvictionApplyConfiguration { + b.Safe = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/fleet.go b/pkg/client/applyconfiguration/agones/v1/fleet.go new file mode 100644 index 0000000000..1f3030c668 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/fleet.go @@ -0,0 +1,219 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// FleetApplyConfiguration represents an declarative configuration of the Fleet type for use +// with apply. +type FleetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *FleetSpecApplyConfiguration `json:"spec,omitempty"` + Status *FleetStatusApplyConfiguration `json:"status,omitempty"` +} + +// Fleet constructs an declarative configuration of the Fleet type for use with +// apply. +func Fleet(name, namespace string) *FleetApplyConfiguration { + b := &FleetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Fleet") + b.WithAPIVersion("agones.dev/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithKind(value string) *FleetApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithAPIVersion(value string) *FleetApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithName(value string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithGenerateName(value string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithNamespace(value string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithUID(value types.UID) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithResourceVersion(value string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithGeneration(value int64) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *FleetApplyConfiguration) WithLabels(entries map[string]string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *FleetApplyConfiguration) WithAnnotations(entries map[string]string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *FleetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *FleetApplyConfiguration) WithFinalizers(values ...string) *FleetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *FleetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithSpec(value *FleetSpecApplyConfiguration) *FleetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *FleetApplyConfiguration) WithStatus(value *FleetStatusApplyConfiguration) *FleetApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/fleetspec.go b/pkg/client/applyconfiguration/agones/v1/fleetspec.go new file mode 100644 index 0000000000..a9a9126485 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/fleetspec.go @@ -0,0 +1,94 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apis "agones.dev/agones/pkg/apis" + appsv1 "k8s.io/api/apps/v1" +) + +// FleetSpecApplyConfiguration represents an declarative configuration of the FleetSpec type for use +// with apply. +type FleetSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + AllocationOverflow *AllocationOverflowApplyConfiguration `json:"allocationOverflow,omitempty"` + Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty"` + Scheduling *apis.SchedulingStrategy `json:"scheduling,omitempty"` + Priorities []PriorityApplyConfiguration `json:"priorities,omitempty"` + Template *GameServerTemplateSpecApplyConfiguration `json:"template,omitempty"` +} + +// FleetSpecApplyConfiguration constructs an declarative configuration of the FleetSpec type for use with +// apply. +func FleetSpec() *FleetSpecApplyConfiguration { + return &FleetSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *FleetSpecApplyConfiguration) WithReplicas(value int32) *FleetSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithAllocationOverflow sets the AllocationOverflow field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationOverflow field is set to the value of the last call. +func (b *FleetSpecApplyConfiguration) WithAllocationOverflow(value *AllocationOverflowApplyConfiguration) *FleetSpecApplyConfiguration { + b.AllocationOverflow = value + return b +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *FleetSpecApplyConfiguration) WithStrategy(value appsv1.DeploymentStrategy) *FleetSpecApplyConfiguration { + b.Strategy = &value + return b +} + +// WithScheduling sets the Scheduling field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheduling field is set to the value of the last call. +func (b *FleetSpecApplyConfiguration) WithScheduling(value apis.SchedulingStrategy) *FleetSpecApplyConfiguration { + b.Scheduling = &value + return b +} + +// WithPriorities adds the given value to the Priorities field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Priorities field. +func (b *FleetSpecApplyConfiguration) WithPriorities(values ...*PriorityApplyConfiguration) *FleetSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPriorities") + } + b.Priorities = append(b.Priorities, *values[i]) + } + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *FleetSpecApplyConfiguration) WithTemplate(value *GameServerTemplateSpecApplyConfiguration) *FleetSpecApplyConfiguration { + b.Template = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/fleetstatus.go b/pkg/client/applyconfiguration/agones/v1/fleetstatus.go new file mode 100644 index 0000000000..4b83841c2a --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/fleetstatus.go @@ -0,0 +1,105 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FleetStatusApplyConfiguration represents an declarative configuration of the FleetStatus type for use +// with apply. +type FleetStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + ReservedReplicas *int32 `json:"reservedReplicas,omitempty"` + AllocatedReplicas *int32 `json:"allocatedReplicas,omitempty"` + Players *AggregatedPlayerStatusApplyConfiguration `json:"players,omitempty"` + Counters map[string]AggregatedCounterStatusApplyConfiguration `json:"counters,omitempty"` + Lists map[string]AggregatedListStatusApplyConfiguration `json:"lists,omitempty"` +} + +// FleetStatusApplyConfiguration constructs an declarative configuration of the FleetStatus type for use with +// apply. +func FleetStatus() *FleetStatusApplyConfiguration { + return &FleetStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *FleetStatusApplyConfiguration) WithReplicas(value int32) *FleetStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *FleetStatusApplyConfiguration) WithReadyReplicas(value int32) *FleetStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithReservedReplicas sets the ReservedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReservedReplicas field is set to the value of the last call. +func (b *FleetStatusApplyConfiguration) WithReservedReplicas(value int32) *FleetStatusApplyConfiguration { + b.ReservedReplicas = &value + return b +} + +// WithAllocatedReplicas sets the AllocatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedReplicas field is set to the value of the last call. +func (b *FleetStatusApplyConfiguration) WithAllocatedReplicas(value int32) *FleetStatusApplyConfiguration { + b.AllocatedReplicas = &value + return b +} + +// WithPlayers sets the Players field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Players field is set to the value of the last call. +func (b *FleetStatusApplyConfiguration) WithPlayers(value *AggregatedPlayerStatusApplyConfiguration) *FleetStatusApplyConfiguration { + b.Players = value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *FleetStatusApplyConfiguration) WithCounters(entries map[string]AggregatedCounterStatusApplyConfiguration) *FleetStatusApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]AggregatedCounterStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} + +// WithLists puts the entries into the Lists field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Lists field, +// overwriting an existing map entries in Lists field with the same key. +func (b *FleetStatusApplyConfiguration) WithLists(entries map[string]AggregatedListStatusApplyConfiguration) *FleetStatusApplyConfiguration { + if b.Lists == nil && len(entries) > 0 { + b.Lists = make(map[string]AggregatedListStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Lists[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserver.go b/pkg/client/applyconfiguration/agones/v1/gameserver.go new file mode 100644 index 0000000000..f4eeb2e7a1 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserver.go @@ -0,0 +1,219 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// GameServerApplyConfiguration represents an declarative configuration of the GameServer type for use +// with apply. +type GameServerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GameServerSpecApplyConfiguration `json:"spec,omitempty"` + Status *GameServerStatusApplyConfiguration `json:"status,omitempty"` +} + +// GameServer constructs an declarative configuration of the GameServer type for use with +// apply. +func GameServer(name, namespace string) *GameServerApplyConfiguration { + b := &GameServerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("GameServer") + b.WithAPIVersion("agones.dev/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithKind(value string) *GameServerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithAPIVersion(value string) *GameServerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithName(value string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithGenerateName(value string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithNamespace(value string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithUID(value types.UID) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithResourceVersion(value string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithGeneration(value int64) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GameServerApplyConfiguration) WithLabels(entries map[string]string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GameServerApplyConfiguration) WithAnnotations(entries map[string]string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GameServerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GameServerApplyConfiguration) WithFinalizers(values ...string) *GameServerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GameServerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithSpec(value *GameServerSpecApplyConfiguration) *GameServerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GameServerApplyConfiguration) WithStatus(value *GameServerStatusApplyConfiguration) *GameServerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserverport.go b/pkg/client/applyconfiguration/agones/v1/gameserverport.go new file mode 100644 index 0000000000..ebbc8b5b67 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserverport.go @@ -0,0 +1,89 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "agones.dev/agones/pkg/apis/agones/v1" + corev1 "k8s.io/api/core/v1" +) + +// GameServerPortApplyConfiguration represents an declarative configuration of the GameServerPort type for use +// with apply. +type GameServerPortApplyConfiguration struct { + Name *string `json:"name,omitempty"` + PortPolicy *v1.PortPolicy `json:"portPolicy,omitempty"` + Container *string `json:"container,omitempty"` + ContainerPort *int32 `json:"containerPort,omitempty"` + HostPort *int32 `json:"hostPort,omitempty"` + Protocol *corev1.Protocol `json:"protocol,omitempty"` +} + +// GameServerPortApplyConfiguration constructs an declarative configuration of the GameServerPort type for use with +// apply. +func GameServerPort() *GameServerPortApplyConfiguration { + return &GameServerPortApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GameServerPortApplyConfiguration) WithName(value string) *GameServerPortApplyConfiguration { + b.Name = &value + return b +} + +// WithPortPolicy sets the PortPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortPolicy field is set to the value of the last call. +func (b *GameServerPortApplyConfiguration) WithPortPolicy(value v1.PortPolicy) *GameServerPortApplyConfiguration { + b.PortPolicy = &value + return b +} + +// WithContainer sets the Container field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Container field is set to the value of the last call. +func (b *GameServerPortApplyConfiguration) WithContainer(value string) *GameServerPortApplyConfiguration { + b.Container = &value + return b +} + +// WithContainerPort sets the ContainerPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerPort field is set to the value of the last call. +func (b *GameServerPortApplyConfiguration) WithContainerPort(value int32) *GameServerPortApplyConfiguration { + b.ContainerPort = &value + return b +} + +// WithHostPort sets the HostPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPort field is set to the value of the last call. +func (b *GameServerPortApplyConfiguration) WithHostPort(value int32) *GameServerPortApplyConfiguration { + b.HostPort = &value + return b +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *GameServerPortApplyConfiguration) WithProtocol(value corev1.Protocol) *GameServerPortApplyConfiguration { + b.Protocol = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserverset.go b/pkg/client/applyconfiguration/agones/v1/gameserverset.go new file mode 100644 index 0000000000..4e9237ce60 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserverset.go @@ -0,0 +1,219 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// GameServerSetApplyConfiguration represents an declarative configuration of the GameServerSet type for use +// with apply. +type GameServerSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GameServerSetSpecApplyConfiguration `json:"spec,omitempty"` + Status *GameServerSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// GameServerSet constructs an declarative configuration of the GameServerSet type for use with +// apply. +func GameServerSet(name, namespace string) *GameServerSetApplyConfiguration { + b := &GameServerSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("GameServerSet") + b.WithAPIVersion("agones.dev/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithKind(value string) *GameServerSetApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithAPIVersion(value string) *GameServerSetApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithName(value string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithGenerateName(value string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithNamespace(value string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithUID(value types.UID) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithResourceVersion(value string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithGeneration(value int64) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GameServerSetApplyConfiguration) WithLabels(entries map[string]string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GameServerSetApplyConfiguration) WithAnnotations(entries map[string]string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GameServerSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GameServerSetApplyConfiguration) WithFinalizers(values ...string) *GameServerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GameServerSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithSpec(value *GameServerSetSpecApplyConfiguration) *GameServerSetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GameServerSetApplyConfiguration) WithStatus(value *GameServerSetStatusApplyConfiguration) *GameServerSetApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserversetspec.go b/pkg/client/applyconfiguration/agones/v1/gameserversetspec.go new file mode 100644 index 0000000000..95189d7692 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserversetspec.go @@ -0,0 +1,84 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apis "agones.dev/agones/pkg/apis" +) + +// GameServerSetSpecApplyConfiguration represents an declarative configuration of the GameServerSetSpec type for use +// with apply. +type GameServerSetSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + AllocationOverflow *AllocationOverflowApplyConfiguration `json:"allocationOverflow,omitempty"` + Scheduling *apis.SchedulingStrategy `json:"scheduling,omitempty"` + Priorities []PriorityApplyConfiguration `json:"priorities,omitempty"` + Template *GameServerTemplateSpecApplyConfiguration `json:"template,omitempty"` +} + +// GameServerSetSpecApplyConfiguration constructs an declarative configuration of the GameServerSetSpec type for use with +// apply. +func GameServerSetSpec() *GameServerSetSpecApplyConfiguration { + return &GameServerSetSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *GameServerSetSpecApplyConfiguration) WithReplicas(value int32) *GameServerSetSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithAllocationOverflow sets the AllocationOverflow field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationOverflow field is set to the value of the last call. +func (b *GameServerSetSpecApplyConfiguration) WithAllocationOverflow(value *AllocationOverflowApplyConfiguration) *GameServerSetSpecApplyConfiguration { + b.AllocationOverflow = value + return b +} + +// WithScheduling sets the Scheduling field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheduling field is set to the value of the last call. +func (b *GameServerSetSpecApplyConfiguration) WithScheduling(value apis.SchedulingStrategy) *GameServerSetSpecApplyConfiguration { + b.Scheduling = &value + return b +} + +// WithPriorities adds the given value to the Priorities field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Priorities field. +func (b *GameServerSetSpecApplyConfiguration) WithPriorities(values ...*PriorityApplyConfiguration) *GameServerSetSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPriorities") + } + b.Priorities = append(b.Priorities, *values[i]) + } + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *GameServerSetSpecApplyConfiguration) WithTemplate(value *GameServerTemplateSpecApplyConfiguration) *GameServerSetSpecApplyConfiguration { + b.Template = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserversetstatus.go b/pkg/client/applyconfiguration/agones/v1/gameserversetstatus.go new file mode 100644 index 0000000000..25b396eeb5 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserversetstatus.go @@ -0,0 +1,114 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GameServerSetStatusApplyConfiguration represents an declarative configuration of the GameServerSetStatus type for use +// with apply. +type GameServerSetStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + ReservedReplicas *int32 `json:"reservedReplicas,omitempty"` + AllocatedReplicas *int32 `json:"allocatedReplicas,omitempty"` + ShutdownReplicas *int32 `json:"shutdownReplicas,omitempty"` + Players *AggregatedPlayerStatusApplyConfiguration `json:"players,omitempty"` + Counters map[string]AggregatedCounterStatusApplyConfiguration `json:"counters,omitempty"` + Lists map[string]AggregatedListStatusApplyConfiguration `json:"lists,omitempty"` +} + +// GameServerSetStatusApplyConfiguration constructs an declarative configuration of the GameServerSetStatus type for use with +// apply. +func GameServerSetStatus() *GameServerSetStatusApplyConfiguration { + return &GameServerSetStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *GameServerSetStatusApplyConfiguration) WithReplicas(value int32) *GameServerSetStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *GameServerSetStatusApplyConfiguration) WithReadyReplicas(value int32) *GameServerSetStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithReservedReplicas sets the ReservedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReservedReplicas field is set to the value of the last call. +func (b *GameServerSetStatusApplyConfiguration) WithReservedReplicas(value int32) *GameServerSetStatusApplyConfiguration { + b.ReservedReplicas = &value + return b +} + +// WithAllocatedReplicas sets the AllocatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedReplicas field is set to the value of the last call. +func (b *GameServerSetStatusApplyConfiguration) WithAllocatedReplicas(value int32) *GameServerSetStatusApplyConfiguration { + b.AllocatedReplicas = &value + return b +} + +// WithShutdownReplicas sets the ShutdownReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShutdownReplicas field is set to the value of the last call. +func (b *GameServerSetStatusApplyConfiguration) WithShutdownReplicas(value int32) *GameServerSetStatusApplyConfiguration { + b.ShutdownReplicas = &value + return b +} + +// WithPlayers sets the Players field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Players field is set to the value of the last call. +func (b *GameServerSetStatusApplyConfiguration) WithPlayers(value *AggregatedPlayerStatusApplyConfiguration) *GameServerSetStatusApplyConfiguration { + b.Players = value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *GameServerSetStatusApplyConfiguration) WithCounters(entries map[string]AggregatedCounterStatusApplyConfiguration) *GameServerSetStatusApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]AggregatedCounterStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} + +// WithLists puts the entries into the Lists field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Lists field, +// overwriting an existing map entries in Lists field with the same key. +func (b *GameServerSetStatusApplyConfiguration) WithLists(entries map[string]AggregatedListStatusApplyConfiguration) *GameServerSetStatusApplyConfiguration { + if b.Lists == nil && len(entries) > 0 { + b.Lists = make(map[string]AggregatedListStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Lists[k] = v + } + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserverspec.go b/pkg/client/applyconfiguration/agones/v1/gameserverspec.go new file mode 100644 index 0000000000..1870d82772 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserverspec.go @@ -0,0 +1,142 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apis "agones.dev/agones/pkg/apis" + corev1 "k8s.io/api/core/v1" +) + +// GameServerSpecApplyConfiguration represents an declarative configuration of the GameServerSpec type for use +// with apply. +type GameServerSpecApplyConfiguration struct { + Container *string `json:"container,omitempty"` + Ports []GameServerPortApplyConfiguration `json:"ports,omitempty"` + Health *HealthApplyConfiguration `json:"health,omitempty"` + Scheduling *apis.SchedulingStrategy `json:"scheduling,omitempty"` + SdkServer *SdkServerApplyConfiguration `json:"sdkServer,omitempty"` + Template *corev1.PodTemplateSpec `json:"template,omitempty"` + Players *PlayersSpecApplyConfiguration `json:"players,omitempty"` + Counters map[string]CounterStatusApplyConfiguration `json:"counters,omitempty"` + Lists map[string]ListStatusApplyConfiguration `json:"lists,omitempty"` + Eviction *EvictionApplyConfiguration `json:"eviction,omitempty"` +} + +// GameServerSpecApplyConfiguration constructs an declarative configuration of the GameServerSpec type for use with +// apply. +func GameServerSpec() *GameServerSpecApplyConfiguration { + return &GameServerSpecApplyConfiguration{} +} + +// WithContainer sets the Container field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Container field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithContainer(value string) *GameServerSpecApplyConfiguration { + b.Container = &value + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *GameServerSpecApplyConfiguration) WithPorts(values ...*GameServerPortApplyConfiguration) *GameServerSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} + +// WithHealth sets the Health field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Health field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithHealth(value *HealthApplyConfiguration) *GameServerSpecApplyConfiguration { + b.Health = value + return b +} + +// WithScheduling sets the Scheduling field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheduling field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithScheduling(value apis.SchedulingStrategy) *GameServerSpecApplyConfiguration { + b.Scheduling = &value + return b +} + +// WithSdkServer sets the SdkServer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SdkServer field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithSdkServer(value *SdkServerApplyConfiguration) *GameServerSpecApplyConfiguration { + b.SdkServer = value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithTemplate(value corev1.PodTemplateSpec) *GameServerSpecApplyConfiguration { + b.Template = &value + return b +} + +// WithPlayers sets the Players field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Players field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithPlayers(value *PlayersSpecApplyConfiguration) *GameServerSpecApplyConfiguration { + b.Players = value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *GameServerSpecApplyConfiguration) WithCounters(entries map[string]CounterStatusApplyConfiguration) *GameServerSpecApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} + +// WithLists puts the entries into the Lists field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Lists field, +// overwriting an existing map entries in Lists field with the same key. +func (b *GameServerSpecApplyConfiguration) WithLists(entries map[string]ListStatusApplyConfiguration) *GameServerSpecApplyConfiguration { + if b.Lists == nil && len(entries) > 0 { + b.Lists = make(map[string]ListStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Lists[k] = v + } + return b +} + +// WithEviction sets the Eviction field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Eviction field is set to the value of the last call. +func (b *GameServerSpecApplyConfiguration) WithEviction(value *EvictionApplyConfiguration) *GameServerSpecApplyConfiguration { + b.Eviction = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserverstatus.go b/pkg/client/applyconfiguration/agones/v1/gameserverstatus.go new file mode 100644 index 0000000000..04e3968c75 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserverstatus.go @@ -0,0 +1,145 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "agones.dev/agones/pkg/apis/agones/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// GameServerStatusApplyConfiguration represents an declarative configuration of the GameServerStatus type for use +// with apply. +type GameServerStatusApplyConfiguration struct { + State *v1.GameServerState `json:"state,omitempty"` + Ports []GameServerStatusPortApplyConfiguration `json:"ports,omitempty"` + Address *string `json:"address,omitempty"` + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + ReservedUntil *metav1.Time `json:"reservedUntil,omitempty"` + Players *PlayerStatusApplyConfiguration `json:"players,omitempty"` + Counters map[string]CounterStatusApplyConfiguration `json:"counters,omitempty"` + Lists map[string]ListStatusApplyConfiguration `json:"lists,omitempty"` + Eviction *EvictionApplyConfiguration `json:"eviction,omitempty"` +} + +// GameServerStatusApplyConfiguration constructs an declarative configuration of the GameServerStatus type for use with +// apply. +func GameServerStatus() *GameServerStatusApplyConfiguration { + return &GameServerStatusApplyConfiguration{} +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *GameServerStatusApplyConfiguration) WithState(value v1.GameServerState) *GameServerStatusApplyConfiguration { + b.State = &value + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *GameServerStatusApplyConfiguration) WithPorts(values ...*GameServerStatusPortApplyConfiguration) *GameServerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} + +// WithAddress sets the Address field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Address field is set to the value of the last call. +func (b *GameServerStatusApplyConfiguration) WithAddress(value string) *GameServerStatusApplyConfiguration { + b.Address = &value + return b +} + +// WithAddresses adds the given value to the Addresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Addresses field. +func (b *GameServerStatusApplyConfiguration) WithAddresses(values ...corev1.NodeAddress) *GameServerStatusApplyConfiguration { + for i := range values { + b.Addresses = append(b.Addresses, values[i]) + } + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *GameServerStatusApplyConfiguration) WithNodeName(value string) *GameServerStatusApplyConfiguration { + b.NodeName = &value + return b +} + +// WithReservedUntil sets the ReservedUntil field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReservedUntil field is set to the value of the last call. +func (b *GameServerStatusApplyConfiguration) WithReservedUntil(value metav1.Time) *GameServerStatusApplyConfiguration { + b.ReservedUntil = &value + return b +} + +// WithPlayers sets the Players field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Players field is set to the value of the last call. +func (b *GameServerStatusApplyConfiguration) WithPlayers(value *PlayerStatusApplyConfiguration) *GameServerStatusApplyConfiguration { + b.Players = value + return b +} + +// WithCounters puts the entries into the Counters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Counters field, +// overwriting an existing map entries in Counters field with the same key. +func (b *GameServerStatusApplyConfiguration) WithCounters(entries map[string]CounterStatusApplyConfiguration) *GameServerStatusApplyConfiguration { + if b.Counters == nil && len(entries) > 0 { + b.Counters = make(map[string]CounterStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Counters[k] = v + } + return b +} + +// WithLists puts the entries into the Lists field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Lists field, +// overwriting an existing map entries in Lists field with the same key. +func (b *GameServerStatusApplyConfiguration) WithLists(entries map[string]ListStatusApplyConfiguration) *GameServerStatusApplyConfiguration { + if b.Lists == nil && len(entries) > 0 { + b.Lists = make(map[string]ListStatusApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Lists[k] = v + } + return b +} + +// WithEviction sets the Eviction field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Eviction field is set to the value of the last call. +func (b *GameServerStatusApplyConfiguration) WithEviction(value *EvictionApplyConfiguration) *GameServerStatusApplyConfiguration { + b.Eviction = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameserverstatusport.go b/pkg/client/applyconfiguration/agones/v1/gameserverstatusport.go new file mode 100644 index 0000000000..cd90e08c7b --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameserverstatusport.go @@ -0,0 +1,48 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GameServerStatusPortApplyConfiguration represents an declarative configuration of the GameServerStatusPort type for use +// with apply. +type GameServerStatusPortApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Port *int32 `json:"port,omitempty"` +} + +// GameServerStatusPortApplyConfiguration constructs an declarative configuration of the GameServerStatusPort type for use with +// apply. +func GameServerStatusPort() *GameServerStatusPortApplyConfiguration { + return &GameServerStatusPortApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GameServerStatusPortApplyConfiguration) WithName(value string) *GameServerStatusPortApplyConfiguration { + b.Name = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *GameServerStatusPortApplyConfiguration) WithPort(value int32) *GameServerStatusPortApplyConfiguration { + b.Port = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/gameservertemplatespec.go b/pkg/client/applyconfiguration/agones/v1/gameservertemplatespec.go new file mode 100644 index 0000000000..3b0468fb7d --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/gameservertemplatespec.go @@ -0,0 +1,188 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// GameServerTemplateSpecApplyConfiguration represents an declarative configuration of the GameServerTemplateSpec type for use +// with apply. +type GameServerTemplateSpecApplyConfiguration struct { + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GameServerSpecApplyConfiguration `json:"spec,omitempty"` +} + +// GameServerTemplateSpecApplyConfiguration constructs an declarative configuration of the GameServerTemplateSpec type for use with +// apply. +func GameServerTemplateSpec() *GameServerTemplateSpecApplyConfiguration { + return &GameServerTemplateSpecApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithName(value string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithGenerateName(value string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithNamespace(value string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithUID(value types.UID) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithResourceVersion(value string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithGeneration(value int64) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GameServerTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GameServerTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GameServerTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GameServerTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *GameServerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GameServerTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GameServerTemplateSpecApplyConfiguration) WithSpec(value *GameServerSpecApplyConfiguration) *GameServerTemplateSpecApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/health.go b/pkg/client/applyconfiguration/agones/v1/health.go new file mode 100644 index 0000000000..96368abee3 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/health.go @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HealthApplyConfiguration represents an declarative configuration of the Health type for use +// with apply. +type HealthApplyConfiguration struct { + Disabled *bool `json:"disabled,omitempty"` + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` +} + +// HealthApplyConfiguration constructs an declarative configuration of the Health type for use with +// apply. +func Health() *HealthApplyConfiguration { + return &HealthApplyConfiguration{} +} + +// WithDisabled sets the Disabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Disabled field is set to the value of the last call. +func (b *HealthApplyConfiguration) WithDisabled(value bool) *HealthApplyConfiguration { + b.Disabled = &value + return b +} + +// WithPeriodSeconds sets the PeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PeriodSeconds field is set to the value of the last call. +func (b *HealthApplyConfiguration) WithPeriodSeconds(value int32) *HealthApplyConfiguration { + b.PeriodSeconds = &value + return b +} + +// WithFailureThreshold sets the FailureThreshold field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureThreshold field is set to the value of the last call. +func (b *HealthApplyConfiguration) WithFailureThreshold(value int32) *HealthApplyConfiguration { + b.FailureThreshold = &value + return b +} + +// WithInitialDelaySeconds sets the InitialDelaySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InitialDelaySeconds field is set to the value of the last call. +func (b *HealthApplyConfiguration) WithInitialDelaySeconds(value int32) *HealthApplyConfiguration { + b.InitialDelaySeconds = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/liststatus.go b/pkg/client/applyconfiguration/agones/v1/liststatus.go new file mode 100644 index 0000000000..4329e54a79 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/liststatus.go @@ -0,0 +1,50 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ListStatusApplyConfiguration represents an declarative configuration of the ListStatus type for use +// with apply. +type ListStatusApplyConfiguration struct { + Capacity *int64 `json:"capacity,omitempty"` + Values []string `json:"values,omitempty"` +} + +// ListStatusApplyConfiguration constructs an declarative configuration of the ListStatus type for use with +// apply. +func ListStatus() *ListStatusApplyConfiguration { + return &ListStatusApplyConfiguration{} +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *ListStatusApplyConfiguration) WithCapacity(value int64) *ListStatusApplyConfiguration { + b.Capacity = &value + return b +} + +// WithValues adds the given value to the Values field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Values field. +func (b *ListStatusApplyConfiguration) WithValues(values ...string) *ListStatusApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/playersspec.go b/pkg/client/applyconfiguration/agones/v1/playersspec.go new file mode 100644 index 0000000000..766337adc0 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/playersspec.go @@ -0,0 +1,39 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PlayersSpecApplyConfiguration represents an declarative configuration of the PlayersSpec type for use +// with apply. +type PlayersSpecApplyConfiguration struct { + InitialCapacity *int64 `json:"initialCapacity,omitempty"` +} + +// PlayersSpecApplyConfiguration constructs an declarative configuration of the PlayersSpec type for use with +// apply. +func PlayersSpec() *PlayersSpecApplyConfiguration { + return &PlayersSpecApplyConfiguration{} +} + +// WithInitialCapacity sets the InitialCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InitialCapacity field is set to the value of the last call. +func (b *PlayersSpecApplyConfiguration) WithInitialCapacity(value int64) *PlayersSpecApplyConfiguration { + b.InitialCapacity = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/playerstatus.go b/pkg/client/applyconfiguration/agones/v1/playerstatus.go new file mode 100644 index 0000000000..be475b7a97 --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/playerstatus.go @@ -0,0 +1,59 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PlayerStatusApplyConfiguration represents an declarative configuration of the PlayerStatus type for use +// with apply. +type PlayerStatusApplyConfiguration struct { + Count *int64 `json:"count,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` + IDs []string `json:"ids,omitempty"` +} + +// PlayerStatusApplyConfiguration constructs an declarative configuration of the PlayerStatus type for use with +// apply. +func PlayerStatus() *PlayerStatusApplyConfiguration { + return &PlayerStatusApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *PlayerStatusApplyConfiguration) WithCount(value int64) *PlayerStatusApplyConfiguration { + b.Count = &value + return b +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *PlayerStatusApplyConfiguration) WithCapacity(value int64) *PlayerStatusApplyConfiguration { + b.Capacity = &value + return b +} + +// WithIDs adds the given value to the IDs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the IDs field. +func (b *PlayerStatusApplyConfiguration) WithIDs(values ...string) *PlayerStatusApplyConfiguration { + for i := range values { + b.IDs = append(b.IDs, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/priority.go b/pkg/client/applyconfiguration/agones/v1/priority.go new file mode 100644 index 0000000000..05627a119a --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/priority.go @@ -0,0 +1,57 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PriorityApplyConfiguration represents an declarative configuration of the Priority type for use +// with apply. +type PriorityApplyConfiguration struct { + Type *string `json:"type,omitempty"` + Key *string `json:"key,omitempty"` + Order *string `json:"order,omitempty"` +} + +// PriorityApplyConfiguration constructs an declarative configuration of the Priority type for use with +// apply. +func Priority() *PriorityApplyConfiguration { + return &PriorityApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PriorityApplyConfiguration) WithType(value string) *PriorityApplyConfiguration { + b.Type = &value + return b +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *PriorityApplyConfiguration) WithKey(value string) *PriorityApplyConfiguration { + b.Key = &value + return b +} + +// WithOrder sets the Order field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Order field is set to the value of the last call. +func (b *PriorityApplyConfiguration) WithOrder(value string) *PriorityApplyConfiguration { + b.Order = &value + return b +} diff --git a/pkg/client/applyconfiguration/agones/v1/sdkserver.go b/pkg/client/applyconfiguration/agones/v1/sdkserver.go new file mode 100644 index 0000000000..828b7932bc --- /dev/null +++ b/pkg/client/applyconfiguration/agones/v1/sdkserver.go @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "agones.dev/agones/pkg/apis/agones/v1" +) + +// SdkServerApplyConfiguration represents an declarative configuration of the SdkServer type for use +// with apply. +type SdkServerApplyConfiguration struct { + LogLevel *v1.SdkServerLogLevel `json:"logLevel,omitempty"` + GRPCPort *int32 `json:"grpcPort,omitempty"` + HTTPPort *int32 `json:"httpPort,omitempty"` +} + +// SdkServerApplyConfiguration constructs an declarative configuration of the SdkServer type for use with +// apply. +func SdkServer() *SdkServerApplyConfiguration { + return &SdkServerApplyConfiguration{} +} + +// WithLogLevel sets the LogLevel field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LogLevel field is set to the value of the last call. +func (b *SdkServerApplyConfiguration) WithLogLevel(value v1.SdkServerLogLevel) *SdkServerApplyConfiguration { + b.LogLevel = &value + return b +} + +// WithGRPCPort sets the GRPCPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GRPCPort field is set to the value of the last call. +func (b *SdkServerApplyConfiguration) WithGRPCPort(value int32) *SdkServerApplyConfiguration { + b.GRPCPort = &value + return b +} + +// WithHTTPPort sets the HTTPPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPPort field is set to the value of the last call. +func (b *SdkServerApplyConfiguration) WithHTTPPort(value int32) *SdkServerApplyConfiguration { + b.HTTPPort = &value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/bufferpolicy.go b/pkg/client/applyconfiguration/autoscaling/v1/bufferpolicy.go new file mode 100644 index 0000000000..5503e1b2d5 --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/bufferpolicy.go @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// BufferPolicyApplyConfiguration represents an declarative configuration of the BufferPolicy type for use +// with apply. +type BufferPolicyApplyConfiguration struct { + MaxReplicas *int32 `json:"maxReplicas,omitempty"` + MinReplicas *int32 `json:"minReplicas,omitempty"` + BufferSize *intstr.IntOrString `json:"bufferSize,omitempty"` +} + +// BufferPolicyApplyConfiguration constructs an declarative configuration of the BufferPolicy type for use with +// apply. +func BufferPolicy() *BufferPolicyApplyConfiguration { + return &BufferPolicyApplyConfiguration{} +} + +// WithMaxReplicas sets the MaxReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxReplicas field is set to the value of the last call. +func (b *BufferPolicyApplyConfiguration) WithMaxReplicas(value int32) *BufferPolicyApplyConfiguration { + b.MaxReplicas = &value + return b +} + +// WithMinReplicas sets the MinReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReplicas field is set to the value of the last call. +func (b *BufferPolicyApplyConfiguration) WithMinReplicas(value int32) *BufferPolicyApplyConfiguration { + b.MinReplicas = &value + return b +} + +// WithBufferSize sets the BufferSize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BufferSize field is set to the value of the last call. +func (b *BufferPolicyApplyConfiguration) WithBufferSize(value intstr.IntOrString) *BufferPolicyApplyConfiguration { + b.BufferSize = &value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/counterpolicy.go b/pkg/client/applyconfiguration/autoscaling/v1/counterpolicy.go new file mode 100644 index 0000000000..a47e73130c --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/counterpolicy.go @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// CounterPolicyApplyConfiguration represents an declarative configuration of the CounterPolicy type for use +// with apply. +type CounterPolicyApplyConfiguration struct { + Key *string `json:"key,omitempty"` + MaxCapacity *int64 `json:"maxCapacity,omitempty"` + MinCapacity *int64 `json:"minCapacity,omitempty"` + BufferSize *intstr.IntOrString `json:"bufferSize,omitempty"` +} + +// CounterPolicyApplyConfiguration constructs an declarative configuration of the CounterPolicy type for use with +// apply. +func CounterPolicy() *CounterPolicyApplyConfiguration { + return &CounterPolicyApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *CounterPolicyApplyConfiguration) WithKey(value string) *CounterPolicyApplyConfiguration { + b.Key = &value + return b +} + +// WithMaxCapacity sets the MaxCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxCapacity field is set to the value of the last call. +func (b *CounterPolicyApplyConfiguration) WithMaxCapacity(value int64) *CounterPolicyApplyConfiguration { + b.MaxCapacity = &value + return b +} + +// WithMinCapacity sets the MinCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinCapacity field is set to the value of the last call. +func (b *CounterPolicyApplyConfiguration) WithMinCapacity(value int64) *CounterPolicyApplyConfiguration { + b.MinCapacity = &value + return b +} + +// WithBufferSize sets the BufferSize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BufferSize field is set to the value of the last call. +func (b *CounterPolicyApplyConfiguration) WithBufferSize(value intstr.IntOrString) *CounterPolicyApplyConfiguration { + b.BufferSize = &value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/fixedintervalsync.go b/pkg/client/applyconfiguration/autoscaling/v1/fixedintervalsync.go new file mode 100644 index 0000000000..a897768284 --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/fixedintervalsync.go @@ -0,0 +1,39 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FixedIntervalSyncApplyConfiguration represents an declarative configuration of the FixedIntervalSync type for use +// with apply. +type FixedIntervalSyncApplyConfiguration struct { + Seconds *int32 `json:"seconds,omitempty"` +} + +// FixedIntervalSyncApplyConfiguration constructs an declarative configuration of the FixedIntervalSync type for use with +// apply. +func FixedIntervalSync() *FixedIntervalSyncApplyConfiguration { + return &FixedIntervalSyncApplyConfiguration{} +} + +// WithSeconds sets the Seconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Seconds field is set to the value of the last call. +func (b *FixedIntervalSyncApplyConfiguration) WithSeconds(value int32) *FixedIntervalSyncApplyConfiguration { + b.Seconds = &value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscaler.go b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscaler.go new file mode 100644 index 0000000000..600f89b2de --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscaler.go @@ -0,0 +1,219 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// FleetAutoscalerApplyConfiguration represents an declarative configuration of the FleetAutoscaler type for use +// with apply. +type FleetAutoscalerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *FleetAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` + Status *FleetAutoscalerStatusApplyConfiguration `json:"status,omitempty"` +} + +// FleetAutoscaler constructs an declarative configuration of the FleetAutoscaler type for use with +// apply. +func FleetAutoscaler(name, namespace string) *FleetAutoscalerApplyConfiguration { + b := &FleetAutoscalerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("FleetAutoscaler") + b.WithAPIVersion("autoscaling.agones.dev/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithKind(value string) *FleetAutoscalerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithAPIVersion(value string) *FleetAutoscalerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithName(value string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithGenerateName(value string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithNamespace(value string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithUID(value types.UID) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithResourceVersion(value string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithGeneration(value int64) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *FleetAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *FleetAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *FleetAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *FleetAutoscalerApplyConfiguration) WithFinalizers(values ...string) *FleetAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *FleetAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithSpec(value *FleetAutoscalerSpecApplyConfiguration) *FleetAutoscalerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *FleetAutoscalerApplyConfiguration) WithStatus(value *FleetAutoscalerStatusApplyConfiguration) *FleetAutoscalerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerpolicy.go b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerpolicy.go new file mode 100644 index 0000000000..c1d9b00dfd --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerpolicy.go @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "agones.dev/agones/pkg/apis/autoscaling/v1" +) + +// FleetAutoscalerPolicyApplyConfiguration represents an declarative configuration of the FleetAutoscalerPolicy type for use +// with apply. +type FleetAutoscalerPolicyApplyConfiguration struct { + Type *v1.FleetAutoscalerPolicyType `json:"type,omitempty"` + Buffer *BufferPolicyApplyConfiguration `json:"buffer,omitempty"` + Webhook *WebhookPolicyApplyConfiguration `json:"webhook,omitempty"` + Counter *CounterPolicyApplyConfiguration `json:"counter,omitempty"` + List *ListPolicyApplyConfiguration `json:"list,omitempty"` +} + +// FleetAutoscalerPolicyApplyConfiguration constructs an declarative configuration of the FleetAutoscalerPolicy type for use with +// apply. +func FleetAutoscalerPolicy() *FleetAutoscalerPolicyApplyConfiguration { + return &FleetAutoscalerPolicyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *FleetAutoscalerPolicyApplyConfiguration) WithType(value v1.FleetAutoscalerPolicyType) *FleetAutoscalerPolicyApplyConfiguration { + b.Type = &value + return b +} + +// WithBuffer sets the Buffer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Buffer field is set to the value of the last call. +func (b *FleetAutoscalerPolicyApplyConfiguration) WithBuffer(value *BufferPolicyApplyConfiguration) *FleetAutoscalerPolicyApplyConfiguration { + b.Buffer = value + return b +} + +// WithWebhook sets the Webhook field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Webhook field is set to the value of the last call. +func (b *FleetAutoscalerPolicyApplyConfiguration) WithWebhook(value *WebhookPolicyApplyConfiguration) *FleetAutoscalerPolicyApplyConfiguration { + b.Webhook = value + return b +} + +// WithCounter sets the Counter field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Counter field is set to the value of the last call. +func (b *FleetAutoscalerPolicyApplyConfiguration) WithCounter(value *CounterPolicyApplyConfiguration) *FleetAutoscalerPolicyApplyConfiguration { + b.Counter = value + return b +} + +// WithList sets the List field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the List field is set to the value of the last call. +func (b *FleetAutoscalerPolicyApplyConfiguration) WithList(value *ListPolicyApplyConfiguration) *FleetAutoscalerPolicyApplyConfiguration { + b.List = value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerspec.go b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerspec.go new file mode 100644 index 0000000000..804d70be1e --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerspec.go @@ -0,0 +1,57 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FleetAutoscalerSpecApplyConfiguration represents an declarative configuration of the FleetAutoscalerSpec type for use +// with apply. +type FleetAutoscalerSpecApplyConfiguration struct { + FleetName *string `json:"fleetName,omitempty"` + Policy *FleetAutoscalerPolicyApplyConfiguration `json:"policy,omitempty"` + Sync *FleetAutoscalerSyncApplyConfiguration `json:"sync,omitempty"` +} + +// FleetAutoscalerSpecApplyConfiguration constructs an declarative configuration of the FleetAutoscalerSpec type for use with +// apply. +func FleetAutoscalerSpec() *FleetAutoscalerSpecApplyConfiguration { + return &FleetAutoscalerSpecApplyConfiguration{} +} + +// WithFleetName sets the FleetName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FleetName field is set to the value of the last call. +func (b *FleetAutoscalerSpecApplyConfiguration) WithFleetName(value string) *FleetAutoscalerSpecApplyConfiguration { + b.FleetName = &value + return b +} + +// WithPolicy sets the Policy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Policy field is set to the value of the last call. +func (b *FleetAutoscalerSpecApplyConfiguration) WithPolicy(value *FleetAutoscalerPolicyApplyConfiguration) *FleetAutoscalerSpecApplyConfiguration { + b.Policy = value + return b +} + +// WithSync sets the Sync field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sync field is set to the value of the last call. +func (b *FleetAutoscalerSpecApplyConfiguration) WithSync(value *FleetAutoscalerSyncApplyConfiguration) *FleetAutoscalerSpecApplyConfiguration { + b.Sync = value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerstatus.go b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerstatus.go new file mode 100644 index 0000000000..705bb92957 --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalerstatus.go @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// FleetAutoscalerStatusApplyConfiguration represents an declarative configuration of the FleetAutoscalerStatus type for use +// with apply. +type FleetAutoscalerStatusApplyConfiguration struct { + CurrentReplicas *int32 `json:"currentReplicas,omitempty"` + DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` + LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"` + AbleToScale *bool `json:"ableToScale,omitempty"` + ScalingLimited *bool `json:"scalingLimited,omitempty"` +} + +// FleetAutoscalerStatusApplyConfiguration constructs an declarative configuration of the FleetAutoscalerStatus type for use with +// apply. +func FleetAutoscalerStatus() *FleetAutoscalerStatusApplyConfiguration { + return &FleetAutoscalerStatusApplyConfiguration{} +} + +// WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentReplicas field is set to the value of the last call. +func (b *FleetAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *FleetAutoscalerStatusApplyConfiguration { + b.CurrentReplicas = &value + return b +} + +// WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DesiredReplicas field is set to the value of the last call. +func (b *FleetAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *FleetAutoscalerStatusApplyConfiguration { + b.DesiredReplicas = &value + return b +} + +// WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastScaleTime field is set to the value of the last call. +func (b *FleetAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *FleetAutoscalerStatusApplyConfiguration { + b.LastScaleTime = &value + return b +} + +// WithAbleToScale sets the AbleToScale field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AbleToScale field is set to the value of the last call. +func (b *FleetAutoscalerStatusApplyConfiguration) WithAbleToScale(value bool) *FleetAutoscalerStatusApplyConfiguration { + b.AbleToScale = &value + return b +} + +// WithScalingLimited sets the ScalingLimited field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScalingLimited field is set to the value of the last call. +func (b *FleetAutoscalerStatusApplyConfiguration) WithScalingLimited(value bool) *FleetAutoscalerStatusApplyConfiguration { + b.ScalingLimited = &value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalersync.go b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalersync.go new file mode 100644 index 0000000000..5826450554 --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/fleetautoscalersync.go @@ -0,0 +1,52 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "agones.dev/agones/pkg/apis/autoscaling/v1" +) + +// FleetAutoscalerSyncApplyConfiguration represents an declarative configuration of the FleetAutoscalerSync type for use +// with apply. +type FleetAutoscalerSyncApplyConfiguration struct { + Type *v1.FleetAutoscalerSyncType `json:"type,omitempty"` + FixedInterval *FixedIntervalSyncApplyConfiguration `json:"fixedInterval,omitempty"` +} + +// FleetAutoscalerSyncApplyConfiguration constructs an declarative configuration of the FleetAutoscalerSync type for use with +// apply. +func FleetAutoscalerSync() *FleetAutoscalerSyncApplyConfiguration { + return &FleetAutoscalerSyncApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *FleetAutoscalerSyncApplyConfiguration) WithType(value v1.FleetAutoscalerSyncType) *FleetAutoscalerSyncApplyConfiguration { + b.Type = &value + return b +} + +// WithFixedInterval sets the FixedInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FixedInterval field is set to the value of the last call. +func (b *FleetAutoscalerSyncApplyConfiguration) WithFixedInterval(value *FixedIntervalSyncApplyConfiguration) *FleetAutoscalerSyncApplyConfiguration { + b.FixedInterval = value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/listpolicy.go b/pkg/client/applyconfiguration/autoscaling/v1/listpolicy.go new file mode 100644 index 0000000000..a4489d3c6f --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/listpolicy.go @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// ListPolicyApplyConfiguration represents an declarative configuration of the ListPolicy type for use +// with apply. +type ListPolicyApplyConfiguration struct { + Key *string `json:"key,omitempty"` + MaxCapacity *int64 `json:"maxCapacity,omitempty"` + MinCapacity *int64 `json:"minCapacity,omitempty"` + BufferSize *intstr.IntOrString `json:"bufferSize,omitempty"` +} + +// ListPolicyApplyConfiguration constructs an declarative configuration of the ListPolicy type for use with +// apply. +func ListPolicy() *ListPolicyApplyConfiguration { + return &ListPolicyApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *ListPolicyApplyConfiguration) WithKey(value string) *ListPolicyApplyConfiguration { + b.Key = &value + return b +} + +// WithMaxCapacity sets the MaxCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxCapacity field is set to the value of the last call. +func (b *ListPolicyApplyConfiguration) WithMaxCapacity(value int64) *ListPolicyApplyConfiguration { + b.MaxCapacity = &value + return b +} + +// WithMinCapacity sets the MinCapacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinCapacity field is set to the value of the last call. +func (b *ListPolicyApplyConfiguration) WithMinCapacity(value int64) *ListPolicyApplyConfiguration { + b.MinCapacity = &value + return b +} + +// WithBufferSize sets the BufferSize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BufferSize field is set to the value of the last call. +func (b *ListPolicyApplyConfiguration) WithBufferSize(value intstr.IntOrString) *ListPolicyApplyConfiguration { + b.BufferSize = &value + return b +} diff --git a/pkg/client/applyconfiguration/autoscaling/v1/webhookpolicy.go b/pkg/client/applyconfiguration/autoscaling/v1/webhookpolicy.go new file mode 100644 index 0000000000..806207e900 --- /dev/null +++ b/pkg/client/applyconfiguration/autoscaling/v1/webhookpolicy.go @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/admissionregistration/v1" +) + +// WebhookPolicyApplyConfiguration represents an declarative configuration of the WebhookPolicy type for use +// with apply. +type WebhookPolicyApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Service *v1.ServiceReference `json:"service,omitempty"` + CABundle []byte `json:"caBundle,omitempty"` +} + +// WebhookPolicyApplyConfiguration constructs an declarative configuration of the WebhookPolicy type for use with +// apply. +func WebhookPolicy() *WebhookPolicyApplyConfiguration { + return &WebhookPolicyApplyConfiguration{} +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *WebhookPolicyApplyConfiguration) WithURL(value string) *WebhookPolicyApplyConfiguration { + b.URL = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *WebhookPolicyApplyConfiguration) WithService(value v1.ServiceReference) *WebhookPolicyApplyConfiguration { + b.Service = &value + return b +} + +// WithCABundle adds the given value to the CABundle field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CABundle field. +func (b *WebhookPolicyApplyConfiguration) WithCABundle(values ...byte) *WebhookPolicyApplyConfiguration { + for i := range values { + b.CABundle = append(b.CABundle, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/internal/internal.go b/pkg/client/applyconfiguration/internal/internal.go new file mode 100644 index 0000000000..5dfdc1101f --- /dev/null +++ b/pkg/client/applyconfiguration/internal/internal.go @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/pkg/client/applyconfiguration/multicluster/v1/clusterconnectioninfo.go b/pkg/client/applyconfiguration/multicluster/v1/clusterconnectioninfo.go new file mode 100644 index 0000000000..4a6280c7ca --- /dev/null +++ b/pkg/client/applyconfiguration/multicluster/v1/clusterconnectioninfo.go @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ClusterConnectionInfoApplyConfiguration represents an declarative configuration of the ClusterConnectionInfo type for use +// with apply. +type ClusterConnectionInfoApplyConfiguration struct { + ClusterName *string `json:"clusterName,omitempty"` + AllocationEndpoints []string `json:"allocationEndpoints,omitempty"` + SecretName *string `json:"secretName,omitempty"` + Namespace *string `json:"namespace,omitempty"` + ServerCA []byte `json:"serverCa,omitempty"` +} + +// ClusterConnectionInfoApplyConfiguration constructs an declarative configuration of the ClusterConnectionInfo type for use with +// apply. +func ClusterConnectionInfo() *ClusterConnectionInfoApplyConfiguration { + return &ClusterConnectionInfoApplyConfiguration{} +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *ClusterConnectionInfoApplyConfiguration) WithClusterName(value string) *ClusterConnectionInfoApplyConfiguration { + b.ClusterName = &value + return b +} + +// WithAllocationEndpoints adds the given value to the AllocationEndpoints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AllocationEndpoints field. +func (b *ClusterConnectionInfoApplyConfiguration) WithAllocationEndpoints(values ...string) *ClusterConnectionInfoApplyConfiguration { + for i := range values { + b.AllocationEndpoints = append(b.AllocationEndpoints, values[i]) + } + return b +} + +// WithSecretName sets the SecretName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretName field is set to the value of the last call. +func (b *ClusterConnectionInfoApplyConfiguration) WithSecretName(value string) *ClusterConnectionInfoApplyConfiguration { + b.SecretName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterConnectionInfoApplyConfiguration) WithNamespace(value string) *ClusterConnectionInfoApplyConfiguration { + b.Namespace = &value + return b +} + +// WithServerCA adds the given value to the ServerCA field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ServerCA field. +func (b *ClusterConnectionInfoApplyConfiguration) WithServerCA(values ...byte) *ClusterConnectionInfoApplyConfiguration { + for i := range values { + b.ServerCA = append(b.ServerCA, values[i]) + } + return b +} diff --git a/pkg/client/applyconfiguration/multicluster/v1/gameserverallocationpolicy.go b/pkg/client/applyconfiguration/multicluster/v1/gameserverallocationpolicy.go new file mode 100644 index 0000000000..178aa038cf --- /dev/null +++ b/pkg/client/applyconfiguration/multicluster/v1/gameserverallocationpolicy.go @@ -0,0 +1,210 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// GameServerAllocationPolicyApplyConfiguration represents an declarative configuration of the GameServerAllocationPolicy type for use +// with apply. +type GameServerAllocationPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GameServerAllocationPolicySpecApplyConfiguration `json:"spec,omitempty"` +} + +// GameServerAllocationPolicy constructs an declarative configuration of the GameServerAllocationPolicy type for use with +// apply. +func GameServerAllocationPolicy(name, namespace string) *GameServerAllocationPolicyApplyConfiguration { + b := &GameServerAllocationPolicyApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("GameServerAllocationPolicy") + b.WithAPIVersion("multicluster.agones.dev/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithKind(value string) *GameServerAllocationPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithAPIVersion(value string) *GameServerAllocationPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithName(value string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithGenerateName(value string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithNamespace(value string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithUID(value types.UID) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithResourceVersion(value string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithGeneration(value int64) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GameServerAllocationPolicyApplyConfiguration) WithLabels(entries map[string]string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GameServerAllocationPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GameServerAllocationPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GameServerAllocationPolicyApplyConfiguration) WithFinalizers(values ...string) *GameServerAllocationPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GameServerAllocationPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GameServerAllocationPolicyApplyConfiguration) WithSpec(value *GameServerAllocationPolicySpecApplyConfiguration) *GameServerAllocationPolicyApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/client/applyconfiguration/multicluster/v1/gameserverallocationpolicyspec.go b/pkg/client/applyconfiguration/multicluster/v1/gameserverallocationpolicyspec.go new file mode 100644 index 0000000000..ddfcf4bde1 --- /dev/null +++ b/pkg/client/applyconfiguration/multicluster/v1/gameserverallocationpolicyspec.go @@ -0,0 +1,57 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GameServerAllocationPolicySpecApplyConfiguration represents an declarative configuration of the GameServerAllocationPolicySpec type for use +// with apply. +type GameServerAllocationPolicySpecApplyConfiguration struct { + Priority *int32 `json:"priority,omitempty"` + Weight *int `json:"weight,omitempty"` + ConnectionInfo *ClusterConnectionInfoApplyConfiguration `json:"connectionInfo,omitempty"` +} + +// GameServerAllocationPolicySpecApplyConfiguration constructs an declarative configuration of the GameServerAllocationPolicySpec type for use with +// apply. +func GameServerAllocationPolicySpec() *GameServerAllocationPolicySpecApplyConfiguration { + return &GameServerAllocationPolicySpecApplyConfiguration{} +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *GameServerAllocationPolicySpecApplyConfiguration) WithPriority(value int32) *GameServerAllocationPolicySpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithWeight sets the Weight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Weight field is set to the value of the last call. +func (b *GameServerAllocationPolicySpecApplyConfiguration) WithWeight(value int) *GameServerAllocationPolicySpecApplyConfiguration { + b.Weight = &value + return b +} + +// WithConnectionInfo sets the ConnectionInfo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConnectionInfo field is set to the value of the last call. +func (b *GameServerAllocationPolicySpecApplyConfiguration) WithConnectionInfo(value *ClusterConnectionInfoApplyConfiguration) *GameServerAllocationPolicySpecApplyConfiguration { + b.ConnectionInfo = value + return b +} diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go new file mode 100644 index 0000000000..88e0bb5401 --- /dev/null +++ b/pkg/client/applyconfiguration/utils.go @@ -0,0 +1,117 @@ +// Copyright 2023 Google LLC All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + v1 "agones.dev/agones/pkg/apis/agones/v1" + autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" + applyconfigurationautoscalingv1 "agones.dev/agones/pkg/client/applyconfiguration/autoscaling/v1" + applyconfigurationmulticlusterv1 "agones.dev/agones/pkg/client/applyconfiguration/multicluster/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=agones.dev, Version=v1 + case v1.SchemeGroupVersion.WithKind("AggregatedCounterStatus"): + return &agonesv1.AggregatedCounterStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AggregatedListStatus"): + return &agonesv1.AggregatedListStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AggregatedPlayerStatus"): + return &agonesv1.AggregatedPlayerStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("AllocationOverflow"): + return &agonesv1.AllocationOverflowApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CounterStatus"): + return &agonesv1.CounterStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Eviction"): + return &agonesv1.EvictionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Fleet"): + return &agonesv1.FleetApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("FleetSpec"): + return &agonesv1.FleetSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("FleetStatus"): + return &agonesv1.FleetStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServer"): + return &agonesv1.GameServerApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerPort"): + return &agonesv1.GameServerPortApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerSet"): + return &agonesv1.GameServerSetApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerSetSpec"): + return &agonesv1.GameServerSetSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerSetStatus"): + return &agonesv1.GameServerSetStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerSpec"): + return &agonesv1.GameServerSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerStatus"): + return &agonesv1.GameServerStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerStatusPort"): + return &agonesv1.GameServerStatusPortApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GameServerTemplateSpec"): + return &agonesv1.GameServerTemplateSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Health"): + return &agonesv1.HealthApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ListStatus"): + return &agonesv1.ListStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PlayersSpec"): + return &agonesv1.PlayersSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PlayerStatus"): + return &agonesv1.PlayerStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Priority"): + return &agonesv1.PriorityApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SdkServer"): + return &agonesv1.SdkServerApplyConfiguration{} + + // Group=autoscaling.agones.dev, Version=v1 + case autoscalingv1.SchemeGroupVersion.WithKind("BufferPolicy"): + return &applyconfigurationautoscalingv1.BufferPolicyApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("CounterPolicy"): + return &applyconfigurationautoscalingv1.CounterPolicyApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("FixedIntervalSync"): + return &applyconfigurationautoscalingv1.FixedIntervalSyncApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("FleetAutoscaler"): + return &applyconfigurationautoscalingv1.FleetAutoscalerApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("FleetAutoscalerPolicy"): + return &applyconfigurationautoscalingv1.FleetAutoscalerPolicyApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("FleetAutoscalerSpec"): + return &applyconfigurationautoscalingv1.FleetAutoscalerSpecApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("FleetAutoscalerStatus"): + return &applyconfigurationautoscalingv1.FleetAutoscalerStatusApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("FleetAutoscalerSync"): + return &applyconfigurationautoscalingv1.FleetAutoscalerSyncApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("ListPolicy"): + return &applyconfigurationautoscalingv1.ListPolicyApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("WebhookPolicy"): + return &applyconfigurationautoscalingv1.WebhookPolicyApplyConfiguration{} + + // Group=multicluster.agones.dev, Version=v1 + case multiclusterv1.SchemeGroupVersion.WithKind("ClusterConnectionInfo"): + return &applyconfigurationmulticlusterv1.ClusterConnectionInfoApplyConfiguration{} + case multiclusterv1.SchemeGroupVersion.WithKind("GameServerAllocationPolicy"): + return &applyconfigurationmulticlusterv1.GameServerAllocationPolicyApplyConfiguration{} + case multiclusterv1.SchemeGroupVersion.WithKind("GameServerAllocationPolicySpec"): + return &applyconfigurationmulticlusterv1.GameServerAllocationPolicySpecApplyConfiguration{} + + } + return nil +} diff --git a/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_fleet.go b/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_fleet.go index cfc4f43670..8f73ea6676 100644 --- a/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_fleet.go +++ b/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_fleet.go @@ -20,12 +20,14 @@ package fake import ( "context" + json "encoding/json" + "fmt" - agonesv1 "agones.dev/agones/pkg/apis/agones/v1" + v1 "agones.dev/agones/pkg/apis/agones/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -37,25 +39,25 @@ type FakeFleets struct { ns string } -var fleetsResource = schema.GroupVersionResource{Group: "agones.dev", Version: "v1", Resource: "fleets"} +var fleetsResource = v1.SchemeGroupVersion.WithResource("fleets") -var fleetsKind = schema.GroupVersionKind{Group: "agones.dev", Version: "v1", Kind: "Fleet"} +var fleetsKind = v1.SchemeGroupVersion.WithKind("Fleet") // Get takes name of the fleet, and returns the corresponding fleet object, and an error if there is any. -func (c *FakeFleets) Get(ctx context.Context, name string, options v1.GetOptions) (result *agonesv1.Fleet, err error) { +func (c *FakeFleets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Fleet, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(fleetsResource, c.ns, name), &agonesv1.Fleet{}) + Invokes(testing.NewGetAction(fleetsResource, c.ns, name), &v1.Fleet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.Fleet), err + return obj.(*v1.Fleet), err } // List takes label and field selectors, and returns the list of Fleets that match those selectors. -func (c *FakeFleets) List(ctx context.Context, opts v1.ListOptions) (result *agonesv1.FleetList, err error) { +func (c *FakeFleets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FleetList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(fleetsResource, fleetsKind, c.ns, opts), &agonesv1.FleetList{}) + Invokes(testing.NewListAction(fleetsResource, fleetsKind, c.ns, opts), &v1.FleetList{}) if obj == nil { return nil, err @@ -65,8 +67,8 @@ func (c *FakeFleets) List(ctx context.Context, opts v1.ListOptions) (result *ago if label == nil { label = labels.Everything() } - list := &agonesv1.FleetList{ListMeta: obj.(*agonesv1.FleetList).ListMeta} - for _, item := range obj.(*agonesv1.FleetList).Items { + list := &v1.FleetList{ListMeta: obj.(*v1.FleetList).ListMeta} + for _, item := range obj.(*v1.FleetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -75,75 +77,120 @@ func (c *FakeFleets) List(ctx context.Context, opts v1.ListOptions) (result *ago } // Watch returns a watch.Interface that watches the requested fleets. -func (c *FakeFleets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeFleets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(fleetsResource, c.ns, opts)) } // Create takes the representation of a fleet and creates it. Returns the server's representation of the fleet, and an error, if there is any. -func (c *FakeFleets) Create(ctx context.Context, fleet *agonesv1.Fleet, opts v1.CreateOptions) (result *agonesv1.Fleet, err error) { +func (c *FakeFleets) Create(ctx context.Context, fleet *v1.Fleet, opts metav1.CreateOptions) (result *v1.Fleet, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(fleetsResource, c.ns, fleet), &agonesv1.Fleet{}) + Invokes(testing.NewCreateAction(fleetsResource, c.ns, fleet), &v1.Fleet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.Fleet), err + return obj.(*v1.Fleet), err } // Update takes the representation of a fleet and updates it. Returns the server's representation of the fleet, and an error, if there is any. -func (c *FakeFleets) Update(ctx context.Context, fleet *agonesv1.Fleet, opts v1.UpdateOptions) (result *agonesv1.Fleet, err error) { +func (c *FakeFleets) Update(ctx context.Context, fleet *v1.Fleet, opts metav1.UpdateOptions) (result *v1.Fleet, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(fleetsResource, c.ns, fleet), &agonesv1.Fleet{}) + Invokes(testing.NewUpdateAction(fleetsResource, c.ns, fleet), &v1.Fleet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.Fleet), err + return obj.(*v1.Fleet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFleets) UpdateStatus(ctx context.Context, fleet *agonesv1.Fleet, opts v1.UpdateOptions) (*agonesv1.Fleet, error) { +func (c *FakeFleets) UpdateStatus(ctx context.Context, fleet *v1.Fleet, opts metav1.UpdateOptions) (*v1.Fleet, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(fleetsResource, "status", c.ns, fleet), &agonesv1.Fleet{}) + Invokes(testing.NewUpdateSubresourceAction(fleetsResource, "status", c.ns, fleet), &v1.Fleet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.Fleet), err + return obj.(*v1.Fleet), err } // Delete takes name of the fleet and deletes it. Returns an error if one occurs. -func (c *FakeFleets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeFleets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(fleetsResource, c.ns, name, opts), &agonesv1.Fleet{}) + Invokes(testing.NewDeleteActionWithOptions(fleetsResource, c.ns, name, opts), &v1.Fleet{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeFleets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeFleets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(fleetsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &agonesv1.FleetList{}) + _, err := c.Fake.Invokes(action, &v1.FleetList{}) return err } // Patch applies the patch and returns the patched fleet. -func (c *FakeFleets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *agonesv1.Fleet, err error) { +func (c *FakeFleets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Fleet, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(fleetsResource, c.ns, name, pt, data, subresources...), &agonesv1.Fleet{}) + Invokes(testing.NewPatchSubresourceAction(fleetsResource, c.ns, name, pt, data, subresources...), &v1.Fleet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.Fleet), err + return obj.(*v1.Fleet), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied fleet. +func (c *FakeFleets) Apply(ctx context.Context, fleet *agonesv1.FleetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Fleet, err error) { + if fleet == nil { + return nil, fmt.Errorf("fleet provided to Apply must not be nil") + } + data, err := json.Marshal(fleet) + if err != nil { + return nil, err + } + name := fleet.Name + if name == nil { + return nil, fmt.Errorf("fleet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(fleetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Fleet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Fleet), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeFleets) ApplyStatus(ctx context.Context, fleet *agonesv1.FleetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Fleet, err error) { + if fleet == nil { + return nil, fmt.Errorf("fleet provided to Apply must not be nil") + } + data, err := json.Marshal(fleet) + if err != nil { + return nil, err + } + name := fleet.Name + if name == nil { + return nil, fmt.Errorf("fleet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(fleetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Fleet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Fleet), err } // GetScale takes name of the fleet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeFleets) GetScale(ctx context.Context, fleetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { +func (c *FakeFleets) GetScale(ctx context.Context, fleetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { obj, err := c.Fake. Invokes(testing.NewGetSubresourceAction(fleetsResource, c.ns, "scale", fleetName), &autoscalingv1.Scale{}) @@ -154,7 +201,7 @@ func (c *FakeFleets) GetScale(ctx context.Context, fleetName string, options v1. } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeFleets) UpdateScale(ctx context.Context, fleetName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { +func (c *FakeFleets) UpdateScale(ctx context.Context, fleetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(fleetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) diff --git a/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserver.go b/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserver.go index b726b81623..b871f0f0cd 100644 --- a/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserver.go +++ b/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserver.go @@ -20,11 +20,13 @@ package fake import ( "context" + json "encoding/json" + "fmt" - agonesv1 "agones.dev/agones/pkg/apis/agones/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "agones.dev/agones/pkg/apis/agones/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -36,25 +38,25 @@ type FakeGameServers struct { ns string } -var gameserversResource = schema.GroupVersionResource{Group: "agones.dev", Version: "v1", Resource: "gameservers"} +var gameserversResource = v1.SchemeGroupVersion.WithResource("gameservers") -var gameserversKind = schema.GroupVersionKind{Group: "agones.dev", Version: "v1", Kind: "GameServer"} +var gameserversKind = v1.SchemeGroupVersion.WithKind("GameServer") // Get takes name of the gameServer, and returns the corresponding gameServer object, and an error if there is any. -func (c *FakeGameServers) Get(ctx context.Context, name string, options v1.GetOptions) (result *agonesv1.GameServer, err error) { +func (c *FakeGameServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GameServer, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(gameserversResource, c.ns, name), &agonesv1.GameServer{}) + Invokes(testing.NewGetAction(gameserversResource, c.ns, name), &v1.GameServer{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServer), err + return obj.(*v1.GameServer), err } // List takes label and field selectors, and returns the list of GameServers that match those selectors. -func (c *FakeGameServers) List(ctx context.Context, opts v1.ListOptions) (result *agonesv1.GameServerList, err error) { +func (c *FakeGameServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GameServerList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(gameserversResource, gameserversKind, c.ns, opts), &agonesv1.GameServerList{}) + Invokes(testing.NewListAction(gameserversResource, gameserversKind, c.ns, opts), &v1.GameServerList{}) if obj == nil { return nil, err @@ -64,8 +66,8 @@ func (c *FakeGameServers) List(ctx context.Context, opts v1.ListOptions) (result if label == nil { label = labels.Everything() } - list := &agonesv1.GameServerList{ListMeta: obj.(*agonesv1.GameServerList).ListMeta} - for _, item := range obj.(*agonesv1.GameServerList).Items { + list := &v1.GameServerList{ListMeta: obj.(*v1.GameServerList).ListMeta} + for _, item := range obj.(*v1.GameServerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -74,57 +76,79 @@ func (c *FakeGameServers) List(ctx context.Context, opts v1.ListOptions) (result } // Watch returns a watch.Interface that watches the requested gameServers. -func (c *FakeGameServers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeGameServers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(gameserversResource, c.ns, opts)) } // Create takes the representation of a gameServer and creates it. Returns the server's representation of the gameServer, and an error, if there is any. -func (c *FakeGameServers) Create(ctx context.Context, gameServer *agonesv1.GameServer, opts v1.CreateOptions) (result *agonesv1.GameServer, err error) { +func (c *FakeGameServers) Create(ctx context.Context, gameServer *v1.GameServer, opts metav1.CreateOptions) (result *v1.GameServer, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(gameserversResource, c.ns, gameServer), &agonesv1.GameServer{}) + Invokes(testing.NewCreateAction(gameserversResource, c.ns, gameServer), &v1.GameServer{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServer), err + return obj.(*v1.GameServer), err } // Update takes the representation of a gameServer and updates it. Returns the server's representation of the gameServer, and an error, if there is any. -func (c *FakeGameServers) Update(ctx context.Context, gameServer *agonesv1.GameServer, opts v1.UpdateOptions) (result *agonesv1.GameServer, err error) { +func (c *FakeGameServers) Update(ctx context.Context, gameServer *v1.GameServer, opts metav1.UpdateOptions) (result *v1.GameServer, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gameserversResource, c.ns, gameServer), &agonesv1.GameServer{}) + Invokes(testing.NewUpdateAction(gameserversResource, c.ns, gameServer), &v1.GameServer{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServer), err + return obj.(*v1.GameServer), err } // Delete takes name of the gameServer and deletes it. Returns an error if one occurs. -func (c *FakeGameServers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeGameServers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gameserversResource, c.ns, name, opts), &agonesv1.GameServer{}) + Invokes(testing.NewDeleteActionWithOptions(gameserversResource, c.ns, name, opts), &v1.GameServer{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeGameServers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeGameServers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(gameserversResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &agonesv1.GameServerList{}) + _, err := c.Fake.Invokes(action, &v1.GameServerList{}) return err } // Patch applies the patch and returns the patched gameServer. -func (c *FakeGameServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *agonesv1.GameServer, err error) { +func (c *FakeGameServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GameServer, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gameserversResource, c.ns, name, pt, data, subresources...), &agonesv1.GameServer{}) + Invokes(testing.NewPatchSubresourceAction(gameserversResource, c.ns, name, pt, data, subresources...), &v1.GameServer{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServer), err + return obj.(*v1.GameServer), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gameServer. +func (c *FakeGameServers) Apply(ctx context.Context, gameServer *agonesv1.GameServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServer, err error) { + if gameServer == nil { + return nil, fmt.Errorf("gameServer provided to Apply must not be nil") + } + data, err := json.Marshal(gameServer) + if err != nil { + return nil, err + } + name := gameServer.Name + if name == nil { + return nil, fmt.Errorf("gameServer.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gameserversResource, c.ns, *name, types.ApplyPatchType, data), &v1.GameServer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GameServer), err } diff --git a/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserverset.go b/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserverset.go index 20a7b9f6a9..e7405bbf88 100644 --- a/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserverset.go +++ b/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_gameserverset.go @@ -20,12 +20,14 @@ package fake import ( "context" + json "encoding/json" + "fmt" - agonesv1 "agones.dev/agones/pkg/apis/agones/v1" + v1 "agones.dev/agones/pkg/apis/agones/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -37,25 +39,25 @@ type FakeGameServerSets struct { ns string } -var gameserversetsResource = schema.GroupVersionResource{Group: "agones.dev", Version: "v1", Resource: "gameserversets"} +var gameserversetsResource = v1.SchemeGroupVersion.WithResource("gameserversets") -var gameserversetsKind = schema.GroupVersionKind{Group: "agones.dev", Version: "v1", Kind: "GameServerSet"} +var gameserversetsKind = v1.SchemeGroupVersion.WithKind("GameServerSet") // Get takes name of the gameServerSet, and returns the corresponding gameServerSet object, and an error if there is any. -func (c *FakeGameServerSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *agonesv1.GameServerSet, err error) { +func (c *FakeGameServerSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GameServerSet, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(gameserversetsResource, c.ns, name), &agonesv1.GameServerSet{}) + Invokes(testing.NewGetAction(gameserversetsResource, c.ns, name), &v1.GameServerSet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServerSet), err + return obj.(*v1.GameServerSet), err } // List takes label and field selectors, and returns the list of GameServerSets that match those selectors. -func (c *FakeGameServerSets) List(ctx context.Context, opts v1.ListOptions) (result *agonesv1.GameServerSetList, err error) { +func (c *FakeGameServerSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GameServerSetList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(gameserversetsResource, gameserversetsKind, c.ns, opts), &agonesv1.GameServerSetList{}) + Invokes(testing.NewListAction(gameserversetsResource, gameserversetsKind, c.ns, opts), &v1.GameServerSetList{}) if obj == nil { return nil, err @@ -65,8 +67,8 @@ func (c *FakeGameServerSets) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &agonesv1.GameServerSetList{ListMeta: obj.(*agonesv1.GameServerSetList).ListMeta} - for _, item := range obj.(*agonesv1.GameServerSetList).Items { + list := &v1.GameServerSetList{ListMeta: obj.(*v1.GameServerSetList).ListMeta} + for _, item := range obj.(*v1.GameServerSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -75,75 +77,120 @@ func (c *FakeGameServerSets) List(ctx context.Context, opts v1.ListOptions) (res } // Watch returns a watch.Interface that watches the requested gameServerSets. -func (c *FakeGameServerSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeGameServerSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(gameserversetsResource, c.ns, opts)) } // Create takes the representation of a gameServerSet and creates it. Returns the server's representation of the gameServerSet, and an error, if there is any. -func (c *FakeGameServerSets) Create(ctx context.Context, gameServerSet *agonesv1.GameServerSet, opts v1.CreateOptions) (result *agonesv1.GameServerSet, err error) { +func (c *FakeGameServerSets) Create(ctx context.Context, gameServerSet *v1.GameServerSet, opts metav1.CreateOptions) (result *v1.GameServerSet, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(gameserversetsResource, c.ns, gameServerSet), &agonesv1.GameServerSet{}) + Invokes(testing.NewCreateAction(gameserversetsResource, c.ns, gameServerSet), &v1.GameServerSet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServerSet), err + return obj.(*v1.GameServerSet), err } // Update takes the representation of a gameServerSet and updates it. Returns the server's representation of the gameServerSet, and an error, if there is any. -func (c *FakeGameServerSets) Update(ctx context.Context, gameServerSet *agonesv1.GameServerSet, opts v1.UpdateOptions) (result *agonesv1.GameServerSet, err error) { +func (c *FakeGameServerSets) Update(ctx context.Context, gameServerSet *v1.GameServerSet, opts metav1.UpdateOptions) (result *v1.GameServerSet, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gameserversetsResource, c.ns, gameServerSet), &agonesv1.GameServerSet{}) + Invokes(testing.NewUpdateAction(gameserversetsResource, c.ns, gameServerSet), &v1.GameServerSet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServerSet), err + return obj.(*v1.GameServerSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGameServerSets) UpdateStatus(ctx context.Context, gameServerSet *agonesv1.GameServerSet, opts v1.UpdateOptions) (*agonesv1.GameServerSet, error) { +func (c *FakeGameServerSets) UpdateStatus(ctx context.Context, gameServerSet *v1.GameServerSet, opts metav1.UpdateOptions) (*v1.GameServerSet, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gameserversetsResource, "status", c.ns, gameServerSet), &agonesv1.GameServerSet{}) + Invokes(testing.NewUpdateSubresourceAction(gameserversetsResource, "status", c.ns, gameServerSet), &v1.GameServerSet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServerSet), err + return obj.(*v1.GameServerSet), err } // Delete takes name of the gameServerSet and deletes it. Returns an error if one occurs. -func (c *FakeGameServerSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeGameServerSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gameserversetsResource, c.ns, name, opts), &agonesv1.GameServerSet{}) + Invokes(testing.NewDeleteActionWithOptions(gameserversetsResource, c.ns, name, opts), &v1.GameServerSet{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeGameServerSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeGameServerSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(gameserversetsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &agonesv1.GameServerSetList{}) + _, err := c.Fake.Invokes(action, &v1.GameServerSetList{}) return err } // Patch applies the patch and returns the patched gameServerSet. -func (c *FakeGameServerSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *agonesv1.GameServerSet, err error) { +func (c *FakeGameServerSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GameServerSet, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gameserversetsResource, c.ns, name, pt, data, subresources...), &agonesv1.GameServerSet{}) + Invokes(testing.NewPatchSubresourceAction(gameserversetsResource, c.ns, name, pt, data, subresources...), &v1.GameServerSet{}) if obj == nil { return nil, err } - return obj.(*agonesv1.GameServerSet), err + return obj.(*v1.GameServerSet), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gameServerSet. +func (c *FakeGameServerSets) Apply(ctx context.Context, gameServerSet *agonesv1.GameServerSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerSet, err error) { + if gameServerSet == nil { + return nil, fmt.Errorf("gameServerSet provided to Apply must not be nil") + } + data, err := json.Marshal(gameServerSet) + if err != nil { + return nil, err + } + name := gameServerSet.Name + if name == nil { + return nil, fmt.Errorf("gameServerSet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gameserversetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.GameServerSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GameServerSet), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGameServerSets) ApplyStatus(ctx context.Context, gameServerSet *agonesv1.GameServerSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerSet, err error) { + if gameServerSet == nil { + return nil, fmt.Errorf("gameServerSet provided to Apply must not be nil") + } + data, err := json.Marshal(gameServerSet) + if err != nil { + return nil, err + } + name := gameServerSet.Name + if name == nil { + return nil, fmt.Errorf("gameServerSet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gameserversetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.GameServerSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GameServerSet), err } // GetScale takes name of the gameServerSet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeGameServerSets) GetScale(ctx context.Context, gameServerSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { +func (c *FakeGameServerSets) GetScale(ctx context.Context, gameServerSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { obj, err := c.Fake. Invokes(testing.NewGetSubresourceAction(gameserversetsResource, c.ns, "scale", gameServerSetName), &autoscalingv1.Scale{}) @@ -154,7 +201,7 @@ func (c *FakeGameServerSets) GetScale(ctx context.Context, gameServerSetName str } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeGameServerSets) UpdateScale(ctx context.Context, gameServerSetName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { +func (c *FakeGameServerSets) UpdateScale(ctx context.Context, gameServerSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(gameserversetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) diff --git a/pkg/client/clientset/versioned/typed/agones/v1/fleet.go b/pkg/client/clientset/versioned/typed/agones/v1/fleet.go index 06b3ab8cea..ade1ca84ce 100644 --- a/pkg/client/clientset/versioned/typed/agones/v1/fleet.go +++ b/pkg/client/clientset/versioned/typed/agones/v1/fleet.go @@ -20,9 +20,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "agones.dev/agones/pkg/apis/agones/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" scheme "agones.dev/agones/pkg/client/clientset/versioned/scheme" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,6 +51,8 @@ type FleetInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.FleetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Fleet, err error) + Apply(ctx context.Context, fleet *agonesv1.FleetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Fleet, err error) + ApplyStatus(ctx context.Context, fleet *agonesv1.FleetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Fleet, err error) GetScale(ctx context.Context, fleetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, fleetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) @@ -198,6 +203,62 @@ func (c *fleets) Patch(ctx context.Context, name string, pt types.PatchType, dat return } +// Apply takes the given apply declarative configuration, applies it and returns the applied fleet. +func (c *fleets) Apply(ctx context.Context, fleet *agonesv1.FleetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Fleet, err error) { + if fleet == nil { + return nil, fmt.Errorf("fleet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(fleet) + if err != nil { + return nil, err + } + name := fleet.Name + if name == nil { + return nil, fmt.Errorf("fleet.Name must be provided to Apply") + } + result = &v1.Fleet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("fleets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *fleets) ApplyStatus(ctx context.Context, fleet *agonesv1.FleetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Fleet, err error) { + if fleet == nil { + return nil, fmt.Errorf("fleet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(fleet) + if err != nil { + return nil, err + } + + name := fleet.Name + if name == nil { + return nil, fmt.Errorf("fleet.Name must be provided to Apply") + } + + result = &v1.Fleet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("fleets"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + // GetScale takes name of the fleet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *fleets) GetScale(ctx context.Context, fleetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} diff --git a/pkg/client/clientset/versioned/typed/agones/v1/gameserver.go b/pkg/client/clientset/versioned/typed/agones/v1/gameserver.go index 97051a003a..b458b1aaea 100644 --- a/pkg/client/clientset/versioned/typed/agones/v1/gameserver.go +++ b/pkg/client/clientset/versioned/typed/agones/v1/gameserver.go @@ -20,9 +20,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "agones.dev/agones/pkg/apis/agones/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" scheme "agones.dev/agones/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -46,6 +49,7 @@ type GameServerInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.GameServerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GameServer, err error) + Apply(ctx context.Context, gameServer *agonesv1.GameServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServer, err error) GameServerExpansion } @@ -176,3 +180,29 @@ func (c *gameServers) Patch(ctx context.Context, name string, pt types.PatchType Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gameServer. +func (c *gameServers) Apply(ctx context.Context, gameServer *agonesv1.GameServerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServer, err error) { + if gameServer == nil { + return nil, fmt.Errorf("gameServer provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gameServer) + if err != nil { + return nil, err + } + name := gameServer.Name + if name == nil { + return nil, fmt.Errorf("gameServer.Name must be provided to Apply") + } + result = &v1.GameServer{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gameservers"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/agones/v1/gameserverset.go b/pkg/client/clientset/versioned/typed/agones/v1/gameserverset.go index 0b1cd9f020..d6bbc07044 100644 --- a/pkg/client/clientset/versioned/typed/agones/v1/gameserverset.go +++ b/pkg/client/clientset/versioned/typed/agones/v1/gameserverset.go @@ -20,9 +20,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "agones.dev/agones/pkg/apis/agones/v1" + agonesv1 "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" scheme "agones.dev/agones/pkg/client/clientset/versioned/scheme" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,6 +51,8 @@ type GameServerSetInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.GameServerSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GameServerSet, err error) + Apply(ctx context.Context, gameServerSet *agonesv1.GameServerSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerSet, err error) + ApplyStatus(ctx context.Context, gameServerSet *agonesv1.GameServerSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerSet, err error) GetScale(ctx context.Context, gameServerSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, gameServerSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) @@ -198,6 +203,62 @@ func (c *gameServerSets) Patch(ctx context.Context, name string, pt types.PatchT return } +// Apply takes the given apply declarative configuration, applies it and returns the applied gameServerSet. +func (c *gameServerSets) Apply(ctx context.Context, gameServerSet *agonesv1.GameServerSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerSet, err error) { + if gameServerSet == nil { + return nil, fmt.Errorf("gameServerSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gameServerSet) + if err != nil { + return nil, err + } + name := gameServerSet.Name + if name == nil { + return nil, fmt.Errorf("gameServerSet.Name must be provided to Apply") + } + result = &v1.GameServerSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gameserversets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gameServerSets) ApplyStatus(ctx context.Context, gameServerSet *agonesv1.GameServerSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerSet, err error) { + if gameServerSet == nil { + return nil, fmt.Errorf("gameServerSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gameServerSet) + if err != nil { + return nil, err + } + + name := gameServerSet.Name + if name == nil { + return nil, fmt.Errorf("gameServerSet.Name must be provided to Apply") + } + + result = &v1.GameServerSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gameserversets"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + // GetScale takes name of the gameServerSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *gameServerSets) GetScale(ctx context.Context, gameServerSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} diff --git a/pkg/client/clientset/versioned/typed/allocation/v1/fake/fake_gameserverallocation.go b/pkg/client/clientset/versioned/typed/allocation/v1/fake/fake_gameserverallocation.go index aa8fad8299..31b262b19f 100644 --- a/pkg/client/clientset/versioned/typed/allocation/v1/fake/fake_gameserverallocation.go +++ b/pkg/client/clientset/versioned/typed/allocation/v1/fake/fake_gameserverallocation.go @@ -23,7 +23,6 @@ import ( v1 "agones.dev/agones/pkg/apis/allocation/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -33,9 +32,9 @@ type FakeGameServerAllocations struct { ns string } -var gameserverallocationsResource = schema.GroupVersionResource{Group: "allocation.agones.dev", Version: "v1", Resource: "gameserverallocations"} +var gameserverallocationsResource = v1.SchemeGroupVersion.WithResource("gameserverallocations") -var gameserverallocationsKind = schema.GroupVersionKind{Group: "allocation.agones.dev", Version: "v1", Kind: "GameServerAllocation"} +var gameserverallocationsKind = v1.SchemeGroupVersion.WithKind("GameServerAllocation") // Create takes the representation of a gameServerAllocation and creates it. Returns the server's representation of the gameServerAllocation, and an error, if there is any. func (c *FakeGameServerAllocations) Create(ctx context.Context, gameServerAllocation *v1.GameServerAllocation, opts metav1.CreateOptions) (result *v1.GameServerAllocation, err error) { diff --git a/pkg/client/clientset/versioned/typed/autoscaling/v1/fake/fake_fleetautoscaler.go b/pkg/client/clientset/versioned/typed/autoscaling/v1/fake/fake_fleetautoscaler.go index 90f5006a49..232a42f136 100644 --- a/pkg/client/clientset/versioned/typed/autoscaling/v1/fake/fake_fleetautoscaler.go +++ b/pkg/client/clientset/versioned/typed/autoscaling/v1/fake/fake_fleetautoscaler.go @@ -20,11 +20,13 @@ package fake import ( "context" + json "encoding/json" + "fmt" - autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "agones.dev/agones/pkg/apis/autoscaling/v1" + autoscalingv1 "agones.dev/agones/pkg/client/applyconfiguration/autoscaling/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -36,25 +38,25 @@ type FakeFleetAutoscalers struct { ns string } -var fleetautoscalersResource = schema.GroupVersionResource{Group: "autoscaling.agones.dev", Version: "v1", Resource: "fleetautoscalers"} +var fleetautoscalersResource = v1.SchemeGroupVersion.WithResource("fleetautoscalers") -var fleetautoscalersKind = schema.GroupVersionKind{Group: "autoscaling.agones.dev", Version: "v1", Kind: "FleetAutoscaler"} +var fleetautoscalersKind = v1.SchemeGroupVersion.WithKind("FleetAutoscaler") // Get takes name of the fleetAutoscaler, and returns the corresponding fleetAutoscaler object, and an error if there is any. -func (c *FakeFleetAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *autoscalingv1.FleetAutoscaler, err error) { +func (c *FakeFleetAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FleetAutoscaler, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(fleetautoscalersResource, c.ns, name), &autoscalingv1.FleetAutoscaler{}) + Invokes(testing.NewGetAction(fleetautoscalersResource, c.ns, name), &v1.FleetAutoscaler{}) if obj == nil { return nil, err } - return obj.(*autoscalingv1.FleetAutoscaler), err + return obj.(*v1.FleetAutoscaler), err } // List takes label and field selectors, and returns the list of FleetAutoscalers that match those selectors. -func (c *FakeFleetAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *autoscalingv1.FleetAutoscalerList, err error) { +func (c *FakeFleetAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FleetAutoscalerList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(fleetautoscalersResource, fleetautoscalersKind, c.ns, opts), &autoscalingv1.FleetAutoscalerList{}) + Invokes(testing.NewListAction(fleetautoscalersResource, fleetautoscalersKind, c.ns, opts), &v1.FleetAutoscalerList{}) if obj == nil { return nil, err @@ -64,8 +66,8 @@ func (c *FakeFleetAutoscalers) List(ctx context.Context, opts v1.ListOptions) (r if label == nil { label = labels.Everything() } - list := &autoscalingv1.FleetAutoscalerList{ListMeta: obj.(*autoscalingv1.FleetAutoscalerList).ListMeta} - for _, item := range obj.(*autoscalingv1.FleetAutoscalerList).Items { + list := &v1.FleetAutoscalerList{ListMeta: obj.(*v1.FleetAutoscalerList).ListMeta} + for _, item := range obj.(*v1.FleetAutoscalerList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -74,69 +76,114 @@ func (c *FakeFleetAutoscalers) List(ctx context.Context, opts v1.ListOptions) (r } // Watch returns a watch.Interface that watches the requested fleetAutoscalers. -func (c *FakeFleetAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeFleetAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(fleetautoscalersResource, c.ns, opts)) } // Create takes the representation of a fleetAutoscaler and creates it. Returns the server's representation of the fleetAutoscaler, and an error, if there is any. -func (c *FakeFleetAutoscalers) Create(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscaler, opts v1.CreateOptions) (result *autoscalingv1.FleetAutoscaler, err error) { +func (c *FakeFleetAutoscalers) Create(ctx context.Context, fleetAutoscaler *v1.FleetAutoscaler, opts metav1.CreateOptions) (result *v1.FleetAutoscaler, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(fleetautoscalersResource, c.ns, fleetAutoscaler), &autoscalingv1.FleetAutoscaler{}) + Invokes(testing.NewCreateAction(fleetautoscalersResource, c.ns, fleetAutoscaler), &v1.FleetAutoscaler{}) if obj == nil { return nil, err } - return obj.(*autoscalingv1.FleetAutoscaler), err + return obj.(*v1.FleetAutoscaler), err } // Update takes the representation of a fleetAutoscaler and updates it. Returns the server's representation of the fleetAutoscaler, and an error, if there is any. -func (c *FakeFleetAutoscalers) Update(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscaler, opts v1.UpdateOptions) (result *autoscalingv1.FleetAutoscaler, err error) { +func (c *FakeFleetAutoscalers) Update(ctx context.Context, fleetAutoscaler *v1.FleetAutoscaler, opts metav1.UpdateOptions) (result *v1.FleetAutoscaler, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(fleetautoscalersResource, c.ns, fleetAutoscaler), &autoscalingv1.FleetAutoscaler{}) + Invokes(testing.NewUpdateAction(fleetautoscalersResource, c.ns, fleetAutoscaler), &v1.FleetAutoscaler{}) if obj == nil { return nil, err } - return obj.(*autoscalingv1.FleetAutoscaler), err + return obj.(*v1.FleetAutoscaler), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFleetAutoscalers) UpdateStatus(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscaler, opts v1.UpdateOptions) (*autoscalingv1.FleetAutoscaler, error) { +func (c *FakeFleetAutoscalers) UpdateStatus(ctx context.Context, fleetAutoscaler *v1.FleetAutoscaler, opts metav1.UpdateOptions) (*v1.FleetAutoscaler, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(fleetautoscalersResource, "status", c.ns, fleetAutoscaler), &autoscalingv1.FleetAutoscaler{}) + Invokes(testing.NewUpdateSubresourceAction(fleetautoscalersResource, "status", c.ns, fleetAutoscaler), &v1.FleetAutoscaler{}) if obj == nil { return nil, err } - return obj.(*autoscalingv1.FleetAutoscaler), err + return obj.(*v1.FleetAutoscaler), err } // Delete takes name of the fleetAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeFleetAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeFleetAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(fleetautoscalersResource, c.ns, name, opts), &autoscalingv1.FleetAutoscaler{}) + Invokes(testing.NewDeleteActionWithOptions(fleetautoscalersResource, c.ns, name, opts), &v1.FleetAutoscaler{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeFleetAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeFleetAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(fleetautoscalersResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &autoscalingv1.FleetAutoscalerList{}) + _, err := c.Fake.Invokes(action, &v1.FleetAutoscalerList{}) return err } // Patch applies the patch and returns the patched fleetAutoscaler. -func (c *FakeFleetAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *autoscalingv1.FleetAutoscaler, err error) { +func (c *FakeFleetAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FleetAutoscaler, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(fleetautoscalersResource, c.ns, name, pt, data, subresources...), &autoscalingv1.FleetAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(fleetautoscalersResource, c.ns, name, pt, data, subresources...), &v1.FleetAutoscaler{}) if obj == nil { return nil, err } - return obj.(*autoscalingv1.FleetAutoscaler), err + return obj.(*v1.FleetAutoscaler), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied fleetAutoscaler. +func (c *FakeFleetAutoscalers) Apply(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FleetAutoscaler, err error) { + if fleetAutoscaler == nil { + return nil, fmt.Errorf("fleetAutoscaler provided to Apply must not be nil") + } + data, err := json.Marshal(fleetAutoscaler) + if err != nil { + return nil, err + } + name := fleetAutoscaler.Name + if name == nil { + return nil, fmt.Errorf("fleetAutoscaler.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(fleetautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v1.FleetAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.FleetAutoscaler), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeFleetAutoscalers) ApplyStatus(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FleetAutoscaler, err error) { + if fleetAutoscaler == nil { + return nil, fmt.Errorf("fleetAutoscaler provided to Apply must not be nil") + } + data, err := json.Marshal(fleetAutoscaler) + if err != nil { + return nil, err + } + name := fleetAutoscaler.Name + if name == nil { + return nil, fmt.Errorf("fleetAutoscaler.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(fleetautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.FleetAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.FleetAutoscaler), err } diff --git a/pkg/client/clientset/versioned/typed/autoscaling/v1/fleetautoscaler.go b/pkg/client/clientset/versioned/typed/autoscaling/v1/fleetautoscaler.go index 060c3942cc..bad2b02394 100644 --- a/pkg/client/clientset/versioned/typed/autoscaling/v1/fleetautoscaler.go +++ b/pkg/client/clientset/versioned/typed/autoscaling/v1/fleetautoscaler.go @@ -20,9 +20,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "agones.dev/agones/pkg/apis/autoscaling/v1" + autoscalingv1 "agones.dev/agones/pkg/client/applyconfiguration/autoscaling/v1" scheme "agones.dev/agones/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -47,6 +50,8 @@ type FleetAutoscalerInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.FleetAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FleetAutoscaler, err error) + Apply(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FleetAutoscaler, err error) + ApplyStatus(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FleetAutoscaler, err error) FleetAutoscalerExpansion } @@ -193,3 +198,59 @@ func (c *fleetAutoscalers) Patch(ctx context.Context, name string, pt types.Patc Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied fleetAutoscaler. +func (c *fleetAutoscalers) Apply(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FleetAutoscaler, err error) { + if fleetAutoscaler == nil { + return nil, fmt.Errorf("fleetAutoscaler provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(fleetAutoscaler) + if err != nil { + return nil, err + } + name := fleetAutoscaler.Name + if name == nil { + return nil, fmt.Errorf("fleetAutoscaler.Name must be provided to Apply") + } + result = &v1.FleetAutoscaler{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("fleetautoscalers"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *fleetAutoscalers) ApplyStatus(ctx context.Context, fleetAutoscaler *autoscalingv1.FleetAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FleetAutoscaler, err error) { + if fleetAutoscaler == nil { + return nil, fmt.Errorf("fleetAutoscaler provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(fleetAutoscaler) + if err != nil { + return nil, err + } + + name := fleetAutoscaler.Name + if name == nil { + return nil, fmt.Errorf("fleetAutoscaler.Name must be provided to Apply") + } + + result = &v1.FleetAutoscaler{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("fleetautoscalers"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go index e7437d44d6..7be340034c 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go @@ -20,11 +20,13 @@ package fake import ( "context" + json "encoding/json" + "fmt" - multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "agones.dev/agones/pkg/apis/multicluster/v1" + multiclusterv1 "agones.dev/agones/pkg/client/applyconfiguration/multicluster/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -36,25 +38,25 @@ type FakeGameServerAllocationPolicies struct { ns string } -var gameserverallocationpoliciesResource = schema.GroupVersionResource{Group: "multicluster.agones.dev", Version: "v1", Resource: "gameserverallocationpolicies"} +var gameserverallocationpoliciesResource = v1.SchemeGroupVersion.WithResource("gameserverallocationpolicies") -var gameserverallocationpoliciesKind = schema.GroupVersionKind{Group: "multicluster.agones.dev", Version: "v1", Kind: "GameServerAllocationPolicy"} +var gameserverallocationpoliciesKind = v1.SchemeGroupVersion.WithKind("GameServerAllocationPolicy") // Get takes name of the gameServerAllocationPolicy, and returns the corresponding gameServerAllocationPolicy object, and an error if there is any. -func (c *FakeGameServerAllocationPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *multiclusterv1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(gameserverallocationpoliciesResource, c.ns, name), &multiclusterv1.GameServerAllocationPolicy{}) + Invokes(testing.NewGetAction(gameserverallocationpoliciesResource, c.ns, name), &v1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*multiclusterv1.GameServerAllocationPolicy), err + return obj.(*v1.GameServerAllocationPolicy), err } // List takes label and field selectors, and returns the list of GameServerAllocationPolicies that match those selectors. -func (c *FakeGameServerAllocationPolicies) List(ctx context.Context, opts v1.ListOptions) (result *multiclusterv1.GameServerAllocationPolicyList, err error) { +func (c *FakeGameServerAllocationPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GameServerAllocationPolicyList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(gameserverallocationpoliciesResource, gameserverallocationpoliciesKind, c.ns, opts), &multiclusterv1.GameServerAllocationPolicyList{}) + Invokes(testing.NewListAction(gameserverallocationpoliciesResource, gameserverallocationpoliciesKind, c.ns, opts), &v1.GameServerAllocationPolicyList{}) if obj == nil { return nil, err @@ -64,8 +66,8 @@ func (c *FakeGameServerAllocationPolicies) List(ctx context.Context, opts v1.Lis if label == nil { label = labels.Everything() } - list := &multiclusterv1.GameServerAllocationPolicyList{ListMeta: obj.(*multiclusterv1.GameServerAllocationPolicyList).ListMeta} - for _, item := range obj.(*multiclusterv1.GameServerAllocationPolicyList).Items { + list := &v1.GameServerAllocationPolicyList{ListMeta: obj.(*v1.GameServerAllocationPolicyList).ListMeta} + for _, item := range obj.(*v1.GameServerAllocationPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -74,57 +76,79 @@ func (c *FakeGameServerAllocationPolicies) List(ctx context.Context, opts v1.Lis } // Watch returns a watch.Interface that watches the requested gameServerAllocationPolicies. -func (c *FakeGameServerAllocationPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeGameServerAllocationPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(gameserverallocationpoliciesResource, c.ns, opts)) } // Create takes the representation of a gameServerAllocationPolicy and creates it. Returns the server's representation of the gameServerAllocationPolicy, and an error, if there is any. -func (c *FakeGameServerAllocationPolicies) Create(ctx context.Context, gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicy, opts v1.CreateOptions) (result *multiclusterv1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Create(ctx context.Context, gameServerAllocationPolicy *v1.GameServerAllocationPolicy, opts metav1.CreateOptions) (result *v1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &multiclusterv1.GameServerAllocationPolicy{}) + Invokes(testing.NewCreateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &v1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*multiclusterv1.GameServerAllocationPolicy), err + return obj.(*v1.GameServerAllocationPolicy), err } // Update takes the representation of a gameServerAllocationPolicy and updates it. Returns the server's representation of the gameServerAllocationPolicy, and an error, if there is any. -func (c *FakeGameServerAllocationPolicies) Update(ctx context.Context, gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicy, opts v1.UpdateOptions) (result *multiclusterv1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Update(ctx context.Context, gameServerAllocationPolicy *v1.GameServerAllocationPolicy, opts metav1.UpdateOptions) (result *v1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &multiclusterv1.GameServerAllocationPolicy{}) + Invokes(testing.NewUpdateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &v1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*multiclusterv1.GameServerAllocationPolicy), err + return obj.(*v1.GameServerAllocationPolicy), err } // Delete takes name of the gameServerAllocationPolicy and deletes it. Returns an error if one occurs. -func (c *FakeGameServerAllocationPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (c *FakeGameServerAllocationPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gameserverallocationpoliciesResource, c.ns, name, opts), &multiclusterv1.GameServerAllocationPolicy{}) + Invokes(testing.NewDeleteActionWithOptions(gameserverallocationpoliciesResource, c.ns, name, opts), &v1.GameServerAllocationPolicy{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeGameServerAllocationPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (c *FakeGameServerAllocationPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { action := testing.NewDeleteCollectionAction(gameserverallocationpoliciesResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &multiclusterv1.GameServerAllocationPolicyList{}) + _, err := c.Fake.Invokes(action, &v1.GameServerAllocationPolicyList{}) return err } // Patch applies the patch and returns the patched gameServerAllocationPolicy. -func (c *FakeGameServerAllocationPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *multiclusterv1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gameserverallocationpoliciesResource, c.ns, name, pt, data, subresources...), &multiclusterv1.GameServerAllocationPolicy{}) + Invokes(testing.NewPatchSubresourceAction(gameserverallocationpoliciesResource, c.ns, name, pt, data, subresources...), &v1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*multiclusterv1.GameServerAllocationPolicy), err + return obj.(*v1.GameServerAllocationPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gameServerAllocationPolicy. +func (c *FakeGameServerAllocationPolicies) Apply(ctx context.Context, gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerAllocationPolicy, err error) { + if gameServerAllocationPolicy == nil { + return nil, fmt.Errorf("gameServerAllocationPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(gameServerAllocationPolicy) + if err != nil { + return nil, err + } + name := gameServerAllocationPolicy.Name + if name == nil { + return nil, fmt.Errorf("gameServerAllocationPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gameserverallocationpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1.GameServerAllocationPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GameServerAllocationPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go b/pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go index 2a79be998a..143e55f670 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go @@ -20,9 +20,12 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "agones.dev/agones/pkg/apis/multicluster/v1" + multiclusterv1 "agones.dev/agones/pkg/client/applyconfiguration/multicluster/v1" scheme "agones.dev/agones/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -46,6 +49,7 @@ type GameServerAllocationPolicyInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.GameServerAllocationPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GameServerAllocationPolicy, err error) + Apply(ctx context.Context, gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerAllocationPolicy, err error) GameServerAllocationPolicyExpansion } @@ -176,3 +180,29 @@ func (c *gameServerAllocationPolicies) Patch(ctx context.Context, name string, p Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gameServerAllocationPolicy. +func (c *gameServerAllocationPolicies) Apply(ctx context.Context, gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GameServerAllocationPolicy, err error) { + if gameServerAllocationPolicy == nil { + return nil, fmt.Errorf("gameServerAllocationPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gameServerAllocationPolicy) + if err != nil { + return nil, err + } + name := gameServerAllocationPolicy.Name + if name == nil { + return nil, fmt.Errorf("gameServerAllocationPolicy.Name must be provided to Apply") + } + result = &v1.GameServerAllocationPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gameserverallocationpolicies"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/fleets/controller_test.go b/pkg/fleets/controller_test.go index a93060688e..6ee68b1ea5 100644 --- a/pkg/fleets/controller_test.go +++ b/pkg/fleets/controller_test.go @@ -25,6 +25,7 @@ import ( "agones.dev/agones/pkg/apis" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" v1 "agones.dev/agones/pkg/apis/agones/v1" + applyconfigurations "agones.dev/agones/pkg/client/applyconfiguration/agones/v1" agonesv1clientset "agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1" agonesv1client "agones.dev/agones/pkg/client/listers/agones/v1" "agones.dev/agones/pkg/cloudproduct/generic" @@ -1765,6 +1766,14 @@ func (ffg *fakeFleetsGetterWithErr) Patch(ctx context.Context, name string, pt t panic("not implemented") } +func (ffg *fakeFleetsGetterWithErr) Apply(ctx context.Context, fleet *applyconfigurations.FleetApplyConfiguration, opts metav1.ApplyOptions) (*v1.Fleet, error) { + panic("not implemented") +} + +func (ffg *fakeFleetsGetterWithErr) ApplyStatus(ctx context.Context, fleet *applyconfigurations.FleetApplyConfiguration, opts metav1.ApplyOptions) (*v1.Fleet, error) { + panic("not implemented") +} + func (ffg *fakeFleetsGetterWithErr) GetScale(ctx context.Context, fleetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) { panic("not implemented") } diff --git a/pkg/gameserverallocations/allocation_cache_test.go b/pkg/gameserverallocations/allocation_cache_test.go index 1553801521..3dac0d1fb4 100644 --- a/pkg/gameserverallocations/allocation_cache_test.go +++ b/pkg/gameserverallocations/allocation_cache_test.go @@ -15,6 +15,7 @@ package gameserverallocations import ( + "context" "fmt" "testing" "time" @@ -513,7 +514,7 @@ func TestAllocatorRunCacheSync(t *testing.T) { assertCacheEntries := func(expected int) { count := 0 - err := wait.PollImmediate(time.Second, 5*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Second, true, func(ctx context.Context) (done bool, err error) { count = 0 cache.cache.Range(func(key string, gs *agonesv1.GameServer) bool { count++ diff --git a/pkg/gameserverallocations/allocator.go b/pkg/gameserverallocations/allocator.go index 4283ea6048..78d831a9e4 100644 --- a/pkg/gameserverallocations/allocator.go +++ b/pkg/gameserverallocations/allocator.go @@ -692,6 +692,7 @@ func Retry(backoff wait.Backoff, fn func() error) error { return false, nil } }) + // nolint:staticcheck if err == wait.ErrWaitTimeout { err = lastConflictErr } diff --git a/pkg/gameserverallocations/allocator_test.go b/pkg/gameserverallocations/allocator_test.go index c3e630edfc..cc46e04278 100644 --- a/pkg/gameserverallocations/allocator_test.go +++ b/pkg/gameserverallocations/allocator_test.go @@ -81,7 +81,7 @@ func TestAllocatorAllocate(t *testing.T) { require.NoError(t, a.Run(ctx)) // wait for it to be up and running - err := wait.PollImmediate(time.Second, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { return a.allocationCache.workerqueue.RunCount() == 1, nil }) require.NoError(t, err) @@ -164,7 +164,7 @@ func TestAllocatorAllocatePriority(t *testing.T) { require.NoError(t, a.Run(ctx)) // wait for it to be up and running - err := wait.PollImmediate(time.Second, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { return a.allocationCache.workerqueue.RunCount() == 1, nil }) require.NoError(t, err) diff --git a/pkg/gameserverallocations/controller_test.go b/pkg/gameserverallocations/controller_test.go index b4a85f7ec0..5185db105b 100644 --- a/pkg/gameserverallocations/controller_test.go +++ b/pkg/gameserverallocations/controller_test.go @@ -98,7 +98,7 @@ func TestControllerAllocator(t *testing.T) { assert.FailNow(t, err.Error()) } // wait for it to be up and running - err := wait.PollImmediate(time.Second, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { return c.allocator.allocationCache.workerqueue.RunCount() == 1, nil }) assert.NoError(t, err) @@ -236,7 +236,7 @@ func TestMultiClusterAllocationFromLocal(t *testing.T) { assert.FailNow(t, err.Error()) } // wait for it to be up and running - err := wait.PollImmediate(time.Second, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { return c.allocator.allocationCache.workerqueue.RunCount() == 1, nil }) assert.NoError(t, err) @@ -284,7 +284,7 @@ func TestMultiClusterAllocationFromLocal(t *testing.T) { assert.FailNow(t, err.Error()) } // wait for it to be up and running - err := wait.PollImmediate(time.Second, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { return c.allocator.allocationCache.workerqueue.RunCount() == 1, nil }) assert.NoError(t, err) @@ -344,7 +344,7 @@ func TestMultiClusterAllocationFromLocal(t *testing.T) { assert.FailNow(t, err.Error()) } // wait for it to be up and running - err := wait.PollImmediate(time.Second, 10*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { return c.allocator.allocationCache.workerqueue.RunCount() == 1, nil }) assert.NoError(t, err) diff --git a/pkg/gameservers/health_test.go b/pkg/gameservers/health_test.go index e0e11f7f8f..f0b6591186 100644 --- a/pkg/gameservers/health_test.go +++ b/pkg/gameservers/health_test.go @@ -15,6 +15,7 @@ package gameservers import ( + "context" "errors" "testing" "time" @@ -413,7 +414,7 @@ func TestHealthControllerRun(t *testing.T) { podWatch.Add(pod.DeepCopy()) go hc.Run(stop, 1) // nolint: errcheck - err = wait.PollImmediate(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { return hc.workerqueue.RunCount() == 1, nil }) assert.NoError(t, err) diff --git a/pkg/sdkserver/helper_test.go b/pkg/sdkserver/helper_test.go index 2185028d3f..23f2acce9b 100644 --- a/pkg/sdkserver/helper_test.go +++ b/pkg/sdkserver/helper_test.go @@ -31,7 +31,7 @@ import ( func testHTTPHealth(t *testing.T, url string, expectedResponse string, expectedStatus int) { // do a poll, because this code could run before the health check becomes live - err := wait.PollImmediate(time.Second, 20*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 20*time.Second, true, func(ctx context.Context) (done bool, err error) { resp, err := http.Get(url) if err != nil { logrus.WithError(err).Error("Error connecting to ", url) diff --git a/pkg/sdkserver/localsdk_test.go b/pkg/sdkserver/localsdk_test.go index ea45c13aef..1575c4cb99 100644 --- a/pkg/sdkserver/localsdk_test.go +++ b/pkg/sdkserver/localsdk_test.go @@ -181,7 +181,7 @@ func TestLocalSDKServerSetLabel(t *testing.T) { assertInitialWatchUpdate(t, stream) // make sure length of l.updateObservers is at least 1 - err = wait.PollImmediate(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { ret := false l.updateObservers.Range(func(_, _ interface{}) bool { ret = true @@ -250,7 +250,7 @@ func TestLocalSDKServerSetAnnotation(t *testing.T) { assertInitialWatchUpdate(t, stream) // make sure length of l.updateObservers is at least 1 - err = wait.PollImmediate(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { ret := false l.updateObservers.Range(func(_, _ interface{}) bool { ret = true @@ -297,7 +297,7 @@ func TestLocalSDKServerWatchGameServer(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -343,7 +343,7 @@ func TestLocalSDKServerPlayerCapacity(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -491,7 +491,7 @@ func TestLocalSDKServerPlayerConnectAndDisconnect(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -641,7 +641,7 @@ func TestLocalSDKServerGetCounter(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -713,7 +713,7 @@ func TestLocalSDKServerGetList(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -789,7 +789,7 @@ func TestLocalSDKServerUpdateList(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -981,7 +981,7 @@ func TestLocalSDKServerAddListValue(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true @@ -1073,7 +1073,7 @@ func TestLocalSDKServerRemoveListValue(t *testing.T) { assertInitialWatchUpdate(t, stream) // wait for watching to begin - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { found := false l.updateObservers.Range(func(_, _ interface{}) bool { found = true diff --git a/pkg/sdkserver/sdkserver.go b/pkg/sdkserver/sdkserver.go index 06ad2fe9f7..63ef1d32f9 100644 --- a/pkg/sdkserver/sdkserver.go +++ b/pkg/sdkserver/sdkserver.go @@ -295,6 +295,7 @@ func (s *SDKServer) WaitForConnection(ctx context.Context) error { } try := 0 + // nolint:staticcheck return wait.PollImmediateInfiniteWithContext(ctx, 4*time.Second, func(ctx context.Context) (bool, error) { ctx, cancel := context.WithTimeout(ctx, 3*time.Second) defer cancel() diff --git a/pkg/sdkserver/sdkserver_test.go b/pkg/sdkserver/sdkserver_test.go index a6f3d0c4ee..8ab25844a1 100644 --- a/pkg/sdkserver/sdkserver_test.go +++ b/pkg/sdkserver/sdkserver_test.go @@ -1373,7 +1373,7 @@ func TestSDKServerPlayerCapacity(t *testing.T) { // check initial value comes through // async, so check after a period - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { count, err := sc.GetPlayerCapacity(context.Background(), &alpha.Empty{}) return count.Count == 10, err }) @@ -1439,7 +1439,7 @@ func TestSDKServerPlayerConnectAndDisconnectWithoutPlayerTracking(t *testing.T) // check initial value comes through // async, so check after a period e := &alpha.Empty{} - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { count, err := sc.GetPlayerCapacity(context.Background(), e) assert.Nil(t, count) @@ -1524,7 +1524,7 @@ func TestSDKServerPlayerConnectAndDisconnect(t *testing.T) { // check initial value comes through // async, so check after a period e := &alpha.Empty{} - err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { count, err := sc.GetPlayerCapacity(context.Background(), e) return count.Count == capacity, err }) @@ -1833,7 +1833,7 @@ func defaultSidecar(m agtesting.Mocks) (*SDKServer, error) { } func waitForMessage(sc *SDKServer) error { - return wait.PollImmediate(time.Second, 5*time.Second, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Second, true, func(ctx context.Context) (done bool, err error) { sc.healthMutex.RLock() defer sc.healthMutex.RUnlock() return sc.clock.Now().UTC() == sc.healthLastUpdated, nil @@ -1841,7 +1841,7 @@ func waitForMessage(sc *SDKServer) error { } func waitConnectedStreamCount(sc *SDKServer, count int) error { //nolint:unparam // Keep flexibility. - return wait.PollImmediate(1*time.Second, 10*time.Second, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 10*time.Second, true, func(ctx context.Context) (bool, error) { sc.streamMutex.RLock() defer sc.streamMutex.RUnlock() return len(sc.connectedStreams) == count, nil diff --git a/pkg/util/crd/crd.go b/pkg/util/crd/crd.go index 4873ea9a57..e80a77fc3a 100644 --- a/pkg/util/crd/crd.go +++ b/pkg/util/crd/crd.go @@ -30,7 +30,7 @@ import ( // WaitForEstablishedCRD blocks until CRD comes to an Established state. // Has a deadline of 60 seconds for this to occur. func WaitForEstablishedCRD(ctx context.Context, crdGetter apiextclientv1.CustomResourceDefinitionInterface, name string, logger *logrus.Entry) error { - return wait.PollImmediate(time.Second, 60*time.Second, func() (done bool, err error) { + return wait.PollUntilContextTimeout(context.Background(), time.Second, 60*time.Second, true, func(ctx context.Context) (done bool, err error) { crd, err := crdGetter.Get(ctx, name, metav1.GetOptions{}) if err != nil { return false, err diff --git a/pkg/util/workerqueue/workerqueue_test.go b/pkg/util/workerqueue/workerqueue_test.go index 21630a9304..37ba602679 100644 --- a/pkg/util/workerqueue/workerqueue_test.go +++ b/pkg/util/workerqueue/workerqueue_test.go @@ -79,7 +79,7 @@ func TestWorkerQueueHealthy(t *testing.T) { go wq.Run(ctx, 1) // Yield to the scheduler to ensure the worker queue goroutine can run. - err := wait.Poll(100*time.Millisecond, 3*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 3*time.Second, true, func(ctx context.Context) (done bool, err error) { if (wq.RunCount() == 1) && wq.Healthy() == nil { return true, nil } @@ -93,7 +93,7 @@ func TestWorkerQueueHealthy(t *testing.T) { // Yield to the scheduler again to ensure the worker queue goroutine can // finish. - err = wait.Poll(100*time.Millisecond, 3*time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 3*time.Second, true, func(ctx context.Context) (done bool, err error) { if (wq.RunCount() == 0) && wq.Healthy() != nil { return true, nil } @@ -121,7 +121,7 @@ func TestWorkQueueHealthCheck(t *testing.T) { go wq.Run(ctx, workersCount) // Wait for worker to actually start - err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) { rc := wq.RunCount() logrus.WithField("runcount", rc).Info("Checking run count before liveness check") return rc == workersCount, nil @@ -130,7 +130,7 @@ func TestWorkQueueHealthCheck(t *testing.T) { f := func(t *testing.T, url string, status int) { // sometimes the http server takes a bit to start up - err := wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Second, true, func(ctx context.Context) (done bool, err error) { resp, err := http.Get(url) assert.Nil(t, err) defer resp.Body.Close() // nolint: errcheck @@ -155,7 +155,7 @@ func TestWorkQueueHealthCheck(t *testing.T) { cancel() // closing can take a short while - err = wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Second, true, func(ctx context.Context) (bool, error) { rc := wq.RunCount() logrus.WithField("runcount", rc).Info("Checking run count") return rc == 0, nil diff --git a/site/assets/templates/crd-doc-config.json b/site/assets/templates/crd-doc-config.json index bf60b577c2..1f9314984b 100644 --- a/site/assets/templates/crd-doc-config.json +++ b/site/assets/templates/crd-doc-config.json @@ -14,7 +14,7 @@ }, { "typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/", - "docsURLTemplate": "https://v1-26.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}" + "docsURLTemplate": "https://v1-27.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}" }, { "typeMatchPrefix": "^github\\.com/knative/pkg/apis/duck/", diff --git a/site/config.toml b/site/config.toml index 70c491132b..130cbb1762 100644 --- a/site/config.toml +++ b/site/config.toml @@ -92,12 +92,12 @@ aks_example_cluster_version = "1.27.1" eks_example_cluster_version = "1.27" minikube_example_cluster_version = "1.26.6" # shown in development (or the next versions that will be supported) -dev_supported_k8s = ["1.25", "1.26", "1.27"] -dev_k8s_api_version = "1.26" -dev_gke_example_cluster_version = "1.26" -dev_aks_example_cluster_version = "1.27.1" -dev_eks_example_cluster_version = "1.27" -dev_minikube_example_cluster_version = "1.26.6" +dev_supported_k8s = ["1.26", "1.27", "1.28"] +dev_k8s_api_version = "1.27" +dev_gke_example_cluster_version = "1.27" +dev_aks_example_cluster_version = "1.28.0" +dev_eks_example_cluster_version = "1.28" +dev_minikube_example_cluster_version = "1.27.6" # example tag example_image_tag = "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.19" diff --git a/site/content/en/docs/Reference/agones_crd_api_reference.html b/site/content/en/docs/Reference/agones_crd_api_reference.html index 982482612b..1db38ceb4f 100644 --- a/site/content/en/docs/Reference/agones_crd_api_reference.html +++ b/site/content/en/docs/Reference/agones_crd_api_reference.html @@ -3,7 +3,7 @@ description="Detailed list of Agones Custom Resource Definitions available" +++ -{{% feature expiryVersion="1.34.0" %}} +{{% feature expiryVersion="1.36.0" %}}

Packages: