diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 3ae5befe5e..9652265ef2 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: # Detail: `setup-envtest list` - kubernetes-version: ["1.28.3", "1.29.3", "1.30.0"] + kubernetes-version: ["1.28.3", "1.29.3", "1.30.0", "1.31.3"] steps: - name: Check out code diff --git a/Makefile b/Makefile index 41de69bd07..29ed6d05d6 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ ifeq ($(GOLANGCI_LINT),) endif ${GOBIN}/golangci-lint run --timeout 5m --go 1.22 ./... -ENVTEST_K8S_VERSION ?= 1.30 +ENVTEST_K8S_VERSION ?= 1.31 HAS_SETUP_ENVTEST := $(shell command -v setup-envtest;) testall: manifests generate fmt vet golangci-lint test ## Run tests. @@ -90,7 +90,7 @@ testv2: envtest: ifndef HAS_SETUP_ENVTEST - go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.18 + go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.19 @echo "setup-envtest has been installed" endif @echo "setup-envtest has already installed" diff --git a/cmd/training-operator.v2alpha1/main.go b/cmd/training-operator.v2alpha1/main.go index 891e3ddae1..ea3573dfc4 100644 --- a/cmd/training-operator.v2alpha1/main.go +++ b/cmd/training-operator.v2alpha1/main.go @@ -139,7 +139,7 @@ func main() { ctx := ctrl.SetupSignalHandler() setupProbeEndpoints(mgr, certsReady) - runtimes, err := runtimecore.New(ctx, mgr.GetClient(), mgr.GetFieldIndexer()) + runtimes, err := runtimecore.New(ctx, mgr.GetClient(), mgr.GetCache(), mgr.GetFieldIndexer()) if err != nil { setupLog.Error(err, "Could not initialize runtimes") os.Exit(1) diff --git a/go.mod b/go.mod index f2fc0a1a39..29992d57a9 100644 --- a/go.mod +++ b/go.mod @@ -5,21 +5,21 @@ go 1.22.0 require ( github.com/go-logr/logr v1.4.2 github.com/google/go-cmp v0.6.0 - github.com/onsi/ginkgo/v2 v2.19.0 - github.com/onsi/gomega v1.34.1 - github.com/open-policy-agent/cert-controller v0.11.0 - github.com/prometheus/client_golang v1.19.1 + github.com/onsi/ginkgo/v2 v2.20.1 + github.com/onsi/gomega v1.35.1 + github.com/open-policy-agent/cert-controller v0.12.0 + github.com/prometheus/client_golang v1.20.2 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - k8s.io/api v0.30.7 - k8s.io/apimachinery v0.30.7 - k8s.io/client-go v0.30.7 - k8s.io/code-generator v0.30.7 + k8s.io/api v0.31.3 + k8s.io/apimachinery v0.31.3 + k8s.io/client-go v0.31.3 + k8s.io/code-generator v0.31.3 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.18.5 + sigs.k8s.io/controller-runtime v0.19.1 sigs.k8s.io/jobset v0.5.2 sigs.k8s.io/kueue v0.6.3 sigs.k8s.io/scheduler-plugins v0.28.9 @@ -36,6 +36,7 @@ require ( github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect @@ -46,11 +47,12 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect + github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect @@ -58,27 +60,29 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.53.0 // indirect - github.com/prometheus/procfs v0.15.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/x448/float16 v0.8.4 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/mod v0.19.0 // indirect - golang.org/x/net v0.27.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/term v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.23.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.24.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect + google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.30.3 // indirect + k8s.io/apiextensions-apiserver v0.31.2 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect ) diff --git a/go.sum b/go.sum index 55e1e0e7d7..f4660bd844 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0 github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -40,8 +42,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= @@ -52,10 +54,14 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -65,29 +71,29 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= -github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/open-policy-agent/cert-controller v0.11.0 h1:zXaXeaS4eRAZXhUH5SxWqky681Y2KWjQv/z3X8iMcaQ= -github.com/open-policy-agent/cert-controller v0.11.0/go.mod h1:456gr2XKHzxDOjxJZUST5rLIX8olrHkBUymy49FZzps= -github.com/open-policy-agent/frameworks/constraint v0.0.0-20230822235116-f0b62fe1e4c4 h1:5dum5SLEz+95JDLkMls7Z7IDPjvSq3UhJSFe4f5einQ= -github.com/open-policy-agent/frameworks/constraint v0.0.0-20230822235116-f0b62fe1e4c4/go.mod h1:54/KzLMvA5ndBVpm7B1OjLeV0cUtTLTz2bZ2OtydLpU= +github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= +github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= +github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= +github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= +github.com/open-policy-agent/cert-controller v0.12.0 h1:RKXlBafMcCh+++I1geJetXo77tAjyb4542DQc/+aZIw= +github.com/open-policy-agent/cert-controller v0.12.0/go.mod h1:N5bCFXdAXMYx0PdS6ZQ9lrDQQMz+F6deoChym6VleXw= +github.com/open-policy-agent/frameworks/constraint v0.0.0-20241101234656-e78c8abd754a h1:gQtOJ50XFyL2Xh3lDD9zP4KQ2PY4mZKQ9hDcWc81Sp8= +github.com/open-policy-agent/frameworks/constraint v0.0.0-20241101234656-e78c8abd754a/go.mod h1:tI7nc6H6os2UYZRvSm9Y7bq4oMoXqhwA0WfnqKpoAgc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= +github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= -github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= -github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= -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/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -97,6 +103,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -114,52 +122,54 @@ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -168,28 +178,28 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.7 h1:wB2eHI+IptVYsz5WsAQpI6+Dqi3+11wEWBqIh4fh980= -k8s.io/api v0.30.7/go.mod h1:bR0EwbmhYmJvUoeza7ZzBUmYCrVXccQ9JOdfv0BxhH0= -k8s.io/apiextensions-apiserver v0.30.3 h1:oChu5li2vsZHx2IvnGP3ah8Nj3KyqG3kRSaKmijhB9U= -k8s.io/apiextensions-apiserver v0.30.3/go.mod h1:uhXxYDkMAvl6CJw4lrDN4CPbONkF3+XL9cacCT44kV4= -k8s.io/apimachinery v0.30.7 h1:CoQFxvzPFKwU1eJGN/8LgM3ZJBC3hKgvwGqRrL43uIY= -k8s.io/apimachinery v0.30.7/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.7 h1:DQRfuGWxDzxPEyyiTE/fxzAsZcj2p9sbc5671njR52w= -k8s.io/client-go v0.30.7/go.mod h1:oED9+njB91ExCc4BNPAotniB7WH1ig7CmiBx5pVA1yw= -k8s.io/code-generator v0.30.7 h1:Vw8991AoEjwW3qjkJhsTJosrlCN+6+VA3KR7wU28Sc0= -k8s.io/code-generator v0.30.7/go.mod h1:kMe4cE9rGqC9SoXwHqV7VaD4F8G7UL0BQF6NbRqxOdo= +k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= +k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= +k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= +k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI= +k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-aggregator v0.30.3 h1:hy5zfQ7p6BuJgc/XtGp3GBh2MPfOj6b1n3raKKMHOQE= -k8s.io/kube-aggregator v0.30.3/go.mod h1:2SP0IckvQoOwwZN8lmtWUnTZTgIpwOWvidWtxyqLwuk= +k8s.io/kube-aggregator v0.31.2 h1:Uw1zUP2D/4wiSjKWVVzSOcCGLuW/+IdRwjjC0FJooYU= +k8s.io/kube-aggregator v0.31.2/go.mod h1:41/VIXH+/Qcg9ERNAY6bRF/WQR6xL1wFgYagdHac1X4= k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM= k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f/go.mod h1:S9tOR0FxgyusSNR+MboCuiDpVWkAifZvaYI1Q2ubgro= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk= -sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= +sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/jobset v0.5.2 h1:276q5Pi/ErLYj+GQ0ydEXR6tx3LwBhEzHLQv+k8bYF4= sigs.k8s.io/jobset v0.5.2/go.mod h1:Vg99rj/6OoGvy1uvywGEHOcVLCWWJYkJtisKqdWzcFw= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/hack/python-sdk/swagger.json b/hack/python-sdk/swagger.json index fe5a678389..8b5e19494a 100644 --- a/hack/python-sdk/swagger.json +++ b/hack/python-sdk/swagger.json @@ -1190,6 +1190,35 @@ "description": "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", "type": "string" }, + "v1.FieldSelectorRequirement": { + "description": "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", + "type": "object", + "required": [ + "key", + "operator" + ], + "properties": { + "key": { + "description": "key is the field selector key that the requirement applies to.", + "type": "string", + "default": "" + }, + "operator": { + "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", + "type": "string", + "default": "" + }, + "values": { + "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "atomic" + } + } + }, "v1.FieldsV1": { "description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", "type": "object" diff --git a/hack/swagger/go.mod b/hack/swagger/go.mod index ff8a7ed6d5..ab5fb259dd 100644 --- a/hack/swagger/go.mod +++ b/hack/swagger/go.mod @@ -26,17 +26,17 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect + google.golang.org/protobuf v1.35.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/api v0.31.3 // indirect k8s.io/apimachinery v0.31.3 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect - sigs.k8s.io/controller-runtime v0.18.5 // indirect + sigs.k8s.io/controller-runtime v0.19.1 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/hack/swagger/go.sum b/hack/swagger/go.sum index fd800327f3..1342c66ed2 100644 --- a/hack/swagger/go.sum +++ b/hack/swagger/go.sum @@ -77,6 +77,7 @@ golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -88,11 +89,13 @@ golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -106,6 +109,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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= @@ -136,6 +140,7 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= 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.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/manifests/base/crds/kubeflow.org_jaxjobs.yaml b/manifests/base/crds/kubeflow.org_jaxjobs.yaml index ffca33b073..af56195604 100644 --- a/manifests/base/crds/kubeflow.org_jaxjobs.yaml +++ b/manifests/base/crds/kubeflow.org_jaxjobs.yaml @@ -1879,6 +1879,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -1991,7 +1997,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -3323,6 +3329,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3434,7 +3446,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -4806,6 +4818,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -4918,7 +4936,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5328,9 +5346,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes. type: string nodeSelector: additionalProperties: @@ -5436,7 +5456,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -5445,25 +5468,23 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes where to find the - ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. - type: string - type: object + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. + type: string required: - name type: object @@ -5642,15 +5663,24 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -5976,6 +6006,7 @@ spec: in the blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -5989,6 +6020,7 @@ spec: availability set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -6774,6 +6806,29 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -6806,6 +6861,7 @@ spec: Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -6957,11 +7013,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume - projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected - along with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -7341,6 +7399,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -7355,6 +7414,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -7385,6 +7445,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -7399,6 +7460,7 @@ spec: volume attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7441,6 +7503,7 @@ spec: false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/base/crds/kubeflow.org_mpijobs.yaml b/manifests/base/crds/kubeflow.org_mpijobs.yaml index b1f5ac7644..017a97b71f 100644 --- a/manifests/base/crds/kubeflow.org_mpijobs.yaml +++ b/manifests/base/crds/kubeflow.org_mpijobs.yaml @@ -1887,6 +1887,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -1999,7 +2005,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -3331,6 +3337,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3442,7 +3454,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -4814,6 +4826,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -4926,7 +4944,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5336,9 +5354,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes. type: string nodeSelector: additionalProperties: @@ -5444,7 +5464,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -5453,25 +5476,23 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes where to find the - ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. - type: string - type: object + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. + type: string required: - name type: object @@ -5650,15 +5671,24 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -5984,6 +6014,7 @@ spec: in the blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -5997,6 +6028,7 @@ spec: availability set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -6782,6 +6814,29 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -6814,6 +6869,7 @@ spec: Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -6965,11 +7021,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume - projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected - along with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -7349,6 +7407,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -7363,6 +7422,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -7393,6 +7453,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -7407,6 +7468,7 @@ spec: volume attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7449,6 +7511,7 @@ spec: false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/base/crds/kubeflow.org_paddlejobs.yaml b/manifests/base/crds/kubeflow.org_paddlejobs.yaml index ae6cc311b1..fbcf3f2037 100644 --- a/manifests/base/crds/kubeflow.org_paddlejobs.yaml +++ b/manifests/base/crds/kubeflow.org_paddlejobs.yaml @@ -2371,6 +2371,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -2483,7 +2489,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -3815,6 +3821,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3926,7 +3938,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5298,6 +5310,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -5410,7 +5428,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5820,9 +5838,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes. type: string nodeSelector: additionalProperties: @@ -5928,7 +5948,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -5937,25 +5960,23 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes where to find the - ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. - type: string - type: object + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. + type: string required: - name type: object @@ -6134,15 +6155,24 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -6468,6 +6498,7 @@ spec: in the blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -6481,6 +6512,7 @@ spec: availability set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -7266,6 +7298,29 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -7298,6 +7353,7 @@ spec: Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -7449,11 +7505,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume - projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected - along with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -7833,6 +7891,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -7847,6 +7906,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -7877,6 +7937,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -7891,6 +7952,7 @@ spec: volume attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7933,6 +7995,7 @@ spec: false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/base/crds/kubeflow.org_pytorchjobs.yaml b/manifests/base/crds/kubeflow.org_pytorchjobs.yaml index 89b226a3a4..1f8c8bc873 100644 --- a/manifests/base/crds/kubeflow.org_pytorchjobs.yaml +++ b/manifests/base/crds/kubeflow.org_pytorchjobs.yaml @@ -2408,6 +2408,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -2520,7 +2526,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -3852,6 +3858,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3963,7 +3975,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5335,6 +5347,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -5447,7 +5465,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5857,9 +5875,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes. type: string nodeSelector: additionalProperties: @@ -5965,7 +5985,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -5974,25 +5997,23 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes where to find the - ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. - type: string - type: object + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. + type: string required: - name type: object @@ -6171,15 +6192,24 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -6505,6 +6535,7 @@ spec: in the blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -6518,6 +6549,7 @@ spec: availability set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -7303,6 +7335,29 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -7335,6 +7390,7 @@ spec: Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -7486,11 +7542,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume - projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected - along with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -7870,6 +7928,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -7884,6 +7943,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -7914,6 +7974,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -7928,6 +7989,7 @@ spec: volume attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7970,6 +8032,7 @@ spec: false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/base/crds/kubeflow.org_tfjobs.yaml b/manifests/base/crds/kubeflow.org_tfjobs.yaml index b80def7a3d..a5e75eea9e 100644 --- a/manifests/base/crds/kubeflow.org_tfjobs.yaml +++ b/manifests/base/crds/kubeflow.org_tfjobs.yaml @@ -1964,6 +1964,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -2076,7 +2082,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -3408,6 +3414,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3519,7 +3531,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -4891,6 +4903,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -5003,7 +5021,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5413,9 +5431,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes. type: string nodeSelector: additionalProperties: @@ -5521,7 +5541,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -5530,25 +5553,23 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes where to find the - ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. - type: string - type: object + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. + type: string required: - name type: object @@ -5727,15 +5748,24 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -6061,6 +6091,7 @@ spec: in the blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -6074,6 +6105,7 @@ spec: availability set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -6859,6 +6891,29 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -6891,6 +6946,7 @@ spec: Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -7042,11 +7098,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume - projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected - along with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -7426,6 +7484,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -7440,6 +7499,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -7470,6 +7530,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -7484,6 +7545,7 @@ spec: volume attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7526,6 +7588,7 @@ spec: false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/base/crds/kubeflow.org_xgboostjobs.yaml b/manifests/base/crds/kubeflow.org_xgboostjobs.yaml index 50fdad02c0..accb08a4a2 100644 --- a/manifests/base/crds/kubeflow.org_xgboostjobs.yaml +++ b/manifests/base/crds/kubeflow.org_xgboostjobs.yaml @@ -1955,6 +1955,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -2067,7 +2073,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -3399,6 +3405,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3510,7 +3522,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -4882,6 +4894,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -4994,7 +5012,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -5404,9 +5422,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes. type: string nodeSelector: additionalProperties: @@ -5512,7 +5532,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -5521,25 +5544,23 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes where to find the - ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. - type: string - type: object + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. + + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. + type: string required: - name type: object @@ -5718,15 +5739,24 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -6052,6 +6082,7 @@ spec: in the blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -6065,6 +6096,7 @@ spec: availability set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -6850,6 +6882,29 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -6882,6 +6937,7 @@ spec: Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -7033,11 +7089,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume - projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected - along with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -7417,6 +7475,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -7431,6 +7490,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -7461,6 +7521,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -7475,6 +7536,7 @@ spec: volume attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7517,6 +7579,7 @@ spec: false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/v2/base/crds/kubeflow.org_clustertrainingruntimes.yaml b/manifests/v2/base/crds/kubeflow.org_clustertrainingruntimes.yaml index 372585fb92..4d281801c1 100644 --- a/manifests/v2/base/crds/kubeflow.org_clustertrainingruntimes.yaml +++ b/manifests/v2/base/crds/kubeflow.org_clustertrainingruntimes.yaml @@ -797,7 +797,8 @@ spec: The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first "/" must be a valid subdomain as defined by RFC 1123. All characters trailing the first "/" must be valid HTTP Path - characters as defined by RFC 3986. The value cannot exceed 64 characters. + characters as defined by RFC 3986. The value cannot exceed 63 characters. + This field is immutable. This field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default). @@ -847,9 +848,6 @@ spec: represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure. - - This field is beta-level. It can be used when the `JobPodFailurePolicy` - feature gate is enabled (enabled by default). properties: rules: description: |- @@ -1030,8 +1028,8 @@ spec: When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated. - This field is alpha-level. To use this field, you must enable the - `JobSuccessPolicy` feature gate (disabled by default). + This field is beta-level. To use this field, you must enable the + `JobSuccessPolicy` feature gate (enabled by default). properties: rules: description: |- @@ -1450,7 +1448,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1465,7 +1463,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1645,7 +1643,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1660,7 +1658,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1843,7 +1841,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1858,7 +1856,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -2038,7 +2036,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -2053,7 +2051,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -3120,6 +3118,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3245,7 +3249,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -4725,6 +4729,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -4838,7 +4848,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -6367,6 +6377,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -6492,7 +6508,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -6951,9 +6967,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename type: string nodeSelector: additionalProperties: @@ -6986,6 +7004,7 @@ spec: - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups + - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile @@ -7081,7 +7100,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -7090,31 +7112,32 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes - where to find the ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. The pod name and resource name, along with a - generated component, will be used to form a unique name for the - ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. - This field is immutable and no changes will be made to the - corresponding ResourceClaim by the control plane after creating the - ResourceClaim. - type: string - type: object + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. The pod name and resource name, along with a + generated component, will be used to form a unique name for the + ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + + This field is immutable and no changes will be made to the + corresponding ResourceClaim by the control plane after creating the + ResourceClaim. + + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string required: - name type: object @@ -7303,18 +7326,28 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. Note that group memberships - defined in the container image for the uid of the container process are still effective, - even if they are not included in this list. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. + If unspecified, no additional groups are added, though group memberships + defined in the container image may still be used, depending on the + supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -7709,6 +7742,7 @@ spec: blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7725,6 +7759,7 @@ spec: set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -8401,7 +8436,7 @@ spec: set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ - (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. + (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default). type: string volumeMode: description: |- @@ -8637,6 +8672,41 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + + The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. + A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. + The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. + The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. + The volume will be mounted read-only (ro) and non-executable files (noexec). + Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). + The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -8671,6 +8741,7 @@ spec: iSCSI Qualified Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -8828,13 +8899,13 @@ spec: format: int32 type: integer sources: - description: sources is the - list of volume projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection - that may be projected - along with other supported - volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -9300,6 +9371,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -9314,6 +9386,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -9344,6 +9417,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -9360,6 +9434,7 @@ spec: nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -9404,6 +9479,7 @@ spec: with Gateway, default false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/v2/base/crds/kubeflow.org_trainingruntimes.yaml b/manifests/v2/base/crds/kubeflow.org_trainingruntimes.yaml index b0494edcf5..0ae165315c 100644 --- a/manifests/v2/base/crds/kubeflow.org_trainingruntimes.yaml +++ b/manifests/v2/base/crds/kubeflow.org_trainingruntimes.yaml @@ -797,7 +797,8 @@ spec: The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first "/" must be a valid subdomain as defined by RFC 1123. All characters trailing the first "/" must be valid HTTP Path - characters as defined by RFC 3986. The value cannot exceed 64 characters. + characters as defined by RFC 3986. The value cannot exceed 63 characters. + This field is immutable. This field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default). @@ -847,9 +848,6 @@ spec: represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure. - - This field is beta-level. It can be used when the `JobPodFailurePolicy` - feature gate is enabled (enabled by default). properties: rules: description: |- @@ -1030,8 +1028,8 @@ spec: When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated. - This field is alpha-level. To use this field, you must enable the - `JobSuccessPolicy` feature gate (disabled by default). + This field is beta-level. To use this field, you must enable the + `JobSuccessPolicy` feature gate (enabled by default). properties: rules: description: |- @@ -1450,7 +1448,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1465,7 +1463,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1645,7 +1643,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1660,7 +1658,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1843,7 +1841,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -1858,7 +1856,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -2038,7 +2036,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -2053,7 +2051,7 @@ spec: pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. - This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate. + This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). items: type: string type: array @@ -3120,6 +3118,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -3245,7 +3249,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -4725,6 +4729,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -4838,7 +4848,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -6367,6 +6377,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object @@ -6492,7 +6508,7 @@ spec: procMount: description: |- procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for + The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. @@ -6951,9 +6967,11 @@ spec: x-kubernetes-list-type: map nodeName: description: |- - NodeName is a request to schedule this pod onto a specific node. If it is non-empty, - the scheduler simply schedules this pod onto that node, assuming that it fits resource - requirements. + NodeName indicates in which node this pod is scheduled. + If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. + Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. + This field should not be used to express a desire for the pod to be scheduled on a specific node. + https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename type: string nodeSelector: additionalProperties: @@ -6986,6 +7004,7 @@ spec: - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups + - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile @@ -7081,7 +7100,10 @@ spec: This field is immutable. items: description: |- - PodResourceClaim references exactly one ResourceClaim through a ClaimSource. + PodResourceClaim references exactly one ResourceClaim, either directly + or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim + for the pod. + It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. properties: @@ -7090,31 +7112,32 @@ spec: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. type: string - source: - description: Source describes - where to find the ResourceClaim. - properties: - resourceClaimName: - description: |- - ResourceClaimName is the name of a ResourceClaim object in the same - namespace as this pod. - type: string - resourceClaimTemplateName: - description: |- - ResourceClaimTemplateName is the name of a ResourceClaimTemplate - object in the same namespace as this pod. + resourceClaimName: + description: |- + ResourceClaimName is the name of a ResourceClaim object in the same + namespace as this pod. - The template will be used to create a new ResourceClaim, which will - be bound to this pod. When this pod is deleted, the ResourceClaim - will also be deleted. The pod name and resource name, along with a - generated component, will be used to form a unique name for the - ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string + resourceClaimTemplateName: + description: |- + ResourceClaimTemplateName is the name of a ResourceClaimTemplate + object in the same namespace as this pod. - This field is immutable and no changes will be made to the - corresponding ResourceClaim by the control plane after creating the - ResourceClaim. - type: string - type: object + The template will be used to create a new ResourceClaim, which will + be bound to this pod. When this pod is deleted, the ResourceClaim + will also be deleted. The pod name and resource name, along with a + generated component, will be used to form a unique name for the + ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + + This field is immutable and no changes will be made to the + corresponding ResourceClaim by the control plane after creating the + ResourceClaim. + + Exactly one of ResourceClaimName and ResourceClaimTemplateName must + be set. + type: string required: - name type: object @@ -7303,18 +7326,28 @@ spec: type: object supplementalGroups: description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. Note that group memberships - defined in the container image for the uid of the container process are still effective, - even if they are not included in this list. + A list of groups applied to the first process run in each container, in + addition to the container's primary GID and fsGroup (if specified). If + the SupplementalGroupsPolicy feature is enabled, the + supplementalGroupsPolicy field determines whether these are in addition + to or instead of any group memberships defined in the container image. + If unspecified, no additional groups are added, though group memberships + defined in the container image may still be used, depending on the + supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows. items: format: int64 type: integer type: array x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + description: |- + Defines how supplemental groups of the first container processes are calculated. + Valid values are "Merge" and "Strict". If not specified, "Merge" is used. + (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled + and the container runtime must implement support for this feature. + Note that this field cannot be set when spec.os.name is windows. + type: string sysctls: description: |- Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported @@ -7709,6 +7742,7 @@ spec: blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -7725,6 +7759,7 @@ spec: set). defaults to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -8401,7 +8436,7 @@ spec: set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ - (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. + (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default). type: string volumeMode: description: |- @@ -8637,6 +8672,41 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + + The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. + A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. + The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. + The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. + The volume will be mounted read-only (ro) and non-executable files (noexec). + Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). + The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -8671,6 +8741,7 @@ spec: iSCSI Qualified Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -8828,13 +8899,13 @@ spec: format: int32 type: integer sources: - description: sources is the - list of volume projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection - that may be projected - along with other supported - volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -9300,6 +9371,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -9314,6 +9386,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -9344,6 +9417,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -9360,6 +9434,7 @@ spec: nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -9404,6 +9479,7 @@ spec: with Gateway, default false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. diff --git a/manifests/v2/base/crds/kubeflow.org_trainjobs.yaml b/manifests/v2/base/crds/kubeflow.org_trainjobs.yaml index 371b7faa8f..037e04191d 100644 --- a/manifests/v2/base/crds/kubeflow.org_trainjobs.yaml +++ b/manifests/v2/base/crds/kubeflow.org_trainjobs.yaml @@ -1211,6 +1211,7 @@ spec: blob storage type: string fsType: + default: ext4 description: |- fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -1224,6 +1225,7 @@ spec: to shared' type: string readOnly: + default: false description: |- readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. @@ -1847,7 +1849,7 @@ spec: set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ - (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. + (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default). type: string volumeMode: description: |- @@ -2070,6 +2072,41 @@ spec: required: - path type: object + image: + description: |- + image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + The volume is resolved at pod startup depending on which PullPolicy value is provided: + + - Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + + The volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. + A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. + The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. + The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. + The volume will be mounted read-only (ro) and non-executable files (noexec). + Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). + The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. + properties: + pullPolicy: + description: |- + Policy for pulling OCI objects. Possible values are: + Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. + Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. + IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. + Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + type: string + reference: + description: |- + Required: Image or artifact reference to be used. + Behaves in the same way as pod.spec.containers[*].image. + Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. + More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config management to default or override + container images in workload controllers like Deployments and StatefulSets. + type: string + type: object iscsi: description: |- iscsi represents an ISCSI Disk resource that is attached to a @@ -2101,6 +2138,7 @@ spec: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: + default: default description: |- iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). @@ -2252,10 +2290,13 @@ spec: format: int32 type: integer sources: - description: sources is the list of volume projections + description: |- + sources is the list of volume projections. Each entry in this list + handles one source. items: - description: Projection that may be projected along - with other supported volume types + description: |- + Projection that may be projected along with other supported volume types. + Exactly one of these fields must be set. properties: clusterTrustBundle: description: |- @@ -2640,6 +2681,7 @@ spec: More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it type: string keyring: + default: /etc/ceph/keyring description: |- keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. @@ -2654,6 +2696,7 @@ spec: type: array x-kubernetes-list-type: atomic pool: + default: rbd description: |- pool is the rados pool name. Default is rbd. @@ -2684,6 +2727,7 @@ spec: type: object x-kubernetes-map-type: atomic user: + default: admin description: |- user is the rados user name. Default is admin. @@ -2698,6 +2742,7 @@ spec: attached and mounted on Kubernetes nodes. properties: fsType: + default: xfs description: |- fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. @@ -2738,6 +2783,7 @@ spec: with Gateway, default false type: boolean storageMode: + default: ThinProvisioned description: |- storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. @@ -3118,6 +3164,12 @@ spec: the Pod where this field is used. It makes that resource available inside a container. type: string + request: + description: |- + Request is the name chosen for a request in the referenced claim. + If empty, everything from the claim is made available, otherwise + only the result of this request. + type: string required: - name type: object diff --git a/pkg/apis/kubeflow.org/v1/zz_generated.openapi.go b/pkg/apis/kubeflow.org/v1/zz_generated.openapi.go index 0d5a7c12bd..57538e7810 100644 --- a/pkg/apis/kubeflow.org/v1/zz_generated.openapi.go +++ b/pkg/apis/kubeflow.org/v1/zz_generated.openapi.go @@ -64,6 +64,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), @@ -2118,6 +2119,56 @@ func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenA } } +func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the field selector key that the requirement applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, + }, + }, + } +} + func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/apis/kubeflow.org/v2alpha1/zz_generated.defaults.go b/pkg/apis/kubeflow.org/v2alpha1/zz_generated.defaults.go index 65956270c2..53a8037ea9 100644 --- a/pkg/apis/kubeflow.org/v2alpha1/zz_generated.defaults.go +++ b/pkg/apis/kubeflow.org/v2alpha1/zz_generated.defaults.go @@ -20,6 +20,7 @@ package v2alpha1 import ( + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -29,6 +30,8 @@ import ( func RegisterDefaults(scheme *runtime.Scheme) error { scheme.AddTypeDefaultingFunc(&ClusterTrainingRuntime{}, func(obj interface{}) { SetObjectDefaults_ClusterTrainingRuntime(obj.(*ClusterTrainingRuntime)) }) scheme.AddTypeDefaultingFunc(&ClusterTrainingRuntimeList{}, func(obj interface{}) { SetObjectDefaults_ClusterTrainingRuntimeList(obj.(*ClusterTrainingRuntimeList)) }) + scheme.AddTypeDefaultingFunc(&TrainJob{}, func(obj interface{}) { SetObjectDefaults_TrainJob(obj.(*TrainJob)) }) + scheme.AddTypeDefaultingFunc(&TrainJobList{}, func(obj interface{}) { SetObjectDefaults_TrainJobList(obj.(*TrainJobList)) }) scheme.AddTypeDefaultingFunc(&TrainingRuntime{}, func(obj interface{}) { SetObjectDefaults_TrainingRuntime(obj.(*TrainingRuntime)) }) scheme.AddTypeDefaultingFunc(&TrainingRuntimeList{}, func(obj interface{}) { SetObjectDefaults_TrainingRuntimeList(obj.(*TrainingRuntimeList)) }) return nil @@ -37,6 +40,51 @@ func RegisterDefaults(scheme *runtime.Scheme) error { func SetObjectDefaults_ClusterTrainingRuntime(in *ClusterTrainingRuntime) { for i := range in.Spec.Template.Spec.ReplicatedJobs { a := &in.Spec.Template.Spec.ReplicatedJobs[i] + for j := range a.Template.Spec.Template.Spec.Volumes { + b := &a.Template.Spec.Template.Spec.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } for j := range a.Template.Spec.Template.Spec.InitContainers { b := &a.Template.Spec.Template.Spec.InitContainers[j] for k := range b.Ports { @@ -146,9 +194,112 @@ func SetObjectDefaults_ClusterTrainingRuntimeList(in *ClusterTrainingRuntimeList } } +func SetObjectDefaults_TrainJob(in *TrainJob) { + for i := range in.Spec.PodSpecOverrides { + a := &in.Spec.PodSpecOverrides[i] + for j := range a.Volumes { + b := &a.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + } +} + +func SetObjectDefaults_TrainJobList(in *TrainJobList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_TrainJob(a) + } +} + func SetObjectDefaults_TrainingRuntime(in *TrainingRuntime) { for i := range in.Spec.Template.Spec.ReplicatedJobs { a := &in.Spec.Template.Spec.ReplicatedJobs[i] + for j := range a.Template.Spec.Template.Spec.Volumes { + b := &a.Template.Spec.Template.Spec.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } for j := range a.Template.Spec.Template.Spec.InitContainers { b := &a.Template.Spec.Template.Spec.InitContainers[j] for k := range b.Ports { diff --git a/pkg/apis/kubeflow.org/v2alpha1/zz_generated.openapi.go b/pkg/apis/kubeflow.org/v2alpha1/zz_generated.openapi.go index a3c9b9c783..b304919e08 100644 --- a/pkg/apis/kubeflow.org/v2alpha1/zz_generated.openapi.go +++ b/pkg/apis/kubeflow.org/v2alpha1/zz_generated.openapi.go @@ -65,6 +65,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), @@ -2200,6 +2201,56 @@ func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenA } } +func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the field selector key that the requirement applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, + }, + }, + } +} + func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/elasticpolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v1/elasticpolicy.go index 0c7627cf3b..d47cc0282c 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/elasticpolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/elasticpolicy.go @@ -21,7 +21,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// ElasticPolicyApplyConfiguration represents an declarative configuration of the ElasticPolicy type for use +// ElasticPolicyApplyConfiguration represents a declarative configuration of the ElasticPolicy type for use // with apply. type ElasticPolicyApplyConfiguration struct { MinReplicas *int32 `json:"minReplicas,omitempty"` @@ -37,7 +37,7 @@ type ElasticPolicyApplyConfiguration struct { Metrics []v2.MetricSpec `json:"metrics,omitempty"` } -// ElasticPolicyApplyConfiguration constructs an declarative configuration of the ElasticPolicy type for use with +// ElasticPolicyApplyConfiguration constructs a declarative configuration of the ElasticPolicy type for use with // apply. func ElasticPolicy() *ElasticPolicyApplyConfiguration { return &ElasticPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjob.go b/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjob.go index b5c6963fae..ac20c9403a 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// JAXJobApplyConfiguration represents an declarative configuration of the JAXJob type for use +// JAXJobApplyConfiguration represents a declarative configuration of the JAXJob type for use // with apply. type JAXJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type JAXJobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// JAXJob constructs an declarative configuration of the JAXJob type for use with +// JAXJob constructs a declarative configuration of the JAXJob type for use with // apply. func JAXJob(name, namespace string) *JAXJobApplyConfiguration { b := &JAXJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *JAXJobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *JAXJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjobspec.go index e61fa91b77..7bd90de693 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/jaxjobspec.go @@ -20,14 +20,14 @@ import ( kubefloworgv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// JAXJobSpecApplyConfiguration represents an declarative configuration of the JAXJobSpec type for use +// JAXJobSpecApplyConfiguration represents a declarative configuration of the JAXJobSpec type for use // with apply. type JAXJobSpecApplyConfiguration struct { RunPolicy *RunPolicyApplyConfiguration `json:"runPolicy,omitempty"` JAXReplicaSpecs map[kubefloworgv1.ReplicaType]*kubefloworgv1.ReplicaSpec `json:"jaxReplicaSpecs,omitempty"` } -// JAXJobSpecApplyConfiguration constructs an declarative configuration of the JAXJobSpec type for use with +// JAXJobSpecApplyConfiguration constructs a declarative configuration of the JAXJobSpec type for use with // apply. func JAXJobSpec() *JAXJobSpecApplyConfiguration { return &JAXJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/jobcondition.go b/pkg/client/applyconfiguration/kubeflow.org/v1/jobcondition.go index f3b6a15328..707ff7dd2f 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/jobcondition.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/jobcondition.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// JobConditionApplyConfiguration represents an declarative configuration of the JobCondition type for use +// JobConditionApplyConfiguration represents a declarative configuration of the JobCondition type for use // with apply. type JobConditionApplyConfiguration struct { Type *v1.JobConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type JobConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// JobConditionApplyConfiguration constructs an declarative configuration of the JobCondition type for use with +// JobConditionApplyConfiguration constructs a declarative configuration of the JobCondition type for use with // apply. func JobCondition() *JobConditionApplyConfiguration { return &JobConditionApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/jobstatus.go b/pkg/client/applyconfiguration/kubeflow.org/v1/jobstatus.go index 3dfbcfb4b4..01346b6919 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/jobstatus.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/jobstatus.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use +// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use // with apply. type JobStatusApplyConfiguration struct { Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"` @@ -31,7 +31,7 @@ type JobStatusApplyConfiguration struct { LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"` } -// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with +// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with // apply. func JobStatus() *JobStatusApplyConfiguration { return &JobStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/mpijob.go b/pkg/client/applyconfiguration/kubeflow.org/v1/mpijob.go index 4cd16250fc..354c5e9fed 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/mpijob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/mpijob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MPIJobApplyConfiguration represents an declarative configuration of the MPIJob type for use +// MPIJobApplyConfiguration represents a declarative configuration of the MPIJob type for use // with apply. type MPIJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type MPIJobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// MPIJob constructs an declarative configuration of the MPIJob type for use with +// MPIJob constructs a declarative configuration of the MPIJob type for use with // apply. func MPIJob(name, namespace string) *MPIJobApplyConfiguration { b := &MPIJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *MPIJobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MPIJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/mpijobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/mpijobspec.go index 10e0053564..3fe53440b4 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/mpijobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/mpijobspec.go @@ -20,7 +20,7 @@ import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// MPIJobSpecApplyConfiguration represents an declarative configuration of the MPIJobSpec type for use +// MPIJobSpecApplyConfiguration represents a declarative configuration of the MPIJobSpec type for use // with apply. type MPIJobSpecApplyConfiguration struct { SlotsPerWorker *int32 `json:"slotsPerWorker,omitempty"` @@ -30,7 +30,7 @@ type MPIJobSpecApplyConfiguration struct { RunPolicy *RunPolicyApplyConfiguration `json:"runPolicy,omitempty"` } -// MPIJobSpecApplyConfiguration constructs an declarative configuration of the MPIJobSpec type for use with +// MPIJobSpecApplyConfiguration constructs a declarative configuration of the MPIJobSpec type for use with // apply. func MPIJobSpec() *MPIJobSpecApplyConfiguration { return &MPIJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/paddleelasticpolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v1/paddleelasticpolicy.go index 1bb523734b..53e9165c1c 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/paddleelasticpolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/paddleelasticpolicy.go @@ -20,7 +20,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// PaddleElasticPolicyApplyConfiguration represents an declarative configuration of the PaddleElasticPolicy type for use +// PaddleElasticPolicyApplyConfiguration represents a declarative configuration of the PaddleElasticPolicy type for use // with apply. type PaddleElasticPolicyApplyConfiguration struct { MinReplicas *int32 `json:"minReplicas,omitempty"` @@ -29,7 +29,7 @@ type PaddleElasticPolicyApplyConfiguration struct { Metrics []v2.MetricSpec `json:"metrics,omitempty"` } -// PaddleElasticPolicyApplyConfiguration constructs an declarative configuration of the PaddleElasticPolicy type for use with +// PaddleElasticPolicyApplyConfiguration constructs a declarative configuration of the PaddleElasticPolicy type for use with // apply. func PaddleElasticPolicy() *PaddleElasticPolicyApplyConfiguration { return &PaddleElasticPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejob.go b/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejob.go index d19ed1dfcd..51c65cb681 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PaddleJobApplyConfiguration represents an declarative configuration of the PaddleJob type for use +// PaddleJobApplyConfiguration represents a declarative configuration of the PaddleJob type for use // with apply. type PaddleJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type PaddleJobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// PaddleJob constructs an declarative configuration of the PaddleJob type for use with +// PaddleJob constructs a declarative configuration of the PaddleJob type for use with // apply. func PaddleJob(name, namespace string) *PaddleJobApplyConfiguration { b := &PaddleJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *PaddleJobApplyConfiguration) WithStatus(value *JobStatusApplyConfigurat b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PaddleJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejobspec.go index d00496c069..a8f57fe346 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/paddlejobspec.go @@ -20,7 +20,7 @@ import ( kubefloworgv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// PaddleJobSpecApplyConfiguration represents an declarative configuration of the PaddleJobSpec type for use +// PaddleJobSpecApplyConfiguration represents a declarative configuration of the PaddleJobSpec type for use // with apply. type PaddleJobSpecApplyConfiguration struct { RunPolicy *RunPolicyApplyConfiguration `json:"runPolicy,omitempty"` @@ -28,7 +28,7 @@ type PaddleJobSpecApplyConfiguration struct { PaddleReplicaSpecs map[kubefloworgv1.ReplicaType]*kubefloworgv1.ReplicaSpec `json:"paddleReplicaSpecs,omitempty"` } -// PaddleJobSpecApplyConfiguration constructs an declarative configuration of the PaddleJobSpec type for use with +// PaddleJobSpecApplyConfiguration constructs a declarative configuration of the PaddleJobSpec type for use with // apply. func PaddleJobSpec() *PaddleJobSpecApplyConfiguration { return &PaddleJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjob.go b/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjob.go index 9c9ed84150..6fb1336a49 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PyTorchJobApplyConfiguration represents an declarative configuration of the PyTorchJob type for use +// PyTorchJobApplyConfiguration represents a declarative configuration of the PyTorchJob type for use // with apply. type PyTorchJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type PyTorchJobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// PyTorchJob constructs an declarative configuration of the PyTorchJob type for use with +// PyTorchJob constructs a declarative configuration of the PyTorchJob type for use with // apply. func PyTorchJob(name, namespace string) *PyTorchJobApplyConfiguration { b := &PyTorchJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *PyTorchJobApplyConfiguration) WithStatus(value *JobStatusApplyConfigura b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PyTorchJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjobspec.go index f5a921701d..1a9ae0ceff 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/pytorchjobspec.go @@ -20,7 +20,7 @@ import ( kubefloworgv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// PyTorchJobSpecApplyConfiguration represents an declarative configuration of the PyTorchJobSpec type for use +// PyTorchJobSpecApplyConfiguration represents a declarative configuration of the PyTorchJobSpec type for use // with apply. type PyTorchJobSpecApplyConfiguration struct { RunPolicy *RunPolicyApplyConfiguration `json:"runPolicy,omitempty"` @@ -29,7 +29,7 @@ type PyTorchJobSpecApplyConfiguration struct { NprocPerNode *string `json:"nprocPerNode,omitempty"` } -// PyTorchJobSpecApplyConfiguration constructs an declarative configuration of the PyTorchJobSpec type for use with +// PyTorchJobSpecApplyConfiguration constructs a declarative configuration of the PyTorchJobSpec type for use with // apply. func PyTorchJobSpec() *PyTorchJobSpecApplyConfiguration { return &PyTorchJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/rdzvconf.go b/pkg/client/applyconfiguration/kubeflow.org/v1/rdzvconf.go index dbf35fb938..397a82477e 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/rdzvconf.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/rdzvconf.go @@ -16,14 +16,14 @@ package v1 -// RDZVConfApplyConfiguration represents an declarative configuration of the RDZVConf type for use +// RDZVConfApplyConfiguration represents a declarative configuration of the RDZVConf type for use // with apply. type RDZVConfApplyConfiguration struct { Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` } -// RDZVConfApplyConfiguration constructs an declarative configuration of the RDZVConf type for use with +// RDZVConfApplyConfiguration constructs a declarative configuration of the RDZVConf type for use with // apply. func RDZVConf() *RDZVConfApplyConfiguration { return &RDZVConfApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/replicaspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/replicaspec.go index 27a54c4510..49fa1ff32e 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/replicaspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/replicaspec.go @@ -21,7 +21,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ReplicaSpecApplyConfiguration represents an declarative configuration of the ReplicaSpec type for use +// ReplicaSpecApplyConfiguration represents a declarative configuration of the ReplicaSpec type for use // with apply. type ReplicaSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -29,7 +29,7 @@ type ReplicaSpecApplyConfiguration struct { RestartPolicy *kubefloworgv1.RestartPolicy `json:"restartPolicy,omitempty"` } -// ReplicaSpecApplyConfiguration constructs an declarative configuration of the ReplicaSpec type for use with +// ReplicaSpecApplyConfiguration constructs a declarative configuration of the ReplicaSpec type for use with // apply. func ReplicaSpec() *ReplicaSpecApplyConfiguration { return &ReplicaSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/replicastatus.go b/pkg/client/applyconfiguration/kubeflow.org/v1/replicastatus.go index a903e558dd..1d34e4bd0a 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/replicastatus.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/replicastatus.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaStatusApplyConfiguration represents an declarative configuration of the ReplicaStatus type for use +// ReplicaStatusApplyConfiguration represents a declarative configuration of the ReplicaStatus type for use // with apply. type ReplicaStatusApplyConfiguration struct { Active *int32 `json:"active,omitempty"` @@ -30,7 +30,7 @@ type ReplicaStatusApplyConfiguration struct { Selector *string `json:"selector,omitempty"` } -// ReplicaStatusApplyConfiguration constructs an declarative configuration of the ReplicaStatus type for use with +// ReplicaStatusApplyConfiguration constructs a declarative configuration of the ReplicaStatus type for use with // apply. func ReplicaStatus() *ReplicaStatusApplyConfiguration { return &ReplicaStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/runpolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v1/runpolicy.go index df3f53b36e..76f5299c36 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/runpolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/runpolicy.go @@ -20,7 +20,7 @@ import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// RunPolicyApplyConfiguration represents an declarative configuration of the RunPolicy type for use +// RunPolicyApplyConfiguration represents a declarative configuration of the RunPolicy type for use // with apply. type RunPolicyApplyConfiguration struct { CleanPodPolicy *v1.CleanPodPolicy `json:"cleanPodPolicy,omitempty"` @@ -32,7 +32,7 @@ type RunPolicyApplyConfiguration struct { ManagedBy *string `json:"managedBy,omitempty"` } -// RunPolicyApplyConfiguration constructs an declarative configuration of the RunPolicy type for use with +// RunPolicyApplyConfiguration constructs a declarative configuration of the RunPolicy type for use with // apply. func RunPolicy() *RunPolicyApplyConfiguration { return &RunPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/schedulingpolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v1/schedulingpolicy.go index cd2c5c59eb..c66cc436f0 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/schedulingpolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/schedulingpolicy.go @@ -21,7 +21,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// SchedulingPolicyApplyConfiguration represents an declarative configuration of the SchedulingPolicy type for use +// SchedulingPolicyApplyConfiguration represents a declarative configuration of the SchedulingPolicy type for use // with apply. type SchedulingPolicyApplyConfiguration struct { MinAvailable *int32 `json:"minAvailable,omitempty"` @@ -31,7 +31,7 @@ type SchedulingPolicyApplyConfiguration struct { ScheduleTimeoutSeconds *int32 `json:"scheduleTimeoutSeconds,omitempty"` } -// SchedulingPolicyApplyConfiguration constructs an declarative configuration of the SchedulingPolicy type for use with +// SchedulingPolicyApplyConfiguration constructs a declarative configuration of the SchedulingPolicy type for use with // apply. func SchedulingPolicy() *SchedulingPolicyApplyConfiguration { return &SchedulingPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/tfjob.go b/pkg/client/applyconfiguration/kubeflow.org/v1/tfjob.go index 56b41f000c..61e08dd5f5 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/tfjob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/tfjob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// TFJobApplyConfiguration represents an declarative configuration of the TFJob type for use +// TFJobApplyConfiguration represents a declarative configuration of the TFJob type for use // with apply. type TFJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type TFJobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// TFJob constructs an declarative configuration of the TFJob type for use with +// TFJob constructs a declarative configuration of the TFJob type for use with // apply. func TFJob(name, namespace string) *TFJobApplyConfiguration { b := &TFJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *TFJobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration) b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *TFJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/tfjobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/tfjobspec.go index a40305011c..defbd9c7fc 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/tfjobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/tfjobspec.go @@ -20,7 +20,7 @@ import ( kubefloworgv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// TFJobSpecApplyConfiguration represents an declarative configuration of the TFJobSpec type for use +// TFJobSpecApplyConfiguration represents a declarative configuration of the TFJobSpec type for use // with apply. type TFJobSpecApplyConfiguration struct { RunPolicy *RunPolicyApplyConfiguration `json:"runPolicy,omitempty"` @@ -29,7 +29,7 @@ type TFJobSpecApplyConfiguration struct { EnableDynamicWorker *bool `json:"enableDynamicWorker,omitempty"` } -// TFJobSpecApplyConfiguration constructs an declarative configuration of the TFJobSpec type for use with +// TFJobSpecApplyConfiguration constructs a declarative configuration of the TFJobSpec type for use with // apply. func TFJobSpec() *TFJobSpecApplyConfiguration { return &TFJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjob.go b/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjob.go index 9aeacb0089..7c27f76105 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// XGBoostJobApplyConfiguration represents an declarative configuration of the XGBoostJob type for use +// XGBoostJobApplyConfiguration represents a declarative configuration of the XGBoostJob type for use // with apply. type XGBoostJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type XGBoostJobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// XGBoostJob constructs an declarative configuration of the XGBoostJob type for use with +// XGBoostJob constructs a declarative configuration of the XGBoostJob type for use with // apply. func XGBoostJob(name, namespace string) *XGBoostJobApplyConfiguration { b := &XGBoostJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *XGBoostJobApplyConfiguration) WithStatus(value *JobStatusApplyConfigura b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *XGBoostJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjobspec.go index 63451f570f..77f81c4da7 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v1/xgboostjobspec.go @@ -20,14 +20,14 @@ import ( kubefloworgv1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" ) -// XGBoostJobSpecApplyConfiguration represents an declarative configuration of the XGBoostJobSpec type for use +// XGBoostJobSpecApplyConfiguration represents a declarative configuration of the XGBoostJobSpec type for use // with apply. type XGBoostJobSpecApplyConfiguration struct { RunPolicy *RunPolicyApplyConfiguration `json:"runPolicy,omitempty"` XGBReplicaSpecs map[kubefloworgv1.ReplicaType]*kubefloworgv1.ReplicaSpec `json:"xgbReplicaSpecs,omitempty"` } -// XGBoostJobSpecApplyConfiguration constructs an declarative configuration of the XGBoostJobSpec type for use with +// XGBoostJobSpecApplyConfiguration constructs a declarative configuration of the XGBoostJobSpec type for use with // apply. func XGBoostJobSpec() *XGBoostJobSpecApplyConfiguration { return &XGBoostJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/clustertrainingruntime.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/clustertrainingruntime.go index cb0b8f6d3b..975aff515f 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/clustertrainingruntime.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/clustertrainingruntime.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterTrainingRuntimeApplyConfiguration represents an declarative configuration of the ClusterTrainingRuntime type for use +// ClusterTrainingRuntimeApplyConfiguration represents a declarative configuration of the ClusterTrainingRuntime type for use // with apply. type ClusterTrainingRuntimeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -30,7 +30,7 @@ type ClusterTrainingRuntimeApplyConfiguration struct { Spec *TrainingRuntimeSpecApplyConfiguration `json:"spec,omitempty"` } -// ClusterTrainingRuntime constructs an declarative configuration of the ClusterTrainingRuntime type for use with +// ClusterTrainingRuntime constructs a declarative configuration of the ClusterTrainingRuntime type for use with // apply. func ClusterTrainingRuntime(name string) *ClusterTrainingRuntimeApplyConfiguration { b := &ClusterTrainingRuntimeApplyConfiguration{} @@ -205,3 +205,9 @@ func (b *ClusterTrainingRuntimeApplyConfiguration) WithSpec(value *TrainingRunti b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterTrainingRuntimeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/containeroverride.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/containeroverride.go index 569a4418d4..6df7b9e27b 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/containeroverride.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/containeroverride.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerOverrideApplyConfiguration represents an declarative configuration of the ContainerOverride type for use +// ContainerOverrideApplyConfiguration represents a declarative configuration of the ContainerOverride type for use // with apply. type ContainerOverrideApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type ContainerOverrideApplyConfiguration struct { VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` } -// ContainerOverrideApplyConfiguration constructs an declarative configuration of the ContainerOverride type for use with +// ContainerOverrideApplyConfiguration constructs a declarative configuration of the ContainerOverride type for use with // apply. func ContainerOverride() *ContainerOverrideApplyConfiguration { return &ContainerOverrideApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/coschedulingpodgrouppolicysource.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/coschedulingpodgrouppolicysource.go index 6ed03dcc80..78cda683bb 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/coschedulingpodgrouppolicysource.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/coschedulingpodgrouppolicysource.go @@ -16,13 +16,13 @@ package v2alpha1 -// CoschedulingPodGroupPolicySourceApplyConfiguration represents an declarative configuration of the CoschedulingPodGroupPolicySource type for use +// CoschedulingPodGroupPolicySourceApplyConfiguration represents a declarative configuration of the CoschedulingPodGroupPolicySource type for use // with apply. type CoschedulingPodGroupPolicySourceApplyConfiguration struct { ScheduleTimeoutSeconds *int32 `json:"scheduleTimeoutSeconds,omitempty"` } -// CoschedulingPodGroupPolicySourceApplyConfiguration constructs an declarative configuration of the CoschedulingPodGroupPolicySource type for use with +// CoschedulingPodGroupPolicySourceApplyConfiguration constructs a declarative configuration of the CoschedulingPodGroupPolicySource type for use with // apply. func CoschedulingPodGroupPolicySource() *CoschedulingPodGroupPolicySourceApplyConfiguration { return &CoschedulingPodGroupPolicySourceApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/datasetconfig.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/datasetconfig.go index 42392014e8..1b5aa9d4a3 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/datasetconfig.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/datasetconfig.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// DatasetConfigApplyConfiguration represents an declarative configuration of the DatasetConfig type for use +// DatasetConfigApplyConfiguration represents a declarative configuration of the DatasetConfig type for use // with apply. type DatasetConfigApplyConfiguration struct { StorageUri *string `json:"storageUri,omitempty"` @@ -28,7 +28,7 @@ type DatasetConfigApplyConfiguration struct { SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` } -// DatasetConfigApplyConfiguration constructs an declarative configuration of the DatasetConfig type for use with +// DatasetConfigApplyConfiguration constructs a declarative configuration of the DatasetConfig type for use with // apply. func DatasetConfig() *DatasetConfigApplyConfiguration { return &DatasetConfigApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/inputmodel.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/inputmodel.go index 4994c1a7da..2f2989356c 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/inputmodel.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/inputmodel.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// InputModelApplyConfiguration represents an declarative configuration of the InputModel type for use +// InputModelApplyConfiguration represents a declarative configuration of the InputModel type for use // with apply. type InputModelApplyConfiguration struct { StorageUri *string `json:"storageUri,omitempty"` @@ -28,7 +28,7 @@ type InputModelApplyConfiguration struct { SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` } -// InputModelApplyConfiguration constructs an declarative configuration of the InputModel type for use with +// InputModelApplyConfiguration constructs a declarative configuration of the InputModel type for use with // apply. func InputModel() *InputModelApplyConfiguration { return &InputModelApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobsettemplatespec.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobsettemplatespec.go index 95ab3f565c..fab6222d52 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobsettemplatespec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobsettemplatespec.go @@ -23,14 +23,14 @@ import ( v1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2" ) -// JobSetTemplateSpecApplyConfiguration represents an declarative configuration of the JobSetTemplateSpec type for use +// JobSetTemplateSpecApplyConfiguration represents a declarative configuration of the JobSetTemplateSpec type for use // with apply. type JobSetTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *v1alpha2.JobSetSpec `json:"spec,omitempty"` } -// JobSetTemplateSpecApplyConfiguration constructs an declarative configuration of the JobSetTemplateSpec type for use with +// JobSetTemplateSpecApplyConfiguration constructs a declarative configuration of the JobSetTemplateSpec type for use with // apply. func JobSetTemplateSpec() *JobSetTemplateSpecApplyConfiguration { return &JobSetTemplateSpecApplyConfiguration{} @@ -185,3 +185,9 @@ func (b *JobSetTemplateSpecApplyConfiguration) WithSpec(value v1alpha2.JobSetSpe b.Spec = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *JobSetTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobstatus.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobstatus.go index 301e3577d4..3d9315ee1b 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobstatus.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/jobstatus.go @@ -16,7 +16,7 @@ package v2alpha1 -// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use +// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use // with apply. type JobStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -27,7 +27,7 @@ type JobStatusApplyConfiguration struct { Suspended *int32 `json:"suspended,omitempty"` } -// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with +// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with // apply. func JobStatus() *JobStatusApplyConfiguration { return &JobStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicy.go index 77a372b881..217646fe88 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicy.go @@ -16,14 +16,14 @@ package v2alpha1 -// MLPolicyApplyConfiguration represents an declarative configuration of the MLPolicy type for use +// MLPolicyApplyConfiguration represents a declarative configuration of the MLPolicy type for use // with apply. type MLPolicyApplyConfiguration struct { NumNodes *int32 `json:"numNodes,omitempty"` MLPolicySourceApplyConfiguration `json:",inline"` } -// MLPolicyApplyConfiguration constructs an declarative configuration of the MLPolicy type for use with +// MLPolicyApplyConfiguration constructs a declarative configuration of the MLPolicy type for use with // apply. func MLPolicy() *MLPolicyApplyConfiguration { return &MLPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicysource.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicysource.go index 429395e576..92d96e8a0a 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicysource.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mlpolicysource.go @@ -16,14 +16,14 @@ package v2alpha1 -// MLPolicySourceApplyConfiguration represents an declarative configuration of the MLPolicySource type for use +// MLPolicySourceApplyConfiguration represents a declarative configuration of the MLPolicySource type for use // with apply. type MLPolicySourceApplyConfiguration struct { Torch *TorchMLPolicySourceApplyConfiguration `json:"torch,omitempty"` MPI *MPIMLPolicySourceApplyConfiguration `json:"mpi,omitempty"` } -// MLPolicySourceApplyConfiguration constructs an declarative configuration of the MLPolicySource type for use with +// MLPolicySourceApplyConfiguration constructs a declarative configuration of the MLPolicySource type for use with // apply. func MLPolicySource() *MLPolicySourceApplyConfiguration { return &MLPolicySourceApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/modelconfig.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/modelconfig.go index e178a55311..d47ef36d7d 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/modelconfig.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/modelconfig.go @@ -16,14 +16,14 @@ package v2alpha1 -// ModelConfigApplyConfiguration represents an declarative configuration of the ModelConfig type for use +// ModelConfigApplyConfiguration represents a declarative configuration of the ModelConfig type for use // with apply. type ModelConfigApplyConfiguration struct { Input *InputModelApplyConfiguration `json:"input,omitempty"` Output *OutputModelApplyConfiguration `json:"output,omitempty"` } -// ModelConfigApplyConfiguration constructs an declarative configuration of the ModelConfig type for use with +// ModelConfigApplyConfiguration constructs a declarative configuration of the ModelConfig type for use with // apply. func ModelConfig() *ModelConfigApplyConfiguration { return &ModelConfigApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mpimlpolicysource.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mpimlpolicysource.go index a90f828971..d80f265253 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mpimlpolicysource.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/mpimlpolicysource.go @@ -20,7 +20,7 @@ import ( v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" ) -// MPIMLPolicySourceApplyConfiguration represents an declarative configuration of the MPIMLPolicySource type for use +// MPIMLPolicySourceApplyConfiguration represents a declarative configuration of the MPIMLPolicySource type for use // with apply. type MPIMLPolicySourceApplyConfiguration struct { NumProcPerNode *int32 `json:"numProcPerNode,omitempty"` @@ -29,7 +29,7 @@ type MPIMLPolicySourceApplyConfiguration struct { RunLauncherAsNode *bool `json:"runLauncherAsNode,omitempty"` } -// MPIMLPolicySourceApplyConfiguration constructs an declarative configuration of the MPIMLPolicySource type for use with +// MPIMLPolicySourceApplyConfiguration constructs a declarative configuration of the MPIMLPolicySource type for use with // apply. func MPIMLPolicySource() *MPIMLPolicySourceApplyConfiguration { return &MPIMLPolicySourceApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/outputmodel.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/outputmodel.go index 2942302b79..4f00d0e18e 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/outputmodel.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/outputmodel.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// OutputModelApplyConfiguration represents an declarative configuration of the OutputModel type for use +// OutputModelApplyConfiguration represents a declarative configuration of the OutputModel type for use // with apply. type OutputModelApplyConfiguration struct { StorageUri *string `json:"storageUri,omitempty"` @@ -28,7 +28,7 @@ type OutputModelApplyConfiguration struct { SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` } -// OutputModelApplyConfiguration constructs an declarative configuration of the OutputModel type for use with +// OutputModelApplyConfiguration constructs a declarative configuration of the OutputModel type for use with // apply. func OutputModel() *OutputModelApplyConfiguration { return &OutputModelApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicy.go index 4c8323ab34..0d4bb3982e 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicy.go @@ -16,13 +16,13 @@ package v2alpha1 -// PodGroupPolicyApplyConfiguration represents an declarative configuration of the PodGroupPolicy type for use +// PodGroupPolicyApplyConfiguration represents a declarative configuration of the PodGroupPolicy type for use // with apply. type PodGroupPolicyApplyConfiguration struct { PodGroupPolicySourceApplyConfiguration `json:",inline"` } -// PodGroupPolicyApplyConfiguration constructs an declarative configuration of the PodGroupPolicy type for use with +// PodGroupPolicyApplyConfiguration constructs a declarative configuration of the PodGroupPolicy type for use with // apply. func PodGroupPolicy() *PodGroupPolicyApplyConfiguration { return &PodGroupPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicysource.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicysource.go index bd96139e52..86d81ac2da 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicysource.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podgrouppolicysource.go @@ -16,13 +16,13 @@ package v2alpha1 -// PodGroupPolicySourceApplyConfiguration represents an declarative configuration of the PodGroupPolicySource type for use +// PodGroupPolicySourceApplyConfiguration represents a declarative configuration of the PodGroupPolicySource type for use // with apply. type PodGroupPolicySourceApplyConfiguration struct { Coscheduling *CoschedulingPodGroupPolicySourceApplyConfiguration `json:"coscheduling,omitempty"` } -// PodGroupPolicySourceApplyConfiguration constructs an declarative configuration of the PodGroupPolicySource type for use with +// PodGroupPolicySourceApplyConfiguration constructs a declarative configuration of the PodGroupPolicySource type for use with // apply. func PodGroupPolicySource() *PodGroupPolicySourceApplyConfiguration { return &PodGroupPolicySourceApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverride.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverride.go index d9becfd7bd..be802f0794 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverride.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverride.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PodSpecOverrideApplyConfiguration represents an declarative configuration of the PodSpecOverride type for use +// PodSpecOverrideApplyConfiguration represents a declarative configuration of the PodSpecOverride type for use // with apply. type PodSpecOverrideApplyConfiguration struct { TargetJobs []PodSpecOverrideTargetJobApplyConfiguration `json:"targetJobs,omitempty"` @@ -32,7 +32,7 @@ type PodSpecOverrideApplyConfiguration struct { Tolerations []v1.Toleration `json:"tolerations,omitempty"` } -// PodSpecOverrideApplyConfiguration constructs an declarative configuration of the PodSpecOverride type for use with +// PodSpecOverrideApplyConfiguration constructs a declarative configuration of the PodSpecOverride type for use with // apply. func PodSpecOverride() *PodSpecOverrideApplyConfiguration { return &PodSpecOverrideApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverridetargetjob.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverridetargetjob.go index 41d5f4fc69..ca05d2646f 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverridetargetjob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/podspecoverridetargetjob.go @@ -16,13 +16,13 @@ package v2alpha1 -// PodSpecOverrideTargetJobApplyConfiguration represents an declarative configuration of the PodSpecOverrideTargetJob type for use +// PodSpecOverrideTargetJobApplyConfiguration represents a declarative configuration of the PodSpecOverrideTargetJob type for use // with apply. type PodSpecOverrideTargetJobApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// PodSpecOverrideTargetJobApplyConfiguration constructs an declarative configuration of the PodSpecOverrideTargetJob type for use with +// PodSpecOverrideTargetJobApplyConfiguration constructs a declarative configuration of the PodSpecOverrideTargetJob type for use with // apply. func PodSpecOverrideTargetJob() *PodSpecOverrideTargetJobApplyConfiguration { return &PodSpecOverrideTargetJobApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/runtimeref.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/runtimeref.go index 420890bce2..822218ba6e 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/runtimeref.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/runtimeref.go @@ -16,7 +16,7 @@ package v2alpha1 -// RuntimeRefApplyConfiguration represents an declarative configuration of the RuntimeRef type for use +// RuntimeRefApplyConfiguration represents a declarative configuration of the RuntimeRef type for use // with apply. type RuntimeRefApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -24,7 +24,7 @@ type RuntimeRefApplyConfiguration struct { Kind *string `json:"kind,omitempty"` } -// RuntimeRefApplyConfiguration constructs an declarative configuration of the RuntimeRef type for use with +// RuntimeRefApplyConfiguration constructs a declarative configuration of the RuntimeRef type for use with // apply. func RuntimeRef() *RuntimeRefApplyConfiguration { return &RuntimeRefApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchelasticpolicy.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchelasticpolicy.go index 17f7ceff98..350d9d135b 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchelasticpolicy.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchelasticpolicy.go @@ -20,7 +20,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// TorchElasticPolicyApplyConfiguration represents an declarative configuration of the TorchElasticPolicy type for use +// TorchElasticPolicyApplyConfiguration represents a declarative configuration of the TorchElasticPolicy type for use // with apply. type TorchElasticPolicyApplyConfiguration struct { MaxRestarts *int32 `json:"maxRestarts,omitempty"` @@ -29,7 +29,7 @@ type TorchElasticPolicyApplyConfiguration struct { Metrics []v2.MetricSpec `json:"metrics,omitempty"` } -// TorchElasticPolicyApplyConfiguration constructs an declarative configuration of the TorchElasticPolicy type for use with +// TorchElasticPolicyApplyConfiguration constructs a declarative configuration of the TorchElasticPolicy type for use with // apply. func TorchElasticPolicy() *TorchElasticPolicyApplyConfiguration { return &TorchElasticPolicyApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchmlpolicysource.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchmlpolicysource.go index 03a8a58b56..401234ac01 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchmlpolicysource.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/torchmlpolicysource.go @@ -16,14 +16,14 @@ package v2alpha1 -// TorchMLPolicySourceApplyConfiguration represents an declarative configuration of the TorchMLPolicySource type for use +// TorchMLPolicySourceApplyConfiguration represents a declarative configuration of the TorchMLPolicySource type for use // with apply. type TorchMLPolicySourceApplyConfiguration struct { NumProcPerNode *string `json:"numProcPerNode,omitempty"` ElasticPolicy *TorchElasticPolicyApplyConfiguration `json:"elasticPolicy,omitempty"` } -// TorchMLPolicySourceApplyConfiguration constructs an declarative configuration of the TorchMLPolicySource type for use with +// TorchMLPolicySourceApplyConfiguration constructs a declarative configuration of the TorchMLPolicySource type for use with // apply. func TorchMLPolicySource() *TorchMLPolicySourceApplyConfiguration { return &TorchMLPolicySourceApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainer.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainer.go index dee8841c7b..49d991a440 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainer.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainer.go @@ -20,7 +20,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// TrainerApplyConfiguration represents an declarative configuration of the Trainer type for use +// TrainerApplyConfiguration represents a declarative configuration of the Trainer type for use // with apply. type TrainerApplyConfiguration struct { Image *string `json:"image,omitempty"` @@ -32,7 +32,7 @@ type TrainerApplyConfiguration struct { NumProcPerNode *string `json:"numProcPerNode,omitempty"` } -// TrainerApplyConfiguration constructs an declarative configuration of the Trainer type for use with +// TrainerApplyConfiguration constructs a declarative configuration of the Trainer type for use with // apply. func Trainer() *TrainerApplyConfiguration { return &TrainerApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntime.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntime.go index 9d918c3e83..eaf31f4479 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntime.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntime.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// TrainingRuntimeApplyConfiguration represents an declarative configuration of the TrainingRuntime type for use +// TrainingRuntimeApplyConfiguration represents a declarative configuration of the TrainingRuntime type for use // with apply. type TrainingRuntimeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -30,7 +30,7 @@ type TrainingRuntimeApplyConfiguration struct { Spec *TrainingRuntimeSpecApplyConfiguration `json:"spec,omitempty"` } -// TrainingRuntime constructs an declarative configuration of the TrainingRuntime type for use with +// TrainingRuntime constructs a declarative configuration of the TrainingRuntime type for use with // apply. func TrainingRuntime(name, namespace string) *TrainingRuntimeApplyConfiguration { b := &TrainingRuntimeApplyConfiguration{} @@ -206,3 +206,9 @@ func (b *TrainingRuntimeApplyConfiguration) WithSpec(value *TrainingRuntimeSpecA b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *TrainingRuntimeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntimespec.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntimespec.go index ed9133d6bf..c06a3a7a35 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntimespec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainingruntimespec.go @@ -16,7 +16,7 @@ package v2alpha1 -// TrainingRuntimeSpecApplyConfiguration represents an declarative configuration of the TrainingRuntimeSpec type for use +// TrainingRuntimeSpecApplyConfiguration represents a declarative configuration of the TrainingRuntimeSpec type for use // with apply. type TrainingRuntimeSpecApplyConfiguration struct { MLPolicy *MLPolicyApplyConfiguration `json:"mlPolicy,omitempty"` @@ -24,7 +24,7 @@ type TrainingRuntimeSpecApplyConfiguration struct { Template *JobSetTemplateSpecApplyConfiguration `json:"template,omitempty"` } -// TrainingRuntimeSpecApplyConfiguration constructs an declarative configuration of the TrainingRuntimeSpec type for use with +// TrainingRuntimeSpecApplyConfiguration constructs a declarative configuration of the TrainingRuntimeSpec type for use with // apply. func TrainingRuntimeSpec() *TrainingRuntimeSpecApplyConfiguration { return &TrainingRuntimeSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjob.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjob.go index cc1a983ca5..55ac69a875 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjob.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjob.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// TrainJobApplyConfiguration represents an declarative configuration of the TrainJob type for use +// TrainJobApplyConfiguration represents a declarative configuration of the TrainJob type for use // with apply. type TrainJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -31,7 +31,7 @@ type TrainJobApplyConfiguration struct { Status *TrainJobStatusApplyConfiguration `json:"status,omitempty"` } -// TrainJob constructs an declarative configuration of the TrainJob type for use with +// TrainJob constructs a declarative configuration of the TrainJob type for use with // apply. func TrainJob(name, namespace string) *TrainJobApplyConfiguration { b := &TrainJobApplyConfiguration{} @@ -215,3 +215,9 @@ func (b *TrainJobApplyConfiguration) WithStatus(value *TrainJobStatusApplyConfig b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *TrainJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobspec.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobspec.go index bd58729353..6c2b716a1a 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobspec.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobspec.go @@ -16,7 +16,7 @@ package v2alpha1 -// TrainJobSpecApplyConfiguration represents an declarative configuration of the TrainJobSpec type for use +// TrainJobSpecApplyConfiguration represents a declarative configuration of the TrainJobSpec type for use // with apply. type TrainJobSpecApplyConfiguration struct { RuntimeRef *RuntimeRefApplyConfiguration `json:"runtimeRef,omitempty"` @@ -30,7 +30,7 @@ type TrainJobSpecApplyConfiguration struct { ManagedBy *string `json:"managedBy,omitempty"` } -// TrainJobSpecApplyConfiguration constructs an declarative configuration of the TrainJobSpec type for use with +// TrainJobSpecApplyConfiguration constructs a declarative configuration of the TrainJobSpec type for use with // apply. func TrainJobSpec() *TrainJobSpecApplyConfiguration { return &TrainJobSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobstatus.go b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobstatus.go index 2d8d0cd084..f231c518a9 100644 --- a/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobstatus.go +++ b/pkg/client/applyconfiguration/kubeflow.org/v2alpha1/trainjobstatus.go @@ -20,14 +20,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// TrainJobStatusApplyConfiguration represents an declarative configuration of the TrainJobStatus type for use +// TrainJobStatusApplyConfiguration represents a declarative configuration of the TrainJobStatus type for use // with apply. type TrainJobStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` JobsStatus []JobStatusApplyConfiguration `json:"jobsStatus,omitempty"` } -// TrainJobStatusApplyConfiguration constructs an declarative configuration of the TrainJobStatus type for use with +// TrainJobStatusApplyConfiguration constructs a declarative configuration of the TrainJobStatus type for use with // apply. func TrainJobStatus() *TrainJobStatusApplyConfiguration { return &TrainJobStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go index 0dd820f1e6..19f5d0d69c 100644 --- a/pkg/client/applyconfiguration/utils.go +++ b/pkg/client/applyconfiguration/utils.go @@ -19,9 +19,12 @@ package applyconfiguration import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" + internal "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/internal" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" kubefloworgv2alpha1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v2alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no @@ -127,3 +130,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} { } return nil } + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 79099d552b..3bb8feb7e8 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -17,6 +17,7 @@ package fake import ( + applyconfiguration "github.com/kubeflow/training-operator/pkg/client/applyconfiguration" clientset "github.com/kubeflow/training-operator/pkg/client/clientset/versioned" kubeflowv1 "github.com/kubeflow/training-operator/pkg/client/clientset/versioned/typed/kubeflow.org/v1" fakekubeflowv1 "github.com/kubeflow/training-operator/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake" @@ -31,8 +32,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { @@ -74,6 +79,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } +// NewClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + var ( _ clientset.Interface = &Clientset{} _ testing.FakeClient = &Clientset{} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_jaxjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_jaxjob.go index c0e6d3594a..988e5b9956 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_jaxjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_jaxjob.go @@ -42,22 +42,24 @@ var jaxjobsKind = v1.SchemeGroupVersion.WithKind("JAXJob") // Get takes name of the jAXJob, and returns the corresponding jAXJob object, and an error if there is any. func (c *FakeJAXJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.JAXJob, err error) { + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(jaxjobsResource, c.ns, name), &v1.JAXJob{}) + Invokes(testing.NewGetActionWithOptions(jaxjobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), err } // List takes label and field selectors, and returns the list of JAXJobs that match those selectors. func (c *FakeJAXJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JAXJobList, err error) { + emptyResult := &v1.JAXJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(jaxjobsResource, jaxjobsKind, c.ns, opts), &v1.JAXJobList{}) + Invokes(testing.NewListActionWithOptions(jaxjobsResource, jaxjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakeJAXJobs) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested jAXJobs. func (c *FakeJAXJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(jaxjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(jaxjobsResource, c.ns, opts)) } // Create takes the representation of a jAXJob and creates it. Returns the server's representation of the jAXJob, and an error, if there is any. func (c *FakeJAXJobs) Create(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.CreateOptions) (result *v1.JAXJob, err error) { + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(jaxjobsResource, c.ns, jAXJob), &v1.JAXJob{}) + Invokes(testing.NewCreateActionWithOptions(jaxjobsResource, c.ns, jAXJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), err } // Update takes the representation of a jAXJob and updates it. Returns the server's representation of the jAXJob, and an error, if there is any. func (c *FakeJAXJobs) Update(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (result *v1.JAXJob, err error) { + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jaxjobsResource, c.ns, jAXJob), &v1.JAXJob{}) + Invokes(testing.NewUpdateActionWithOptions(jaxjobsResource, c.ns, jAXJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), 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 *FakeJAXJobs) UpdateStatus(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (*v1.JAXJob, error) { +func (c *FakeJAXJobs) UpdateStatus(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (result *v1.JAXJob, err error) { + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jaxjobsResource, "status", c.ns, jAXJob), &v1.JAXJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(jaxjobsResource, "status", c.ns, jAXJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), err } @@ -124,7 +129,7 @@ func (c *FakeJAXJobs) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeJAXJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jaxjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(jaxjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.JAXJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakeJAXJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched jAXJob. func (c *FakeJAXJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JAXJob, err error) { + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jaxjobsResource, c.ns, name, pt, data, subresources...), &v1.JAXJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(jaxjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), err } @@ -154,11 +160,12 @@ func (c *FakeJAXJobs) Apply(ctx context.Context, jAXJob *kubefloworgv1.JAXJobApp if name == nil { return nil, fmt.Errorf("jAXJob.Name must be provided to Apply") } + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jaxjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.JAXJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(jaxjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), err } @@ -177,11 +184,12 @@ func (c *FakeJAXJobs) ApplyStatus(ctx context.Context, jAXJob *kubefloworgv1.JAX if name == nil { return nil, fmt.Errorf("jAXJob.Name must be provided to Apply") } + emptyResult := &v1.JAXJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jaxjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.JAXJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(jaxjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.JAXJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_mpijob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_mpijob.go index 9f0c9f8c4b..0a1d1e9b9e 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_mpijob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_mpijob.go @@ -42,22 +42,24 @@ var mpijobsKind = v1.SchemeGroupVersion.WithKind("MPIJob") // Get takes name of the mPIJob, and returns the corresponding mPIJob object, and an error if there is any. func (c *FakeMPIJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MPIJob, err error) { + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(mpijobsResource, c.ns, name), &v1.MPIJob{}) + Invokes(testing.NewGetActionWithOptions(mpijobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), err } // List takes label and field selectors, and returns the list of MPIJobs that match those selectors. func (c *FakeMPIJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MPIJobList, err error) { + emptyResult := &v1.MPIJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(mpijobsResource, mpijobsKind, c.ns, opts), &v1.MPIJobList{}) + Invokes(testing.NewListActionWithOptions(mpijobsResource, mpijobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakeMPIJobs) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested mPIJobs. func (c *FakeMPIJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(mpijobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(mpijobsResource, c.ns, opts)) } // Create takes the representation of a mPIJob and creates it. Returns the server's representation of the mPIJob, and an error, if there is any. func (c *FakeMPIJobs) Create(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.CreateOptions) (result *v1.MPIJob, err error) { + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(mpijobsResource, c.ns, mPIJob), &v1.MPIJob{}) + Invokes(testing.NewCreateActionWithOptions(mpijobsResource, c.ns, mPIJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), err } // Update takes the representation of a mPIJob and updates it. Returns the server's representation of the mPIJob, and an error, if there is any. func (c *FakeMPIJobs) Update(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (result *v1.MPIJob, err error) { + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(mpijobsResource, c.ns, mPIJob), &v1.MPIJob{}) + Invokes(testing.NewUpdateActionWithOptions(mpijobsResource, c.ns, mPIJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), 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 *FakeMPIJobs) UpdateStatus(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (*v1.MPIJob, error) { +func (c *FakeMPIJobs) UpdateStatus(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (result *v1.MPIJob, err error) { + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(mpijobsResource, "status", c.ns, mPIJob), &v1.MPIJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(mpijobsResource, "status", c.ns, mPIJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), err } @@ -124,7 +129,7 @@ func (c *FakeMPIJobs) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeMPIJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(mpijobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(mpijobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.MPIJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakeMPIJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched mPIJob. func (c *FakeMPIJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MPIJob, err error) { + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mpijobsResource, c.ns, name, pt, data, subresources...), &v1.MPIJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(mpijobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), err } @@ -154,11 +160,12 @@ func (c *FakeMPIJobs) Apply(ctx context.Context, mPIJob *kubefloworgv1.MPIJobApp if name == nil { return nil, fmt.Errorf("mPIJob.Name must be provided to Apply") } + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mpijobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.MPIJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(mpijobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), err } @@ -177,11 +184,12 @@ func (c *FakeMPIJobs) ApplyStatus(ctx context.Context, mPIJob *kubefloworgv1.MPI if name == nil { return nil, fmt.Errorf("mPIJob.Name must be provided to Apply") } + emptyResult := &v1.MPIJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(mpijobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.MPIJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(mpijobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MPIJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_paddlejob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_paddlejob.go index 33378022c9..39388f682a 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_paddlejob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_paddlejob.go @@ -42,22 +42,24 @@ var paddlejobsKind = v1.SchemeGroupVersion.WithKind("PaddleJob") // Get takes name of the paddleJob, and returns the corresponding paddleJob object, and an error if there is any. func (c *FakePaddleJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PaddleJob, err error) { + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(paddlejobsResource, c.ns, name), &v1.PaddleJob{}) + Invokes(testing.NewGetActionWithOptions(paddlejobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), err } // List takes label and field selectors, and returns the list of PaddleJobs that match those selectors. func (c *FakePaddleJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PaddleJobList, err error) { + emptyResult := &v1.PaddleJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(paddlejobsResource, paddlejobsKind, c.ns, opts), &v1.PaddleJobList{}) + Invokes(testing.NewListActionWithOptions(paddlejobsResource, paddlejobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakePaddleJobs) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested paddleJobs. func (c *FakePaddleJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(paddlejobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(paddlejobsResource, c.ns, opts)) } // Create takes the representation of a paddleJob and creates it. Returns the server's representation of the paddleJob, and an error, if there is any. func (c *FakePaddleJobs) Create(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.CreateOptions) (result *v1.PaddleJob, err error) { + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(paddlejobsResource, c.ns, paddleJob), &v1.PaddleJob{}) + Invokes(testing.NewCreateActionWithOptions(paddlejobsResource, c.ns, paddleJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), err } // Update takes the representation of a paddleJob and updates it. Returns the server's representation of the paddleJob, and an error, if there is any. func (c *FakePaddleJobs) Update(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (result *v1.PaddleJob, err error) { + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(paddlejobsResource, c.ns, paddleJob), &v1.PaddleJob{}) + Invokes(testing.NewUpdateActionWithOptions(paddlejobsResource, c.ns, paddleJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), 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 *FakePaddleJobs) UpdateStatus(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (*v1.PaddleJob, error) { +func (c *FakePaddleJobs) UpdateStatus(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (result *v1.PaddleJob, err error) { + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(paddlejobsResource, "status", c.ns, paddleJob), &v1.PaddleJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(paddlejobsResource, "status", c.ns, paddleJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), err } @@ -124,7 +129,7 @@ func (c *FakePaddleJobs) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakePaddleJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(paddlejobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(paddlejobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PaddleJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakePaddleJobs) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched paddleJob. func (c *FakePaddleJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PaddleJob, err error) { + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(paddlejobsResource, c.ns, name, pt, data, subresources...), &v1.PaddleJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(paddlejobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), err } @@ -154,11 +160,12 @@ func (c *FakePaddleJobs) Apply(ctx context.Context, paddleJob *kubefloworgv1.Pad if name == nil { return nil, fmt.Errorf("paddleJob.Name must be provided to Apply") } + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(paddlejobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.PaddleJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(paddlejobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), err } @@ -177,11 +184,12 @@ func (c *FakePaddleJobs) ApplyStatus(ctx context.Context, paddleJob *kubefloworg if name == nil { return nil, fmt.Errorf("paddleJob.Name must be provided to Apply") } + emptyResult := &v1.PaddleJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(paddlejobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.PaddleJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(paddlejobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PaddleJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_pytorchjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_pytorchjob.go index b40917f68b..526d8d68ec 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_pytorchjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_pytorchjob.go @@ -42,22 +42,24 @@ var pytorchjobsKind = v1.SchemeGroupVersion.WithKind("PyTorchJob") // Get takes name of the pyTorchJob, and returns the corresponding pyTorchJob object, and an error if there is any. func (c *FakePyTorchJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PyTorchJob, err error) { + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(pytorchjobsResource, c.ns, name), &v1.PyTorchJob{}) + Invokes(testing.NewGetActionWithOptions(pytorchjobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), err } // List takes label and field selectors, and returns the list of PyTorchJobs that match those selectors. func (c *FakePyTorchJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PyTorchJobList, err error) { + emptyResult := &v1.PyTorchJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(pytorchjobsResource, pytorchjobsKind, c.ns, opts), &v1.PyTorchJobList{}) + Invokes(testing.NewListActionWithOptions(pytorchjobsResource, pytorchjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakePyTorchJobs) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested pyTorchJobs. func (c *FakePyTorchJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(pytorchjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(pytorchjobsResource, c.ns, opts)) } // Create takes the representation of a pyTorchJob and creates it. Returns the server's representation of the pyTorchJob, and an error, if there is any. func (c *FakePyTorchJobs) Create(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.CreateOptions) (result *v1.PyTorchJob, err error) { + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(pytorchjobsResource, c.ns, pyTorchJob), &v1.PyTorchJob{}) + Invokes(testing.NewCreateActionWithOptions(pytorchjobsResource, c.ns, pyTorchJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), err } // Update takes the representation of a pyTorchJob and updates it. Returns the server's representation of the pyTorchJob, and an error, if there is any. func (c *FakePyTorchJobs) Update(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (result *v1.PyTorchJob, err error) { + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(pytorchjobsResource, c.ns, pyTorchJob), &v1.PyTorchJob{}) + Invokes(testing.NewUpdateActionWithOptions(pytorchjobsResource, c.ns, pyTorchJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), 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 *FakePyTorchJobs) UpdateStatus(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (*v1.PyTorchJob, error) { +func (c *FakePyTorchJobs) UpdateStatus(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (result *v1.PyTorchJob, err error) { + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(pytorchjobsResource, "status", c.ns, pyTorchJob), &v1.PyTorchJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(pytorchjobsResource, "status", c.ns, pyTorchJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), err } @@ -124,7 +129,7 @@ func (c *FakePyTorchJobs) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakePyTorchJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(pytorchjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(pytorchjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PyTorchJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakePyTorchJobs) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched pyTorchJob. func (c *FakePyTorchJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PyTorchJob, err error) { + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pytorchjobsResource, c.ns, name, pt, data, subresources...), &v1.PyTorchJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(pytorchjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), err } @@ -154,11 +160,12 @@ func (c *FakePyTorchJobs) Apply(ctx context.Context, pyTorchJob *kubefloworgv1.P if name == nil { return nil, fmt.Errorf("pyTorchJob.Name must be provided to Apply") } + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pytorchjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.PyTorchJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(pytorchjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), err } @@ -177,11 +184,12 @@ func (c *FakePyTorchJobs) ApplyStatus(ctx context.Context, pyTorchJob *kubeflowo if name == nil { return nil, fmt.Errorf("pyTorchJob.Name must be provided to Apply") } + emptyResult := &v1.PyTorchJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pytorchjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.PyTorchJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(pytorchjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PyTorchJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_tfjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_tfjob.go index 6dcf267189..3673e9265b 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_tfjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_tfjob.go @@ -42,22 +42,24 @@ var tfjobsKind = v1.SchemeGroupVersion.WithKind("TFJob") // Get takes name of the tFJob, and returns the corresponding tFJob object, and an error if there is any. func (c *FakeTFJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TFJob, err error) { + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(tfjobsResource, c.ns, name), &v1.TFJob{}) + Invokes(testing.NewGetActionWithOptions(tfjobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), err } // List takes label and field selectors, and returns the list of TFJobs that match those selectors. func (c *FakeTFJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TFJobList, err error) { + emptyResult := &v1.TFJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(tfjobsResource, tfjobsKind, c.ns, opts), &v1.TFJobList{}) + Invokes(testing.NewListActionWithOptions(tfjobsResource, tfjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakeTFJobs) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested tFJobs. func (c *FakeTFJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tfjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(tfjobsResource, c.ns, opts)) } // Create takes the representation of a tFJob and creates it. Returns the server's representation of the tFJob, and an error, if there is any. func (c *FakeTFJobs) Create(ctx context.Context, tFJob *v1.TFJob, opts metav1.CreateOptions) (result *v1.TFJob, err error) { + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(tfjobsResource, c.ns, tFJob), &v1.TFJob{}) + Invokes(testing.NewCreateActionWithOptions(tfjobsResource, c.ns, tFJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), err } // Update takes the representation of a tFJob and updates it. Returns the server's representation of the tFJob, and an error, if there is any. func (c *FakeTFJobs) Update(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (result *v1.TFJob, err error) { + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tfjobsResource, c.ns, tFJob), &v1.TFJob{}) + Invokes(testing.NewUpdateActionWithOptions(tfjobsResource, c.ns, tFJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), 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 *FakeTFJobs) UpdateStatus(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (*v1.TFJob, error) { +func (c *FakeTFJobs) UpdateStatus(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (result *v1.TFJob, err error) { + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tfjobsResource, "status", c.ns, tFJob), &v1.TFJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(tfjobsResource, "status", c.ns, tFJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), err } @@ -124,7 +129,7 @@ func (c *FakeTFJobs) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeTFJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tfjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(tfjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TFJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakeTFJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched tFJob. func (c *FakeTFJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TFJob, err error) { + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tfjobsResource, c.ns, name, pt, data, subresources...), &v1.TFJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tfjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), err } @@ -154,11 +160,12 @@ func (c *FakeTFJobs) Apply(ctx context.Context, tFJob *kubefloworgv1.TFJobApplyC if name == nil { return nil, fmt.Errorf("tFJob.Name must be provided to Apply") } + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tfjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.TFJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tfjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), err } @@ -177,11 +184,12 @@ func (c *FakeTFJobs) ApplyStatus(ctx context.Context, tFJob *kubefloworgv1.TFJob if name == nil { return nil, fmt.Errorf("tFJob.Name must be provided to Apply") } + emptyResult := &v1.TFJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tfjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.TFJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tfjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TFJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_xgboostjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_xgboostjob.go index 640cf84f4a..ada50b3bc4 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_xgboostjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/fake/fake_xgboostjob.go @@ -42,22 +42,24 @@ var xgboostjobsKind = v1.SchemeGroupVersion.WithKind("XGBoostJob") // Get takes name of the xGBoostJob, and returns the corresponding xGBoostJob object, and an error if there is any. func (c *FakeXGBoostJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.XGBoostJob, err error) { + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(xgboostjobsResource, c.ns, name), &v1.XGBoostJob{}) + Invokes(testing.NewGetActionWithOptions(xgboostjobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), err } // List takes label and field selectors, and returns the list of XGBoostJobs that match those selectors. func (c *FakeXGBoostJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.XGBoostJobList, err error) { + emptyResult := &v1.XGBoostJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(xgboostjobsResource, xgboostjobsKind, c.ns, opts), &v1.XGBoostJobList{}) + Invokes(testing.NewListActionWithOptions(xgboostjobsResource, xgboostjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakeXGBoostJobs) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested xGBoostJobs. func (c *FakeXGBoostJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(xgboostjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(xgboostjobsResource, c.ns, opts)) } // Create takes the representation of a xGBoostJob and creates it. Returns the server's representation of the xGBoostJob, and an error, if there is any. func (c *FakeXGBoostJobs) Create(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.CreateOptions) (result *v1.XGBoostJob, err error) { + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(xgboostjobsResource, c.ns, xGBoostJob), &v1.XGBoostJob{}) + Invokes(testing.NewCreateActionWithOptions(xgboostjobsResource, c.ns, xGBoostJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), err } // Update takes the representation of a xGBoostJob and updates it. Returns the server's representation of the xGBoostJob, and an error, if there is any. func (c *FakeXGBoostJobs) Update(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (result *v1.XGBoostJob, err error) { + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(xgboostjobsResource, c.ns, xGBoostJob), &v1.XGBoostJob{}) + Invokes(testing.NewUpdateActionWithOptions(xgboostjobsResource, c.ns, xGBoostJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), 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 *FakeXGBoostJobs) UpdateStatus(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (*v1.XGBoostJob, error) { +func (c *FakeXGBoostJobs) UpdateStatus(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (result *v1.XGBoostJob, err error) { + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(xgboostjobsResource, "status", c.ns, xGBoostJob), &v1.XGBoostJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(xgboostjobsResource, "status", c.ns, xGBoostJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), err } @@ -124,7 +129,7 @@ func (c *FakeXGBoostJobs) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeXGBoostJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(xgboostjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(xgboostjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.XGBoostJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakeXGBoostJobs) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched xGBoostJob. func (c *FakeXGBoostJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.XGBoostJob, err error) { + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(xgboostjobsResource, c.ns, name, pt, data, subresources...), &v1.XGBoostJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(xgboostjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), err } @@ -154,11 +160,12 @@ func (c *FakeXGBoostJobs) Apply(ctx context.Context, xGBoostJob *kubefloworgv1.X if name == nil { return nil, fmt.Errorf("xGBoostJob.Name must be provided to Apply") } + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(xgboostjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.XGBoostJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(xgboostjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), err } @@ -177,11 +184,12 @@ func (c *FakeXGBoostJobs) ApplyStatus(ctx context.Context, xGBoostJob *kubeflowo if name == nil { return nil, fmt.Errorf("xGBoostJob.Name must be provided to Apply") } + emptyResult := &v1.XGBoostJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(xgboostjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.XGBoostJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(xgboostjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.XGBoostJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/jaxjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/jaxjob.go index fe28bcec88..b70a281b06 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/jaxjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/jaxjob.go @@ -18,9 +18,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" @@ -28,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // JAXJobsGetter has a method to return a JAXJobInterface. @@ -41,6 +38,7 @@ type JAXJobsGetter interface { type JAXJobInterface interface { Create(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.CreateOptions) (*v1.JAXJob, error) Update(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (*v1.JAXJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (*v1.JAXJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -49,206 +47,25 @@ type JAXJobInterface interface { 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.JAXJob, err error) Apply(ctx context.Context, jAXJob *kubefloworgv1.JAXJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.JAXJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, jAXJob *kubefloworgv1.JAXJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.JAXJob, err error) JAXJobExpansion } // jAXJobs implements JAXJobInterface type jAXJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.JAXJob, *v1.JAXJobList, *kubefloworgv1.JAXJobApplyConfiguration] } // newJAXJobs returns a JAXJobs func newJAXJobs(c *KubeflowV1Client, namespace string) *jAXJobs { return &jAXJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.JAXJob, *v1.JAXJobList, *kubefloworgv1.JAXJobApplyConfiguration]( + "jaxjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.JAXJob { return &v1.JAXJob{} }, + func() *v1.JAXJobList { return &v1.JAXJobList{} }), } } - -// Get takes name of the jAXJob, and returns the corresponding jAXJob object, and an error if there is any. -func (c *jAXJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.JAXJob, err error) { - result = &v1.JAXJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jaxjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of JAXJobs that match those selectors. -func (c *jAXJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JAXJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.JAXJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jaxjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested jAXJobs. -func (c *jAXJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("jaxjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a jAXJob and creates it. Returns the server's representation of the jAXJob, and an error, if there is any. -func (c *jAXJobs) Create(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.CreateOptions) (result *v1.JAXJob, err error) { - result = &v1.JAXJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("jaxjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(jAXJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a jAXJob and updates it. Returns the server's representation of the jAXJob, and an error, if there is any. -func (c *jAXJobs) Update(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (result *v1.JAXJob, err error) { - result = &v1.JAXJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("jaxjobs"). - Name(jAXJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(jAXJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *jAXJobs) UpdateStatus(ctx context.Context, jAXJob *v1.JAXJob, opts metav1.UpdateOptions) (result *v1.JAXJob, err error) { - result = &v1.JAXJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("jaxjobs"). - Name(jAXJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(jAXJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the jAXJob and deletes it. Returns an error if one occurs. -func (c *jAXJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("jaxjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *jAXJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("jaxjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched jAXJob. -func (c *jAXJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.JAXJob, err error) { - result = &v1.JAXJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("jaxjobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied jAXJob. -func (c *jAXJobs) Apply(ctx context.Context, jAXJob *kubefloworgv1.JAXJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.JAXJob, err error) { - if jAXJob == nil { - return nil, fmt.Errorf("jAXJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(jAXJob) - if err != nil { - return nil, err - } - name := jAXJob.Name - if name == nil { - return nil, fmt.Errorf("jAXJob.Name must be provided to Apply") - } - result = &v1.JAXJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("jaxjobs"). - 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 *jAXJobs) ApplyStatus(ctx context.Context, jAXJob *kubefloworgv1.JAXJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.JAXJob, err error) { - if jAXJob == nil { - return nil, fmt.Errorf("jAXJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(jAXJob) - if err != nil { - return nil, err - } - - name := jAXJob.Name - if name == nil { - return nil, fmt.Errorf("jAXJob.Name must be provided to Apply") - } - - result = &v1.JAXJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("jaxjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/mpijob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/mpijob.go index 694b9b9619..79e6a6e06a 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/mpijob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/mpijob.go @@ -18,9 +18,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" @@ -28,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // MPIJobsGetter has a method to return a MPIJobInterface. @@ -41,6 +38,7 @@ type MPIJobsGetter interface { type MPIJobInterface interface { Create(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.CreateOptions) (*v1.MPIJob, error) Update(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (*v1.MPIJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (*v1.MPIJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -49,206 +47,25 @@ type MPIJobInterface interface { 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.MPIJob, err error) Apply(ctx context.Context, mPIJob *kubefloworgv1.MPIJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MPIJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, mPIJob *kubefloworgv1.MPIJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MPIJob, err error) MPIJobExpansion } // mPIJobs implements MPIJobInterface type mPIJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.MPIJob, *v1.MPIJobList, *kubefloworgv1.MPIJobApplyConfiguration] } // newMPIJobs returns a MPIJobs func newMPIJobs(c *KubeflowV1Client, namespace string) *mPIJobs { return &mPIJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.MPIJob, *v1.MPIJobList, *kubefloworgv1.MPIJobApplyConfiguration]( + "mpijobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.MPIJob { return &v1.MPIJob{} }, + func() *v1.MPIJobList { return &v1.MPIJobList{} }), } } - -// Get takes name of the mPIJob, and returns the corresponding mPIJob object, and an error if there is any. -func (c *mPIJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MPIJob, err error) { - result = &v1.MPIJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mpijobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MPIJobs that match those selectors. -func (c *mPIJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MPIJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.MPIJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("mpijobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested mPIJobs. -func (c *mPIJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("mpijobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a mPIJob and creates it. Returns the server's representation of the mPIJob, and an error, if there is any. -func (c *mPIJobs) Create(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.CreateOptions) (result *v1.MPIJob, err error) { - result = &v1.MPIJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("mpijobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mPIJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a mPIJob and updates it. Returns the server's representation of the mPIJob, and an error, if there is any. -func (c *mPIJobs) Update(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (result *v1.MPIJob, err error) { - result = &v1.MPIJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("mpijobs"). - Name(mPIJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mPIJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *mPIJobs) UpdateStatus(ctx context.Context, mPIJob *v1.MPIJob, opts metav1.UpdateOptions) (result *v1.MPIJob, err error) { - result = &v1.MPIJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("mpijobs"). - Name(mPIJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mPIJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the mPIJob and deletes it. Returns an error if one occurs. -func (c *mPIJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("mpijobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *mPIJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("mpijobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched mPIJob. -func (c *mPIJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MPIJob, err error) { - result = &v1.MPIJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("mpijobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied mPIJob. -func (c *mPIJobs) Apply(ctx context.Context, mPIJob *kubefloworgv1.MPIJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MPIJob, err error) { - if mPIJob == nil { - return nil, fmt.Errorf("mPIJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(mPIJob) - if err != nil { - return nil, err - } - name := mPIJob.Name - if name == nil { - return nil, fmt.Errorf("mPIJob.Name must be provided to Apply") - } - result = &v1.MPIJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("mpijobs"). - 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 *mPIJobs) ApplyStatus(ctx context.Context, mPIJob *kubefloworgv1.MPIJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MPIJob, err error) { - if mPIJob == nil { - return nil, fmt.Errorf("mPIJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(mPIJob) - if err != nil { - return nil, err - } - - name := mPIJob.Name - if name == nil { - return nil, fmt.Errorf("mPIJob.Name must be provided to Apply") - } - - result = &v1.MPIJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("mpijobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/paddlejob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/paddlejob.go index 4be46c0682..19c6cd5f63 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/paddlejob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/paddlejob.go @@ -18,9 +18,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" @@ -28,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // PaddleJobsGetter has a method to return a PaddleJobInterface. @@ -41,6 +38,7 @@ type PaddleJobsGetter interface { type PaddleJobInterface interface { Create(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.CreateOptions) (*v1.PaddleJob, error) Update(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (*v1.PaddleJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (*v1.PaddleJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -49,206 +47,25 @@ type PaddleJobInterface interface { 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.PaddleJob, err error) Apply(ctx context.Context, paddleJob *kubefloworgv1.PaddleJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PaddleJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, paddleJob *kubefloworgv1.PaddleJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PaddleJob, err error) PaddleJobExpansion } // paddleJobs implements PaddleJobInterface type paddleJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.PaddleJob, *v1.PaddleJobList, *kubefloworgv1.PaddleJobApplyConfiguration] } // newPaddleJobs returns a PaddleJobs func newPaddleJobs(c *KubeflowV1Client, namespace string) *paddleJobs { return &paddleJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.PaddleJob, *v1.PaddleJobList, *kubefloworgv1.PaddleJobApplyConfiguration]( + "paddlejobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.PaddleJob { return &v1.PaddleJob{} }, + func() *v1.PaddleJobList { return &v1.PaddleJobList{} }), } } - -// Get takes name of the paddleJob, and returns the corresponding paddleJob object, and an error if there is any. -func (c *paddleJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PaddleJob, err error) { - result = &v1.PaddleJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("paddlejobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PaddleJobs that match those selectors. -func (c *paddleJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PaddleJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PaddleJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("paddlejobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested paddleJobs. -func (c *paddleJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("paddlejobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a paddleJob and creates it. Returns the server's representation of the paddleJob, and an error, if there is any. -func (c *paddleJobs) Create(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.CreateOptions) (result *v1.PaddleJob, err error) { - result = &v1.PaddleJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("paddlejobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(paddleJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a paddleJob and updates it. Returns the server's representation of the paddleJob, and an error, if there is any. -func (c *paddleJobs) Update(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (result *v1.PaddleJob, err error) { - result = &v1.PaddleJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("paddlejobs"). - Name(paddleJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(paddleJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *paddleJobs) UpdateStatus(ctx context.Context, paddleJob *v1.PaddleJob, opts metav1.UpdateOptions) (result *v1.PaddleJob, err error) { - result = &v1.PaddleJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("paddlejobs"). - Name(paddleJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(paddleJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the paddleJob and deletes it. Returns an error if one occurs. -func (c *paddleJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("paddlejobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *paddleJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("paddlejobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched paddleJob. -func (c *paddleJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PaddleJob, err error) { - result = &v1.PaddleJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("paddlejobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied paddleJob. -func (c *paddleJobs) Apply(ctx context.Context, paddleJob *kubefloworgv1.PaddleJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PaddleJob, err error) { - if paddleJob == nil { - return nil, fmt.Errorf("paddleJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(paddleJob) - if err != nil { - return nil, err - } - name := paddleJob.Name - if name == nil { - return nil, fmt.Errorf("paddleJob.Name must be provided to Apply") - } - result = &v1.PaddleJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("paddlejobs"). - 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 *paddleJobs) ApplyStatus(ctx context.Context, paddleJob *kubefloworgv1.PaddleJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PaddleJob, err error) { - if paddleJob == nil { - return nil, fmt.Errorf("paddleJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(paddleJob) - if err != nil { - return nil, err - } - - name := paddleJob.Name - if name == nil { - return nil, fmt.Errorf("paddleJob.Name must be provided to Apply") - } - - result = &v1.PaddleJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("paddlejobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/pytorchjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/pytorchjob.go index ea9a991135..042c0e2e59 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/pytorchjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/pytorchjob.go @@ -18,9 +18,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" @@ -28,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // PyTorchJobsGetter has a method to return a PyTorchJobInterface. @@ -41,6 +38,7 @@ type PyTorchJobsGetter interface { type PyTorchJobInterface interface { Create(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.CreateOptions) (*v1.PyTorchJob, error) Update(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (*v1.PyTorchJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (*v1.PyTorchJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -49,206 +47,25 @@ type PyTorchJobInterface interface { 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.PyTorchJob, err error) Apply(ctx context.Context, pyTorchJob *kubefloworgv1.PyTorchJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PyTorchJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, pyTorchJob *kubefloworgv1.PyTorchJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PyTorchJob, err error) PyTorchJobExpansion } // pyTorchJobs implements PyTorchJobInterface type pyTorchJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.PyTorchJob, *v1.PyTorchJobList, *kubefloworgv1.PyTorchJobApplyConfiguration] } // newPyTorchJobs returns a PyTorchJobs func newPyTorchJobs(c *KubeflowV1Client, namespace string) *pyTorchJobs { return &pyTorchJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.PyTorchJob, *v1.PyTorchJobList, *kubefloworgv1.PyTorchJobApplyConfiguration]( + "pytorchjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.PyTorchJob { return &v1.PyTorchJob{} }, + func() *v1.PyTorchJobList { return &v1.PyTorchJobList{} }), } } - -// Get takes name of the pyTorchJob, and returns the corresponding pyTorchJob object, and an error if there is any. -func (c *pyTorchJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PyTorchJob, err error) { - result = &v1.PyTorchJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pytorchjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PyTorchJobs that match those selectors. -func (c *pyTorchJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PyTorchJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PyTorchJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pytorchjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested pyTorchJobs. -func (c *pyTorchJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("pytorchjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a pyTorchJob and creates it. Returns the server's representation of the pyTorchJob, and an error, if there is any. -func (c *pyTorchJobs) Create(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.CreateOptions) (result *v1.PyTorchJob, err error) { - result = &v1.PyTorchJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("pytorchjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pyTorchJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a pyTorchJob and updates it. Returns the server's representation of the pyTorchJob, and an error, if there is any. -func (c *pyTorchJobs) Update(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (result *v1.PyTorchJob, err error) { - result = &v1.PyTorchJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("pytorchjobs"). - Name(pyTorchJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pyTorchJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *pyTorchJobs) UpdateStatus(ctx context.Context, pyTorchJob *v1.PyTorchJob, opts metav1.UpdateOptions) (result *v1.PyTorchJob, err error) { - result = &v1.PyTorchJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("pytorchjobs"). - Name(pyTorchJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pyTorchJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the pyTorchJob and deletes it. Returns an error if one occurs. -func (c *pyTorchJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("pytorchjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *pyTorchJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("pytorchjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched pyTorchJob. -func (c *pyTorchJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PyTorchJob, err error) { - result = &v1.PyTorchJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("pytorchjobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied pyTorchJob. -func (c *pyTorchJobs) Apply(ctx context.Context, pyTorchJob *kubefloworgv1.PyTorchJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PyTorchJob, err error) { - if pyTorchJob == nil { - return nil, fmt.Errorf("pyTorchJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(pyTorchJob) - if err != nil { - return nil, err - } - name := pyTorchJob.Name - if name == nil { - return nil, fmt.Errorf("pyTorchJob.Name must be provided to Apply") - } - result = &v1.PyTorchJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("pytorchjobs"). - 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 *pyTorchJobs) ApplyStatus(ctx context.Context, pyTorchJob *kubefloworgv1.PyTorchJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PyTorchJob, err error) { - if pyTorchJob == nil { - return nil, fmt.Errorf("pyTorchJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(pyTorchJob) - if err != nil { - return nil, err - } - - name := pyTorchJob.Name - if name == nil { - return nil, fmt.Errorf("pyTorchJob.Name must be provided to Apply") - } - - result = &v1.PyTorchJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("pytorchjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/tfjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/tfjob.go index 48d73e1c5e..b69cf60bb4 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/tfjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/tfjob.go @@ -18,9 +18,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" @@ -28,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TFJobsGetter has a method to return a TFJobInterface. @@ -41,6 +38,7 @@ type TFJobsGetter interface { type TFJobInterface interface { Create(ctx context.Context, tFJob *v1.TFJob, opts metav1.CreateOptions) (*v1.TFJob, error) Update(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (*v1.TFJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (*v1.TFJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -49,206 +47,25 @@ type TFJobInterface interface { 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.TFJob, err error) Apply(ctx context.Context, tFJob *kubefloworgv1.TFJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.TFJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, tFJob *kubefloworgv1.TFJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.TFJob, err error) TFJobExpansion } // tFJobs implements TFJobInterface type tFJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.TFJob, *v1.TFJobList, *kubefloworgv1.TFJobApplyConfiguration] } // newTFJobs returns a TFJobs func newTFJobs(c *KubeflowV1Client, namespace string) *tFJobs { return &tFJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.TFJob, *v1.TFJobList, *kubefloworgv1.TFJobApplyConfiguration]( + "tfjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.TFJob { return &v1.TFJob{} }, + func() *v1.TFJobList { return &v1.TFJobList{} }), } } - -// Get takes name of the tFJob, and returns the corresponding tFJob object, and an error if there is any. -func (c *tFJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TFJob, err error) { - result = &v1.TFJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tfjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TFJobs that match those selectors. -func (c *tFJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TFJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TFJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tfjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tFJobs. -func (c *tFJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("tfjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a tFJob and creates it. Returns the server's representation of the tFJob, and an error, if there is any. -func (c *tFJobs) Create(ctx context.Context, tFJob *v1.TFJob, opts metav1.CreateOptions) (result *v1.TFJob, err error) { - result = &v1.TFJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("tfjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tFJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a tFJob and updates it. Returns the server's representation of the tFJob, and an error, if there is any. -func (c *tFJobs) Update(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (result *v1.TFJob, err error) { - result = &v1.TFJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tfjobs"). - Name(tFJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tFJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *tFJobs) UpdateStatus(ctx context.Context, tFJob *v1.TFJob, opts metav1.UpdateOptions) (result *v1.TFJob, err error) { - result = &v1.TFJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tfjobs"). - Name(tFJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tFJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the tFJob and deletes it. Returns an error if one occurs. -func (c *tFJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("tfjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tFJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("tfjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched tFJob. -func (c *tFJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TFJob, err error) { - result = &v1.TFJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("tfjobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied tFJob. -func (c *tFJobs) Apply(ctx context.Context, tFJob *kubefloworgv1.TFJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.TFJob, err error) { - if tFJob == nil { - return nil, fmt.Errorf("tFJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tFJob) - if err != nil { - return nil, err - } - name := tFJob.Name - if name == nil { - return nil, fmt.Errorf("tFJob.Name must be provided to Apply") - } - result = &v1.TFJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tfjobs"). - 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 *tFJobs) ApplyStatus(ctx context.Context, tFJob *kubefloworgv1.TFJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.TFJob, err error) { - if tFJob == nil { - return nil, fmt.Errorf("tFJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tFJob) - if err != nil { - return nil, err - } - - name := tFJob.Name - if name == nil { - return nil, fmt.Errorf("tFJob.Name must be provided to Apply") - } - - result = &v1.TFJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tfjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/xgboostjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/xgboostjob.go index 25203d400a..e04ff3fe22 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v1/xgboostjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v1/xgboostjob.go @@ -18,9 +18,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" kubefloworgv1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v1" @@ -28,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // XGBoostJobsGetter has a method to return a XGBoostJobInterface. @@ -41,6 +38,7 @@ type XGBoostJobsGetter interface { type XGBoostJobInterface interface { Create(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.CreateOptions) (*v1.XGBoostJob, error) Update(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (*v1.XGBoostJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (*v1.XGBoostJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -49,206 +47,25 @@ type XGBoostJobInterface interface { 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.XGBoostJob, err error) Apply(ctx context.Context, xGBoostJob *kubefloworgv1.XGBoostJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.XGBoostJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, xGBoostJob *kubefloworgv1.XGBoostJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.XGBoostJob, err error) XGBoostJobExpansion } // xGBoostJobs implements XGBoostJobInterface type xGBoostJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.XGBoostJob, *v1.XGBoostJobList, *kubefloworgv1.XGBoostJobApplyConfiguration] } // newXGBoostJobs returns a XGBoostJobs func newXGBoostJobs(c *KubeflowV1Client, namespace string) *xGBoostJobs { return &xGBoostJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.XGBoostJob, *v1.XGBoostJobList, *kubefloworgv1.XGBoostJobApplyConfiguration]( + "xgboostjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.XGBoostJob { return &v1.XGBoostJob{} }, + func() *v1.XGBoostJobList { return &v1.XGBoostJobList{} }), } } - -// Get takes name of the xGBoostJob, and returns the corresponding xGBoostJob object, and an error if there is any. -func (c *xGBoostJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.XGBoostJob, err error) { - result = &v1.XGBoostJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("xgboostjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of XGBoostJobs that match those selectors. -func (c *xGBoostJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.XGBoostJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.XGBoostJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("xgboostjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested xGBoostJobs. -func (c *xGBoostJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("xgboostjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a xGBoostJob and creates it. Returns the server's representation of the xGBoostJob, and an error, if there is any. -func (c *xGBoostJobs) Create(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.CreateOptions) (result *v1.XGBoostJob, err error) { - result = &v1.XGBoostJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("xgboostjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(xGBoostJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a xGBoostJob and updates it. Returns the server's representation of the xGBoostJob, and an error, if there is any. -func (c *xGBoostJobs) Update(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (result *v1.XGBoostJob, err error) { - result = &v1.XGBoostJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("xgboostjobs"). - Name(xGBoostJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(xGBoostJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *xGBoostJobs) UpdateStatus(ctx context.Context, xGBoostJob *v1.XGBoostJob, opts metav1.UpdateOptions) (result *v1.XGBoostJob, err error) { - result = &v1.XGBoostJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("xgboostjobs"). - Name(xGBoostJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(xGBoostJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the xGBoostJob and deletes it. Returns an error if one occurs. -func (c *xGBoostJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("xgboostjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *xGBoostJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("xgboostjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched xGBoostJob. -func (c *xGBoostJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.XGBoostJob, err error) { - result = &v1.XGBoostJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("xgboostjobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied xGBoostJob. -func (c *xGBoostJobs) Apply(ctx context.Context, xGBoostJob *kubefloworgv1.XGBoostJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.XGBoostJob, err error) { - if xGBoostJob == nil { - return nil, fmt.Errorf("xGBoostJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(xGBoostJob) - if err != nil { - return nil, err - } - name := xGBoostJob.Name - if name == nil { - return nil, fmt.Errorf("xGBoostJob.Name must be provided to Apply") - } - result = &v1.XGBoostJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("xgboostjobs"). - 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 *xGBoostJobs) ApplyStatus(ctx context.Context, xGBoostJob *kubefloworgv1.XGBoostJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.XGBoostJob, err error) { - if xGBoostJob == nil { - return nil, fmt.Errorf("xGBoostJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(xGBoostJob) - if err != nil { - return nil, err - } - - name := xGBoostJob.Name - if name == nil { - return nil, fmt.Errorf("xGBoostJob.Name must be provided to Apply") - } - - result = &v1.XGBoostJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("xgboostjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/clustertrainingruntime.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/clustertrainingruntime.go index 767a31916c..8bfe2183a0 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/clustertrainingruntime.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/clustertrainingruntime.go @@ -18,9 +18,6 @@ package v2alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" kubefloworgv2alpha1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v2alpha1" @@ -28,7 +25,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClusterTrainingRuntimesGetter has a method to return a ClusterTrainingRuntimeInterface. @@ -53,143 +50,18 @@ type ClusterTrainingRuntimeInterface interface { // clusterTrainingRuntimes implements ClusterTrainingRuntimeInterface type clusterTrainingRuntimes struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v2alpha1.ClusterTrainingRuntime, *v2alpha1.ClusterTrainingRuntimeList, *kubefloworgv2alpha1.ClusterTrainingRuntimeApplyConfiguration] } // newClusterTrainingRuntimes returns a ClusterTrainingRuntimes func newClusterTrainingRuntimes(c *KubeflowV2alpha1Client) *clusterTrainingRuntimes { return &clusterTrainingRuntimes{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v2alpha1.ClusterTrainingRuntime, *v2alpha1.ClusterTrainingRuntimeList, *kubefloworgv2alpha1.ClusterTrainingRuntimeApplyConfiguration]( + "clustertrainingruntimes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v2alpha1.ClusterTrainingRuntime { return &v2alpha1.ClusterTrainingRuntime{} }, + func() *v2alpha1.ClusterTrainingRuntimeList { return &v2alpha1.ClusterTrainingRuntimeList{} }), } } - -// Get takes name of the clusterTrainingRuntime, and returns the corresponding clusterTrainingRuntime object, and an error if there is any. -func (c *clusterTrainingRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { - result = &v2alpha1.ClusterTrainingRuntime{} - err = c.client.Get(). - Resource("clustertrainingruntimes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterTrainingRuntimes that match those selectors. -func (c *clusterTrainingRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ClusterTrainingRuntimeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2alpha1.ClusterTrainingRuntimeList{} - err = c.client.Get(). - Resource("clustertrainingruntimes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterTrainingRuntimes. -func (c *clusterTrainingRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clustertrainingruntimes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterTrainingRuntime and creates it. Returns the server's representation of the clusterTrainingRuntime, and an error, if there is any. -func (c *clusterTrainingRuntimes) Create(ctx context.Context, clusterTrainingRuntime *v2alpha1.ClusterTrainingRuntime, opts v1.CreateOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { - result = &v2alpha1.ClusterTrainingRuntime{} - err = c.client.Post(). - Resource("clustertrainingruntimes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterTrainingRuntime). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterTrainingRuntime and updates it. Returns the server's representation of the clusterTrainingRuntime, and an error, if there is any. -func (c *clusterTrainingRuntimes) Update(ctx context.Context, clusterTrainingRuntime *v2alpha1.ClusterTrainingRuntime, opts v1.UpdateOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { - result = &v2alpha1.ClusterTrainingRuntime{} - err = c.client.Put(). - Resource("clustertrainingruntimes"). - Name(clusterTrainingRuntime.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterTrainingRuntime). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterTrainingRuntime and deletes it. Returns an error if one occurs. -func (c *clusterTrainingRuntimes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clustertrainingruntimes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterTrainingRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clustertrainingruntimes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterTrainingRuntime. -func (c *clusterTrainingRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ClusterTrainingRuntime, err error) { - result = &v2alpha1.ClusterTrainingRuntime{} - err = c.client.Patch(pt). - Resource("clustertrainingruntimes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterTrainingRuntime. -func (c *clusterTrainingRuntimes) Apply(ctx context.Context, clusterTrainingRuntime *kubefloworgv2alpha1.ClusterTrainingRuntimeApplyConfiguration, opts v1.ApplyOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { - if clusterTrainingRuntime == nil { - return nil, fmt.Errorf("clusterTrainingRuntime provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterTrainingRuntime) - if err != nil { - return nil, err - } - name := clusterTrainingRuntime.Name - if name == nil { - return nil, fmt.Errorf("clusterTrainingRuntime.Name must be provided to Apply") - } - result = &v2alpha1.ClusterTrainingRuntime{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clustertrainingruntimes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_clustertrainingruntime.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_clustertrainingruntime.go index 7dadf6f47c..0321263668 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_clustertrainingruntime.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_clustertrainingruntime.go @@ -41,20 +41,22 @@ var clustertrainingruntimesKind = v2alpha1.SchemeGroupVersion.WithKind("ClusterT // Get takes name of the clusterTrainingRuntime, and returns the corresponding clusterTrainingRuntime object, and an error if there is any. func (c *FakeClusterTrainingRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { + emptyResult := &v2alpha1.ClusterTrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustertrainingruntimesResource, name), &v2alpha1.ClusterTrainingRuntime{}) + Invokes(testing.NewRootGetActionWithOptions(clustertrainingruntimesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.ClusterTrainingRuntime), err } // List takes label and field selectors, and returns the list of ClusterTrainingRuntimes that match those selectors. func (c *FakeClusterTrainingRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ClusterTrainingRuntimeList, err error) { + emptyResult := &v2alpha1.ClusterTrainingRuntimeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustertrainingruntimesResource, clustertrainingruntimesKind, opts), &v2alpha1.ClusterTrainingRuntimeList{}) + Invokes(testing.NewRootListActionWithOptions(clustertrainingruntimesResource, clustertrainingruntimesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -73,25 +75,27 @@ func (c *FakeClusterTrainingRuntimes) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested clusterTrainingRuntimes. func (c *FakeClusterTrainingRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clustertrainingruntimesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clustertrainingruntimesResource, opts)) } // Create takes the representation of a clusterTrainingRuntime and creates it. Returns the server's representation of the clusterTrainingRuntime, and an error, if there is any. func (c *FakeClusterTrainingRuntimes) Create(ctx context.Context, clusterTrainingRuntime *v2alpha1.ClusterTrainingRuntime, opts v1.CreateOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { + emptyResult := &v2alpha1.ClusterTrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustertrainingruntimesResource, clusterTrainingRuntime), &v2alpha1.ClusterTrainingRuntime{}) + Invokes(testing.NewRootCreateActionWithOptions(clustertrainingruntimesResource, clusterTrainingRuntime, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.ClusterTrainingRuntime), err } // Update takes the representation of a clusterTrainingRuntime and updates it. Returns the server's representation of the clusterTrainingRuntime, and an error, if there is any. func (c *FakeClusterTrainingRuntimes) Update(ctx context.Context, clusterTrainingRuntime *v2alpha1.ClusterTrainingRuntime, opts v1.UpdateOptions) (result *v2alpha1.ClusterTrainingRuntime, err error) { + emptyResult := &v2alpha1.ClusterTrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustertrainingruntimesResource, clusterTrainingRuntime), &v2alpha1.ClusterTrainingRuntime{}) + Invokes(testing.NewRootUpdateActionWithOptions(clustertrainingruntimesResource, clusterTrainingRuntime, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.ClusterTrainingRuntime), err } @@ -105,7 +109,7 @@ func (c *FakeClusterTrainingRuntimes) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeClusterTrainingRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustertrainingruntimesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clustertrainingruntimesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v2alpha1.ClusterTrainingRuntimeList{}) return err @@ -113,10 +117,11 @@ func (c *FakeClusterTrainingRuntimes) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched clusterTrainingRuntime. func (c *FakeClusterTrainingRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ClusterTrainingRuntime, err error) { + emptyResult := &v2alpha1.ClusterTrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertrainingruntimesResource, name, pt, data, subresources...), &v2alpha1.ClusterTrainingRuntime{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrainingruntimesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.ClusterTrainingRuntime), err } @@ -134,10 +139,11 @@ func (c *FakeClusterTrainingRuntimes) Apply(ctx context.Context, clusterTraining if name == nil { return nil, fmt.Errorf("clusterTrainingRuntime.Name must be provided to Apply") } + emptyResult := &v2alpha1.ClusterTrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertrainingruntimesResource, *name, types.ApplyPatchType, data), &v2alpha1.ClusterTrainingRuntime{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrainingruntimesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.ClusterTrainingRuntime), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainingruntime.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainingruntime.go index 70db641d80..22a0b81d36 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainingruntime.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainingruntime.go @@ -42,22 +42,24 @@ var trainingruntimesKind = v2alpha1.SchemeGroupVersion.WithKind("TrainingRuntime // Get takes name of the trainingRuntime, and returns the corresponding trainingRuntime object, and an error if there is any. func (c *FakeTrainingRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.TrainingRuntime, err error) { + emptyResult := &v2alpha1.TrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewGetAction(trainingruntimesResource, c.ns, name), &v2alpha1.TrainingRuntime{}) + Invokes(testing.NewGetActionWithOptions(trainingruntimesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainingRuntime), err } // List takes label and field selectors, and returns the list of TrainingRuntimes that match those selectors. func (c *FakeTrainingRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.TrainingRuntimeList, err error) { + emptyResult := &v2alpha1.TrainingRuntimeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(trainingruntimesResource, trainingruntimesKind, c.ns, opts), &v2alpha1.TrainingRuntimeList{}) + Invokes(testing.NewListActionWithOptions(trainingruntimesResource, trainingruntimesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,28 +78,30 @@ func (c *FakeTrainingRuntimes) List(ctx context.Context, opts v1.ListOptions) (r // Watch returns a watch.Interface that watches the requested trainingRuntimes. func (c *FakeTrainingRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(trainingruntimesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(trainingruntimesResource, c.ns, opts)) } // Create takes the representation of a trainingRuntime and creates it. Returns the server's representation of the trainingRuntime, and an error, if there is any. func (c *FakeTrainingRuntimes) Create(ctx context.Context, trainingRuntime *v2alpha1.TrainingRuntime, opts v1.CreateOptions) (result *v2alpha1.TrainingRuntime, err error) { + emptyResult := &v2alpha1.TrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(trainingruntimesResource, c.ns, trainingRuntime), &v2alpha1.TrainingRuntime{}) + Invokes(testing.NewCreateActionWithOptions(trainingruntimesResource, c.ns, trainingRuntime, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainingRuntime), err } // Update takes the representation of a trainingRuntime and updates it. Returns the server's representation of the trainingRuntime, and an error, if there is any. func (c *FakeTrainingRuntimes) Update(ctx context.Context, trainingRuntime *v2alpha1.TrainingRuntime, opts v1.UpdateOptions) (result *v2alpha1.TrainingRuntime, err error) { + emptyResult := &v2alpha1.TrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(trainingruntimesResource, c.ns, trainingRuntime), &v2alpha1.TrainingRuntime{}) + Invokes(testing.NewUpdateActionWithOptions(trainingruntimesResource, c.ns, trainingRuntime, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainingRuntime), err } @@ -112,7 +116,7 @@ func (c *FakeTrainingRuntimes) Delete(ctx context.Context, name string, opts v1. // DeleteCollection deletes a collection of objects. func (c *FakeTrainingRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(trainingruntimesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(trainingruntimesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2alpha1.TrainingRuntimeList{}) return err @@ -120,11 +124,12 @@ func (c *FakeTrainingRuntimes) DeleteCollection(ctx context.Context, opts v1.Del // Patch applies the patch and returns the patched trainingRuntime. func (c *FakeTrainingRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.TrainingRuntime, err error) { + emptyResult := &v2alpha1.TrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(trainingruntimesResource, c.ns, name, pt, data, subresources...), &v2alpha1.TrainingRuntime{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(trainingruntimesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainingRuntime), err } @@ -142,11 +147,12 @@ func (c *FakeTrainingRuntimes) Apply(ctx context.Context, trainingRuntime *kubef if name == nil { return nil, fmt.Errorf("trainingRuntime.Name must be provided to Apply") } + emptyResult := &v2alpha1.TrainingRuntime{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(trainingruntimesResource, c.ns, *name, types.ApplyPatchType, data), &v2alpha1.TrainingRuntime{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(trainingruntimesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainingRuntime), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainjob.go index b50ed38807..a00b899ee1 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/fake/fake_trainjob.go @@ -42,22 +42,24 @@ var trainjobsKind = v2alpha1.SchemeGroupVersion.WithKind("TrainJob") // Get takes name of the trainJob, and returns the corresponding trainJob object, and an error if there is any. func (c *FakeTrainJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.TrainJob, err error) { + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(trainjobsResource, c.ns, name), &v2alpha1.TrainJob{}) + Invokes(testing.NewGetActionWithOptions(trainjobsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), err } // List takes label and field selectors, and returns the list of TrainJobs that match those selectors. func (c *FakeTrainJobs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.TrainJobList, err error) { + emptyResult := &v2alpha1.TrainJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(trainjobsResource, trainjobsKind, c.ns, opts), &v2alpha1.TrainJobList{}) + Invokes(testing.NewListActionWithOptions(trainjobsResource, trainjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -76,40 +78,43 @@ func (c *FakeTrainJobs) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested trainJobs. func (c *FakeTrainJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(trainjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(trainjobsResource, c.ns, opts)) } // Create takes the representation of a trainJob and creates it. Returns the server's representation of the trainJob, and an error, if there is any. func (c *FakeTrainJobs) Create(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.CreateOptions) (result *v2alpha1.TrainJob, err error) { + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(trainjobsResource, c.ns, trainJob), &v2alpha1.TrainJob{}) + Invokes(testing.NewCreateActionWithOptions(trainjobsResource, c.ns, trainJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), err } // Update takes the representation of a trainJob and updates it. Returns the server's representation of the trainJob, and an error, if there is any. func (c *FakeTrainJobs) Update(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (result *v2alpha1.TrainJob, err error) { + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(trainjobsResource, c.ns, trainJob), &v2alpha1.TrainJob{}) + Invokes(testing.NewUpdateActionWithOptions(trainjobsResource, c.ns, trainJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), 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 *FakeTrainJobs) UpdateStatus(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (*v2alpha1.TrainJob, error) { +func (c *FakeTrainJobs) UpdateStatus(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (result *v2alpha1.TrainJob, err error) { + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(trainjobsResource, "status", c.ns, trainJob), &v2alpha1.TrainJob{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(trainjobsResource, "status", c.ns, trainJob, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), err } @@ -124,7 +129,7 @@ func (c *FakeTrainJobs) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTrainJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(trainjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(trainjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2alpha1.TrainJobList{}) return err @@ -132,11 +137,12 @@ func (c *FakeTrainJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched trainJob. func (c *FakeTrainJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.TrainJob, err error) { + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(trainjobsResource, c.ns, name, pt, data, subresources...), &v2alpha1.TrainJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(trainjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), err } @@ -154,11 +160,12 @@ func (c *FakeTrainJobs) Apply(ctx context.Context, trainJob *kubefloworgv2alpha1 if name == nil { return nil, fmt.Errorf("trainJob.Name must be provided to Apply") } + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(trainjobsResource, c.ns, *name, types.ApplyPatchType, data), &v2alpha1.TrainJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(trainjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), err } @@ -177,11 +184,12 @@ func (c *FakeTrainJobs) ApplyStatus(ctx context.Context, trainJob *kubefloworgv2 if name == nil { return nil, fmt.Errorf("trainJob.Name must be provided to Apply") } + emptyResult := &v2alpha1.TrainJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(trainjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2alpha1.TrainJob{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(trainjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2alpha1.TrainJob), err } diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainingruntime.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainingruntime.go index 1e712d2a29..3102132958 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainingruntime.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainingruntime.go @@ -18,9 +18,6 @@ package v2alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" kubefloworgv2alpha1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v2alpha1" @@ -28,7 +25,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TrainingRuntimesGetter has a method to return a TrainingRuntimeInterface. @@ -53,154 +50,18 @@ type TrainingRuntimeInterface interface { // trainingRuntimes implements TrainingRuntimeInterface type trainingRuntimes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v2alpha1.TrainingRuntime, *v2alpha1.TrainingRuntimeList, *kubefloworgv2alpha1.TrainingRuntimeApplyConfiguration] } // newTrainingRuntimes returns a TrainingRuntimes func newTrainingRuntimes(c *KubeflowV2alpha1Client, namespace string) *trainingRuntimes { return &trainingRuntimes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v2alpha1.TrainingRuntime, *v2alpha1.TrainingRuntimeList, *kubefloworgv2alpha1.TrainingRuntimeApplyConfiguration]( + "trainingruntimes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v2alpha1.TrainingRuntime { return &v2alpha1.TrainingRuntime{} }, + func() *v2alpha1.TrainingRuntimeList { return &v2alpha1.TrainingRuntimeList{} }), } } - -// Get takes name of the trainingRuntime, and returns the corresponding trainingRuntime object, and an error if there is any. -func (c *trainingRuntimes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.TrainingRuntime, err error) { - result = &v2alpha1.TrainingRuntime{} - err = c.client.Get(). - Namespace(c.ns). - Resource("trainingruntimes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TrainingRuntimes that match those selectors. -func (c *trainingRuntimes) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.TrainingRuntimeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2alpha1.TrainingRuntimeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("trainingruntimes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested trainingRuntimes. -func (c *trainingRuntimes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("trainingruntimes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a trainingRuntime and creates it. Returns the server's representation of the trainingRuntime, and an error, if there is any. -func (c *trainingRuntimes) Create(ctx context.Context, trainingRuntime *v2alpha1.TrainingRuntime, opts v1.CreateOptions) (result *v2alpha1.TrainingRuntime, err error) { - result = &v2alpha1.TrainingRuntime{} - err = c.client.Post(). - Namespace(c.ns). - Resource("trainingruntimes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(trainingRuntime). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a trainingRuntime and updates it. Returns the server's representation of the trainingRuntime, and an error, if there is any. -func (c *trainingRuntimes) Update(ctx context.Context, trainingRuntime *v2alpha1.TrainingRuntime, opts v1.UpdateOptions) (result *v2alpha1.TrainingRuntime, err error) { - result = &v2alpha1.TrainingRuntime{} - err = c.client.Put(). - Namespace(c.ns). - Resource("trainingruntimes"). - Name(trainingRuntime.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(trainingRuntime). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the trainingRuntime and deletes it. Returns an error if one occurs. -func (c *trainingRuntimes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("trainingruntimes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *trainingRuntimes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("trainingruntimes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched trainingRuntime. -func (c *trainingRuntimes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.TrainingRuntime, err error) { - result = &v2alpha1.TrainingRuntime{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("trainingruntimes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied trainingRuntime. -func (c *trainingRuntimes) Apply(ctx context.Context, trainingRuntime *kubefloworgv2alpha1.TrainingRuntimeApplyConfiguration, opts v1.ApplyOptions) (result *v2alpha1.TrainingRuntime, err error) { - if trainingRuntime == nil { - return nil, fmt.Errorf("trainingRuntime provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(trainingRuntime) - if err != nil { - return nil, err - } - name := trainingRuntime.Name - if name == nil { - return nil, fmt.Errorf("trainingRuntime.Name must be provided to Apply") - } - result = &v2alpha1.TrainingRuntime{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("trainingruntimes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainjob.go b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainjob.go index a66f05b87b..45fbc86425 100644 --- a/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainjob.go +++ b/pkg/client/clientset/versioned/typed/kubeflow.org/v2alpha1/trainjob.go @@ -18,9 +18,6 @@ package v2alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" kubefloworgv2alpha1 "github.com/kubeflow/training-operator/pkg/client/applyconfiguration/kubeflow.org/v2alpha1" @@ -28,7 +25,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TrainJobsGetter has a method to return a TrainJobInterface. @@ -41,6 +38,7 @@ type TrainJobsGetter interface { type TrainJobInterface interface { Create(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.CreateOptions) (*v2alpha1.TrainJob, error) Update(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (*v2alpha1.TrainJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (*v2alpha1.TrainJob, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -49,206 +47,25 @@ type TrainJobInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.TrainJob, err error) Apply(ctx context.Context, trainJob *kubefloworgv2alpha1.TrainJobApplyConfiguration, opts v1.ApplyOptions) (result *v2alpha1.TrainJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, trainJob *kubefloworgv2alpha1.TrainJobApplyConfiguration, opts v1.ApplyOptions) (result *v2alpha1.TrainJob, err error) TrainJobExpansion } // trainJobs implements TrainJobInterface type trainJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v2alpha1.TrainJob, *v2alpha1.TrainJobList, *kubefloworgv2alpha1.TrainJobApplyConfiguration] } // newTrainJobs returns a TrainJobs func newTrainJobs(c *KubeflowV2alpha1Client, namespace string) *trainJobs { return &trainJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v2alpha1.TrainJob, *v2alpha1.TrainJobList, *kubefloworgv2alpha1.TrainJobApplyConfiguration]( + "trainjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v2alpha1.TrainJob { return &v2alpha1.TrainJob{} }, + func() *v2alpha1.TrainJobList { return &v2alpha1.TrainJobList{} }), } } - -// Get takes name of the trainJob, and returns the corresponding trainJob object, and an error if there is any. -func (c *trainJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.TrainJob, err error) { - result = &v2alpha1.TrainJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("trainjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TrainJobs that match those selectors. -func (c *trainJobs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.TrainJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2alpha1.TrainJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("trainjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested trainJobs. -func (c *trainJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("trainjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a trainJob and creates it. Returns the server's representation of the trainJob, and an error, if there is any. -func (c *trainJobs) Create(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.CreateOptions) (result *v2alpha1.TrainJob, err error) { - result = &v2alpha1.TrainJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("trainjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(trainJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a trainJob and updates it. Returns the server's representation of the trainJob, and an error, if there is any. -func (c *trainJobs) Update(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (result *v2alpha1.TrainJob, err error) { - result = &v2alpha1.TrainJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("trainjobs"). - Name(trainJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(trainJob). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *trainJobs) UpdateStatus(ctx context.Context, trainJob *v2alpha1.TrainJob, opts v1.UpdateOptions) (result *v2alpha1.TrainJob, err error) { - result = &v2alpha1.TrainJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("trainjobs"). - Name(trainJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(trainJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the trainJob and deletes it. Returns an error if one occurs. -func (c *trainJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("trainjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *trainJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("trainjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched trainJob. -func (c *trainJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.TrainJob, err error) { - result = &v2alpha1.TrainJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("trainjobs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied trainJob. -func (c *trainJobs) Apply(ctx context.Context, trainJob *kubefloworgv2alpha1.TrainJobApplyConfiguration, opts v1.ApplyOptions) (result *v2alpha1.TrainJob, err error) { - if trainJob == nil { - return nil, fmt.Errorf("trainJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(trainJob) - if err != nil { - return nil, err - } - name := trainJob.Name - if name == nil { - return nil, fmt.Errorf("trainJob.Name must be provided to Apply") - } - result = &v2alpha1.TrainJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("trainjobs"). - 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 *trainJobs) ApplyStatus(ctx context.Context, trainJob *kubefloworgv2alpha1.TrainJobApplyConfiguration, opts v1.ApplyOptions) (result *v2alpha1.TrainJob, err error) { - if trainJob == nil { - return nil, fmt.Errorf("trainJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(trainJob) - if err != nil { - return nil, err - } - - name := trainJob.Name - if name == nil { - return nil, fmt.Errorf("trainJob.Name must be provided to Apply") - } - - result = &v2alpha1.TrainJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("trainjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 58bf3c3866..12a8c697b2 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -226,6 +226,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new diff --git a/pkg/client/listers/kubeflow.org/v1/jaxjob.go b/pkg/client/listers/kubeflow.org/v1/jaxjob.go index ccc1a65a99..74f318f018 100644 --- a/pkg/client/listers/kubeflow.org/v1/jaxjob.go +++ b/pkg/client/listers/kubeflow.org/v1/jaxjob.go @@ -18,8 +18,8 @@ package v1 import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type JAXJobLister interface { // jAXJobLister implements the JAXJobLister interface. type jAXJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.JAXJob] } // NewJAXJobLister returns a new JAXJobLister. func NewJAXJobLister(indexer cache.Indexer) JAXJobLister { - return &jAXJobLister{indexer: indexer} -} - -// List lists all JAXJobs in the indexer. -func (s *jAXJobLister) List(selector labels.Selector) (ret []*v1.JAXJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.JAXJob)) - }) - return ret, err + return &jAXJobLister{listers.New[*v1.JAXJob](indexer, v1.Resource("jaxjob"))} } // JAXJobs returns an object that can list and get JAXJobs. func (s *jAXJobLister) JAXJobs(namespace string) JAXJobNamespaceLister { - return jAXJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return jAXJobNamespaceLister{listers.NewNamespaced[*v1.JAXJob](s.ResourceIndexer, namespace)} } // JAXJobNamespaceLister helps list and get JAXJobs. @@ -72,26 +64,5 @@ type JAXJobNamespaceLister interface { // jAXJobNamespaceLister implements the JAXJobNamespaceLister // interface. type jAXJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all JAXJobs in the indexer for a given namespace. -func (s jAXJobNamespaceLister) List(selector labels.Selector) (ret []*v1.JAXJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.JAXJob)) - }) - return ret, err -} - -// Get retrieves the JAXJob from the indexer for a given namespace and name. -func (s jAXJobNamespaceLister) Get(name string) (*v1.JAXJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("jaxjob"), name) - } - return obj.(*v1.JAXJob), nil + listers.ResourceIndexer[*v1.JAXJob] } diff --git a/pkg/client/listers/kubeflow.org/v1/mpijob.go b/pkg/client/listers/kubeflow.org/v1/mpijob.go index d648fed944..9540d47439 100644 --- a/pkg/client/listers/kubeflow.org/v1/mpijob.go +++ b/pkg/client/listers/kubeflow.org/v1/mpijob.go @@ -18,8 +18,8 @@ package v1 import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type MPIJobLister interface { // mPIJobLister implements the MPIJobLister interface. type mPIJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.MPIJob] } // NewMPIJobLister returns a new MPIJobLister. func NewMPIJobLister(indexer cache.Indexer) MPIJobLister { - return &mPIJobLister{indexer: indexer} -} - -// List lists all MPIJobs in the indexer. -func (s *mPIJobLister) List(selector labels.Selector) (ret []*v1.MPIJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.MPIJob)) - }) - return ret, err + return &mPIJobLister{listers.New[*v1.MPIJob](indexer, v1.Resource("mpijob"))} } // MPIJobs returns an object that can list and get MPIJobs. func (s *mPIJobLister) MPIJobs(namespace string) MPIJobNamespaceLister { - return mPIJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return mPIJobNamespaceLister{listers.NewNamespaced[*v1.MPIJob](s.ResourceIndexer, namespace)} } // MPIJobNamespaceLister helps list and get MPIJobs. @@ -72,26 +64,5 @@ type MPIJobNamespaceLister interface { // mPIJobNamespaceLister implements the MPIJobNamespaceLister // interface. type mPIJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all MPIJobs in the indexer for a given namespace. -func (s mPIJobNamespaceLister) List(selector labels.Selector) (ret []*v1.MPIJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.MPIJob)) - }) - return ret, err -} - -// Get retrieves the MPIJob from the indexer for a given namespace and name. -func (s mPIJobNamespaceLister) Get(name string) (*v1.MPIJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("mpijob"), name) - } - return obj.(*v1.MPIJob), nil + listers.ResourceIndexer[*v1.MPIJob] } diff --git a/pkg/client/listers/kubeflow.org/v1/paddlejob.go b/pkg/client/listers/kubeflow.org/v1/paddlejob.go index 45751a680e..1897a9a63c 100644 --- a/pkg/client/listers/kubeflow.org/v1/paddlejob.go +++ b/pkg/client/listers/kubeflow.org/v1/paddlejob.go @@ -18,8 +18,8 @@ package v1 import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type PaddleJobLister interface { // paddleJobLister implements the PaddleJobLister interface. type paddleJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PaddleJob] } // NewPaddleJobLister returns a new PaddleJobLister. func NewPaddleJobLister(indexer cache.Indexer) PaddleJobLister { - return &paddleJobLister{indexer: indexer} -} - -// List lists all PaddleJobs in the indexer. -func (s *paddleJobLister) List(selector labels.Selector) (ret []*v1.PaddleJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PaddleJob)) - }) - return ret, err + return &paddleJobLister{listers.New[*v1.PaddleJob](indexer, v1.Resource("paddlejob"))} } // PaddleJobs returns an object that can list and get PaddleJobs. func (s *paddleJobLister) PaddleJobs(namespace string) PaddleJobNamespaceLister { - return paddleJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return paddleJobNamespaceLister{listers.NewNamespaced[*v1.PaddleJob](s.ResourceIndexer, namespace)} } // PaddleJobNamespaceLister helps list and get PaddleJobs. @@ -72,26 +64,5 @@ type PaddleJobNamespaceLister interface { // paddleJobNamespaceLister implements the PaddleJobNamespaceLister // interface. type paddleJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PaddleJobs in the indexer for a given namespace. -func (s paddleJobNamespaceLister) List(selector labels.Selector) (ret []*v1.PaddleJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PaddleJob)) - }) - return ret, err -} - -// Get retrieves the PaddleJob from the indexer for a given namespace and name. -func (s paddleJobNamespaceLister) Get(name string) (*v1.PaddleJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("paddlejob"), name) - } - return obj.(*v1.PaddleJob), nil + listers.ResourceIndexer[*v1.PaddleJob] } diff --git a/pkg/client/listers/kubeflow.org/v1/pytorchjob.go b/pkg/client/listers/kubeflow.org/v1/pytorchjob.go index 66278941b7..953338197a 100644 --- a/pkg/client/listers/kubeflow.org/v1/pytorchjob.go +++ b/pkg/client/listers/kubeflow.org/v1/pytorchjob.go @@ -18,8 +18,8 @@ package v1 import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type PyTorchJobLister interface { // pyTorchJobLister implements the PyTorchJobLister interface. type pyTorchJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PyTorchJob] } // NewPyTorchJobLister returns a new PyTorchJobLister. func NewPyTorchJobLister(indexer cache.Indexer) PyTorchJobLister { - return &pyTorchJobLister{indexer: indexer} -} - -// List lists all PyTorchJobs in the indexer. -func (s *pyTorchJobLister) List(selector labels.Selector) (ret []*v1.PyTorchJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PyTorchJob)) - }) - return ret, err + return &pyTorchJobLister{listers.New[*v1.PyTorchJob](indexer, v1.Resource("pytorchjob"))} } // PyTorchJobs returns an object that can list and get PyTorchJobs. func (s *pyTorchJobLister) PyTorchJobs(namespace string) PyTorchJobNamespaceLister { - return pyTorchJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return pyTorchJobNamespaceLister{listers.NewNamespaced[*v1.PyTorchJob](s.ResourceIndexer, namespace)} } // PyTorchJobNamespaceLister helps list and get PyTorchJobs. @@ -72,26 +64,5 @@ type PyTorchJobNamespaceLister interface { // pyTorchJobNamespaceLister implements the PyTorchJobNamespaceLister // interface. type pyTorchJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PyTorchJobs in the indexer for a given namespace. -func (s pyTorchJobNamespaceLister) List(selector labels.Selector) (ret []*v1.PyTorchJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PyTorchJob)) - }) - return ret, err -} - -// Get retrieves the PyTorchJob from the indexer for a given namespace and name. -func (s pyTorchJobNamespaceLister) Get(name string) (*v1.PyTorchJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("pytorchjob"), name) - } - return obj.(*v1.PyTorchJob), nil + listers.ResourceIndexer[*v1.PyTorchJob] } diff --git a/pkg/client/listers/kubeflow.org/v1/tfjob.go b/pkg/client/listers/kubeflow.org/v1/tfjob.go index c3444b2a30..92e0524f63 100644 --- a/pkg/client/listers/kubeflow.org/v1/tfjob.go +++ b/pkg/client/listers/kubeflow.org/v1/tfjob.go @@ -18,8 +18,8 @@ package v1 import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type TFJobLister interface { // tFJobLister implements the TFJobLister interface. type tFJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.TFJob] } // NewTFJobLister returns a new TFJobLister. func NewTFJobLister(indexer cache.Indexer) TFJobLister { - return &tFJobLister{indexer: indexer} -} - -// List lists all TFJobs in the indexer. -func (s *tFJobLister) List(selector labels.Selector) (ret []*v1.TFJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TFJob)) - }) - return ret, err + return &tFJobLister{listers.New[*v1.TFJob](indexer, v1.Resource("tfjob"))} } // TFJobs returns an object that can list and get TFJobs. func (s *tFJobLister) TFJobs(namespace string) TFJobNamespaceLister { - return tFJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return tFJobNamespaceLister{listers.NewNamespaced[*v1.TFJob](s.ResourceIndexer, namespace)} } // TFJobNamespaceLister helps list and get TFJobs. @@ -72,26 +64,5 @@ type TFJobNamespaceLister interface { // tFJobNamespaceLister implements the TFJobNamespaceLister // interface. type tFJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TFJobs in the indexer for a given namespace. -func (s tFJobNamespaceLister) List(selector labels.Selector) (ret []*v1.TFJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TFJob)) - }) - return ret, err -} - -// Get retrieves the TFJob from the indexer for a given namespace and name. -func (s tFJobNamespaceLister) Get(name string) (*v1.TFJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("tfjob"), name) - } - return obj.(*v1.TFJob), nil + listers.ResourceIndexer[*v1.TFJob] } diff --git a/pkg/client/listers/kubeflow.org/v1/xgboostjob.go b/pkg/client/listers/kubeflow.org/v1/xgboostjob.go index 8455bb2e8f..d4794c98ba 100644 --- a/pkg/client/listers/kubeflow.org/v1/xgboostjob.go +++ b/pkg/client/listers/kubeflow.org/v1/xgboostjob.go @@ -18,8 +18,8 @@ package v1 import ( v1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type XGBoostJobLister interface { // xGBoostJobLister implements the XGBoostJobLister interface. type xGBoostJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.XGBoostJob] } // NewXGBoostJobLister returns a new XGBoostJobLister. func NewXGBoostJobLister(indexer cache.Indexer) XGBoostJobLister { - return &xGBoostJobLister{indexer: indexer} -} - -// List lists all XGBoostJobs in the indexer. -func (s *xGBoostJobLister) List(selector labels.Selector) (ret []*v1.XGBoostJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.XGBoostJob)) - }) - return ret, err + return &xGBoostJobLister{listers.New[*v1.XGBoostJob](indexer, v1.Resource("xgboostjob"))} } // XGBoostJobs returns an object that can list and get XGBoostJobs. func (s *xGBoostJobLister) XGBoostJobs(namespace string) XGBoostJobNamespaceLister { - return xGBoostJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return xGBoostJobNamespaceLister{listers.NewNamespaced[*v1.XGBoostJob](s.ResourceIndexer, namespace)} } // XGBoostJobNamespaceLister helps list and get XGBoostJobs. @@ -72,26 +64,5 @@ type XGBoostJobNamespaceLister interface { // xGBoostJobNamespaceLister implements the XGBoostJobNamespaceLister // interface. type xGBoostJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all XGBoostJobs in the indexer for a given namespace. -func (s xGBoostJobNamespaceLister) List(selector labels.Selector) (ret []*v1.XGBoostJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.XGBoostJob)) - }) - return ret, err -} - -// Get retrieves the XGBoostJob from the indexer for a given namespace and name. -func (s xGBoostJobNamespaceLister) Get(name string) (*v1.XGBoostJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("xgboostjob"), name) - } - return obj.(*v1.XGBoostJob), nil + listers.ResourceIndexer[*v1.XGBoostJob] } diff --git a/pkg/client/listers/kubeflow.org/v2alpha1/clustertrainingruntime.go b/pkg/client/listers/kubeflow.org/v2alpha1/clustertrainingruntime.go index fdbbb970da..f2d0c73a6c 100644 --- a/pkg/client/listers/kubeflow.org/v2alpha1/clustertrainingruntime.go +++ b/pkg/client/listers/kubeflow.org/v2alpha1/clustertrainingruntime.go @@ -18,8 +18,8 @@ package v2alpha1 import ( v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,30 +37,10 @@ type ClusterTrainingRuntimeLister interface { // clusterTrainingRuntimeLister implements the ClusterTrainingRuntimeLister interface. type clusterTrainingRuntimeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2alpha1.ClusterTrainingRuntime] } // NewClusterTrainingRuntimeLister returns a new ClusterTrainingRuntimeLister. func NewClusterTrainingRuntimeLister(indexer cache.Indexer) ClusterTrainingRuntimeLister { - return &clusterTrainingRuntimeLister{indexer: indexer} -} - -// List lists all ClusterTrainingRuntimes in the indexer. -func (s *clusterTrainingRuntimeLister) List(selector labels.Selector) (ret []*v2alpha1.ClusterTrainingRuntime, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2alpha1.ClusterTrainingRuntime)) - }) - return ret, err -} - -// Get retrieves the ClusterTrainingRuntime from the index for a given name. -func (s *clusterTrainingRuntimeLister) Get(name string) (*v2alpha1.ClusterTrainingRuntime, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2alpha1.Resource("clustertrainingruntime"), name) - } - return obj.(*v2alpha1.ClusterTrainingRuntime), nil + return &clusterTrainingRuntimeLister{listers.New[*v2alpha1.ClusterTrainingRuntime](indexer, v2alpha1.Resource("clustertrainingruntime"))} } diff --git a/pkg/client/listers/kubeflow.org/v2alpha1/trainingruntime.go b/pkg/client/listers/kubeflow.org/v2alpha1/trainingruntime.go index 28c6688984..6b322fb5d0 100644 --- a/pkg/client/listers/kubeflow.org/v2alpha1/trainingruntime.go +++ b/pkg/client/listers/kubeflow.org/v2alpha1/trainingruntime.go @@ -18,8 +18,8 @@ package v2alpha1 import ( v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type TrainingRuntimeLister interface { // trainingRuntimeLister implements the TrainingRuntimeLister interface. type trainingRuntimeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2alpha1.TrainingRuntime] } // NewTrainingRuntimeLister returns a new TrainingRuntimeLister. func NewTrainingRuntimeLister(indexer cache.Indexer) TrainingRuntimeLister { - return &trainingRuntimeLister{indexer: indexer} -} - -// List lists all TrainingRuntimes in the indexer. -func (s *trainingRuntimeLister) List(selector labels.Selector) (ret []*v2alpha1.TrainingRuntime, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2alpha1.TrainingRuntime)) - }) - return ret, err + return &trainingRuntimeLister{listers.New[*v2alpha1.TrainingRuntime](indexer, v2alpha1.Resource("trainingruntime"))} } // TrainingRuntimes returns an object that can list and get TrainingRuntimes. func (s *trainingRuntimeLister) TrainingRuntimes(namespace string) TrainingRuntimeNamespaceLister { - return trainingRuntimeNamespaceLister{indexer: s.indexer, namespace: namespace} + return trainingRuntimeNamespaceLister{listers.NewNamespaced[*v2alpha1.TrainingRuntime](s.ResourceIndexer, namespace)} } // TrainingRuntimeNamespaceLister helps list and get TrainingRuntimes. @@ -72,26 +64,5 @@ type TrainingRuntimeNamespaceLister interface { // trainingRuntimeNamespaceLister implements the TrainingRuntimeNamespaceLister // interface. type trainingRuntimeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TrainingRuntimes in the indexer for a given namespace. -func (s trainingRuntimeNamespaceLister) List(selector labels.Selector) (ret []*v2alpha1.TrainingRuntime, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v2alpha1.TrainingRuntime)) - }) - return ret, err -} - -// Get retrieves the TrainingRuntime from the indexer for a given namespace and name. -func (s trainingRuntimeNamespaceLister) Get(name string) (*v2alpha1.TrainingRuntime, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2alpha1.Resource("trainingruntime"), name) - } - return obj.(*v2alpha1.TrainingRuntime), nil + listers.ResourceIndexer[*v2alpha1.TrainingRuntime] } diff --git a/pkg/client/listers/kubeflow.org/v2alpha1/trainjob.go b/pkg/client/listers/kubeflow.org/v2alpha1/trainjob.go index 76d12c73ba..7d897cf1aa 100644 --- a/pkg/client/listers/kubeflow.org/v2alpha1/trainjob.go +++ b/pkg/client/listers/kubeflow.org/v2alpha1/trainjob.go @@ -18,8 +18,8 @@ package v2alpha1 import ( v2alpha1 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -36,25 +36,17 @@ type TrainJobLister interface { // trainJobLister implements the TrainJobLister interface. type trainJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2alpha1.TrainJob] } // NewTrainJobLister returns a new TrainJobLister. func NewTrainJobLister(indexer cache.Indexer) TrainJobLister { - return &trainJobLister{indexer: indexer} -} - -// List lists all TrainJobs in the indexer. -func (s *trainJobLister) List(selector labels.Selector) (ret []*v2alpha1.TrainJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2alpha1.TrainJob)) - }) - return ret, err + return &trainJobLister{listers.New[*v2alpha1.TrainJob](indexer, v2alpha1.Resource("trainjob"))} } // TrainJobs returns an object that can list and get TrainJobs. func (s *trainJobLister) TrainJobs(namespace string) TrainJobNamespaceLister { - return trainJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return trainJobNamespaceLister{listers.NewNamespaced[*v2alpha1.TrainJob](s.ResourceIndexer, namespace)} } // TrainJobNamespaceLister helps list and get TrainJobs. @@ -72,26 +64,5 @@ type TrainJobNamespaceLister interface { // trainJobNamespaceLister implements the TrainJobNamespaceLister // interface. type trainJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TrainJobs in the indexer for a given namespace. -func (s trainJobNamespaceLister) List(selector labels.Selector) (ret []*v2alpha1.TrainJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v2alpha1.TrainJob)) - }) - return ret, err -} - -// Get retrieves the TrainJob from the indexer for a given namespace and name. -func (s trainJobNamespaceLister) Get(name string) (*v2alpha1.TrainJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2alpha1.Resource("trainjob"), name) - } - return obj.(*v2alpha1.TrainJob), nil + listers.ResourceIndexer[*v2alpha1.TrainJob] } diff --git a/pkg/common/util/fake_workqueue.go b/pkg/common/util/fake_workqueue.go index 44281344c9..5102b1d571 100644 --- a/pkg/common/util/fake_workqueue.go +++ b/pkg/common/util/fake_workqueue.go @@ -17,37 +17,40 @@ package util import "time" // FakeWorkQueue implements RateLimitingInterface but actually does nothing. -type FakeWorkQueue struct{} +type FakeWorkQueue[T any] struct{} // Add WorkQueue Add method -func (f *FakeWorkQueue) Add(item interface{}) {} +func (f *FakeWorkQueue[T]) Add(item T) {} // Len WorkQueue Len method -func (f *FakeWorkQueue) Len() int { return 0 } +func (f *FakeWorkQueue[T]) Len() int { return 0 } // Get WorkQueue Get method -func (f *FakeWorkQueue) Get() (item interface{}, shutdown bool) { return nil, false } +func (f *FakeWorkQueue[T]) Get() (item T, shutdown bool) { + var empty T + return empty, false +} // Done WorkQueue Done method -func (f *FakeWorkQueue) Done(item interface{}) {} +func (f *FakeWorkQueue[T]) Done(item T) {} // ShutDown WorkQueue ShutDown method -func (f *FakeWorkQueue) ShutDown() {} +func (f *FakeWorkQueue[T]) ShutDown() {} -// ShutDown WorkQueue ShutDownWithDrain method -func (f *FakeWorkQueue) ShutDownWithDrain() {} +// ShutDownWithDrain WorkQueue ShutDownWithDrain method +func (f *FakeWorkQueue[T]) ShutDownWithDrain() {} // ShuttingDown WorkQueue ShuttingDown method -func (f *FakeWorkQueue) ShuttingDown() bool { return true } +func (f *FakeWorkQueue[T]) ShuttingDown() bool { return true } // AddAfter WorkQueue AddAfter method -func (f *FakeWorkQueue) AddAfter(item interface{}, duration time.Duration) {} +func (f *FakeWorkQueue[T]) AddAfter(item T, duration time.Duration) {} // AddRateLimited WorkQueue AddRateLimited method -func (f *FakeWorkQueue) AddRateLimited(item interface{}) {} +func (f *FakeWorkQueue[T]) AddRateLimited(item T) {} // Forget WorkQueue Forget method -func (f *FakeWorkQueue) Forget(item interface{}) {} +func (f *FakeWorkQueue[T]) Forget(item T) {} // NumRequeues WorkQueue NumRequeues method -func (f *FakeWorkQueue) NumRequeues(item interface{}) int { return 0 } +func (f *FakeWorkQueue[T]) NumRequeues(item T) int { return 0 } diff --git a/pkg/controller.v1/common/job_controller.go b/pkg/controller.v1/common/job_controller.go index b141c22c55..a4ca4a5815 100644 --- a/pkg/controller.v1/common/job_controller.go +++ b/pkg/controller.v1/common/job_controller.go @@ -147,7 +147,7 @@ type JobController struct { // means we can ensure we only process a fixed amount of resources at a // time, and makes it easy to ensure we are never processing the same item // simultaneously in two different workers. - WorkQueue workqueue.RateLimitingInterface + WorkQueue workqueue.TypedRateLimitingInterface[string] // Recorder is an event recorder for recording Event resources to the // Kubernetes API. @@ -208,8 +208,9 @@ func NewJobController( ServiceControl: serviceControl, KubeClientSet: kubeClientSet, Expectations: expectation.NewControllerExpectations(), - WorkQueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), workQueueName), - Recorder: recorder, + WorkQueue: workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[string](), + workqueue.TypedRateLimitingQueueConfig[string]{Name: workQueueName}), + Recorder: recorder, } setupPodGroup(&jc) diff --git a/pkg/controller.v1/jax/jaxjob_controller.go b/pkg/controller.v1/jax/jaxjob_controller.go index 1b58a51dfa..5334e1eba6 100644 --- a/pkg/controller.v1/jax/jaxjob_controller.go +++ b/pkg/controller.v1/jax/jaxjob_controller.go @@ -78,7 +78,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched r.JobController = common.JobController{ Controller: r, Expectations: expectation.NewControllerExpectations(), - WorkQueue: &util.FakeWorkQueue{}, + WorkQueue: &util.FakeWorkQueue[string]{}, Recorder: r.recorder, KubeClientSet: kubeClientSet, PriorityClassLister: priorityClassInformer.Lister(), diff --git a/pkg/controller.v1/mpi/mpijob_controller.go b/pkg/controller.v1/mpi/mpijob_controller.go index 70e08d51a5..d1ec0855f8 100644 --- a/pkg/controller.v1/mpi/mpijob_controller.go +++ b/pkg/controller.v1/mpi/mpijob_controller.go @@ -85,7 +85,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched r.JobController = common.JobController{ Controller: r, Expectations: expectation.NewControllerExpectations(), - WorkQueue: &util.FakeWorkQueue{}, + WorkQueue: &util.FakeWorkQueue[string]{}, Recorder: r.recorder, KubeClientSet: kubeClientSet, PriorityClassLister: priorityClassInformer.Lister(), diff --git a/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go b/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go index 2abe36de13..b3aa54c3f4 100644 --- a/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go +++ b/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go @@ -79,7 +79,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched r.JobController = common.JobController{ Controller: r, Expectations: expectation.NewControllerExpectations(), - WorkQueue: &util.FakeWorkQueue{}, + WorkQueue: &util.FakeWorkQueue[string]{}, Recorder: r.recorder, KubeClientSet: kubeClientSet, PriorityClassLister: priorityClassInformer.Lister(), diff --git a/pkg/controller.v1/pytorch/pytorchjob_controller.go b/pkg/controller.v1/pytorch/pytorchjob_controller.go index c7ea8c8e09..764fb696a5 100644 --- a/pkg/controller.v1/pytorch/pytorchjob_controller.go +++ b/pkg/controller.v1/pytorch/pytorchjob_controller.go @@ -79,7 +79,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched r.JobController = common.JobController{ Controller: r, Expectations: expectation.NewControllerExpectations(), - WorkQueue: &util.FakeWorkQueue{}, + WorkQueue: &util.FakeWorkQueue[string]{}, Recorder: r.recorder, KubeClientSet: kubeClientSet, PriorityClassLister: priorityClassInformer.Lister(), diff --git a/pkg/controller.v1/tensorflow/tfjob_controller.go b/pkg/controller.v1/tensorflow/tfjob_controller.go index d285647485..dbaf1c8a72 100644 --- a/pkg/controller.v1/tensorflow/tfjob_controller.go +++ b/pkg/controller.v1/tensorflow/tfjob_controller.go @@ -81,7 +81,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched r.JobController = common.JobController{ Controller: r, Expectations: expectation.NewControllerExpectations(), - WorkQueue: &util.FakeWorkQueue{}, + WorkQueue: &util.FakeWorkQueue[string]{}, Recorder: r.recorder, KubeClientSet: kubeClientSet, PriorityClassLister: priorityClassInformer.Lister(), diff --git a/pkg/controller.v1/xgboost/xgboostjob_controller.go b/pkg/controller.v1/xgboost/xgboostjob_controller.go index 3cd16b86cf..5756b787b8 100644 --- a/pkg/controller.v1/xgboost/xgboostjob_controller.go +++ b/pkg/controller.v1/xgboost/xgboostjob_controller.go @@ -82,7 +82,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched r.JobController = common.JobController{ Controller: r, Expectations: expectation.NewControllerExpectations(), - WorkQueue: &util.FakeWorkQueue{}, + WorkQueue: &util.FakeWorkQueue[string]{}, Recorder: r.recorder, KubeClientSet: kubeClientSet, PriorityClassLister: priorityClassInformer.Lister(), diff --git a/pkg/runtime.v2/core/clustertrainingruntime.go b/pkg/runtime.v2/core/clustertrainingruntime.go index 6f2cb8bac3..d02e4380f9 100644 --- a/pkg/runtime.v2/core/clustertrainingruntime.go +++ b/pkg/runtime.v2/core/clustertrainingruntime.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -46,7 +47,7 @@ var ClusterTrainingRuntimeGroupKind = schema.GroupKind{ Kind: kubeflowv2.ClusterTrainingRuntimeKind, }.String() -func NewClusterTrainingRuntime(context.Context, client.Client, client.FieldIndexer) (runtime.Runtime, error) { +func NewClusterTrainingRuntime(context.Context, client.Client, cache.Cache, client.FieldIndexer) (runtime.Runtime, error) { return &ClusterTrainingRuntime{ TrainingRuntime: trainingRuntimeFactory, }, nil diff --git a/pkg/runtime.v2/core/clustertrainingruntime_test.go b/pkg/runtime.v2/core/clustertrainingruntime_test.go index 050d86a23a..00491981b0 100644 --- a/pkg/runtime.v2/core/clustertrainingruntime_test.go +++ b/pkg/runtime.v2/core/clustertrainingruntime_test.go @@ -25,6 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/cache/informertest" "sigs.k8s.io/controller-runtime/pkg/client" schedulerpluginsv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1" @@ -110,7 +111,7 @@ func TestClusterTrainingRuntimeNewObjects(t *testing.T) { clientBuilder.WithObjects(tc.clusterTrainingRuntime) } - trainingRuntime, err := NewTrainingRuntime(ctx, clientBuilder.Build(), testingutil.AsIndex(clientBuilder)) + trainingRuntime, err := NewTrainingRuntime(ctx, clientBuilder.Build(), &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } @@ -120,7 +121,7 @@ func TestClusterTrainingRuntimeNewObjects(t *testing.T) { t.Fatal("Failed type assertion from Runtime interface to TrainingRuntime") } - clTrainingRuntime, err := NewClusterTrainingRuntime(ctx, clientBuilder.Build(), testingutil.AsIndex(clientBuilder)) + clTrainingRuntime, err := NewClusterTrainingRuntime(ctx, clientBuilder.Build(), &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } diff --git a/pkg/runtime.v2/core/core.go b/pkg/runtime.v2/core/core.go index 4fef47aa4e..b8104bff35 100644 --- a/pkg/runtime.v2/core/core.go +++ b/pkg/runtime.v2/core/core.go @@ -20,19 +20,20 @@ import ( "context" "fmt" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" runtime "github.com/kubeflow/training-operator/pkg/runtime.v2" ) -//+kubebuilder:rbac:groups=kubeflow.org,resources=trainingruntimes,verbs=get;list;watch -//+kubebuilder:rbac:groups=kubeflow.org,resources=clustertrainingruntimes,verbs=get;list;watch +// +kubebuilder:rbac:groups=kubeflow.org,resources=trainingruntimes,verbs=get;list;watch +// +kubebuilder:rbac:groups=kubeflow.org,resources=clustertrainingruntimes,verbs=get;list;watch -func New(ctx context.Context, client client.Client, indexer client.FieldIndexer) (map[string]runtime.Runtime, error) { +func New(ctx context.Context, client client.Client, cache cache.Cache, indexer client.FieldIndexer) (map[string]runtime.Runtime, error) { registry := NewRuntimeRegistry() runtimes := make(map[string]runtime.Runtime, len(registry)) for name, factory := range registry { - r, err := factory(ctx, client, indexer) + r, err := factory(ctx, client, cache, indexer) if err != nil { return nil, fmt.Errorf("initializing runtime %q: %w", name, err) } diff --git a/pkg/runtime.v2/core/registry.go b/pkg/runtime.v2/core/registry.go index 9e912a481d..7f6bed2e61 100644 --- a/pkg/runtime.v2/core/registry.go +++ b/pkg/runtime.v2/core/registry.go @@ -19,12 +19,13 @@ package core import ( "context" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" runtime "github.com/kubeflow/training-operator/pkg/runtime.v2" ) -type Registry map[string]func(ctx context.Context, client client.Client, indexer client.FieldIndexer) (runtime.Runtime, error) +type Registry map[string]func(ctx context.Context, client client.Client, cache cache.Cache, indexer client.FieldIndexer) (runtime.Runtime, error) func NewRuntimeRegistry() Registry { return Registry{ diff --git a/pkg/runtime.v2/core/trainingruntime.go b/pkg/runtime.v2/core/trainingruntime.go index 23a859a128..ce8f9b02d9 100644 --- a/pkg/runtime.v2/core/trainingruntime.go +++ b/pkg/runtime.v2/core/trainingruntime.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" jobsetv1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2" @@ -53,14 +54,14 @@ var _ runtime.Runtime = (*TrainingRuntime)(nil) var trainingRuntimeFactory *TrainingRuntime -func NewTrainingRuntime(ctx context.Context, c client.Client, indexer client.FieldIndexer) (runtime.Runtime, error) { +func NewTrainingRuntime(ctx context.Context, c client.Client, cache cache.Cache, indexer client.FieldIndexer) (runtime.Runtime, error) { if err := indexer.IndexField(ctx, &kubeflowv2.TrainJob{}, idxer.TrainJobRuntimeRefKey, idxer.IndexTrainJobTrainingRuntime); err != nil { return nil, fmt.Errorf("setting index on TrainingRuntime for TrainJob: %w", err) } if err := indexer.IndexField(ctx, &kubeflowv2.TrainJob{}, idxer.TrainJobClusterRuntimeRefKey, idxer.IndexTrainJobClusterTrainingRuntime); err != nil { return nil, fmt.Errorf("setting index on ClusterTrainingRuntime for TrainJob: %w", err) } - fwk, err := fwkcore.New(ctx, c, fwkplugins.NewRegistry(), indexer) + fwk, err := fwkcore.New(ctx, c, fwkplugins.NewRegistry(), cache, indexer) if err != nil { return nil, err } diff --git a/pkg/runtime.v2/core/trainingruntime_test.go b/pkg/runtime.v2/core/trainingruntime_test.go index 2a11716cd3..bdb3cb2858 100644 --- a/pkg/runtime.v2/core/trainingruntime_test.go +++ b/pkg/runtime.v2/core/trainingruntime_test.go @@ -26,6 +26,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/cache/informertest" "sigs.k8s.io/controller-runtime/pkg/client" schedulerpluginsv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1" @@ -432,7 +433,7 @@ func TestTrainingRuntimeNewObjects(t *testing.T) { clientBuilder.WithObjects(tc.trainingRuntime) } - trainingRuntime, err := NewTrainingRuntime(ctx, clientBuilder.Build(), testingutil.AsIndex(clientBuilder)) + trainingRuntime, err := NewTrainingRuntime(ctx, clientBuilder.Build(), &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } diff --git a/pkg/runtime.v2/framework/core/framework.go b/pkg/runtime.v2/framework/core/framework.go index e2ecfdca03..ae76fb40a8 100644 --- a/pkg/runtime.v2/framework/core/framework.go +++ b/pkg/runtime.v2/framework/core/framework.go @@ -22,6 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -44,14 +45,14 @@ type Framework struct { terminalConditionPlugins []framework.TerminalConditionPlugin } -func New(ctx context.Context, c client.Client, r fwkplugins.Registry, indexer client.FieldIndexer) (*Framework, error) { +func New(ctx context.Context, c client.Client, r fwkplugins.Registry, cache cache.Cache, indexer client.FieldIndexer) (*Framework, error) { f := &Framework{ registry: r, } plugins := make(map[string]framework.Plugin, len(r)) for name, factory := range r { - plugin, err := factory(ctx, c, indexer) + plugin, err := factory(ctx, c, cache, indexer) if err != nil { return nil, err } diff --git a/pkg/runtime.v2/framework/core/framework_test.go b/pkg/runtime.v2/framework/core/framework_test.go index 223603398a..b73f592642 100644 --- a/pkg/runtime.v2/framework/core/framework_test.go +++ b/pkg/runtime.v2/framework/core/framework_test.go @@ -29,6 +29,8 @@ import ( apiruntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/cache/informertest" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" jobsetv1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2" @@ -140,7 +142,7 @@ func TestNew(t *testing.T) { }) } clientBuilder := testingutil.NewClientBuilder() - fwk, err := New(ctx, clientBuilder.Build(), tc.registry, testingutil.AsIndex(clientBuilder)) + fwk, err := New(ctx, clientBuilder.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if diff := cmp.Diff(tc.wantError, err, cmpopts.EquateErrors()); len(diff) != 0 { t.Errorf("Unexpected errors (-want,+got):\n%s", diff) } @@ -258,7 +260,7 @@ func TestRunEnforceMLPolicyPlugins(t *testing.T) { t.Cleanup(cancel) clientBuilder := testingutil.NewClientBuilder() - fwk, err := New(ctx, clientBuilder.Build(), tc.registry, testingutil.AsIndex(clientBuilder)) + fwk, err := New(ctx, clientBuilder.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } @@ -325,7 +327,7 @@ func TestRunEnforcePodGroupPolicyPlugins(t *testing.T) { t.Cleanup(cancel) clientBuilder := testingutil.NewClientBuilder() - fwk, err := New(ctx, clientBuilder.Build(), tc.registry, testingutil.AsIndex(clientBuilder)) + fwk, err := New(ctx, clientBuilder.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } @@ -365,7 +367,7 @@ func TestRunCustomValidationPlugins(t *testing.T) { t.Cleanup(cancel) clientBuildr := testingutil.NewClientBuilder() - fwk, err := New(ctx, clientBuildr.Build(), tc.registry, testingutil.AsIndex(clientBuildr)) + fwk, err := New(ctx, clientBuildr.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuildr)) if err != nil { t.Fatal(err) } @@ -498,7 +500,7 @@ func TestRunComponentBuilderPlugins(t *testing.T) { t.Cleanup(cancel) clientBuilder := testingutil.NewClientBuilder() - fwk, err := New(ctx, clientBuilder.Build(), tc.registry, testingutil.AsIndex(clientBuilder)) + fwk, err := New(ctx, clientBuilder.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } @@ -549,7 +551,7 @@ func TestWatchExtensionPlugins(t *testing.T) { t.Cleanup(cancel) clientBuilder := testingutil.NewClientBuilder() - fwk, err := New(ctx, clientBuilder.Build(), tc.registry, testingutil.AsIndex(clientBuilder)) + fwk, err := New(ctx, clientBuilder.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } @@ -565,7 +567,7 @@ type fakeTerminalConditionPlugin struct{} var _ framework.TerminalConditionPlugin = (*fakeTerminalConditionPlugin)(nil) -func newFakeTerminalConditionPlugin(context.Context, client.Client, client.FieldIndexer) (framework.Plugin, error) { +func newFakeTerminalConditionPlugin(context.Context, client.Client, cache.Cache, client.FieldIndexer) (framework.Plugin, error) { return &fakeTerminalConditionPlugin{}, nil } @@ -651,7 +653,7 @@ func TestTerminalConditionPlugins(t *testing.T) { if tc.jobSet != nil { clientBuilder = clientBuilder.WithObjects(tc.jobSet) } - fwk, err := New(ctx, clientBuilder.Build(), tc.registry, testingutil.AsIndex(clientBuilder)) + fwk, err := New(ctx, clientBuilder.Build(), tc.registry, &informertest.FakeInformers{}, testingutil.AsIndex(clientBuilder)) if err != nil { t.Fatal(err) } diff --git a/pkg/runtime.v2/framework/plugins/coscheduling/coscheduling.go b/pkg/runtime.v2/framework/plugins/coscheduling/coscheduling.go index 9f21fe56dc..26f9de926d 100644 --- a/pkg/runtime.v2/framework/plugins/coscheduling/coscheduling.go +++ b/pkg/runtime.v2/framework/plugins/coscheduling/coscheduling.go @@ -36,10 +36,13 @@ import ( "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/source" schedulerpluginsv1alpha1 "sigs.k8s.io/scheduler-plugins/apis/scheduling/v1alpha1" kubeflowv2 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" @@ -50,6 +53,7 @@ import ( ) type CoScheduling struct { + cache cache.Cache client client.Client restMapper meta.RESTMapper scheme *apiruntime.Scheme @@ -68,7 +72,7 @@ const Name = "CoScheduling" // +kubebuilder:rbac:groups=scheduling.x-k8s.io,resources=podgroups,verbs=get;list;watch;create -func New(ctx context.Context, c client.Client, indexer client.FieldIndexer) (framework.Plugin, error) { +func New(ctx context.Context, c client.Client, cache cache.Cache, indexer client.FieldIndexer) (framework.Plugin, error) { if err := indexer.IndexField(ctx, &kubeflowv2.TrainingRuntime{}, TrainingRuntimeContainerRuntimeClassKey, IndexTrainingRuntimeContainerRuntimeClass); err != nil { return nil, fmt.Errorf("%w: %w", ErrorCanNotSetupTrainingRuntimeRuntimeClassIndexer, err) @@ -78,6 +82,7 @@ func New(ctx context.Context, c client.Client, indexer client.FieldIndexer) (fra return nil, fmt.Errorf("%w: %w", ErrorCanNotSetupClusterTrainingRuntimeRuntimeClassIndexer, err) } return &CoScheduling{ + cache: cache, client: c, restMapper: c.RESTMapper(), scheme: c.Scheme(), @@ -156,49 +161,36 @@ type PodGroupRuntimeClassHandler struct { client client.Client } -var _ handler.EventHandler = (*PodGroupRuntimeClassHandler)(nil) +var _ handler.TypedEventHandler[*nodev1.RuntimeClass, reconcile.Request] = (*PodGroupRuntimeClassHandler)(nil) -func (h *PodGroupRuntimeClassHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) { - containerRuntimeClass, ok := e.Object.(*nodev1.RuntimeClass) - if !ok { - return - } +func (h *PodGroupRuntimeClassHandler) Create(ctx context.Context, e event.TypedCreateEvent[*nodev1.RuntimeClass], q workqueue.TypedRateLimitingInterface[reconcile.Request]) { + containerRuntimeClass := e.Object log := ctrl.LoggerFrom(ctx).WithValues("runtimeClass", klog.KObj(containerRuntimeClass)) if err := h.queueSuspendedTrainJobs(ctx, containerRuntimeClass, q); err != nil { log.Error(err, "could not queue suspended TrainJob to reconcile queue") } } -func (h *PodGroupRuntimeClassHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) { - _, ok := e.ObjectOld.(*nodev1.RuntimeClass) - if !ok { - return - } - newContainerRuntimeClass, ok := e.ObjectNew.(*nodev1.RuntimeClass) - if !ok { - return - } +func (h *PodGroupRuntimeClassHandler) Update(ctx context.Context, e event.TypedUpdateEvent[*nodev1.RuntimeClass], q workqueue.TypedRateLimitingInterface[reconcile.Request]) { + newContainerRuntimeClass := e.ObjectNew log := ctrl.LoggerFrom(ctx).WithValues("runtimeClass", klog.KObj(newContainerRuntimeClass)) if err := h.queueSuspendedTrainJobs(ctx, newContainerRuntimeClass, q); err != nil { log.Error(err, "could not queue suspended TrainJob to reconcile queue") } } -func (h *PodGroupRuntimeClassHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) { - containerRuntimeClass, ok := e.Object.(*nodev1.RuntimeClass) - if !ok { - return - } +func (h *PodGroupRuntimeClassHandler) Delete(ctx context.Context, e event.TypedDeleteEvent[*nodev1.RuntimeClass], q workqueue.TypedRateLimitingInterface[reconcile.Request]) { + containerRuntimeClass := e.Object log := ctrl.LoggerFrom(ctx).WithValues("runtimeClass", klog.KObj(containerRuntimeClass)) if err := h.queueSuspendedTrainJobs(ctx, containerRuntimeClass, q); err != nil { log.Error(err, "could not queue suspended TrainJob to reconcile queue") } } -func (h *PodGroupRuntimeClassHandler) Generic(context.Context, event.GenericEvent, workqueue.RateLimitingInterface) { +func (h *PodGroupRuntimeClassHandler) Generic(context.Context, event.TypedGenericEvent[*nodev1.RuntimeClass], workqueue.TypedRateLimitingInterface[reconcile.Request]) { } -func (h *PodGroupRuntimeClassHandler) queueSuspendedTrainJobs(ctx context.Context, runtimeClass *nodev1.RuntimeClass, q workqueue.RateLimitingInterface) error { +func (h *PodGroupRuntimeClassHandler) queueSuspendedTrainJobs(ctx context.Context, runtimeClass *nodev1.RuntimeClass, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error { var trainingRuntimes kubeflowv2.TrainingRuntimeList if err := h.client.List(ctx, &trainingRuntimes, client.MatchingFields{TrainingRuntimeContainerRuntimeClassKey: runtimeClass.Name}); err != nil { return err @@ -230,7 +222,7 @@ func (h *PodGroupRuntimeClassHandler) queueSuspendedTrainJobs(ctx context.Contex }) for _, trainJob := range trainJobs { if ptr.Deref(trainJob.Spec.Suspend, false) { - q.Add(client.ObjectKeyFromObject(&trainJob)) + q.Add(reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&trainJob)}) } } return nil @@ -240,56 +232,43 @@ type PodGroupLimitRangeHandler struct { client client.Client } -var _ handler.EventHandler = (*PodGroupLimitRangeHandler)(nil) +var _ handler.TypedEventHandler[*corev1.LimitRange, reconcile.Request] = (*PodGroupLimitRangeHandler)(nil) -func (h *PodGroupLimitRangeHandler) Create(ctx context.Context, e event.CreateEvent, q workqueue.RateLimitingInterface) { - limitRange, ok := e.Object.(*corev1.LimitRange) - if !ok { - return - } +func (h *PodGroupLimitRangeHandler) Create(ctx context.Context, e event.TypedCreateEvent[*corev1.LimitRange], q workqueue.TypedRateLimitingInterface[reconcile.Request]) { + limitRange := e.Object log := ctrl.LoggerFrom(ctx).WithValues("limitRange", klog.KObj(limitRange)) if err := h.queueSuspendedTrainJob(ctx, limitRange.Namespace, q); err != nil { log.Error(err, "could not queue suspended TrainJob to reconcile queue") } } -func (h *PodGroupLimitRangeHandler) Update(ctx context.Context, e event.UpdateEvent, q workqueue.RateLimitingInterface) { - _, ok := e.ObjectOld.(*corev1.LimitRange) - if !ok { - return - } - newLimitRange, ok := e.ObjectNew.(*corev1.LimitRange) - if !ok { - return - } +func (h *PodGroupLimitRangeHandler) Update(ctx context.Context, e event.TypedUpdateEvent[*corev1.LimitRange], q workqueue.TypedRateLimitingInterface[reconcile.Request]) { + newLimitRange := e.ObjectNew log := ctrl.LoggerFrom(ctx).WithValues("limitRange", klog.KObj(newLimitRange)) if err := h.queueSuspendedTrainJob(ctx, newLimitRange.Namespace, q); err != nil { log.Error(err, "could not queue suspended TrainJob to reconcile queue") } } -func (h *PodGroupLimitRangeHandler) Delete(ctx context.Context, e event.DeleteEvent, q workqueue.RateLimitingInterface) { - limitRange, ok := e.Object.(*corev1.LimitRange) - if !ok { - return - } +func (h *PodGroupLimitRangeHandler) Delete(ctx context.Context, e event.TypedDeleteEvent[*corev1.LimitRange], q workqueue.TypedRateLimitingInterface[reconcile.Request]) { + limitRange := e.Object log := ctrl.LoggerFrom(ctx).WithValues("limitRange", klog.KObj(limitRange)) if err := h.queueSuspendedTrainJob(ctx, limitRange.Namespace, q); err != nil { log.Error(err, "could not queue suspended TrainJob to reconcile queue") } } -func (h *PodGroupLimitRangeHandler) Generic(context.Context, event.GenericEvent, workqueue.RateLimitingInterface) { +func (h *PodGroupLimitRangeHandler) Generic(context.Context, event.TypedGenericEvent[*corev1.LimitRange], workqueue.TypedRateLimitingInterface[reconcile.Request]) { } -func (h *PodGroupLimitRangeHandler) queueSuspendedTrainJob(ctx context.Context, ns string, q workqueue.RateLimitingInterface) error { +func (h *PodGroupLimitRangeHandler) queueSuspendedTrainJob(ctx context.Context, ns string, q workqueue.TypedRateLimitingInterface[reconcile.Request]) error { var trainJobs kubeflowv2.TrainJobList if err := h.client.List(ctx, &trainJobs, client.InNamespace(ns)); err != nil { return err } for _, trainJob := range trainJobs.Items { if ptr.Deref(trainJob.Spec.Suspend, false) { - q.Add(client.ObjectKeyFromObject(&trainJob)) + q.Add(reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&trainJob)}) } } return nil @@ -303,18 +282,18 @@ func (c *CoScheduling) ReconcilerBuilders() []runtime.ReconcilerBuilder { return nil } return []runtime.ReconcilerBuilder{ - func(b *builder.Builder, c client.Client) *builder.Builder { + func(b *builder.Builder, cl client.Client) *builder.Builder { return b.Owns(&schedulerpluginsv1alpha1.PodGroup{}) }, - func(b *builder.Builder, c client.Client) *builder.Builder { - return b.Watches(&corev1.LimitRange{}, &PodGroupLimitRangeHandler{ - client: c, - }) + func(b *builder.Builder, cl client.Client) *builder.Builder { + return b.WatchesRawSource(source.TypedKind[*corev1.LimitRange, reconcile.Request](c.cache, &corev1.LimitRange{}, &PodGroupLimitRangeHandler{ + client: cl, + })) }, - func(b *builder.Builder, c client.Client) *builder.Builder { - return b.Watches(&nodev1.RuntimeClass{}, &PodGroupRuntimeClassHandler{ - client: c, - }) + func(b *builder.Builder, cl client.Client) *builder.Builder { + return b.WatchesRawSource(source.TypedKind[*nodev1.RuntimeClass, reconcile.Request](c.cache, &nodev1.RuntimeClass{}, &PodGroupRuntimeClassHandler{ + client: cl, + })) }, } } diff --git a/pkg/runtime.v2/framework/plugins/jobset/jobset.go b/pkg/runtime.v2/framework/plugins/jobset/jobset.go index f913cd169f..4446df92df 100644 --- a/pkg/runtime.v2/framework/plugins/jobset/jobset.go +++ b/pkg/runtime.v2/framework/plugins/jobset/jobset.go @@ -31,6 +31,7 @@ import ( "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" jobsetv1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2" @@ -54,9 +55,9 @@ var _ framework.TerminalConditionPlugin = (*JobSet)(nil) const Name = constants.JobSetKind -//+kubebuilder:rbac:groups=jobset.x-k8s.io,resources=jobsets,verbs=get;list;watch;create +// +kubebuilder:rbac:groups=jobset.x-k8s.io,resources=jobsets,verbs=get;list;watch;create -func New(ctx context.Context, c client.Client, _ client.FieldIndexer) (framework.Plugin, error) { +func New(ctx context.Context, c client.Client, _ cache.Cache, _ client.FieldIndexer) (framework.Plugin, error) { return &JobSet{ client: c, restMapper: c.RESTMapper(), diff --git a/pkg/runtime.v2/framework/plugins/mpi/mpi.go b/pkg/runtime.v2/framework/plugins/mpi/mpi.go index 26e519222b..994619da5a 100644 --- a/pkg/runtime.v2/framework/plugins/mpi/mpi.go +++ b/pkg/runtime.v2/framework/plugins/mpi/mpi.go @@ -20,6 +20,7 @@ import ( "context" "k8s.io/apimachinery/pkg/util/validation/field" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -37,7 +38,7 @@ var _ framework.CustomValidationPlugin = (*MPI)(nil) const Name = "MPI" -func New(_ context.Context, client client.Client, _ client.FieldIndexer) (framework.Plugin, error) { +func New(_ context.Context, client client.Client, _ cache.Cache, _ client.FieldIndexer) (framework.Plugin, error) { return &MPI{ client: client, }, nil diff --git a/pkg/runtime.v2/framework/plugins/plainml/plainml.go b/pkg/runtime.v2/framework/plugins/plainml/plainml.go index f179b9935e..20aea3b80d 100644 --- a/pkg/runtime.v2/framework/plugins/plainml/plainml.go +++ b/pkg/runtime.v2/framework/plugins/plainml/plainml.go @@ -20,6 +20,7 @@ import ( "context" "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" kubeflowv2 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" @@ -34,7 +35,7 @@ type PlainML struct{} const Name = "PlainML" -func New(context.Context, client.Client, client.FieldIndexer) (framework.Plugin, error) { +func New(context.Context, client.Client, cache.Cache, client.FieldIndexer) (framework.Plugin, error) { return &PlainML{}, nil } diff --git a/pkg/runtime.v2/framework/plugins/registry.go b/pkg/runtime.v2/framework/plugins/registry.go index 37cc663dac..5ad24b3e30 100644 --- a/pkg/runtime.v2/framework/plugins/registry.go +++ b/pkg/runtime.v2/framework/plugins/registry.go @@ -19,6 +19,7 @@ package plugins import ( "context" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kubeflow/training-operator/pkg/runtime.v2/framework" @@ -29,7 +30,7 @@ import ( "github.com/kubeflow/training-operator/pkg/runtime.v2/framework/plugins/torch" ) -type Registry map[string]func(ctx context.Context, client client.Client, indexer client.FieldIndexer) (framework.Plugin, error) +type Registry map[string]func(ctx context.Context, client client.Client, cache cache.Cache, indexer client.FieldIndexer) (framework.Plugin, error) func NewRegistry() Registry { return Registry{ diff --git a/pkg/runtime.v2/framework/plugins/torch/torch.go b/pkg/runtime.v2/framework/plugins/torch/torch.go index 4e9c40585f..b1d56a794e 100644 --- a/pkg/runtime.v2/framework/plugins/torch/torch.go +++ b/pkg/runtime.v2/framework/plugins/torch/torch.go @@ -24,6 +24,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -40,7 +41,7 @@ var _ framework.CustomValidationPlugin = (*Torch)(nil) const Name = "Torch" -func New(context.Context, client.Client, client.FieldIndexer) (framework.Plugin, error) { +func New(context.Context, client.Client, cache.Cache, client.FieldIndexer) (framework.Plugin, error) { return &Torch{}, nil } diff --git a/sdk/python/docs/V1FieldSelectorRequirement.md b/sdk/python/docs/V1FieldSelectorRequirement.md new file mode 100644 index 0000000000..cecf603be6 --- /dev/null +++ b/sdk/python/docs/V1FieldSelectorRequirement.md @@ -0,0 +1,13 @@ +# V1FieldSelectorRequirement + +FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **str** | key is the field selector key that the requirement applies to. | [default to ''] +**operator** | **str** | operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future. | [default to ''] +**values** | **list[str]** | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/python/kubeflow/training/__init__.py b/sdk/python/kubeflow/training/__init__.py index 3d5b7f8a0e..7c8a86aee0 100644 --- a/sdk/python/kubeflow/training/__init__.py +++ b/sdk/python/kubeflow/training/__init__.py @@ -65,6 +65,7 @@ from kubeflow.training.models.v1_condition import V1Condition from kubeflow.training.models.v1_create_options import V1CreateOptions from kubeflow.training.models.v1_delete_options import V1DeleteOptions +from kubeflow.training.models.v1_field_selector_requirement import V1FieldSelectorRequirement from kubeflow.training.models.v1_get_options import V1GetOptions from kubeflow.training.models.v1_group_kind import V1GroupKind from kubeflow.training.models.v1_group_resource import V1GroupResource diff --git a/sdk/python/kubeflow/training/models/__init__.py b/sdk/python/kubeflow/training/models/__init__.py index 31ed727e26..15a2e6a6e3 100644 --- a/sdk/python/kubeflow/training/models/__init__.py +++ b/sdk/python/kubeflow/training/models/__init__.py @@ -55,6 +55,7 @@ from kubeflow.training.models.v1_condition import V1Condition from kubeflow.training.models.v1_create_options import V1CreateOptions from kubeflow.training.models.v1_delete_options import V1DeleteOptions +from kubeflow.training.models.v1_field_selector_requirement import V1FieldSelectorRequirement from kubeflow.training.models.v1_get_options import V1GetOptions from kubeflow.training.models.v1_group_kind import V1GroupKind from kubeflow.training.models.v1_group_resource import V1GroupResource diff --git a/sdk/python/kubeflow/training/models/v1_field_selector_requirement.py b/sdk/python/kubeflow/training/models/v1_field_selector_requirement.py new file mode 100644 index 0000000000..da7741c10b --- /dev/null +++ b/sdk/python/kubeflow/training/models/v1_field_selector_requirement.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Kubeflow Training SDK + + Python SDK for Kubeflow Training # noqa: E501 + + The version of the OpenAPI document: v1.7.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from kubeflow.training.configuration import Configuration + + +class V1FieldSelectorRequirement(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'key': 'str', + 'operator': 'str', + 'values': 'list[str]' + } + + attribute_map = { + 'key': 'key', + 'operator': 'operator', + 'values': 'values' + } + + def __init__(self, key='', operator='', values=None, local_vars_configuration=None): # noqa: E501 + """V1FieldSelectorRequirement - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._key = None + self._operator = None + self._values = None + self.discriminator = None + + self.key = key + self.operator = operator + if values is not None: + self.values = values + + @property + def key(self): + """Gets the key of this V1FieldSelectorRequirement. # noqa: E501 + + key is the field selector key that the requirement applies to. # noqa: E501 + + :return: The key of this V1FieldSelectorRequirement. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this V1FieldSelectorRequirement. + + key is the field selector key that the requirement applies to. # noqa: E501 + + :param key: The key of this V1FieldSelectorRequirement. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and key is None: # noqa: E501 + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def operator(self): + """Gets the operator of this V1FieldSelectorRequirement. # noqa: E501 + + operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future. # noqa: E501 + + :return: The operator of this V1FieldSelectorRequirement. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this V1FieldSelectorRequirement. + + operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future. # noqa: E501 + + :param operator: The operator of this V1FieldSelectorRequirement. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and operator is None: # noqa: E501 + raise ValueError("Invalid value for `operator`, must not be `None`") # noqa: E501 + + self._operator = operator + + @property + def values(self): + """Gets the values of this V1FieldSelectorRequirement. # noqa: E501 + + values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. # noqa: E501 + + :return: The values of this V1FieldSelectorRequirement. # noqa: E501 + :rtype: list[str] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this V1FieldSelectorRequirement. + + values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. # noqa: E501 + + :param values: The values of this V1FieldSelectorRequirement. # noqa: E501 + :type: list[str] + """ + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1FieldSelectorRequirement): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1FieldSelectorRequirement): + return True + + return self.to_dict() != other.to_dict() diff --git a/test/integration/framework/framework.go b/test/integration/framework/framework.go index 832fce1867..9824992d8d 100644 --- a/test/integration/framework/framework.go +++ b/test/integration/framework/framework.go @@ -96,7 +96,7 @@ func (f *Framework) RunManager(cfg *rest.Config) (context.Context, client.Client }) gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "failed to create manager") - runtimes, err := runtimecore.New(ctx, mgr.GetClient(), mgr.GetFieldIndexer()) + runtimes, err := runtimecore.New(ctx, mgr.GetClient(), mgr.GetCache(), mgr.GetFieldIndexer()) gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred()) gomega.ExpectWithOffset(1, runtimes).NotTo(gomega.BeNil())