Compare commits

...

47 Commits

Author SHA1 Message Date
Volcano Bot ab00dac7d4
Merge pull request #181 from mahdikhashan/upgrade-k8-1-33
[feature] Upgrade k8-1-33
2025-06-24 16:08:13 +08:00
mahdikhashan c7afd440e3 Update k8s dependencies version to 1.33
Signed-off-by: mahdikhashan <mahdikhashan1@gmail.com>
2025-06-24 08:38:13 +02:00
Volcano Bot 59e96f6abe
Merge pull request #179 from Monokaix/network-topo
Network Topology API Definition
2025-05-26 17:14:49 +08:00
JesseStutler 462f06aaa3 Add label match example
Signed-off-by: JesseStutler <chenzicong4@huawei.com>
2025-05-22 16:25:07 +08:00
JesseStutler 31e4a0aeb1 Fix the labelSelector capitalization issue and set memberSelector to one of three options
Signed-off-by: JesseStutler <chenzicong4@huawei.com>
2025-05-22 16:24:58 +08:00
ecosysbin 9e72c73ac2 HyperNode supports select Nodes By labels
Signed-off-by: ecosysbin <14729934+ecosysbin@user.noreply.gitee.com>
2025-05-22 16:23:51 +08:00
Monokaix e93154f4aa Change tier type to int and fix CEL
Signed-off-by: Monokaix <changxuzheng@huawei.com>
2025-05-22 16:22:34 +08:00
Monokaix dd1f095ffe export MemberTypeHyperNode field
Signed-off-by: Monokaix <changxuzheng@huawei.com>
2025-05-22 16:22:19 +08:00
Monokaix 5d177ef1f4 Add hyperNode CRD and add networkTopology spec for job
Signed-off-by: Monokaix <changxuzheng@huawei.com>
2025-05-22 16:19:10 +08:00
Volcano Bot 61bafe8772
Merge pull request #168 from 7sunarni/master
Command struct "message" and "reason" both have tag 4
2025-04-23 17:38:21 +08:00
Volcano Bot d6adedc794
Merge pull request #160 from hwdef/cleanup-jobflow
Clean up comments in JobFlowSpec and JobTemplateSpec
2025-04-23 17:37:24 +08:00
Volcano Bot cdfc2bd9f4
Merge pull request #157 from dongjiang1989/add-weight-range
feat: add Queue weight range [1-65535], default 1
2025-04-23 17:36:24 +08:00
Volcano Bot d7de304a73
Merge pull request #170 from Monokaix/master
[Security] Add http server timeout
2025-04-22 20:52:20 +08:00
Monokaix 1b58ecf6b5 Add http server timeout
Signed-off-by: Monokaix <changxuzheng@huawei.com>
2025-04-22 20:48:34 +08:00
7sunarni 5cffcd0439 fix(bus): Command field "message" and "reason" both have tag 4
Signed-off-by: 7sunarni <710720732@qq.com>
2025-04-14 16:47:25 +08:00
Volcano Bot 2d1b261f52
Merge pull request #163 from JesseStutler/czc_dev
Set optional for allocated in queue status
2025-03-26 14:26:04 +08:00
JesseStutler 12895d7afb Set optional for allocated in queue status
Signed-off-by: JesseStutler <chenzicong4@huawei.com>
2025-03-25 14:24:41 +08:00
Volcano Bot ffd8b8db39
Merge pull request #162 from Monokaix/pg
Add default queue for podgroup
2025-03-21 17:47:01 +08:00
Monokaix e39d2f91e6 Add default queue for podgroup
Signed-off-by: Monokaix <changxuzheng@huawei.com>
2025-03-21 11:02:34 +08:00
Volcano Bot 9f6712252c
Merge pull request #158 from dongjiang1989/adapt-volcano-apis-to-k8s-1.32.2
feat: adapt volcano apis to k8s 1.32.2
2025-03-19 17:37:01 +08:00
hwdef 37d459641d Clean up comments in JobFlowSpec and JobTemplateSpec, update field descriptions to improve code readability
Signed-off-by: hwdef <hwdefcom@outlook.com>
2025-03-13 14:37:58 +08:00
dongjiang 5a15527a16
add queue weight range 1-65535, default 1
Signed-off-by: dongjiang <dongjiang1989@126.com>
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
2025-03-10 10:48:37 +08:00
dongjiang f47c0ffcf2
adapt volcano apis to k8s 1.32.2
Signed-off-by: dongjiang <dongjiang1989@126.com>
2025-03-06 13:58:58 +08:00
Volcano Bot 385346e5e4
Merge pull request #149 from zedongh/feat-queue-printcolumn-add-parent
feat: v1beta queue printcolumn gen add QUEUE annotation
2025-02-14 09:35:23 +08:00
Volcano Bot 7f8222e881
Merge pull request #154 from sceneryback/labels_add_minAvailable
add minAvailable anno key
2025-02-11 16:25:20 +08:00
sceneryback 97e5eec1f7 add group-min-member annotation
Signed-off-by: sceneryback <afterbreeze@hotmail.com>
2025-02-10 16:12:45 +08:00
zedongh 0720bfb247 feat: v1beta queue printcolumn gen add QUEUE annotation
Signed-off-by: zedongh <248348907@qq.com>
2025-01-03 23:32:51 +08:00
Volcano Bot bf27f4e986
Merge pull request #146 from dongjiang1989/k8s-v1.31.3
chore: adapt volcano apis to k8s 1.31.3
2024-12-10 09:40:34 +08:00
Volcano Bot 3b1a1018f2
Merge pull request #143 from bibibox/add_action
Add RestartPod action for pod reschedule
2024-12-05 11:41:26 +08:00
dongjiang 37c07e9c0d
adapt volcano apis to k8s 1.31.3
Signed-off-by: dongjiang <dongjiang1989@126.com>
2024-12-04 17:41:53 +08:00
Volcano Bot 1309efc321
Merge pull request #139 from dongjiang1989/optimize-kubebuiler-validation
chore: Optimize kubebuilder validation
2024-11-28 19:49:23 +08:00
dongjiang1989 81d01f9647
optimize kubebuilder validation, just validate the fileds that exposed to users
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2024-11-28 12:01:20 +08:00
Box Zhang ed24a54bdd add RestartPod action for pod reschedule
Signed-off-by: Box Zhang <wszwbsddbk@gmail.com>
2024-11-22 15:33:11 +08:00
Volcano Bot 1f6aff102e
Merge pull request #141 from bibibox/add_events
Remove useless RestartPod Action
2024-11-12 17:04:06 +08:00
Box Zhang 01f8792dff Remove useless RestartPod Action
Signed-off-by: Box Zhang <wszwbsddbk@gmail.com>
2024-11-12 16:44:12 +08:00
Volcano Bot f278b63e6f
Merge pull request #140 from bibibox/add_events
add events and actions for task reschedule
2024-11-12 11:15:05 +08:00
WenBo Zhang b29e1eb72f add events and actions for task deschedule
Signed-off-by: WenBo Zhang <407871927@qq.com>
2024-11-11 10:51:53 +08:00
Volcano Bot bb93758bd5
Merge pull request #137 from vie-serendipity/feat/adapt-1.31
feat: adapt volcano apis to k8s 1.31
2024-10-16 19:10:16 +08:00
vie-serendipity c58bd993a6 fix: use go1.22 instead of 1.23
Signed-off-by: vie-serendipity <2733147505@qq.com>
2024-10-11 10:07:09 +08:00
vie-serendipity 8f84807d2b feat: adapt volcano apis to k8s 1.31
Signed-off-by: vie-serendipity <2733147505@qq.com>
2024-10-11 09:43:55 +08:00
Volcano Bot 36a6adc621
Merge pull request #132 from TaiPark/queue-priority-api
Add priority in queue spec
2024-09-03 11:45:35 +08:00
bufan a12713c37a Add priority in queue spec
Signed-off-by: bufan <bufan@bilibili.com>
2024-09-02 19:49:04 +08:00
Volcano Bot ca8c852c5e
Merge pull request #134 from TaiPark/fix_code_generator
Change the generator script to kube_codegen.sh
2024-08-16 11:02:21 +08:00
bufan 6f5ff42a73 Remove copyright year from boilerplate.go.txt
Signed-off-by: bufan <bufan@bilibili.com>
2024-08-12 21:51:18 +08:00
bufan 8cda32887a Change the generator script from generate-groups.sh and generator-internal-groups.sh to kube_codegen.sh
Signed-off-by: bufan <bufan@bilibili.com>
2024-08-08 11:50:27 +08:00
Volcano Bot 78d912ce09
Merge pull request #128 from belo4ya/retry-count-in-pod-annotations
Added pod annotation key: JobRetryCountKey = volcano.sh/job-retry-count
2024-07-09 16:47:48 +08:00
belo4ya 34e43a8378 added pod annotation key: JobRetryCountKey = volcano.sh/job-retry-count
Feat #127

Signed-off-by: belo4ya <41exey.kov41ev@gmail.com>
2024-07-09 08:02:38 +03:00
174 changed files with 8162 additions and 2445 deletions

99
go.mod
View File

@ -1,71 +1,72 @@
module volcano.sh/apis
go 1.22.0
go 1.24.0
require (
k8s.io/api v0.30.1
k8s.io/apimachinery v0.30.1
k8s.io/apiserver v0.30.1
k8s.io/client-go v0.30.1
k8s.io/code-generator v0.30.1
k8s.io/klog/v2 v2.120.1
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
k8s.io/api v0.33.1
k8s.io/apimachinery v0.33.1
k8s.io/apiserver v0.33.1
k8s.io/client-go v0.33.1
k8s.io/code-generator v0.33.1
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff
sigs.k8s.io/structured-merge-diff/v4 v4.7.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
github.com/prometheus/client_golang v1.22.0 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.64.0 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.14.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.33.0 // indirect
google.golang.org/protobuf v1.36.6 // 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/component-base v0.30.1 // indirect
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
k8s.io/component-base v0.33.1 // indirect
k8s.io/gengo/v2 v2.0.0-20250531010418-b22feca77200 // indirect
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
replace (
k8s.io/api => k8s.io/api v0.30.1
k8s.io/apimachinery => k8s.io/apimachinery v0.30.1
k8s.io/apiserver => k8s.io/apiserver v0.30.1
k8s.io/client-go => k8s.io/client-go v0.30.1
k8s.io/api => k8s.io/api v0.33.1
k8s.io/apimachinery => k8s.io/apimachinery v0.33.1
k8s.io/apiserver => k8s.io/apiserver v0.33.1
k8s.io/client-go => k8s.io/client-go v0.33.1
)

228
go.sum
View File

@ -2,61 +2,54 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU=
github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw=
github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/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/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
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/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
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.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@ -64,121 +57,122 @@ 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.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
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/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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.64.0 h1:pdZeA+g617P7oGv1CzdTzyeShxAGrTBsolKNOLQPGO4=
github.com/prometheus/common v0.64.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.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.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
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.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
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.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
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.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
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.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
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=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
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=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
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.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY=
k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM=
k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U=
k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/apiserver v0.30.1 h1:BEWEe8bzS12nMtDKXzCF5Q5ovp6LjjYkSp8qOPk8LZ8=
k8s.io/apiserver v0.30.1/go.mod h1:i87ZnQ+/PGAmSbD/iEKM68bm1D5reX8fO4Ito4B01mo=
k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q=
k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc=
k8s.io/code-generator v0.30.1 h1:ZsG++q5Vt0ScmKCeLhynUuWgcwFGg1Hl1AGfatqPJBI=
k8s.io/code-generator v0.30.1/go.mod h1:hFgxRsvOUg79mbpbVKfjJvRhVz1qLoe40yZDJ/hwRH4=
k8s.io/component-base v0.30.1 h1:bvAtlPh1UrdaZL20D9+sWxsJljMi0QZ3Lmw+kmZAaxQ=
k8s.io/component-base v0.30.1/go.mod h1:e/X9kDiOebwlI41AvBHuWdqFriSRrX50CdwA9TFaHLI=
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.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
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=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
k8s.io/api v0.33.1 h1:tA6Cf3bHnLIrUK4IqEgb2v++/GYUtqiu9sRVk3iBXyw=
k8s.io/api v0.33.1/go.mod h1:87esjTn9DRSRTD4fWMXamiXxJhpOIREjWOSjsW1kEHw=
k8s.io/apimachinery v0.33.1 h1:mzqXWV8tW9Rw4VeW9rEkqvnxj59k1ezDUl20tFK/oM4=
k8s.io/apimachinery v0.33.1/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
k8s.io/apiserver v0.33.1 h1:yLgLUPDVC6tHbNcw5uE9mo1T6ELhJj7B0geifra3Qdo=
k8s.io/apiserver v0.33.1/go.mod h1:VMbE4ArWYLO01omz+k8hFjAdYfc3GVAYPrhP2tTKccs=
k8s.io/client-go v0.33.1 h1:ZZV/Ks2g92cyxWkRRnfUDsnhNn28eFpt26aGc8KbXF4=
k8s.io/client-go v0.33.1/go.mod h1:JAsUrl1ArO7uRVFWfcj6kOomSlCv+JpvIsp6usAGefA=
k8s.io/code-generator v0.33.1 h1:ZLzIRdMsh3Myfnx9BaooX6iQry29UJjVfVG+BuS+UMw=
k8s.io/code-generator v0.33.1/go.mod h1:HUKT7Ubp6bOgIbbaPIs9lpd2Q02uqkMCMx9/GjDrWpY=
k8s.io/component-base v0.33.1 h1:EoJ0xA+wr77T+G8p6T3l4efT2oNwbqBVKR71E0tBIaI=
k8s.io/component-base v0.33.1/go.mod h1:guT/w/6piyPfTgq7gfvgetyXMIh10zuXA6cRRm3rDuY=
k8s.io/gengo/v2 v2.0.0-20250531010418-b22feca77200 h1:yMLTITd3CsU+qcFo2V7YrpeDeRzWRgi2A/Mx8qh0HWs=
k8s.io/gengo/v2 v2.0.0-20250531010418-b22feca77200/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 h1:jgJW5IePPXLGB8e/1wvd0Ich9QE97RvvF3a8J3fP/Lg=
k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -46,7 +46,7 @@ APIS_PKG="$3"
GROUPS_WITH_VERSIONS="$4"
shift 4
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.30.0
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.33.1
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)"

View File

@ -47,7 +47,7 @@ EXT_APIS_PKG="$4"
GROUPS_WITH_VERSIONS="$5"
shift 5
go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}@v0.30.0
go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}@v0.33.1
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
GOBIN="$(go env GOBIN)"

759
hack/kube_codegen.sh Executable file
View File

@ -0,0 +1,759 @@
#!/usr/bin/env bash
# Copyright 2023 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This presents several functions for packages which want to use kubernetes
# code-generation tools.
# These functions insist that your input IDL (commented go) files be located in
# go packages following the pattern $input_pkg_root/$something_sans_slash/$api_version .
# Those $something_sans_slash will be propagated into the output directory structure.
set -o errexit
set -o nounset
set -o pipefail
KUBE_CODEGEN_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
function kube::codegen::internal::findz() {
# We use `find` rather than `git ls-files` because sometimes external
# projects use this across repos. This is an imperfect wrapper of find,
# but good enough for this script.
find "$@" -print0
}
function kube::codegen::internal::grep() {
# We use `grep` rather than `git grep` because sometimes external projects
# use this across repos.
grep "$@" \
--exclude-dir .git \
--exclude-dir _output \
--exclude-dir vendor
}
# Generate tagged helper code: conversions, deepcopy, and defaults
#
# USAGE: kube::codegen::gen_helpers [FLAGS] <input-dir>
#
# <input-dir>
# The root directory under which to search for Go files which request code to
# be generated. This must be a local path, not a Go package.
#
# See note at the top about package structure below that.
#
# FLAGS:
#
# --boilerplate <string = path_to_kube_codegen_boilerplate>
# An optional override for the header file to insert into generated files.
#
# --extra-peer-dir <string>
# An optional list (this flag may be specified multiple times) of "extra"
# directories to consider during conversion generation.
#
function kube::codegen::gen_helpers() {
local in_dir=""
local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt"
local v="${KUBE_VERBOSE:-0}"
local extra_peers=()
while [ "$#" -gt 0 ]; do
case "$1" in
"--boilerplate")
boilerplate="$2"
shift 2
;;
"--extra-peer-dir")
extra_peers+=("$2")
shift 2
;;
*)
if [[ "$1" =~ ^-- ]]; then
echo "unknown argument: $1" >&2
return 1
fi
if [ -n "$in_dir" ]; then
echo "too many arguments: $1 (already have $in_dir)" >&2
return 1
fi
in_dir="$1"
shift
;;
esac
done
if [ -z "${in_dir}" ]; then
echo "input-dir argument is required" >&2
return 1
fi
(
# To support running this from anywhere, first cd into this directory,
# and then install with forced module mode on and fully qualified name.
cd "${KUBE_CODEGEN_ROOT}"
BINS=(
conversion-gen
deepcopy-gen
defaulter-gen
)
# shellcheck disable=2046 # printf word-splitting is intentional
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
)
# Go installs in $GOBIN if defined, and $GOPATH/bin otherwise
gobin="${GOBIN:-$(go env GOPATH)/bin}"
# Deepcopy
#
local input_pkgs=()
while read -r dir; do
pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
input_pkgs+=("${pkg}")
done < <(
( kube::codegen::internal::grep -l --null \
-e '^\s*//\s*+k8s:deepcopy-gen=' \
-r "${in_dir}" \
--include '*.go' \
|| true \
) | while read -r -d $'\0' F; do dirname "${F}"; done \
| LC_ALL=C sort -u
)
if [ "${#input_pkgs[@]}" != 0 ]; then
echo "Generating deepcopy code for ${#input_pkgs[@]} targets"
kube::codegen::internal::findz \
"${in_dir}" \
-type f \
-name zz_generated.deepcopy.go \
| xargs -0 rm -f
"${gobin}/deepcopy-gen" \
-v "${v}" \
--output-file zz_generated.deepcopy.go \
--go-header-file "${boilerplate}" \
"${input_pkgs[@]}"
fi
# Defaults
#
local input_pkgs=()
while read -r dir; do
pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
input_pkgs+=("${pkg}")
done < <(
( kube::codegen::internal::grep -l --null \
-e '^\s*//\s*+k8s:defaulter-gen=' \
-r "${in_dir}" \
--include '*.go' \
|| true \
) | while read -r -d $'\0' F; do dirname "${F}"; done \
| LC_ALL=C sort -u
)
if [ "${#input_pkgs[@]}" != 0 ]; then
echo "Generating defaulter code for ${#input_pkgs[@]} targets"
kube::codegen::internal::findz \
"${in_dir}" \
-type f \
-name zz_generated.defaults.go \
| xargs -0 rm -f
"${gobin}/defaulter-gen" \
-v "${v}" \
--output-file zz_generated.defaults.go \
--go-header-file "${boilerplate}" \
"${input_pkgs[@]}"
fi
# Conversions
#
local input_pkgs=()
while read -r dir; do
pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
input_pkgs+=("${pkg}")
done < <(
( kube::codegen::internal::grep -l --null \
-e '^\s*//\s*+k8s:conversion-gen=' \
-r "${in_dir}" \
--include '*.go' \
|| true \
) | while read -r -d $'\0' F; do dirname "${F}"; done \
| LC_ALL=C sort -u
)
if [ "${#input_pkgs[@]}" != 0 ]; then
echo "Generating conversion code for ${#input_pkgs[@]} targets"
kube::codegen::internal::findz \
"${in_dir}" \
-type f \
-name zz_generated.conversion.go \
| xargs -0 rm -f
local extra_peer_args=()
for arg in "${extra_peers[@]:+"${extra_peers[@]}"}"; do
extra_peer_args+=("--extra-peer-dirs" "$arg")
done
"${gobin}/conversion-gen" \
-v "${v}" \
--output-file zz_generated.conversion.go \
--go-header-file "${boilerplate}" \
"${extra_peer_args[@]:+"${extra_peer_args[@]}"}" \
"${input_pkgs[@]}"
fi
}
# Generate openapi code
#
# USAGE: kube::codegen::gen_openapi [FLAGS] <input-dir>
#
# <input-dir>
# The root directory under which to search for Go files which request openapi
# to be generated. This must be a local path, not a Go package.
#
# See note at the top about package structure below that.
#
# FLAGS:
#
# --output-dir <string>
# The directory into which to emit code.
#
# --output-pkg <string>
# The Go package path (import path) of the --output-dir.
#
# --extra-pkgs <string>
# An optional list of additional packages to be imported during openapi
# generation. The argument must be Go package syntax, e.g.
# "k8s.io/foo/bar". It may be a single value or a comma-delimited list.
# This flag may be repeated.
#
# --report-filename <string = "/dev/null">
# An optional path at which to write an API violations report. "-" means
# stdout.
#
# --update-report
# If specified, update the report file in place, rather than diffing it.
#
# --boilerplate <string = path_to_kube_codegen_boilerplate>
# An optional override for the header file to insert into generated files.
#
function kube::codegen::gen_openapi() {
local in_dir=""
local out_dir=""
local out_pkg=""
local extra_pkgs=()
local report="/dev/null"
local update_report=""
local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt"
local v="${KUBE_VERBOSE:-0}"
while [ "$#" -gt 0 ]; do
case "$1" in
"--output-dir")
out_dir="$2"
shift 2
;;
"--output-pkg")
out_pkg="$2"
shift 2
;;
"--extra-pkgs")
extra_pkgs+=("$2")
shift 2
;;
"--report-filename")
report="$2"
shift 2
;;
"--update-report")
update_report="true"
shift
;;
"--boilerplate")
boilerplate="$2"
shift 2
;;
*)
if [[ "$1" =~ ^-- ]]; then
echo "unknown argument: $1" >&2
return 1
fi
if [ -n "$in_dir" ]; then
echo "too many arguments: $1 (already have $in_dir)" >&2
return 1
fi
in_dir="$1"
shift
;;
esac
done
if [ -z "${in_dir}" ]; then
echo "input-dir argument is required" >&2
return 1
fi
if [ -z "${out_dir}" ]; then
echo "--output-dir is required" >&2
return 1
fi
if [ -z "${out_pkg}" ]; then
echo "--output-pkg is required" >&2
return 1
fi
local new_report
new_report="$(mktemp -t "$(basename "$0").api_violations.XXXXXX")"
if [ -n "${update_report}" ]; then
new_report="${report}"
fi
(
# To support running this from anywhere, first cd into this directory,
# and then install with forced module mode on and fully qualified name.
cd "${KUBE_CODEGEN_ROOT}"
BINS=(
openapi-gen
)
# shellcheck disable=2046 # printf word-splitting is intentional
GO111MODULE=on go install $(printf "k8s.io/kube-openapi/cmd/%s " "${BINS[@]}")
)
# Go installs in $GOBIN if defined, and $GOPATH/bin otherwise
gobin="${GOBIN:-$(go env GOPATH)/bin}"
local input_pkgs=( "${extra_pkgs[@]:+"${extra_pkgs[@]}"}")
while read -r dir; do
pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
input_pkgs+=("${pkg}")
done < <(
( kube::codegen::internal::grep -l --null \
-e '^\s*//\s*+k8s:openapi-gen=' \
-r "${in_dir}" \
--include '*.go' \
|| true \
) | while read -r -d $'\0' F; do dirname "${F}"; done \
| LC_ALL=C sort -u
)
if [ "${#input_pkgs[@]}" != 0 ]; then
echo "Generating openapi code for ${#input_pkgs[@]} targets"
kube::codegen::internal::findz \
"${in_dir}" \
-type f \
-name zz_generated.openapi.go \
| xargs -0 rm -f
"${gobin}/openapi-gen" \
-v "${v}" \
--output-file zz_generated.openapi.go \
--go-header-file "${boilerplate}" \
--output-dir "${out_dir}" \
--output-pkg "${out_pkg}" \
--report-filename "${new_report}" \
"k8s.io/apimachinery/pkg/apis/meta/v1" \
"k8s.io/apimachinery/pkg/runtime" \
"k8s.io/apimachinery/pkg/version" \
"${input_pkgs[@]}"
fi
touch "${report}" # in case it doesn't exist yet
if ! diff -u "${report}" "${new_report}"; then
echo -e "ERROR:"
echo -e "\tAPI rule check failed for ${report}: new reported violations"
echo -e "\tPlease read api/api-rules/README.md"
return 1
fi
}
# Generate client code
#
# USAGE: kube::codegen::gen_client [FLAGS] <input-dir>
#
# <input-dir>
# The root package under which to search for Go files which request clients
# to be generated. This must be a local path, not a Go package.
#
# See note at the top about package structure below that.
#
# FLAGS:
# --one-input-api <string>
# A specific API (a directory) under the input-dir for which to generate a
# client. If this is not set, clients for all APIs under the input-dir
# will be generated (under the --output-pkg).
#
# --output-dir <string>
# The root directory under which to emit code. Each aspect of client
# generation will make one or more subdirectories.
#
# --output-pkg <string>
# The Go package path (import path) of the --output-dir. Each aspect of
# client generation will make one or more sub-packages.
#
# --boilerplate <string = path_to_kube_codegen_boilerplate>
# An optional override for the header file to insert into generated files.
#
# --clientset-name <string = "clientset">
# An optional override for the leaf name of the generated "clientset" directory.
#
# --versioned-name <string = "versioned">
# An optional override for the leaf name of the generated
# "<clientset>/versioned" directory.
#
# --with-applyconfig
# Enables generation of applyconfiguration files.
#
# --applyconfig-name <string = "applyconfiguration">
# An optional override for the leaf name of the generated "applyconfiguration" directory.
#
# --applyconfig-externals <string = "">
# An optional list of comma separated external apply configurations locations
# in <type-package>.<type-name>:<applyconfiguration-package> form.
#
# --with-watch
# Enables generation of listers and informers for APIs which support WATCH.
#
# --listers-name <string = "listers">
# An optional override for the leaf name of the generated "listers" directory.
#
# --informers-name <string = "informers">
# An optional override for the leaf name of the generated "informers" directory.
#
# --plural-exceptions <string = "">
# An optional list of comma separated plural exception definitions in Type:PluralizedType form.
#
function kube::codegen::gen_client() {
local in_dir=""
local one_input_api=""
local out_dir=""
local out_pkg=""
local clientset_subdir="clientset"
local clientset_versioned_name="versioned"
local applyconfig="false"
local applyconfig_subdir="applyconfiguration"
local applyconfig_external=""
local applyconfig_openapi_schema=""
local watchable="false"
local listers_subdir="listers"
local informers_subdir="informers"
local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt"
local plural_exceptions=""
local v="${KUBE_VERBOSE:-0}"
while [ "$#" -gt 0 ]; do
case "$1" in
"--one-input-api")
one_input_api="/$2"
shift 2
;;
"--output-dir")
out_dir="$2"
shift 2
;;
"--output-pkg")
out_pkg="$2"
shift 2
;;
"--boilerplate")
boilerplate="$2"
shift 2
;;
"--clientset-name")
clientset_subdir="$2"
shift 2
;;
"--versioned-name")
clientset_versioned_name="$2"
shift 2
;;
"--with-applyconfig")
applyconfig="true"
shift
;;
"--applyconfig-name")
applyconfig_subdir="$2"
shift 2
;;
"--applyconfig-externals")
applyconfig_external="$2"
shift 2
;;
"--applyconfig-openapi-schema")
applyconfig_openapi_schema="$2"
shift 2
;;
"--with-watch")
watchable="true"
shift
;;
"--listers-name")
listers_subdir="$2"
shift 2
;;
"--informers-name")
informers_subdir="$2"
shift 2
;;
"--plural-exceptions")
plural_exceptions="$2"
shift 2
;;
*)
if [[ "$1" =~ ^-- ]]; then
echo "unknown argument: $1" >&2
return 1
fi
if [ -n "$in_dir" ]; then
echo "too many arguments: $1 (already have $in_dir)" >&2
return 1
fi
in_dir="$1"
shift
;;
esac
done
if [ -z "${in_dir}" ]; then
echo "input-dir argument is required" >&2
return 1
fi
if [ -z "${out_dir}" ]; then
echo "--output-dir is required" >&2
return 1
fi
if [ -z "${out_pkg}" ]; then
echo "--output-pkg is required" >&2
fi
mkdir -p "${out_dir}"
(
# To support running this from anywhere, first cd into this directory,
# and then install with forced module mode on and fully qualified name.
cd "${KUBE_CODEGEN_ROOT}"
BINS=(
applyconfiguration-gen
client-gen
informer-gen
lister-gen
)
# shellcheck disable=2046 # printf word-splitting is intentional
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
)
# Go installs in $GOBIN if defined, and $GOPATH/bin otherwise
gobin="${GOBIN:-$(go env GOPATH)/bin}"
local group_versions=()
local input_pkgs=()
while read -r dir; do
pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
leaf="$(basename "${dir}")"
if grep -E -q '^v[0-9]+((alpha|beta)[0-9]+)?$' <<< "${leaf}"; then
input_pkgs+=("${pkg}")
dir2="$(dirname "${dir}")"
leaf2="$(basename "${dir2}")"
group_versions+=("${leaf2}/${leaf}")
fi
done < <(
( kube::codegen::internal::grep -l --null \
-e '^\s*//\s*+genclient' \
-r "${in_dir}${one_input_api}" \
--include '*.go' \
|| true \
) | while read -r -d $'\0' F; do dirname "${F}"; done \
| LC_ALL=C sort -u
)
if [ "${#group_versions[@]}" == 0 ]; then
return 0
fi
applyconfig_pkg="" # set this for later use, iff enabled
if [ "${applyconfig}" == "true" ]; then
applyconfig_pkg="${out_pkg}/${applyconfig_subdir}"
echo "Generating applyconfig code for ${#input_pkgs[@]} targets"
( kube::codegen::internal::grep -l --null \
-e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \
-r "${out_dir}/${applyconfig_subdir}" \
--include '*.go' \
|| true \
) | xargs -0 rm -f
"${gobin}/applyconfiguration-gen" \
-v "${v}" \
--go-header-file "${boilerplate}" \
--output-dir "${out_dir}/${applyconfig_subdir}" \
--output-pkg "${applyconfig_pkg}" \
--external-applyconfigurations "${applyconfig_external}" \
--openapi-schema "${applyconfig_openapi_schema}" \
"${input_pkgs[@]}"
fi
echo "Generating client code for ${#group_versions[@]} targets"
( kube::codegen::internal::grep -l --null \
-e '^// Code generated by client-gen. DO NOT EDIT.$' \
-r "${out_dir}/${clientset_subdir}" \
--include '*.go' \
|| true \
) | xargs -0 rm -f
local inputs=()
for arg in "${group_versions[@]}"; do
inputs+=("--input" "$arg")
done
"${gobin}/client-gen" \
-v "${v}" \
--go-header-file "${boilerplate}" \
--output-dir "${out_dir}/${clientset_subdir}" \
--output-pkg "${out_pkg}/${clientset_subdir}" \
--clientset-name "${clientset_versioned_name}" \
--apply-configuration-package "${applyconfig_pkg}" \
--input-base "$(cd "${in_dir}" && pwd -P)" `# must be absolute path or Go import path"` \
--plural-exceptions "${plural_exceptions}" \
"${inputs[@]}"
if [ "${watchable}" == "true" ]; then
echo "Generating lister code for ${#input_pkgs[@]} targets"
( kube::codegen::internal::grep -l --null \
-e '^// Code generated by lister-gen. DO NOT EDIT.$' \
-r "${out_dir}/${listers_subdir}" \
--include '*.go' \
|| true \
) | xargs -0 rm -f
"${gobin}/lister-gen" \
-v "${v}" \
--go-header-file "${boilerplate}" \
--output-dir "${out_dir}/${listers_subdir}" \
--output-pkg "${out_pkg}/${listers_subdir}" \
--plural-exceptions "${plural_exceptions}" \
"${input_pkgs[@]}"
echo "Generating informer code for ${#input_pkgs[@]} targets"
( kube::codegen::internal::grep -l --null \
-e '^// Code generated by informer-gen. DO NOT EDIT.$' \
-r "${out_dir}/${informers_subdir}" \
--include '*.go' \
|| true \
) | xargs -0 rm -f
"${gobin}/informer-gen" \
-v "${v}" \
--go-header-file "${boilerplate}" \
--output-dir "${out_dir}/${informers_subdir}" \
--output-pkg "${out_pkg}/${informers_subdir}" \
--versioned-clientset-package "${out_pkg}/${clientset_subdir}/${clientset_versioned_name}" \
--listers-package "${out_pkg}/${listers_subdir}" \
--plural-exceptions "${plural_exceptions}" \
"${input_pkgs[@]}"
fi
}
# Generate register code
#
# USAGE: kube::codegen::gen_register [FLAGS] <input-dir>
#
# <input-dir>
# The root directory under which to search for Go files which request code to
# be generated. This must be a local path, not a Go package.
#
# See note at the top about package structure below that.
#
# FLAGS:
#
# --boilerplate <string = path_to_kube_codegen_boilerplate>
# An optional override for the header file to insert into generated files.
#
function kube::codegen::gen_register() {
local in_dir=""
local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt"
local v="${KUBE_VERBOSE:-0}"
while [ "$#" -gt 0 ]; do
case "$1" in
"--boilerplate")
boilerplate="$2"
shift 2
;;
*)
if [[ "$1" =~ ^-- ]]; then
echo "unknown argument: $1" >&2
return 1
fi
if [ -n "$in_dir" ]; then
echo "too many arguments: $1 (already have $in_dir)" >&2
return 1
fi
in_dir="$1"
shift
;;
esac
done
if [ -z "${in_dir}" ]; then
echo "input-dir argument is required" >&2
return 1
fi
(
# To support running this from anywhere, first cd into this directory,
# and then install with forced module mode on and fully qualified name.
cd "${KUBE_CODEGEN_ROOT}"
BINS=(
register-gen
)
# shellcheck disable=2046 # printf word-splitting is intentional
GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}")
)
# Go installs in $GOBIN if defined, and $GOPATH/bin otherwise
gobin="${GOBIN:-$(go env GOPATH)/bin}"
# Register
#
local input_pkgs=()
while read -r dir; do
pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)"
input_pkgs+=("${pkg}")
done < <(
( kube::codegen::internal::grep -l --null \
-e '^\s*//\s*+groupName' \
-r "${in_dir}" \
--include '*.go' \
|| true \
) | while read -r -d $'\0' F; do dirname "${F}"; done \
| LC_ALL=C sort -u
)
if [ "${#input_pkgs[@]}" != 0 ]; then
echo "Generating register code for ${#input_pkgs[@]} targets"
kube::codegen::internal::findz \
"${in_dir}" \
-type f \
-name zz_generated.register.go \
| xargs -0 rm -f
"${gobin}/register-gen" \
-v "${v}" \
--output-file zz_generated.register.go \
--go-header-file "${boilerplate}" \
"${input_pkgs[@]}"
fi
}

View File

@ -1,6 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2014 The Kubernetes Authors.
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -20,22 +20,20 @@ set -o pipefail
echo $(dirname "${BASH_SOURCE[0]}")
SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
bash ${SCRIPT_ROOT}/hack/generate-groups.sh "deepcopy,client,informer,lister" \
volcano.sh/apis/pkg/client volcano.sh/apis/pkg/apis \
"batch:v1alpha1 bus:v1alpha1 scheduling:v1beta1 nodeinfo:v1alpha1 flow:v1alpha1" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
source "${SCRIPT_ROOT}/hack/kube_codegen.sh"
echo "--------------------"
THIS_PKG="volcano.sh/apis"
bash ${SCRIPT_ROOT}/hack/generate-internal-groups.sh "deepcopy,conversion,openapi" \
volcano.sh/apis/pkg/apis/ volcano.sh/apis/pkg/apis volcano.sh/apis/pkg/apis \
"batch:v1alpha1 scheduling:v1beta1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
kube::codegen::gen_helpers \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}/pkg/apis"
kube::codegen::gen_client \
--with-watch \
--with-applyconfig \
--output-dir "${SCRIPT_ROOT}/pkg/client" \
--output-pkg "${THIS_PKG}/pkg/client" \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
"${SCRIPT_ROOT}/pkg/apis"

View File

@ -87,6 +87,7 @@ type JobSpec struct {
// Specifies the maximum number of retries before marking this Job failed.
// Defaults to 3.
// +kubebuilder:default:=3
// +optional
MaxRetry int32 `json:"maxRetry,omitempty" protobuf:"bytes,9,opt,name=maxRetry"`
@ -107,6 +108,35 @@ type JobSpec struct {
// +kubebuilder:validation:Minimum=1
// +optional
MinSuccess *int32 `json:"minSuccess,omitempty" protobuf:"varint,12,opt,name=minSuccess"`
// NetworkTopology defines the NetworkTopology config, this field works in conjunction with network topology feature and hyperNode CRD.
// +optional
NetworkTopology *NetworkTopologySpec `json:"networkTopology,omitempty" protobuf:"bytes,13,opt,name=networkTopology"`
}
// NetworkTopologyMode represents the networkTopology mode, valid values are "hard" and "soft".
// +kubebuilder:validation:Enum=hard;soft
type NetworkTopologyMode string
const (
// HardNetworkTopologyMode represents a strict network topology constraint that jobs must adhere to.
HardNetworkTopologyMode NetworkTopologyMode = "hard"
// SoftNetworkTopologyMode represents a flexible network topology constraint that allows jobs
// to cross network boundaries under certain conditions.
SoftNetworkTopologyMode NetworkTopologyMode = "soft"
)
type NetworkTopologySpec struct {
// Mode specifies the mode of the network topology constrain.
// +kubebuilder:default=hard
// +optional
Mode NetworkTopologyMode `json:"mode,omitempty" protobuf:"bytes,1,opt,name=mode"`
// HighestTierAllowed specifies the highest tier that a job allowed to cross when scheduling.
// +kubebuilder:default=1
// +optional
HighestTierAllowed *int `json:"highestTierAllowed,omitempty" protobuf:"bytes,2,opt,name=highestTierAllowed"`
}
// VolumeSpec defines the specification of Volume, e.g. PVC.
@ -174,6 +204,7 @@ type LifecyclePolicy struct {
Timeout *metav1.Duration `json:"timeout,omitempty" protobuf:"bytes,5,opt,name=timeout"`
}
// +kubebuilder:validation:Enum=none;best-effort;restricted;single-numa-node
type NumaPolicy string
const (

View File

@ -33,6 +33,8 @@ const (
JobVersion = "volcano.sh/job-version"
// JobTypeKey job type key used in labels
JobTypeKey = "volcano.sh/job-type"
// JobRetryCountKey job retry count key used in pod annotation
JobRetryCountKey = "volcano.sh/job-retry-count"
// PodgroupNamePrefix podgroup name prefix
PodgroupNamePrefix = "podgroup-"
// PodTemplateKey type specify a equivalence pod class

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -183,6 +183,11 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) {
*out = new(int32)
**out = **in
}
if in.NetworkTopology != nil {
in, out := &in.NetworkTopology, &out.NetworkTopology
*out = new(NetworkTopologySpec)
(*in).DeepCopyInto(*out)
}
return
}
@ -287,6 +292,27 @@ func (in *LifecyclePolicy) DeepCopy() *LifecyclePolicy {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NetworkTopologySpec) DeepCopyInto(out *NetworkTopologySpec) {
*out = *in
if in.HighestTierAllowed != nil {
in, out := &in.HighestTierAllowed, &out.HighestTierAllowed
*out = new(int)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkTopologySpec.
func (in *NetworkTopologySpec) DeepCopy() *NetworkTopologySpec {
if in == nil {
return nil
}
out := new(NetworkTopologySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TaskSpec) DeepCopyInto(out *TaskSpec) {
*out = *in

View File

@ -28,10 +28,16 @@ const (
// RestartJobAction if this action is set, the whole job will be restarted
RestartJobAction Action = "RestartJob"
// RestartTaskAction if this action is set, only the task will be restarted; default action.
// RestartTaskAction if this action is set, only the task will be restarted
// It means that all pods under the task will be deleted and recreated.
// This action can not work together with job level events, e.g. JobUnschedulable
RestartTaskAction Action = "RestartTask"
// RestartPodAction if this action is set, only the pod will be restarted
// It means that only the pod corresponding to the event will be deleted and recreated.
// This action can just work together with pod level events, e.g. PodFailed
RestartPodAction Action = "RestartPod"
// TerminateJobAction if this action is set, the whole job wil be terminated
// and can not be resumed: all Pod of Job will be evicted, and no Pod will be recreated.
TerminateJobAction Action = "TerminateJob"

View File

@ -14,9 +14,11 @@ type Command struct {
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Action defines the action that will be took to the target object.
// +optional
Action string `json:"action,omitempty" protobuf:"bytes,2,opt,name=action"`
// TargetObject defines the target object of this command.
// +optional
TargetObject *metav1.OwnerReference `json:"target,omitempty" protobuf:"bytes,3,opt,name=target"`
// Unique, one-word, CamelCase reason for this command.
@ -25,7 +27,7 @@ type Command struct {
// Human-readable message indicating details of this command.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1
// Event represent the phase of Job, e.g. pod-failed.
// +kubebuilder:validation:Enum=*;PodPending;PodRunning;PodFailed;PodEvicted;Unknown;TaskCompleted;OutOfSync;CommandIssued;JobUpdated;TaskFailed
type Event string
const (
@ -30,6 +31,12 @@ const (
// PodEvictedEvent is triggered if Pod was deleted
PodEvictedEvent Event = "PodEvicted"
// PodPendingEvent is triggered if Pod was pending
PodPendingEvent Event = "PodPending"
// PodRunningEvent is triggered if Pod was running
PodRunningEvent Event = "PodRunning"
// JobUnknownEvent These below are several events can lead to job 'Unknown'
// 1. Task Unschedulable, this is triggered when part of
// pods can't be scheduled while some are already running in gang-scheduling case.

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -22,95 +22,129 @@ import (
"volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// JobFlowSpec defines the desired state of JobFlow
type JobFlowSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Foo is an example field of JobFlow. Edit jobflow_types.go to remove/update
Flows []Flow `json:"flows,omitempty"`
JobRetainPolicy string `json:"jobRetainPolicy,omitempty"`
// +optional
Flows []Flow `json:"flows,omitempty"`
// +optional
JobRetainPolicy RetainPolicy `json:"jobRetainPolicy,omitempty"`
}
// Flow defines the dependent of jobs
type Flow struct {
Name string `json:"name"`
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name"`
// +optional
DependsOn *DependsOn `json:"dependsOn,omitempty"`
}
type DependsOn struct {
// +optional
Targets []string `json:"targets,omitempty"`
Probe *Probe `json:"probe,omitempty"`
// +optional
Probe *Probe `json:"probe,omitempty"`
}
type Probe struct {
HttpGetList []HttpGet `json:"httpGetList,omitempty"`
TcpSocketList []TcpSocket `json:"tcpSocketList,omitempty"`
// +optional
HttpGetList []HttpGet `json:"httpGetList,omitempty"`
// +optional
TcpSocketList []TcpSocket `json:"tcpSocketList,omitempty"`
// +optional
TaskStatusList []TaskStatus `json:"taskStatusList,omitempty"`
}
type HttpGet struct {
TaskName string `json:"taskName,omitempty"`
Path string `json:"path,omitempty"`
Port int `json:"port,omitempty"`
// +optional
TaskName string `json:"taskName,omitempty"`
// +optional
Path string `json:"path,omitempty"`
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
Port int `json:"port,omitempty"`
// +optional
HTTPHeader v1.HTTPHeader `json:"httpHeader,omitempty"`
}
type TcpSocket struct {
// +optional
TaskName string `json:"taskName,omitempty"`
Port int `json:"port"`
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
// +required
Port int `json:"port"`
}
type TaskStatus struct {
// +optional
TaskName string `json:"taskName,omitempty"`
Phase string `json:"phase,omitempty"`
// +optional
Phase string `json:"phase,omitempty"`
}
// JobFlowStatus defines the observed state of JobFlow
type JobFlowStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
PendingJobs []string `json:"pendingJobs,omitempty"`
RunningJobs []string `json:"runningJobs,omitempty"`
FailedJobs []string `json:"failedJobs,omitempty"`
CompletedJobs []string `json:"completedJobs,omitempty"`
TerminatedJobs []string `json:"terminatedJobs,omitempty"`
UnKnowJobs []string `json:"unKnowJobs,omitempty"`
JobStatusList []JobStatus `json:"jobStatusList,omitempty"`
Conditions map[string]Condition `json:"conditions,omitempty"`
State State `json:"state,omitempty"`
// +optional
PendingJobs []string `json:"pendingJobs,omitempty"`
// +optional
RunningJobs []string `json:"runningJobs,omitempty"`
// +optional
FailedJobs []string `json:"failedJobs,omitempty"`
// +optional
CompletedJobs []string `json:"completedJobs,omitempty"`
// +optional
TerminatedJobs []string `json:"terminatedJobs,omitempty"`
// +optional
UnKnowJobs []string `json:"unKnowJobs,omitempty"`
// +optional
JobStatusList []JobStatus `json:"jobStatusList,omitempty"`
// +optional
Conditions map[string]Condition `json:"conditions,omitempty"`
// +optional
State State `json:"state,omitempty"`
}
type JobStatus struct {
Name string `json:"name,omitempty"`
State v1alpha1.JobPhase `json:"state,omitempty"`
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
RestartCount int32 `json:"restartCount,omitempty"`
// +optional
Name string `json:"name,omitempty"`
// +optional
State v1alpha1.JobPhase `json:"state,omitempty"`
// +optional
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
// +optional
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
// +optional
RestartCount int32 `json:"restartCount,omitempty"`
// +optional
RunningHistories []JobRunningHistory `json:"runningHistories,omitempty"`
}
type JobRunningHistory struct {
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
State v1alpha1.JobPhase `json:"state,omitempty"`
// +optional
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
// +optional
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
// +optional
State v1alpha1.JobPhase `json:"state,omitempty"`
}
type State struct {
// +optional
Phase Phase `json:"phase,omitempty"`
}
type Phase string
// +kubebuilder:validation:Enum=retain;delete
type RetainPolicy string
const (
Retain = "retain"
Delete = "delete"
Retain RetainPolicy = "retain"
Delete RetainPolicy = "delete"
)
type Phase string
const (
Succeed Phase = "Succeed"
Terminating Phase = "Terminating"

View File

@ -21,24 +21,15 @@ import (
"volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// JobTemplateSpec defines the desired state of JobTemplate
type JobTemplateSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Foo is an example field of JobTemplate. Edit jobtemplate_types.go to remove/update
v1alpha1.JobSpec
// JobSpec is the specification of the Job
v1alpha1.JobSpec `json:"jobSpec,omitempty"`
}
// JobTemplateStatus defines the observed state of JobTemplate
type JobTemplateStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
//Describes the Jobs generated from the JobTemplate
// JobDependsOnList is the list of jobs that this job depends on
JobDependsOnList []string `json:"jobDependsOnList,omitempty"`
}

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -44,6 +44,19 @@ import (
schedulerv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
const (
// DefaultReadHeaderTimeout defines the default timeout for reading request headers
DefaultReadHeaderTimeout = 5 * time.Second
// DefaultReadTimeout defines the default timeout for reading the entire request
DefaultReadTimeout = 30 * time.Second
// DefaultWriteTimeout defines the default timeout for writing the response
DefaultWriteTimeout = 60 * time.Second
// DefaultMaxHeaderBytes defines the default max size of request headers in bytes
// 1 MB
DefaultMaxHeaderBytes = 1 << 20
)
// JobKind creates job GroupVersionKind.
// JobKind creates job GroupVersionKind.
var JobKind = vcbatch.SchemeGroupVersion.WithKind("Job")
@ -200,9 +213,12 @@ func StartHealthz(healthzBindAddress, name string, caCertData, certData, certKey
healthz.InstallHandler(pathRecorderMux)
server := &http.Server{
Addr: listener.Addr().String(),
Handler: pathRecorderMux,
MaxHeaderBytes: 1 << 20,
Addr: listener.Addr().String(),
Handler: pathRecorderMux,
MaxHeaderBytes: DefaultMaxHeaderBytes,
ReadHeaderTimeout: DefaultReadHeaderTimeout,
ReadTimeout: DefaultReadTimeout,
WriteTimeout: DefaultWriteTimeout,
}
if len(caCertData) != 0 && len(certData) != 0 && len(certKeyData) != 0 {
certPool := x509.NewCertPool()

View File

@ -25,18 +25,27 @@ import (
// ResourceInfo is the sets about resource capacity and allocatable
type ResourceInfo struct {
// +optional
Allocatable string `json:"allocatable,omitempty"`
Capacity int `json:"capacity,omitempty"`
// +optional
Capacity int `json:"capacity,omitempty"`
}
// CPUInfo is the cpu topology detail
type CPUInfo struct {
// +kubebuilder:validation:Minimum=0
// +optional
NUMANodeID int `json:"numa,omitempty"`
SocketID int `json:"socket,omitempty"`
CoreID int `json:"core,omitempty"`
// +kubebuilder:validation:Minimum=0
// +optional
SocketID int `json:"socket,omitempty"`
// +kubebuilder:validation:Minimum=0
// +optional
CoreID int `json:"core,omitempty"`
}
// PolicyName is the policy name type
// +kubebuilder:validation:Enum=CPUManagerPolicy;TopologyManagerPolicy
type PolicyName string
const (

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -176,6 +176,7 @@ type PodGroupSpec struct {
// Queue defines the queue to allocate resource for PodGroup; if queue does not exist,
// the PodGroup will not be scheduled.
// +kubebuilder:default:="default"
Queue string
// If specified, indicates the PodGroup's priority. "system-node-critical" and
@ -191,6 +192,35 @@ type PodGroupSpec struct {
// if there's not enough resources to start all tasks, the scheduler
// will not start anyone.
MinResources *v1.ResourceList
// NetworkTopology defines the NetworkTopology config, this field works in conjunction with network topology feature and hyperNode CRD.
// +optional
NetworkTopology *NetworkTopologySpec
}
// NetworkTopologyMode represents the networkTopology mode, valid values are "hard" and "soft".
// +kubebuilder:validation:Enum=hard;soft
type NetworkTopologyMode string
const (
// HardNetworkTopologyMode represents a strict network topology constraint that jobs must adhere to.
HardNetworkTopologyMode NetworkTopologyMode = "hard"
// SoftNetworkTopologyMode represents a flexible network topology constraint that
// allows jobs to cross network boundaries under certain conditions.
SoftNetworkTopologyMode NetworkTopologyMode = "soft"
)
type NetworkTopologySpec struct {
// Mode specifies the mode of the network topology constrain.
// +kubebuilder:default=hard
// +optional
Mode NetworkTopologyMode
// HighestTierAllowed specifies the highest tier that a job allowed to cross when scheduling.
// +kubebuilder:default=1
// +optional
HighestTierAllowed *int
}
// PodGroupStatus represents the current state of a pod group.
@ -288,6 +318,7 @@ type QueueStatus struct {
Reservation Reservation
// Allocated is allocated resources in queue
// +optional
Allocated v1.ResourceList
}
@ -353,6 +384,10 @@ type QueueSpec struct {
// The amount of resources configured by the user. This part of resource can be shared with other queues and reclaimed back.
// +optional
Deserved v1.ResourceList `json:"deserved,omitempty" protobuf:"bytes,9,opt,name=deserved"`
// Priority define the priority of queue. Higher values are prioritized for scheduling and considered later during reclamation.
// +optional
Priority int32 `json:"priority,omitempty" protobuf:"bytes,10,opt,name=priority"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -35,6 +35,10 @@ const KubeGroupNameAnnotationKey = "scheduling.k8s.io/group-name"
// which PodGroup it belongs to.
const VolcanoGroupNameAnnotationKey = GroupName + "/group-name"
// VolcanoGroupMinMemberAnnotationKey is the annotation key of Pod controllers (e.g. Deployment) to identify
// the minimum member of PodGroup.
const VolcanoGroupMinMemberAnnotationKey = GroupName + "/group-min-member"
// VolcanoGroupMinResourcesAnnotationKey is the annotation key of PodGroup's PodGroup.Spec.MinResources
// which PodGroup it belongs to.
const VolcanoGroupMinResourcesAnnotationKey = GroupName + "/group-min-resources"
@ -50,7 +54,7 @@ const PodPreemptable = "volcano.sh/preemptable"
// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
const CooldownTime = "volcano.sh/cooldown-time"
//RevocableZone is the key of revocable-zone
// RevocableZone is the key of revocable-zone
const RevocableZone = "volcano.sh/revocable-zone"
// JDBMinAvailable is the key of min available pod number

View File

@ -21,9 +21,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// PodGroupPhase is the phase of a pod group at the current time.
type PodGroupPhase string
// QueueState is state type of queue.
type QueueState string
@ -38,6 +35,9 @@ const (
QueueStateUnknown QueueState = "Unknown"
)
// PodGroupPhase is the phase of a pod group at the current time.
type PodGroupPhase string
// These are the valid phase of podGroups.
const (
// PodGroupPending means the pod group has been accepted by the system, but scheduler can not allocate
@ -184,6 +184,7 @@ type PodGroupSpec struct {
// Queue defines the queue to allocate resource for PodGroup; if queue does not exist,
// the PodGroup will not be scheduled. Defaults to `default` Queue with the lowest weight.
// +optional
// +kubebuilder:default:="default"
Queue string `json:"queue,omitempty" protobuf:"bytes,2,opt,name=queue"`
// If specified, indicates the PodGroup's priority. "system-node-critical" and
@ -199,6 +200,34 @@ type PodGroupSpec struct {
// if there's not enough resources to start all tasks, the scheduler
// will not start anyone.
MinResources *v1.ResourceList `json:"minResources,omitempty" protobuf:"bytes,4,opt,name=minResources"`
// NetworkTopology defines the NetworkTopology config, this field works in conjunction with network topology feature and hyperNode CRD.
// +optional
NetworkTopology *NetworkTopologySpec `json:"networkTopology,omitempty" protobuf:"bytes,5,opt,name=networkTopology"`
}
type NetworkTopologyMode string
const (
// HardNetworkTopologyMode represents a strict network topology constraint that jobs must adhere to.
HardNetworkTopologyMode NetworkTopologyMode = "hard"
// SoftNetworkTopologyMode represents a flexible network topology constraint that allows jobs
// to cross network boundaries under certain conditions.
SoftNetworkTopologyMode NetworkTopologyMode = "soft"
)
type NetworkTopologySpec struct {
// Mode specifies the mode of the network topology constrain.
// +kubebuilder:validation:Enum=hard;soft
// +kubebuilder:default=hard
// +optional
Mode NetworkTopologyMode `json:"mode,omitempty" protobuf:"bytes,1,opt,name=mode"`
// HighestTierAllowed specifies the highest tier that a job allowed to cross when scheduling.
// +kubebuilder:default=1
// +optional
HighestTierAllowed *int `json:"highestTierAllowed,omitempty" protobuf:"bytes,2,opt,name=highestTierAllowed"`
}
// PodGroupStatus represents the current state of a pod group.
@ -249,6 +278,7 @@ const (
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=queues,scope=Cluster,shortName=q;queue-v1beta1
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="PARENT",type=string,JSONPath=`.spec.parent`
// Queue is a queue of PodGroup.
type Queue struct {
@ -304,13 +334,17 @@ type QueueStatus struct {
Reservation Reservation `json:"reservation,omitempty" protobuf:"bytes,7,opt,name=reservation"`
// Allocated is allocated resources in queue
// +optional
Allocated v1.ResourceList `json:"allocated" protobuf:"bytes,8,opt,name=allocated"`
}
// CluterSpec represents the template of Cluster
type Cluster struct {
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
Weight int32 `json:"weight,omitempty" protobuf:"bytes,2,opt,name=weight"`
// +optional
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// +optional
Weight int32 `json:"weight,omitempty" protobuf:"bytes,2,opt,name=weight"`
// +optional
Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,opt,name=capacity"`
}
@ -341,7 +375,13 @@ type NodeGroupAntiAffinity struct {
// QueueSpec represents the template of Queue.
type QueueSpec struct {
Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"`
// +optional
// +kubebuilder:default:=1
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"`
// +optional
Capability v1.ResourceList `json:"capability,omitempty" protobuf:"bytes,2,opt,name=capability"`
// Reclaimable indicate whether the queue can be reclaimed by other queue
@ -366,6 +406,10 @@ type QueueSpec struct {
// The amount of resources configured by the user. This part of resource can be shared with other queues and reclaimed back.
// +optional
Deserved v1.ResourceList `json:"deserved,omitempty" protobuf:"bytes,9,opt,name=deserved"`
// Priority define the priority of queue. Higher values are prioritized for scheduling and considered later during reclamation.
// +optional
Priority int32 `json:"priority,omitempty" protobuf:"bytes,10,opt,name=priority"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -66,6 +66,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*NetworkTopologySpec)(nil), (*scheduling.NetworkTopologySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_NetworkTopologySpec_To_scheduling_NetworkTopologySpec(a.(*NetworkTopologySpec), b.(*scheduling.NetworkTopologySpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*scheduling.NetworkTopologySpec)(nil), (*NetworkTopologySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_scheduling_NetworkTopologySpec_To_v1beta1_NetworkTopologySpec(a.(*scheduling.NetworkTopologySpec), b.(*NetworkTopologySpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*NodeGroupAffinity)(nil), (*scheduling.NodeGroupAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_NodeGroupAffinity_To_scheduling_NodeGroupAffinity(a.(*NodeGroupAffinity), b.(*scheduling.NodeGroupAffinity), scope)
}); err != nil {
@ -255,6 +265,28 @@ func Convert_scheduling_Guarantee_To_v1beta1_Guarantee(in *scheduling.Guarantee,
return autoConvert_scheduling_Guarantee_To_v1beta1_Guarantee(in, out, s)
}
func autoConvert_v1beta1_NetworkTopologySpec_To_scheduling_NetworkTopologySpec(in *NetworkTopologySpec, out *scheduling.NetworkTopologySpec, s conversion.Scope) error {
out.Mode = scheduling.NetworkTopologyMode(in.Mode)
out.HighestTierAllowed = (*int)(unsafe.Pointer(in.HighestTierAllowed))
return nil
}
// Convert_v1beta1_NetworkTopologySpec_To_scheduling_NetworkTopologySpec is an autogenerated conversion function.
func Convert_v1beta1_NetworkTopologySpec_To_scheduling_NetworkTopologySpec(in *NetworkTopologySpec, out *scheduling.NetworkTopologySpec, s conversion.Scope) error {
return autoConvert_v1beta1_NetworkTopologySpec_To_scheduling_NetworkTopologySpec(in, out, s)
}
func autoConvert_scheduling_NetworkTopologySpec_To_v1beta1_NetworkTopologySpec(in *scheduling.NetworkTopologySpec, out *NetworkTopologySpec, s conversion.Scope) error {
out.Mode = NetworkTopologyMode(in.Mode)
out.HighestTierAllowed = (*int)(unsafe.Pointer(in.HighestTierAllowed))
return nil
}
// Convert_scheduling_NetworkTopologySpec_To_v1beta1_NetworkTopologySpec is an autogenerated conversion function.
func Convert_scheduling_NetworkTopologySpec_To_v1beta1_NetworkTopologySpec(in *scheduling.NetworkTopologySpec, out *NetworkTopologySpec, s conversion.Scope) error {
return autoConvert_scheduling_NetworkTopologySpec_To_v1beta1_NetworkTopologySpec(in, out, s)
}
func autoConvert_v1beta1_NodeGroupAffinity_To_scheduling_NodeGroupAffinity(in *NodeGroupAffinity, out *scheduling.NodeGroupAffinity, s conversion.Scope) error {
out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution))
out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution))
@ -389,6 +421,7 @@ func autoConvert_v1beta1_PodGroupSpec_To_scheduling_PodGroupSpec(in *PodGroupSpe
out.Queue = in.Queue
out.PriorityClassName = in.PriorityClassName
out.MinResources = (*v1.ResourceList)(unsafe.Pointer(in.MinResources))
out.NetworkTopology = (*scheduling.NetworkTopologySpec)(unsafe.Pointer(in.NetworkTopology))
return nil
}
@ -403,6 +436,7 @@ func autoConvert_scheduling_PodGroupSpec_To_v1beta1_PodGroupSpec(in *scheduling.
out.Queue = in.Queue
out.PriorityClassName = in.PriorityClassName
out.MinResources = (*v1.ResourceList)(unsafe.Pointer(in.MinResources))
out.NetworkTopology = (*NetworkTopologySpec)(unsafe.Pointer(in.NetworkTopology))
return nil
}
@ -525,6 +559,7 @@ func autoConvert_v1beta1_QueueSpec_To_scheduling_QueueSpec(in *QueueSpec, out *s
out.Type = in.Type
out.Parent = in.Parent
out.Deserved = *(*v1.ResourceList)(unsafe.Pointer(&in.Deserved))
out.Priority = in.Priority
return nil
}
@ -546,6 +581,7 @@ func autoConvert_scheduling_QueueSpec_To_v1beta1_QueueSpec(in *scheduling.QueueS
out.Type = in.Type
out.Parent = in.Parent
out.Deserved = *(*v1.ResourceList)(unsafe.Pointer(&in.Deserved))
out.Priority = in.Priority
return nil
}

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -98,6 +98,27 @@ func (in *Guarantee) DeepCopy() *Guarantee {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NetworkTopologySpec) DeepCopyInto(out *NetworkTopologySpec) {
*out = *in
if in.HighestTierAllowed != nil {
in, out := &in.HighestTierAllowed, &out.HighestTierAllowed
*out = new(int)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkTopologySpec.
func (in *NetworkTopologySpec) DeepCopy() *NetworkTopologySpec {
if in == nil {
return nil
}
out := new(NetworkTopologySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeGroupAffinity) DeepCopyInto(out *NodeGroupAffinity) {
*out = *in
@ -249,6 +270,11 @@ func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) {
}
}
}
if in.NetworkTopology != nil {
in, out := &in.NetworkTopology, &out.NetworkTopology
*out = new(NetworkTopologySpec)
(*in).DeepCopyInto(*out)
}
return
}

View File

@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -98,6 +98,27 @@ func (in *Guarantee) DeepCopy() *Guarantee {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NetworkTopologySpec) DeepCopyInto(out *NetworkTopologySpec) {
*out = *in
if in.HighestTierAllowed != nil {
in, out := &in.HighestTierAllowed, &out.HighestTierAllowed
*out = new(int)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkTopologySpec.
func (in *NetworkTopologySpec) DeepCopy() *NetworkTopologySpec {
if in == nil {
return nil
}
out := new(NetworkTopologySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeGroupAffinity) DeepCopyInto(out *NodeGroupAffinity) {
*out = *in
@ -249,6 +270,11 @@ func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) {
}
}
}
if in.NetworkTopology != nil {
in, out := &in.NetworkTopology, &out.NetworkTopology
*out = new(NetworkTopologySpec)
(*in).DeepCopyInto(*out)
}
return
}

View File

@ -0,0 +1,20 @@
/*
Copyright 2024 The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:deepcopy-gen=package
// +k8s:defaulter-gen=TypeMeta
// +groupName=topology.volcano.sh
package v1alpha1

View File

@ -0,0 +1,157 @@
/*
Copyright 2024 The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +genclient:nonNamespaced
// +kubebuilder:resource:path=hypernodes,shortName=hn,scope=Cluster
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Tier",type=string,JSONPath=`.spec.tier`
// +kubebuilder:printcolumn:name="NodeCount",type=integer,JSONPath=`.status.nodeCount`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// HyperNode represents a collection of nodes sharing similar network topology or performance characteristics.
type HyperNode struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired configuration of the HyperNode.
// +optional
Spec HyperNodeSpec `json:"spec"`
// Status provides the current state of the HyperNode.
// +optional
Status HyperNodeStatus `json:"status,omitempty"`
}
// MemberType represents the member type, valid values are "Node" and "HyperNode".
// +kubebuilder:validation:Enum=Node;HyperNode
type MemberType string
const (
// MemberTypeNode means the member type is a node.
MemberTypeNode MemberType = "Node"
// MemberTypeHyperNode means the member type is a hyperNode.
MemberTypeHyperNode MemberType = "HyperNode"
)
// HyperNodeSpec defines the desired state of a HyperNode.
type HyperNodeSpec struct {
// Tier categorizes the performance level of the HyperNode.
// +required
Tier int `json:"tier,omitempty"`
// Members defines a list of node groups or individual nodes included in the HyperNode.
// +optional
Members []MemberSpec `json:"members,omitempty"`
}
// MemberSpec represents a specific node or a hyperNodes in the hyperNode.
type MemberSpec struct {
// Type specifies the member type.
// +required
Type MemberType `json:"type,omitempty"`
// Selector defines the selection rules for this member.
// +optional
Selector MemberSelector `json:"selector,omitempty"`
}
// MemberSelector defines the criteria for selecting nodes.
//
// Example for Exact match:
//
// members:
// - type: Node
// selector:
// exactMatch:
// name: "node1"
//
// Example for Regex match:
//
// members:
// - type: Node
// selector:
// regexMatch:
// pattern: "^node-[0-9]+$"
//
// Example for Label match:
//
// members:
// - type: Node
// selector:
// labelMatch:
// matchLabels:
// topology-rack: rack1
//
// +kubebuilder:validation:XValidation:rule="has(self.exactMatch) || has(self.regexMatch) || has(self.labelMatch)",message="Either ExactMatch or RegexMatch or LabelMatch must be specified"
// +kubebuilder:validation:XValidation:rule="(has(self.exactMatch) ? 1 : 0) + (has(self.regexMatch) ? 1 : 0) + (has(self.labelMatch) ? 1 : 0) <= 1",message="Only one of ExactMatch, RegexMatch, or LabelMatch can be specified"
type MemberSelector struct {
// ExactMatch defines the exact match criteria.
// +optional
ExactMatch *ExactMatch `json:"exactMatch,omitempty"`
// RegexMatch defines the regex match criteria.
// +optional
RegexMatch *RegexMatch `json:"regexMatch,omitempty"`
// LabelMatch defines the labels match criteria (only take effect when Member Type is "Node").
// +optional
LabelMatch *metav1.LabelSelector `json:"labelMatch,omitempty"`
}
// ExactMatch represents the criteria for exact name matching.
type ExactMatch struct {
// Name specifies the exact name of the node to match.
// +optional
Name string `json:"name"`
}
// RegexMatch represents the criteria for regex-based matching.
type RegexMatch struct {
// Pattern defines the regex pattern to match node names.
// +optional
Pattern string `json:"pattern"`
}
// HyperNodeStatus represents the observed state of a HyperNode.
type HyperNodeStatus struct {
// Conditions provide details about the current state of the HyperNode.
Conditions []metav1.Condition `json:"conditions,omitempty"`
// NodeCount is the total number of nodes currently in the HyperNode.
// +kubebuilder:validation:Minimum=0
NodeCount int64 `json:"nodeCount,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// HyperNodeList contains a list of HyperNode resources.
type HyperNodeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is the list of HyperNodes.
Items []HyperNode `json:"items"`
}

View File

@ -0,0 +1,52 @@
/*
Copyright 2024 The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (
// SchemeBuilder points to a list of functions added to Scheme.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// AddToScheme applies all the stored functions to the scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
// GroupName is the group name used in this package.
const GroupName = "topology.volcano.sh"
// SchemeGroupVersion is the group version used to register these objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
// Resource takes an unqualified resource and returns a Group-qualified GroupResource.
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&HyperNode{},
&HyperNodeList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

View File

@ -0,0 +1,213 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExactMatch) DeepCopyInto(out *ExactMatch) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExactMatch.
func (in *ExactMatch) DeepCopy() *ExactMatch {
if in == nil {
return nil
}
out := new(ExactMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HyperNode) DeepCopyInto(out *HyperNode) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HyperNode.
func (in *HyperNode) DeepCopy() *HyperNode {
if in == nil {
return nil
}
out := new(HyperNode)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *HyperNode) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HyperNodeList) DeepCopyInto(out *HyperNodeList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]HyperNode, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HyperNodeList.
func (in *HyperNodeList) DeepCopy() *HyperNodeList {
if in == nil {
return nil
}
out := new(HyperNodeList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *HyperNodeList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HyperNodeSpec) DeepCopyInto(out *HyperNodeSpec) {
*out = *in
if in.Members != nil {
in, out := &in.Members, &out.Members
*out = make([]MemberSpec, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HyperNodeSpec.
func (in *HyperNodeSpec) DeepCopy() *HyperNodeSpec {
if in == nil {
return nil
}
out := new(HyperNodeSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HyperNodeStatus) DeepCopyInto(out *HyperNodeStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HyperNodeStatus.
func (in *HyperNodeStatus) DeepCopy() *HyperNodeStatus {
if in == nil {
return nil
}
out := new(HyperNodeStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MemberSelector) DeepCopyInto(out *MemberSelector) {
*out = *in
if in.ExactMatch != nil {
in, out := &in.ExactMatch, &out.ExactMatch
*out = new(ExactMatch)
**out = **in
}
if in.RegexMatch != nil {
in, out := &in.RegexMatch, &out.RegexMatch
*out = new(RegexMatch)
**out = **in
}
if in.LabelMatch != nil {
in, out := &in.LabelMatch, &out.LabelMatch
*out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberSelector.
func (in *MemberSelector) DeepCopy() *MemberSelector {
if in == nil {
return nil
}
out := new(MemberSelector)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MemberSpec) DeepCopyInto(out *MemberSpec) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberSpec.
func (in *MemberSpec) DeepCopy() *MemberSpec {
if in == nil {
return nil
}
out := new(MemberSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RegexMatch) DeepCopyInto(out *RegexMatch) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegexMatch.
func (in *RegexMatch) DeepCopy() *RegexMatch {
if in == nil {
return nil
}
out := new(RegexMatch)
in.DeepCopyInto(out)
return out
}

View File

@ -0,0 +1,32 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by defaulter-gen. DO NOT EDIT.
package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// RegisterDefaults adds defaulters functions to the given scheme.
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
return nil
}

View File

@ -0,0 +1,53 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// DependsOnApplyConfiguration represents a declarative configuration of the DependsOn type for use
// with apply.
type DependsOnApplyConfiguration struct {
Name []string `json:"name,omitempty"`
Iteration *batchv1alpha1.Iteration `json:"iteration,omitempty"`
}
// DependsOnApplyConfiguration constructs a declarative configuration of the DependsOn type for use with
// apply.
func DependsOn() *DependsOnApplyConfiguration {
return &DependsOnApplyConfiguration{}
}
// WithName adds the given value to the Name field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Name field.
func (b *DependsOnApplyConfiguration) WithName(values ...string) *DependsOnApplyConfiguration {
for i := range values {
b.Name = append(b.Name, values[i])
}
return b
}
// WithIteration sets the Iteration field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Iteration field is set to the value of the last call.
func (b *DependsOnApplyConfiguration) WithIteration(value batchv1alpha1.Iteration) *DependsOnApplyConfiguration {
b.Iteration = &value
return b
}

View File

@ -0,0 +1,224 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// JobApplyConfiguration represents a declarative configuration of the Job type for use
// with apply.
type JobApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *JobSpecApplyConfiguration `json:"spec,omitempty"`
Status *JobStatusApplyConfiguration `json:"status,omitempty"`
}
// Job constructs a declarative configuration of the Job type for use with
// apply.
func Job(name, namespace string) *JobApplyConfiguration {
b := &JobApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("Job")
b.WithAPIVersion("batch.volcano.sh/v1alpha1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *JobApplyConfiguration) WithKind(value string) *JobApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *JobApplyConfiguration) WithAPIVersion(value string) *JobApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *JobApplyConfiguration) WithName(value string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *JobApplyConfiguration) WithGenerateName(value string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *JobApplyConfiguration) WithNamespace(value string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *JobApplyConfiguration) WithUID(value types.UID) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *JobApplyConfiguration) WithResourceVersion(value string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *JobApplyConfiguration) WithGeneration(value int64) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *JobApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *JobApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *JobApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *JobApplyConfiguration) WithLabels(entries map[string]string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *JobApplyConfiguration) WithAnnotations(entries map[string]string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *JobApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *JobApplyConfiguration) WithFinalizers(values ...string) *JobApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *JobApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *JobApplyConfiguration) WithSpec(value *JobSpecApplyConfiguration) *JobApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *JobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration) *JobApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *JobApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,52 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobConditionApplyConfiguration represents a declarative configuration of the JobCondition type for use
// with apply.
type JobConditionApplyConfiguration struct {
Status *batchv1alpha1.JobPhase `json:"status,omitempty"`
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
}
// JobConditionApplyConfiguration constructs a declarative configuration of the JobCondition type for use with
// apply.
func JobCondition() *JobConditionApplyConfiguration {
return &JobConditionApplyConfiguration{}
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *JobConditionApplyConfiguration) WithStatus(value batchv1alpha1.JobPhase) *JobConditionApplyConfiguration {
b.Status = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LastTransitionTime field is set to the value of the last call.
func (b *JobConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *JobConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}

View File

@ -0,0 +1,171 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// JobSpecApplyConfiguration represents a declarative configuration of the JobSpec type for use
// with apply.
type JobSpecApplyConfiguration struct {
SchedulerName *string `json:"schedulerName,omitempty"`
MinAvailable *int32 `json:"minAvailable,omitempty"`
Volumes []VolumeSpecApplyConfiguration `json:"volumes,omitempty"`
Tasks []TaskSpecApplyConfiguration `json:"tasks,omitempty"`
Policies []LifecyclePolicyApplyConfiguration `json:"policies,omitempty"`
Plugins map[string][]string `json:"plugins,omitempty"`
RunningEstimate *v1.Duration `json:"runningEstimate,omitempty"`
Queue *string `json:"queue,omitempty"`
MaxRetry *int32 `json:"maxRetry,omitempty"`
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
PriorityClassName *string `json:"priorityClassName,omitempty"`
MinSuccess *int32 `json:"minSuccess,omitempty"`
NetworkTopology *NetworkTopologySpecApplyConfiguration `json:"networkTopology,omitempty"`
}
// JobSpecApplyConfiguration constructs a declarative configuration of the JobSpec type for use with
// apply.
func JobSpec() *JobSpecApplyConfiguration {
return &JobSpecApplyConfiguration{}
}
// WithSchedulerName sets the SchedulerName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SchedulerName field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithSchedulerName(value string) *JobSpecApplyConfiguration {
b.SchedulerName = &value
return b
}
// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MinAvailable field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithMinAvailable(value int32) *JobSpecApplyConfiguration {
b.MinAvailable = &value
return b
}
// WithVolumes adds the given value to the Volumes field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Volumes field.
func (b *JobSpecApplyConfiguration) WithVolumes(values ...*VolumeSpecApplyConfiguration) *JobSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithVolumes")
}
b.Volumes = append(b.Volumes, *values[i])
}
return b
}
// WithTasks adds the given value to the Tasks field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Tasks field.
func (b *JobSpecApplyConfiguration) WithTasks(values ...*TaskSpecApplyConfiguration) *JobSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithTasks")
}
b.Tasks = append(b.Tasks, *values[i])
}
return b
}
// WithPolicies adds the given value to the Policies field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Policies field.
func (b *JobSpecApplyConfiguration) WithPolicies(values ...*LifecyclePolicyApplyConfiguration) *JobSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithPolicies")
}
b.Policies = append(b.Policies, *values[i])
}
return b
}
// WithPlugins puts the entries into the Plugins field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Plugins field,
// overwriting an existing map entries in Plugins field with the same key.
func (b *JobSpecApplyConfiguration) WithPlugins(entries map[string][]string) *JobSpecApplyConfiguration {
if b.Plugins == nil && len(entries) > 0 {
b.Plugins = make(map[string][]string, len(entries))
}
for k, v := range entries {
b.Plugins[k] = v
}
return b
}
// WithRunningEstimate sets the RunningEstimate field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RunningEstimate field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithRunningEstimate(value v1.Duration) *JobSpecApplyConfiguration {
b.RunningEstimate = &value
return b
}
// WithQueue sets the Queue field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Queue field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithQueue(value string) *JobSpecApplyConfiguration {
b.Queue = &value
return b
}
// WithMaxRetry sets the MaxRetry field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MaxRetry field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithMaxRetry(value int32) *JobSpecApplyConfiguration {
b.MaxRetry = &value
return b
}
// WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TTLSecondsAfterFinished field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithTTLSecondsAfterFinished(value int32) *JobSpecApplyConfiguration {
b.TTLSecondsAfterFinished = &value
return b
}
// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PriorityClassName field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithPriorityClassName(value string) *JobSpecApplyConfiguration {
b.PriorityClassName = &value
return b
}
// WithMinSuccess sets the MinSuccess field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MinSuccess field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithMinSuccess(value int32) *JobSpecApplyConfiguration {
b.MinSuccess = &value
return b
}
// WithNetworkTopology sets the NetworkTopology field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NetworkTopology field is set to the value of the last call.
func (b *JobSpecApplyConfiguration) WithNetworkTopology(value *NetworkTopologySpecApplyConfiguration) *JobSpecApplyConfiguration {
b.NetworkTopology = value
return b
}

View File

@ -0,0 +1,70 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobStateApplyConfiguration represents a declarative configuration of the JobState type for use
// with apply.
type JobStateApplyConfiguration struct {
Phase *batchv1alpha1.JobPhase `json:"phase,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
}
// JobStateApplyConfiguration constructs a declarative configuration of the JobState type for use with
// apply.
func JobState() *JobStateApplyConfiguration {
return &JobStateApplyConfiguration{}
}
// WithPhase sets the Phase field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Phase field is set to the value of the last call.
func (b *JobStateApplyConfiguration) WithPhase(value batchv1alpha1.JobPhase) *JobStateApplyConfiguration {
b.Phase = &value
return b
}
// WithReason sets the Reason field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Reason field is set to the value of the last call.
func (b *JobStateApplyConfiguration) WithReason(value string) *JobStateApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Message field is set to the value of the last call.
func (b *JobStateApplyConfiguration) WithMessage(value string) *JobStateApplyConfiguration {
b.Message = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LastTransitionTime field is set to the value of the last call.
func (b *JobStateApplyConfiguration) WithLastTransitionTime(value v1.Time) *JobStateApplyConfiguration {
b.LastTransitionTime = &value
return b
}

View File

@ -0,0 +1,176 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use
// with apply.
type JobStatusApplyConfiguration struct {
State *JobStateApplyConfiguration `json:"state,omitempty"`
MinAvailable *int32 `json:"minAvailable,omitempty"`
TaskStatusCount map[string]TaskStateApplyConfiguration `json:"taskStatusCount,omitempty"`
Pending *int32 `json:"pending,omitempty"`
Running *int32 `json:"running,omitempty"`
Succeeded *int32 `json:"succeeded,omitempty"`
Failed *int32 `json:"failed,omitempty"`
Terminating *int32 `json:"terminating,omitempty"`
Unknown *int32 `json:"unknown,omitempty"`
Version *int32 `json:"version,omitempty"`
RetryCount *int32 `json:"retryCount,omitempty"`
RunningDuration *v1.Duration `json:"runningDuration,omitempty"`
ControlledResources map[string]string `json:"controlledResources,omitempty"`
Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"`
}
// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with
// apply.
func JobStatus() *JobStatusApplyConfiguration {
return &JobStatusApplyConfiguration{}
}
// WithState sets the State field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the State field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithState(value *JobStateApplyConfiguration) *JobStatusApplyConfiguration {
b.State = value
return b
}
// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MinAvailable field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithMinAvailable(value int32) *JobStatusApplyConfiguration {
b.MinAvailable = &value
return b
}
// WithTaskStatusCount puts the entries into the TaskStatusCount field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the TaskStatusCount field,
// overwriting an existing map entries in TaskStatusCount field with the same key.
func (b *JobStatusApplyConfiguration) WithTaskStatusCount(entries map[string]TaskStateApplyConfiguration) *JobStatusApplyConfiguration {
if b.TaskStatusCount == nil && len(entries) > 0 {
b.TaskStatusCount = make(map[string]TaskStateApplyConfiguration, len(entries))
}
for k, v := range entries {
b.TaskStatusCount[k] = v
}
return b
}
// WithPending sets the Pending field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Pending field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithPending(value int32) *JobStatusApplyConfiguration {
b.Pending = &value
return b
}
// WithRunning sets the Running field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Running field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithRunning(value int32) *JobStatusApplyConfiguration {
b.Running = &value
return b
}
// WithSucceeded sets the Succeeded field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Succeeded field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithSucceeded(value int32) *JobStatusApplyConfiguration {
b.Succeeded = &value
return b
}
// WithFailed sets the Failed field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Failed field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithFailed(value int32) *JobStatusApplyConfiguration {
b.Failed = &value
return b
}
// WithTerminating sets the Terminating field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Terminating field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithTerminating(value int32) *JobStatusApplyConfiguration {
b.Terminating = &value
return b
}
// WithUnknown sets the Unknown field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Unknown field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithUnknown(value int32) *JobStatusApplyConfiguration {
b.Unknown = &value
return b
}
// WithVersion sets the Version field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Version field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithVersion(value int32) *JobStatusApplyConfiguration {
b.Version = &value
return b
}
// WithRetryCount sets the RetryCount field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RetryCount field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithRetryCount(value int32) *JobStatusApplyConfiguration {
b.RetryCount = &value
return b
}
// WithRunningDuration sets the RunningDuration field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RunningDuration field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithRunningDuration(value v1.Duration) *JobStatusApplyConfiguration {
b.RunningDuration = &value
return b
}
// WithControlledResources puts the entries into the ControlledResources field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the ControlledResources field,
// overwriting an existing map entries in ControlledResources field with the same key.
func (b *JobStatusApplyConfiguration) WithControlledResources(entries map[string]string) *JobStatusApplyConfiguration {
if b.ControlledResources == nil && len(entries) > 0 {
b.ControlledResources = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ControlledResources[k] = v
}
return b
}
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
func (b *JobStatusApplyConfiguration) WithConditions(values ...*JobConditionApplyConfiguration) *JobStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}

View File

@ -0,0 +1,81 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
busv1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
)
// LifecyclePolicyApplyConfiguration represents a declarative configuration of the LifecyclePolicy type for use
// with apply.
type LifecyclePolicyApplyConfiguration struct {
Action *busv1alpha1.Action `json:"action,omitempty"`
Event *busv1alpha1.Event `json:"event,omitempty"`
Events []busv1alpha1.Event `json:"events,omitempty"`
ExitCode *int32 `json:"exitCode,omitempty"`
Timeout *v1.Duration `json:"timeout,omitempty"`
}
// LifecyclePolicyApplyConfiguration constructs a declarative configuration of the LifecyclePolicy type for use with
// apply.
func LifecyclePolicy() *LifecyclePolicyApplyConfiguration {
return &LifecyclePolicyApplyConfiguration{}
}
// WithAction sets the Action field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Action field is set to the value of the last call.
func (b *LifecyclePolicyApplyConfiguration) WithAction(value busv1alpha1.Action) *LifecyclePolicyApplyConfiguration {
b.Action = &value
return b
}
// WithEvent sets the Event field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Event field is set to the value of the last call.
func (b *LifecyclePolicyApplyConfiguration) WithEvent(value busv1alpha1.Event) *LifecyclePolicyApplyConfiguration {
b.Event = &value
return b
}
// WithEvents adds the given value to the Events field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Events field.
func (b *LifecyclePolicyApplyConfiguration) WithEvents(values ...busv1alpha1.Event) *LifecyclePolicyApplyConfiguration {
for i := range values {
b.Events = append(b.Events, values[i])
}
return b
}
// WithExitCode sets the ExitCode field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ExitCode field is set to the value of the last call.
func (b *LifecyclePolicyApplyConfiguration) WithExitCode(value int32) *LifecyclePolicyApplyConfiguration {
b.ExitCode = &value
return b
}
// WithTimeout sets the Timeout field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Timeout field is set to the value of the last call.
func (b *LifecyclePolicyApplyConfiguration) WithTimeout(value v1.Duration) *LifecyclePolicyApplyConfiguration {
b.Timeout = &value
return b
}

View File

@ -0,0 +1,51 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// NetworkTopologySpecApplyConfiguration represents a declarative configuration of the NetworkTopologySpec type for use
// with apply.
type NetworkTopologySpecApplyConfiguration struct {
Mode *batchv1alpha1.NetworkTopologyMode `json:"mode,omitempty"`
HighestTierAllowed *int `json:"highestTierAllowed,omitempty"`
}
// NetworkTopologySpecApplyConfiguration constructs a declarative configuration of the NetworkTopologySpec type for use with
// apply.
func NetworkTopologySpec() *NetworkTopologySpecApplyConfiguration {
return &NetworkTopologySpecApplyConfiguration{}
}
// WithMode sets the Mode field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Mode field is set to the value of the last call.
func (b *NetworkTopologySpecApplyConfiguration) WithMode(value batchv1alpha1.NetworkTopologyMode) *NetworkTopologySpecApplyConfiguration {
b.Mode = &value
return b
}
// WithHighestTierAllowed sets the HighestTierAllowed field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HighestTierAllowed field is set to the value of the last call.
func (b *NetworkTopologySpecApplyConfiguration) WithHighestTierAllowed(value int) *NetworkTopologySpecApplyConfiguration {
b.HighestTierAllowed = &value
return b
}

View File

@ -0,0 +1,111 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// TaskSpecApplyConfiguration represents a declarative configuration of the TaskSpec type for use
// with apply.
type TaskSpecApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Replicas *int32 `json:"replicas,omitempty"`
MinAvailable *int32 `json:"minAvailable,omitempty"`
Template *v1.PodTemplateSpec `json:"template,omitempty"`
Policies []LifecyclePolicyApplyConfiguration `json:"policies,omitempty"`
TopologyPolicy *batchv1alpha1.NumaPolicy `json:"topologyPolicy,omitempty"`
MaxRetry *int32 `json:"maxRetry,omitempty"`
DependsOn *DependsOnApplyConfiguration `json:"dependsOn,omitempty"`
}
// TaskSpecApplyConfiguration constructs a declarative configuration of the TaskSpec type for use with
// apply.
func TaskSpec() *TaskSpecApplyConfiguration {
return &TaskSpecApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithName(value string) *TaskSpecApplyConfiguration {
b.Name = &value
return b
}
// WithReplicas sets the Replicas field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Replicas field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithReplicas(value int32) *TaskSpecApplyConfiguration {
b.Replicas = &value
return b
}
// WithMinAvailable sets the MinAvailable field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MinAvailable field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithMinAvailable(value int32) *TaskSpecApplyConfiguration {
b.MinAvailable = &value
return b
}
// WithTemplate sets the Template field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Template field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithTemplate(value v1.PodTemplateSpec) *TaskSpecApplyConfiguration {
b.Template = &value
return b
}
// WithPolicies adds the given value to the Policies field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Policies field.
func (b *TaskSpecApplyConfiguration) WithPolicies(values ...*LifecyclePolicyApplyConfiguration) *TaskSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithPolicies")
}
b.Policies = append(b.Policies, *values[i])
}
return b
}
// WithTopologyPolicy sets the TopologyPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TopologyPolicy field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithTopologyPolicy(value batchv1alpha1.NumaPolicy) *TaskSpecApplyConfiguration {
b.TopologyPolicy = &value
return b
}
// WithMaxRetry sets the MaxRetry field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MaxRetry field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithMaxRetry(value int32) *TaskSpecApplyConfiguration {
b.MaxRetry = &value
return b
}
// WithDependsOn sets the DependsOn field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DependsOn field is set to the value of the last call.
func (b *TaskSpecApplyConfiguration) WithDependsOn(value *DependsOnApplyConfiguration) *TaskSpecApplyConfiguration {
b.DependsOn = value
return b
}

View File

@ -0,0 +1,48 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
)
// TaskStateApplyConfiguration represents a declarative configuration of the TaskState type for use
// with apply.
type TaskStateApplyConfiguration struct {
Phase map[v1.PodPhase]int32 `json:"phase,omitempty"`
}
// TaskStateApplyConfiguration constructs a declarative configuration of the TaskState type for use with
// apply.
func TaskState() *TaskStateApplyConfiguration {
return &TaskStateApplyConfiguration{}
}
// WithPhase puts the entries into the Phase field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Phase field,
// overwriting an existing map entries in Phase field with the same key.
func (b *TaskStateApplyConfiguration) WithPhase(entries map[v1.PodPhase]int32) *TaskStateApplyConfiguration {
if b.Phase == nil && len(entries) > 0 {
b.Phase = make(map[v1.PodPhase]int32, len(entries))
}
for k, v := range entries {
b.Phase[k] = v
}
return b
}

View File

@ -0,0 +1,60 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
)
// VolumeSpecApplyConfiguration represents a declarative configuration of the VolumeSpec type for use
// with apply.
type VolumeSpecApplyConfiguration struct {
MountPath *string `json:"mountPath,omitempty"`
VolumeClaimName *string `json:"volumeClaimName,omitempty"`
VolumeClaim *v1.PersistentVolumeClaimSpec `json:"volumeClaim,omitempty"`
}
// VolumeSpecApplyConfiguration constructs a declarative configuration of the VolumeSpec type for use with
// apply.
func VolumeSpec() *VolumeSpecApplyConfiguration {
return &VolumeSpecApplyConfiguration{}
}
// WithMountPath sets the MountPath field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MountPath field is set to the value of the last call.
func (b *VolumeSpecApplyConfiguration) WithMountPath(value string) *VolumeSpecApplyConfiguration {
b.MountPath = &value
return b
}
// WithVolumeClaimName sets the VolumeClaimName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the VolumeClaimName field is set to the value of the last call.
func (b *VolumeSpecApplyConfiguration) WithVolumeClaimName(value string) *VolumeSpecApplyConfiguration {
b.VolumeClaimName = &value
return b
}
// WithVolumeClaim sets the VolumeClaim field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the VolumeClaim field is set to the value of the last call.
func (b *VolumeSpecApplyConfiguration) WithVolumeClaim(value v1.PersistentVolumeClaimSpec) *VolumeSpecApplyConfiguration {
b.VolumeClaim = &value
return b
}

View File

@ -0,0 +1,242 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// CommandApplyConfiguration represents a declarative configuration of the Command type for use
// with apply.
type CommandApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Action *string `json:"action,omitempty"`
TargetObject *v1.OwnerReferenceApplyConfiguration `json:"target,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
}
// Command constructs a declarative configuration of the Command type for use with
// apply.
func Command(name, namespace string) *CommandApplyConfiguration {
b := &CommandApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("Command")
b.WithAPIVersion("bus.volcano.sh/v1alpha1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithKind(value string) *CommandApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithAPIVersion(value string) *CommandApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithName(value string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithGenerateName(value string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithNamespace(value string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithUID(value types.UID) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithResourceVersion(value string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithGeneration(value int64) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *CommandApplyConfiguration) WithLabels(entries map[string]string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *CommandApplyConfiguration) WithAnnotations(entries map[string]string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *CommandApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *CommandApplyConfiguration) WithFinalizers(values ...string) *CommandApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *CommandApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithAction sets the Action field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Action field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithAction(value string) *CommandApplyConfiguration {
b.Action = &value
return b
}
// WithTargetObject sets the TargetObject field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TargetObject field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithTargetObject(value *v1.OwnerReferenceApplyConfiguration) *CommandApplyConfiguration {
b.TargetObject = value
return b
}
// WithReason sets the Reason field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Reason field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithReason(value string) *CommandApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Message field is set to the value of the last call.
func (b *CommandApplyConfiguration) WithMessage(value string) *CommandApplyConfiguration {
b.Message = &value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *CommandApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,77 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
applyconfigurationbatchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
)
// ConditionApplyConfiguration represents a declarative configuration of the Condition type for use
// with apply.
type ConditionApplyConfiguration struct {
Phase *batchv1alpha1.JobPhase `json:"phase,omitempty"`
CreateTimestamp *v1.Time `json:"createTime,omitempty"`
RunningDuration *v1.Duration `json:"runningDuration,omitempty"`
TaskStatusCount map[string]applyconfigurationbatchv1alpha1.TaskStateApplyConfiguration `json:"taskStatusCount,omitempty"`
}
// ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with
// apply.
func Condition() *ConditionApplyConfiguration {
return &ConditionApplyConfiguration{}
}
// WithPhase sets the Phase field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Phase field is set to the value of the last call.
func (b *ConditionApplyConfiguration) WithPhase(value batchv1alpha1.JobPhase) *ConditionApplyConfiguration {
b.Phase = &value
return b
}
// WithCreateTimestamp sets the CreateTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreateTimestamp field is set to the value of the last call.
func (b *ConditionApplyConfiguration) WithCreateTimestamp(value v1.Time) *ConditionApplyConfiguration {
b.CreateTimestamp = &value
return b
}
// WithRunningDuration sets the RunningDuration field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RunningDuration field is set to the value of the last call.
func (b *ConditionApplyConfiguration) WithRunningDuration(value v1.Duration) *ConditionApplyConfiguration {
b.RunningDuration = &value
return b
}
// WithTaskStatusCount puts the entries into the TaskStatusCount field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the TaskStatusCount field,
// overwriting an existing map entries in TaskStatusCount field with the same key.
func (b *ConditionApplyConfiguration) WithTaskStatusCount(entries map[string]applyconfigurationbatchv1alpha1.TaskStateApplyConfiguration) *ConditionApplyConfiguration {
if b.TaskStatusCount == nil && len(entries) > 0 {
b.TaskStatusCount = make(map[string]applyconfigurationbatchv1alpha1.TaskStateApplyConfiguration, len(entries))
}
for k, v := range entries {
b.TaskStatusCount[k] = v
}
return b
}

View File

@ -0,0 +1,49 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// DependsOnApplyConfiguration represents a declarative configuration of the DependsOn type for use
// with apply.
type DependsOnApplyConfiguration struct {
Targets []string `json:"targets,omitempty"`
Probe *ProbeApplyConfiguration `json:"probe,omitempty"`
}
// DependsOnApplyConfiguration constructs a declarative configuration of the DependsOn type for use with
// apply.
func DependsOn() *DependsOnApplyConfiguration {
return &DependsOnApplyConfiguration{}
}
// WithTargets adds the given value to the Targets field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Targets field.
func (b *DependsOnApplyConfiguration) WithTargets(values ...string) *DependsOnApplyConfiguration {
for i := range values {
b.Targets = append(b.Targets, values[i])
}
return b
}
// WithProbe sets the Probe field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Probe field is set to the value of the last call.
func (b *DependsOnApplyConfiguration) WithProbe(value *ProbeApplyConfiguration) *DependsOnApplyConfiguration {
b.Probe = value
return b
}

View File

@ -0,0 +1,47 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// FlowApplyConfiguration represents a declarative configuration of the Flow type for use
// with apply.
type FlowApplyConfiguration struct {
Name *string `json:"name,omitempty"`
DependsOn *DependsOnApplyConfiguration `json:"dependsOn,omitempty"`
}
// FlowApplyConfiguration constructs a declarative configuration of the Flow type for use with
// apply.
func Flow() *FlowApplyConfiguration {
return &FlowApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *FlowApplyConfiguration) WithName(value string) *FlowApplyConfiguration {
b.Name = &value
return b
}
// WithDependsOn sets the DependsOn field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DependsOn field is set to the value of the last call.
func (b *FlowApplyConfiguration) WithDependsOn(value *DependsOnApplyConfiguration) *FlowApplyConfiguration {
b.DependsOn = value
return b
}

View File

@ -0,0 +1,69 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
)
// HttpGetApplyConfiguration represents a declarative configuration of the HttpGet type for use
// with apply.
type HttpGetApplyConfiguration struct {
TaskName *string `json:"taskName,omitempty"`
Path *string `json:"path,omitempty"`
Port *int `json:"port,omitempty"`
HTTPHeader *v1.HTTPHeader `json:"httpHeader,omitempty"`
}
// HttpGetApplyConfiguration constructs a declarative configuration of the HttpGet type for use with
// apply.
func HttpGet() *HttpGetApplyConfiguration {
return &HttpGetApplyConfiguration{}
}
// WithTaskName sets the TaskName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TaskName field is set to the value of the last call.
func (b *HttpGetApplyConfiguration) WithTaskName(value string) *HttpGetApplyConfiguration {
b.TaskName = &value
return b
}
// WithPath sets the Path field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Path field is set to the value of the last call.
func (b *HttpGetApplyConfiguration) WithPath(value string) *HttpGetApplyConfiguration {
b.Path = &value
return b
}
// WithPort sets the Port field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Port field is set to the value of the last call.
func (b *HttpGetApplyConfiguration) WithPort(value int) *HttpGetApplyConfiguration {
b.Port = &value
return b
}
// WithHTTPHeader sets the HTTPHeader field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HTTPHeader field is set to the value of the last call.
func (b *HttpGetApplyConfiguration) WithHTTPHeader(value v1.HTTPHeader) *HttpGetApplyConfiguration {
b.HTTPHeader = &value
return b
}

View File

@ -0,0 +1,224 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// JobFlowApplyConfiguration represents a declarative configuration of the JobFlow type for use
// with apply.
type JobFlowApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *JobFlowSpecApplyConfiguration `json:"spec,omitempty"`
Status *JobFlowStatusApplyConfiguration `json:"status,omitempty"`
}
// JobFlow constructs a declarative configuration of the JobFlow type for use with
// apply.
func JobFlow(name, namespace string) *JobFlowApplyConfiguration {
b := &JobFlowApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("JobFlow")
b.WithAPIVersion("flow.volcano.sh/v1alpha1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithKind(value string) *JobFlowApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithAPIVersion(value string) *JobFlowApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithName(value string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithGenerateName(value string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithNamespace(value string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithUID(value types.UID) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithResourceVersion(value string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithGeneration(value int64) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *JobFlowApplyConfiguration) WithLabels(entries map[string]string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *JobFlowApplyConfiguration) WithAnnotations(entries map[string]string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *JobFlowApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *JobFlowApplyConfiguration) WithFinalizers(values ...string) *JobFlowApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *JobFlowApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithSpec(value *JobFlowSpecApplyConfiguration) *JobFlowApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *JobFlowApplyConfiguration) WithStatus(value *JobFlowStatusApplyConfiguration) *JobFlowApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *JobFlowApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,56 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
)
// JobFlowSpecApplyConfiguration represents a declarative configuration of the JobFlowSpec type for use
// with apply.
type JobFlowSpecApplyConfiguration struct {
Flows []FlowApplyConfiguration `json:"flows,omitempty"`
JobRetainPolicy *flowv1alpha1.RetainPolicy `json:"jobRetainPolicy,omitempty"`
}
// JobFlowSpecApplyConfiguration constructs a declarative configuration of the JobFlowSpec type for use with
// apply.
func JobFlowSpec() *JobFlowSpecApplyConfiguration {
return &JobFlowSpecApplyConfiguration{}
}
// WithFlows adds the given value to the Flows field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Flows field.
func (b *JobFlowSpecApplyConfiguration) WithFlows(values ...*FlowApplyConfiguration) *JobFlowSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithFlows")
}
b.Flows = append(b.Flows, *values[i])
}
return b
}
// WithJobRetainPolicy sets the JobRetainPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the JobRetainPolicy field is set to the value of the last call.
func (b *JobFlowSpecApplyConfiguration) WithJobRetainPolicy(value flowv1alpha1.RetainPolicy) *JobFlowSpecApplyConfiguration {
b.JobRetainPolicy = &value
return b
}

View File

@ -0,0 +1,133 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// JobFlowStatusApplyConfiguration represents a declarative configuration of the JobFlowStatus type for use
// with apply.
type JobFlowStatusApplyConfiguration struct {
PendingJobs []string `json:"pendingJobs,omitempty"`
RunningJobs []string `json:"runningJobs,omitempty"`
FailedJobs []string `json:"failedJobs,omitempty"`
CompletedJobs []string `json:"completedJobs,omitempty"`
TerminatedJobs []string `json:"terminatedJobs,omitempty"`
UnKnowJobs []string `json:"unKnowJobs,omitempty"`
JobStatusList []JobStatusApplyConfiguration `json:"jobStatusList,omitempty"`
Conditions map[string]ConditionApplyConfiguration `json:"conditions,omitempty"`
State *StateApplyConfiguration `json:"state,omitempty"`
}
// JobFlowStatusApplyConfiguration constructs a declarative configuration of the JobFlowStatus type for use with
// apply.
func JobFlowStatus() *JobFlowStatusApplyConfiguration {
return &JobFlowStatusApplyConfiguration{}
}
// WithPendingJobs adds the given value to the PendingJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the PendingJobs field.
func (b *JobFlowStatusApplyConfiguration) WithPendingJobs(values ...string) *JobFlowStatusApplyConfiguration {
for i := range values {
b.PendingJobs = append(b.PendingJobs, values[i])
}
return b
}
// WithRunningJobs adds the given value to the RunningJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the RunningJobs field.
func (b *JobFlowStatusApplyConfiguration) WithRunningJobs(values ...string) *JobFlowStatusApplyConfiguration {
for i := range values {
b.RunningJobs = append(b.RunningJobs, values[i])
}
return b
}
// WithFailedJobs adds the given value to the FailedJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the FailedJobs field.
func (b *JobFlowStatusApplyConfiguration) WithFailedJobs(values ...string) *JobFlowStatusApplyConfiguration {
for i := range values {
b.FailedJobs = append(b.FailedJobs, values[i])
}
return b
}
// WithCompletedJobs adds the given value to the CompletedJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the CompletedJobs field.
func (b *JobFlowStatusApplyConfiguration) WithCompletedJobs(values ...string) *JobFlowStatusApplyConfiguration {
for i := range values {
b.CompletedJobs = append(b.CompletedJobs, values[i])
}
return b
}
// WithTerminatedJobs adds the given value to the TerminatedJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the TerminatedJobs field.
func (b *JobFlowStatusApplyConfiguration) WithTerminatedJobs(values ...string) *JobFlowStatusApplyConfiguration {
for i := range values {
b.TerminatedJobs = append(b.TerminatedJobs, values[i])
}
return b
}
// WithUnKnowJobs adds the given value to the UnKnowJobs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the UnKnowJobs field.
func (b *JobFlowStatusApplyConfiguration) WithUnKnowJobs(values ...string) *JobFlowStatusApplyConfiguration {
for i := range values {
b.UnKnowJobs = append(b.UnKnowJobs, values[i])
}
return b
}
// WithJobStatusList adds the given value to the JobStatusList field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the JobStatusList field.
func (b *JobFlowStatusApplyConfiguration) WithJobStatusList(values ...*JobStatusApplyConfiguration) *JobFlowStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithJobStatusList")
}
b.JobStatusList = append(b.JobStatusList, *values[i])
}
return b
}
// WithConditions puts the entries into the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Conditions field,
// overwriting an existing map entries in Conditions field with the same key.
func (b *JobFlowStatusApplyConfiguration) WithConditions(entries map[string]ConditionApplyConfiguration) *JobFlowStatusApplyConfiguration {
if b.Conditions == nil && len(entries) > 0 {
b.Conditions = make(map[string]ConditionApplyConfiguration, len(entries))
}
for k, v := range entries {
b.Conditions[k] = v
}
return b
}
// WithState sets the State field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the State field is set to the value of the last call.
func (b *JobFlowStatusApplyConfiguration) WithState(value *StateApplyConfiguration) *JobFlowStatusApplyConfiguration {
b.State = value
return b
}

View File

@ -0,0 +1,61 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobRunningHistoryApplyConfiguration represents a declarative configuration of the JobRunningHistory type for use
// with apply.
type JobRunningHistoryApplyConfiguration struct {
StartTimestamp *v1.Time `json:"startTimestamp,omitempty"`
EndTimestamp *v1.Time `json:"endTimestamp,omitempty"`
State *batchv1alpha1.JobPhase `json:"state,omitempty"`
}
// JobRunningHistoryApplyConfiguration constructs a declarative configuration of the JobRunningHistory type for use with
// apply.
func JobRunningHistory() *JobRunningHistoryApplyConfiguration {
return &JobRunningHistoryApplyConfiguration{}
}
// WithStartTimestamp sets the StartTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the StartTimestamp field is set to the value of the last call.
func (b *JobRunningHistoryApplyConfiguration) WithStartTimestamp(value v1.Time) *JobRunningHistoryApplyConfiguration {
b.StartTimestamp = &value
return b
}
// WithEndTimestamp sets the EndTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the EndTimestamp field is set to the value of the last call.
func (b *JobRunningHistoryApplyConfiguration) WithEndTimestamp(value v1.Time) *JobRunningHistoryApplyConfiguration {
b.EndTimestamp = &value
return b
}
// WithState sets the State field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the State field is set to the value of the last call.
func (b *JobRunningHistoryApplyConfiguration) WithState(value batchv1alpha1.JobPhase) *JobRunningHistoryApplyConfiguration {
b.State = &value
return b
}

View File

@ -0,0 +1,93 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
)
// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use
// with apply.
type JobStatusApplyConfiguration struct {
Name *string `json:"name,omitempty"`
State *batchv1alpha1.JobPhase `json:"state,omitempty"`
StartTimestamp *v1.Time `json:"startTimestamp,omitempty"`
EndTimestamp *v1.Time `json:"endTimestamp,omitempty"`
RestartCount *int32 `json:"restartCount,omitempty"`
RunningHistories []JobRunningHistoryApplyConfiguration `json:"runningHistories,omitempty"`
}
// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with
// apply.
func JobStatus() *JobStatusApplyConfiguration {
return &JobStatusApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithName(value string) *JobStatusApplyConfiguration {
b.Name = &value
return b
}
// WithState sets the State field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the State field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithState(value batchv1alpha1.JobPhase) *JobStatusApplyConfiguration {
b.State = &value
return b
}
// WithStartTimestamp sets the StartTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the StartTimestamp field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithStartTimestamp(value v1.Time) *JobStatusApplyConfiguration {
b.StartTimestamp = &value
return b
}
// WithEndTimestamp sets the EndTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the EndTimestamp field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithEndTimestamp(value v1.Time) *JobStatusApplyConfiguration {
b.EndTimestamp = &value
return b
}
// WithRestartCount sets the RestartCount field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RestartCount field is set to the value of the last call.
func (b *JobStatusApplyConfiguration) WithRestartCount(value int32) *JobStatusApplyConfiguration {
b.RestartCount = &value
return b
}
// WithRunningHistories adds the given value to the RunningHistories field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the RunningHistories field.
func (b *JobStatusApplyConfiguration) WithRunningHistories(values ...*JobRunningHistoryApplyConfiguration) *JobStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithRunningHistories")
}
b.RunningHistories = append(b.RunningHistories, *values[i])
}
return b
}

View File

@ -0,0 +1,225 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
)
// JobTemplateApplyConfiguration represents a declarative configuration of the JobTemplate type for use
// with apply.
type JobTemplateApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *batchv1alpha1.JobSpecApplyConfiguration `json:"spec,omitempty"`
Status *JobTemplateStatusApplyConfiguration `json:"status,omitempty"`
}
// JobTemplate constructs a declarative configuration of the JobTemplate type for use with
// apply.
func JobTemplate(name, namespace string) *JobTemplateApplyConfiguration {
b := &JobTemplateApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("JobTemplate")
b.WithAPIVersion("flow.volcano.sh/v1alpha1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithKind(value string) *JobTemplateApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithAPIVersion(value string) *JobTemplateApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithName(value string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithGenerateName(value string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithNamespace(value string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithUID(value types.UID) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithResourceVersion(value string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithGeneration(value int64) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *JobTemplateApplyConfiguration) WithLabels(entries map[string]string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *JobTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *JobTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *JobTemplateApplyConfiguration) WithFinalizers(values ...string) *JobTemplateApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *JobTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithSpec(value *batchv1alpha1.JobSpecApplyConfiguration) *JobTemplateApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *JobTemplateApplyConfiguration) WithStatus(value *JobTemplateStatusApplyConfiguration) *JobTemplateApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *JobTemplateApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,40 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// JobTemplateStatusApplyConfiguration represents a declarative configuration of the JobTemplateStatus type for use
// with apply.
type JobTemplateStatusApplyConfiguration struct {
JobDependsOnList []string `json:"jobDependsOnList,omitempty"`
}
// JobTemplateStatusApplyConfiguration constructs a declarative configuration of the JobTemplateStatus type for use with
// apply.
func JobTemplateStatus() *JobTemplateStatusApplyConfiguration {
return &JobTemplateStatusApplyConfiguration{}
}
// WithJobDependsOnList adds the given value to the JobDependsOnList field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the JobDependsOnList field.
func (b *JobTemplateStatusApplyConfiguration) WithJobDependsOnList(values ...string) *JobTemplateStatusApplyConfiguration {
for i := range values {
b.JobDependsOnList = append(b.JobDependsOnList, values[i])
}
return b
}

View File

@ -0,0 +1,71 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// ProbeApplyConfiguration represents a declarative configuration of the Probe type for use
// with apply.
type ProbeApplyConfiguration struct {
HttpGetList []HttpGetApplyConfiguration `json:"httpGetList,omitempty"`
TcpSocketList []TcpSocketApplyConfiguration `json:"tcpSocketList,omitempty"`
TaskStatusList []TaskStatusApplyConfiguration `json:"taskStatusList,omitempty"`
}
// ProbeApplyConfiguration constructs a declarative configuration of the Probe type for use with
// apply.
func Probe() *ProbeApplyConfiguration {
return &ProbeApplyConfiguration{}
}
// WithHttpGetList adds the given value to the HttpGetList field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the HttpGetList field.
func (b *ProbeApplyConfiguration) WithHttpGetList(values ...*HttpGetApplyConfiguration) *ProbeApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithHttpGetList")
}
b.HttpGetList = append(b.HttpGetList, *values[i])
}
return b
}
// WithTcpSocketList adds the given value to the TcpSocketList field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the TcpSocketList field.
func (b *ProbeApplyConfiguration) WithTcpSocketList(values ...*TcpSocketApplyConfiguration) *ProbeApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithTcpSocketList")
}
b.TcpSocketList = append(b.TcpSocketList, *values[i])
}
return b
}
// WithTaskStatusList adds the given value to the TaskStatusList field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the TaskStatusList field.
func (b *ProbeApplyConfiguration) WithTaskStatusList(values ...*TaskStatusApplyConfiguration) *ProbeApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithTaskStatusList")
}
b.TaskStatusList = append(b.TaskStatusList, *values[i])
}
return b
}

View File

@ -0,0 +1,42 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
)
// StateApplyConfiguration represents a declarative configuration of the State type for use
// with apply.
type StateApplyConfiguration struct {
Phase *flowv1alpha1.Phase `json:"phase,omitempty"`
}
// StateApplyConfiguration constructs a declarative configuration of the State type for use with
// apply.
func State() *StateApplyConfiguration {
return &StateApplyConfiguration{}
}
// WithPhase sets the Phase field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Phase field is set to the value of the last call.
func (b *StateApplyConfiguration) WithPhase(value flowv1alpha1.Phase) *StateApplyConfiguration {
b.Phase = &value
return b
}

View File

@ -0,0 +1,47 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// TaskStatusApplyConfiguration represents a declarative configuration of the TaskStatus type for use
// with apply.
type TaskStatusApplyConfiguration struct {
TaskName *string `json:"taskName,omitempty"`
Phase *string `json:"phase,omitempty"`
}
// TaskStatusApplyConfiguration constructs a declarative configuration of the TaskStatus type for use with
// apply.
func TaskStatus() *TaskStatusApplyConfiguration {
return &TaskStatusApplyConfiguration{}
}
// WithTaskName sets the TaskName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TaskName field is set to the value of the last call.
func (b *TaskStatusApplyConfiguration) WithTaskName(value string) *TaskStatusApplyConfiguration {
b.TaskName = &value
return b
}
// WithPhase sets the Phase field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Phase field is set to the value of the last call.
func (b *TaskStatusApplyConfiguration) WithPhase(value string) *TaskStatusApplyConfiguration {
b.Phase = &value
return b
}

View File

@ -0,0 +1,47 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// TcpSocketApplyConfiguration represents a declarative configuration of the TcpSocket type for use
// with apply.
type TcpSocketApplyConfiguration struct {
TaskName *string `json:"taskName,omitempty"`
Port *int `json:"port,omitempty"`
}
// TcpSocketApplyConfiguration constructs a declarative configuration of the TcpSocket type for use with
// apply.
func TcpSocket() *TcpSocketApplyConfiguration {
return &TcpSocketApplyConfiguration{}
}
// WithTaskName sets the TaskName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TaskName field is set to the value of the last call.
func (b *TcpSocketApplyConfiguration) WithTaskName(value string) *TcpSocketApplyConfiguration {
b.TaskName = &value
return b
}
// WithPort sets the Port field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Port field is set to the value of the last call.
func (b *TcpSocketApplyConfiguration) WithPort(value int) *TcpSocketApplyConfiguration {
b.Port = &value
return b
}

View File

@ -0,0 +1,61 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package internal
import (
fmt "fmt"
sync "sync"
typed "sigs.k8s.io/structured-merge-diff/v4/typed"
)
func Parser() *typed.Parser {
parserOnce.Do(func() {
var err error
parser, err = typed.NewParser(schemaYAML)
if err != nil {
panic(fmt.Sprintf("Failed to parse schema: %v", err))
}
})
return parser
}
var parserOnce sync.Once
var parser *typed.Parser
var schemaYAML = typed.YAMLObject(`types:
- name: __untyped_atomic_
scalar: untyped
list:
elementType:
namedType: __untyped_atomic_
elementRelationship: atomic
map:
elementType:
namedType: __untyped_atomic_
elementRelationship: atomic
- name: __untyped_deduced_
scalar: untyped
list:
elementType:
namedType: __untyped_atomic_
elementRelationship: atomic
map:
elementType:
namedType: __untyped_deduced_
elementRelationship: separable
`)

View File

@ -0,0 +1,56 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// CPUInfoApplyConfiguration represents a declarative configuration of the CPUInfo type for use
// with apply.
type CPUInfoApplyConfiguration struct {
NUMANodeID *int `json:"numa,omitempty"`
SocketID *int `json:"socket,omitempty"`
CoreID *int `json:"core,omitempty"`
}
// CPUInfoApplyConfiguration constructs a declarative configuration of the CPUInfo type for use with
// apply.
func CPUInfo() *CPUInfoApplyConfiguration {
return &CPUInfoApplyConfiguration{}
}
// WithNUMANodeID sets the NUMANodeID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NUMANodeID field is set to the value of the last call.
func (b *CPUInfoApplyConfiguration) WithNUMANodeID(value int) *CPUInfoApplyConfiguration {
b.NUMANodeID = &value
return b
}
// WithSocketID sets the SocketID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SocketID field is set to the value of the last call.
func (b *CPUInfoApplyConfiguration) WithSocketID(value int) *CPUInfoApplyConfiguration {
b.SocketID = &value
return b
}
// WithCoreID sets the CoreID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CoreID field is set to the value of the last call.
func (b *CPUInfoApplyConfiguration) WithCoreID(value int) *CPUInfoApplyConfiguration {
b.CoreID = &value
return b
}

View File

@ -0,0 +1,214 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// NumatopologyApplyConfiguration represents a declarative configuration of the Numatopology type for use
// with apply.
type NumatopologyApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *NumatopoSpecApplyConfiguration `json:"spec,omitempty"`
}
// Numatopology constructs a declarative configuration of the Numatopology type for use with
// apply.
func Numatopology(name string) *NumatopologyApplyConfiguration {
b := &NumatopologyApplyConfiguration{}
b.WithName(name)
b.WithKind("Numatopology")
b.WithAPIVersion("nodeinfo.volcano.sh/v1alpha1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithKind(value string) *NumatopologyApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithAPIVersion(value string) *NumatopologyApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithName(value string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithGenerateName(value string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithNamespace(value string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithUID(value types.UID) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithResourceVersion(value string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithGeneration(value int64) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *NumatopologyApplyConfiguration) WithLabels(entries map[string]string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *NumatopologyApplyConfiguration) WithAnnotations(entries map[string]string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *NumatopologyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *NumatopologyApplyConfiguration) WithFinalizers(values ...string) *NumatopologyApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *NumatopologyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *NumatopologyApplyConfiguration) WithSpec(value *NumatopoSpecApplyConfiguration) *NumatopologyApplyConfiguration {
b.Spec = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *NumatopologyApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,93 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
nodeinfov1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
)
// NumatopoSpecApplyConfiguration represents a declarative configuration of the NumatopoSpec type for use
// with apply.
type NumatopoSpecApplyConfiguration struct {
Policies map[nodeinfov1alpha1.PolicyName]string `json:"policies,omitempty"`
ResReserved map[string]string `json:"resReserved,omitempty"`
NumaResMap map[string]ResourceInfoApplyConfiguration `json:"numares,omitempty"`
CPUDetail map[string]CPUInfoApplyConfiguration `json:"cpuDetail,omitempty"`
}
// NumatopoSpecApplyConfiguration constructs a declarative configuration of the NumatopoSpec type for use with
// apply.
func NumatopoSpec() *NumatopoSpecApplyConfiguration {
return &NumatopoSpecApplyConfiguration{}
}
// WithPolicies puts the entries into the Policies field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Policies field,
// overwriting an existing map entries in Policies field with the same key.
func (b *NumatopoSpecApplyConfiguration) WithPolicies(entries map[nodeinfov1alpha1.PolicyName]string) *NumatopoSpecApplyConfiguration {
if b.Policies == nil && len(entries) > 0 {
b.Policies = make(map[nodeinfov1alpha1.PolicyName]string, len(entries))
}
for k, v := range entries {
b.Policies[k] = v
}
return b
}
// WithResReserved puts the entries into the ResReserved field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the ResReserved field,
// overwriting an existing map entries in ResReserved field with the same key.
func (b *NumatopoSpecApplyConfiguration) WithResReserved(entries map[string]string) *NumatopoSpecApplyConfiguration {
if b.ResReserved == nil && len(entries) > 0 {
b.ResReserved = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ResReserved[k] = v
}
return b
}
// WithNumaResMap puts the entries into the NumaResMap field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the NumaResMap field,
// overwriting an existing map entries in NumaResMap field with the same key.
func (b *NumatopoSpecApplyConfiguration) WithNumaResMap(entries map[string]ResourceInfoApplyConfiguration) *NumatopoSpecApplyConfiguration {
if b.NumaResMap == nil && len(entries) > 0 {
b.NumaResMap = make(map[string]ResourceInfoApplyConfiguration, len(entries))
}
for k, v := range entries {
b.NumaResMap[k] = v
}
return b
}
// WithCPUDetail puts the entries into the CPUDetail field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the CPUDetail field,
// overwriting an existing map entries in CPUDetail field with the same key.
func (b *NumatopoSpecApplyConfiguration) WithCPUDetail(entries map[string]CPUInfoApplyConfiguration) *NumatopoSpecApplyConfiguration {
if b.CPUDetail == nil && len(entries) > 0 {
b.CPUDetail = make(map[string]CPUInfoApplyConfiguration, len(entries))
}
for k, v := range entries {
b.CPUDetail[k] = v
}
return b
}

View File

@ -0,0 +1,47 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// ResourceInfoApplyConfiguration represents a declarative configuration of the ResourceInfo type for use
// with apply.
type ResourceInfoApplyConfiguration struct {
Allocatable *string `json:"allocatable,omitempty"`
Capacity *int `json:"capacity,omitempty"`
}
// ResourceInfoApplyConfiguration constructs a declarative configuration of the ResourceInfo type for use with
// apply.
func ResourceInfo() *ResourceInfoApplyConfiguration {
return &ResourceInfoApplyConfiguration{}
}
// WithAllocatable sets the Allocatable field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Allocatable field is set to the value of the last call.
func (b *ResourceInfoApplyConfiguration) WithAllocatable(value string) *ResourceInfoApplyConfiguration {
b.Allocatable = &value
return b
}
// WithCapacity sets the Capacity field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Capacity field is set to the value of the last call.
func (b *ResourceInfoApplyConfiguration) WithCapacity(value int) *ResourceInfoApplyConfiguration {
b.Capacity = &value
return b
}

View File

@ -0,0 +1,47 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
// AffinityApplyConfiguration represents a declarative configuration of the Affinity type for use
// with apply.
type AffinityApplyConfiguration struct {
NodeGroupAffinity *NodeGroupAffinityApplyConfiguration `json:"nodeGroupAffinity,omitempty"`
NodeGroupAntiAffinity *NodeGroupAntiAffinityApplyConfiguration `json:"nodeGroupAntiAffinity,omitempty"`
}
// AffinityApplyConfiguration constructs a declarative configuration of the Affinity type for use with
// apply.
func Affinity() *AffinityApplyConfiguration {
return &AffinityApplyConfiguration{}
}
// WithNodeGroupAffinity sets the NodeGroupAffinity field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeGroupAffinity field is set to the value of the last call.
func (b *AffinityApplyConfiguration) WithNodeGroupAffinity(value *NodeGroupAffinityApplyConfiguration) *AffinityApplyConfiguration {
b.NodeGroupAffinity = value
return b
}
// WithNodeGroupAntiAffinity sets the NodeGroupAntiAffinity field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeGroupAntiAffinity field is set to the value of the last call.
func (b *AffinityApplyConfiguration) WithNodeGroupAntiAffinity(value *NodeGroupAntiAffinityApplyConfiguration) *AffinityApplyConfiguration {
b.NodeGroupAntiAffinity = value
return b
}

View File

@ -0,0 +1,60 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
)
// ClusterApplyConfiguration represents a declarative configuration of the Cluster type for use
// with apply.
type ClusterApplyConfiguration struct {
Name *string `json:"name,omitempty"`
Weight *int32 `json:"weight,omitempty"`
Capacity *v1.ResourceList `json:"capacity,omitempty"`
}
// ClusterApplyConfiguration constructs a declarative configuration of the Cluster type for use with
// apply.
func Cluster() *ClusterApplyConfiguration {
return &ClusterApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *ClusterApplyConfiguration) WithName(value string) *ClusterApplyConfiguration {
b.Name = &value
return b
}
// WithWeight sets the Weight field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Weight field is set to the value of the last call.
func (b *ClusterApplyConfiguration) WithWeight(value int32) *ClusterApplyConfiguration {
b.Weight = &value
return b
}
// WithCapacity sets the Capacity field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Capacity field is set to the value of the last call.
func (b *ClusterApplyConfiguration) WithCapacity(value v1.ResourceList) *ClusterApplyConfiguration {
b.Capacity = &value
return b
}

View File

@ -0,0 +1,42 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
)
// GuaranteeApplyConfiguration represents a declarative configuration of the Guarantee type for use
// with apply.
type GuaranteeApplyConfiguration struct {
Resource *v1.ResourceList `json:"resource,omitempty"`
}
// GuaranteeApplyConfiguration constructs a declarative configuration of the Guarantee type for use with
// apply.
func Guarantee() *GuaranteeApplyConfiguration {
return &GuaranteeApplyConfiguration{}
}
// WithResource sets the Resource field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Resource field is set to the value of the last call.
func (b *GuaranteeApplyConfiguration) WithResource(value v1.ResourceList) *GuaranteeApplyConfiguration {
b.Resource = &value
return b
}

View File

@ -0,0 +1,51 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// NetworkTopologySpecApplyConfiguration represents a declarative configuration of the NetworkTopologySpec type for use
// with apply.
type NetworkTopologySpecApplyConfiguration struct {
Mode *schedulingv1beta1.NetworkTopologyMode `json:"mode,omitempty"`
HighestTierAllowed *int `json:"highestTierAllowed,omitempty"`
}
// NetworkTopologySpecApplyConfiguration constructs a declarative configuration of the NetworkTopologySpec type for use with
// apply.
func NetworkTopologySpec() *NetworkTopologySpecApplyConfiguration {
return &NetworkTopologySpecApplyConfiguration{}
}
// WithMode sets the Mode field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Mode field is set to the value of the last call.
func (b *NetworkTopologySpecApplyConfiguration) WithMode(value schedulingv1beta1.NetworkTopologyMode) *NetworkTopologySpecApplyConfiguration {
b.Mode = &value
return b
}
// WithHighestTierAllowed sets the HighestTierAllowed field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the HighestTierAllowed field is set to the value of the last call.
func (b *NetworkTopologySpecApplyConfiguration) WithHighestTierAllowed(value int) *NetworkTopologySpecApplyConfiguration {
b.HighestTierAllowed = &value
return b
}

View File

@ -0,0 +1,51 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
// NodeGroupAffinityApplyConfiguration represents a declarative configuration of the NodeGroupAffinity type for use
// with apply.
type NodeGroupAffinityApplyConfiguration struct {
RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
// NodeGroupAffinityApplyConfiguration constructs a declarative configuration of the NodeGroupAffinity type for use with
// apply.
func NodeGroupAffinity() *NodeGroupAffinityApplyConfiguration {
return &NodeGroupAffinityApplyConfiguration{}
}
// WithRequiredDuringSchedulingIgnoredDuringExecution adds the given value to the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the RequiredDuringSchedulingIgnoredDuringExecution field.
func (b *NodeGroupAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(values ...string) *NodeGroupAffinityApplyConfiguration {
for i := range values {
b.RequiredDuringSchedulingIgnoredDuringExecution = append(b.RequiredDuringSchedulingIgnoredDuringExecution, values[i])
}
return b
}
// WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field.
func (b *NodeGroupAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...string) *NodeGroupAffinityApplyConfiguration {
for i := range values {
b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, values[i])
}
return b
}

View File

@ -0,0 +1,51 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
// NodeGroupAntiAffinityApplyConfiguration represents a declarative configuration of the NodeGroupAntiAffinity type for use
// with apply.
type NodeGroupAntiAffinityApplyConfiguration struct {
RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"`
}
// NodeGroupAntiAffinityApplyConfiguration constructs a declarative configuration of the NodeGroupAntiAffinity type for use with
// apply.
func NodeGroupAntiAffinity() *NodeGroupAntiAffinityApplyConfiguration {
return &NodeGroupAntiAffinityApplyConfiguration{}
}
// WithRequiredDuringSchedulingIgnoredDuringExecution adds the given value to the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the RequiredDuringSchedulingIgnoredDuringExecution field.
func (b *NodeGroupAntiAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(values ...string) *NodeGroupAntiAffinityApplyConfiguration {
for i := range values {
b.RequiredDuringSchedulingIgnoredDuringExecution = append(b.RequiredDuringSchedulingIgnoredDuringExecution, values[i])
}
return b
}
// WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field.
func (b *NodeGroupAntiAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...string) *NodeGroupAntiAffinityApplyConfiguration {
for i := range values {
b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, values[i])
}
return b
}

View File

@ -0,0 +1,224 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use
// with apply.
type PodGroupApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *PodGroupSpecApplyConfiguration `json:"spec,omitempty"`
Status *PodGroupStatusApplyConfiguration `json:"status,omitempty"`
}
// PodGroup constructs a declarative configuration of the PodGroup type for use with
// apply.
func PodGroup(name, namespace string) *PodGroupApplyConfiguration {
b := &PodGroupApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("PodGroup")
b.WithAPIVersion("scheduling.volcano.sh/v1beta1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithKind(value string) *PodGroupApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithAPIVersion(value string) *PodGroupApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithName(value string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithGenerateName(value string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithNamespace(value string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithUID(value types.UID) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithResourceVersion(value string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithGeneration(value int64) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *PodGroupApplyConfiguration) WithLabels(entries map[string]string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *PodGroupApplyConfiguration) WithAnnotations(entries map[string]string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *PodGroupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *PodGroupApplyConfiguration) WithFinalizers(values ...string) *PodGroupApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *PodGroupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithSpec(value *PodGroupSpecApplyConfiguration) *PodGroupApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *PodGroupApplyConfiguration) WithStatus(value *PodGroupStatusApplyConfiguration) *PodGroupApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *PodGroupApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,89 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// PodGroupConditionApplyConfiguration represents a declarative configuration of the PodGroupCondition type for use
// with apply.
type PodGroupConditionApplyConfiguration struct {
Type *schedulingv1beta1.PodGroupConditionType `json:"type,omitempty"`
Status *v1.ConditionStatus `json:"status,omitempty"`
TransitionID *string `json:"transitionID,omitempty"`
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
}
// PodGroupConditionApplyConfiguration constructs a declarative configuration of the PodGroupCondition type for use with
// apply.
func PodGroupCondition() *PodGroupConditionApplyConfiguration {
return &PodGroupConditionApplyConfiguration{}
}
// WithType sets the Type field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Type field is set to the value of the last call.
func (b *PodGroupConditionApplyConfiguration) WithType(value schedulingv1beta1.PodGroupConditionType) *PodGroupConditionApplyConfiguration {
b.Type = &value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *PodGroupConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PodGroupConditionApplyConfiguration {
b.Status = &value
return b
}
// WithTransitionID sets the TransitionID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TransitionID field is set to the value of the last call.
func (b *PodGroupConditionApplyConfiguration) WithTransitionID(value string) *PodGroupConditionApplyConfiguration {
b.TransitionID = &value
return b
}
// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LastTransitionTime field is set to the value of the last call.
func (b *PodGroupConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PodGroupConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}
// WithReason sets the Reason field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Reason field is set to the value of the last call.
func (b *PodGroupConditionApplyConfiguration) WithReason(value string) *PodGroupConditionApplyConfiguration {
b.Reason = &value
return b
}
// WithMessage sets the Message field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Message field is set to the value of the last call.
func (b *PodGroupConditionApplyConfiguration) WithMessage(value string) *PodGroupConditionApplyConfiguration {
b.Message = &value
return b
}

View File

@ -0,0 +1,93 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
)
// PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use
// with apply.
type PodGroupSpecApplyConfiguration struct {
MinMember *int32 `json:"minMember,omitempty"`
MinTaskMember map[string]int32 `json:"minTaskMember,omitempty"`
Queue *string `json:"queue,omitempty"`
PriorityClassName *string `json:"priorityClassName,omitempty"`
MinResources *v1.ResourceList `json:"minResources,omitempty"`
NetworkTopology *NetworkTopologySpecApplyConfiguration `json:"networkTopology,omitempty"`
}
// PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with
// apply.
func PodGroupSpec() *PodGroupSpecApplyConfiguration {
return &PodGroupSpecApplyConfiguration{}
}
// WithMinMember sets the MinMember field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MinMember field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithMinMember(value int32) *PodGroupSpecApplyConfiguration {
b.MinMember = &value
return b
}
// WithMinTaskMember puts the entries into the MinTaskMember field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the MinTaskMember field,
// overwriting an existing map entries in MinTaskMember field with the same key.
func (b *PodGroupSpecApplyConfiguration) WithMinTaskMember(entries map[string]int32) *PodGroupSpecApplyConfiguration {
if b.MinTaskMember == nil && len(entries) > 0 {
b.MinTaskMember = make(map[string]int32, len(entries))
}
for k, v := range entries {
b.MinTaskMember[k] = v
}
return b
}
// WithQueue sets the Queue field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Queue field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithQueue(value string) *PodGroupSpecApplyConfiguration {
b.Queue = &value
return b
}
// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PriorityClassName field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithPriorityClassName(value string) *PodGroupSpecApplyConfiguration {
b.PriorityClassName = &value
return b
}
// WithMinResources sets the MinResources field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MinResources field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithMinResources(value v1.ResourceList) *PodGroupSpecApplyConfiguration {
b.MinResources = &value
return b
}
// WithNetworkTopology sets the NetworkTopology field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NetworkTopology field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithNetworkTopology(value *NetworkTopologySpecApplyConfiguration) *PodGroupSpecApplyConfiguration {
b.NetworkTopology = value
return b
}

View File

@ -0,0 +1,83 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// PodGroupStatusApplyConfiguration represents a declarative configuration of the PodGroupStatus type for use
// with apply.
type PodGroupStatusApplyConfiguration struct {
Phase *schedulingv1beta1.PodGroupPhase `json:"phase,omitempty"`
Conditions []PodGroupConditionApplyConfiguration `json:"conditions,omitempty"`
Running *int32 `json:"running,omitempty"`
Succeeded *int32 `json:"succeeded,omitempty"`
Failed *int32 `json:"failed,omitempty"`
}
// PodGroupStatusApplyConfiguration constructs a declarative configuration of the PodGroupStatus type for use with
// apply.
func PodGroupStatus() *PodGroupStatusApplyConfiguration {
return &PodGroupStatusApplyConfiguration{}
}
// WithPhase sets the Phase field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Phase field is set to the value of the last call.
func (b *PodGroupStatusApplyConfiguration) WithPhase(value schedulingv1beta1.PodGroupPhase) *PodGroupStatusApplyConfiguration {
b.Phase = &value
return b
}
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
func (b *PodGroupStatusApplyConfiguration) WithConditions(values ...*PodGroupConditionApplyConfiguration) *PodGroupStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}
// WithRunning sets the Running field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Running field is set to the value of the last call.
func (b *PodGroupStatusApplyConfiguration) WithRunning(value int32) *PodGroupStatusApplyConfiguration {
b.Running = &value
return b
}
// WithSucceeded sets the Succeeded field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Succeeded field is set to the value of the last call.
func (b *PodGroupStatusApplyConfiguration) WithSucceeded(value int32) *PodGroupStatusApplyConfiguration {
b.Succeeded = &value
return b
}
// WithFailed sets the Failed field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Failed field is set to the value of the last call.
func (b *PodGroupStatusApplyConfiguration) WithFailed(value int32) *PodGroupStatusApplyConfiguration {
b.Failed = &value
return b
}

View File

@ -0,0 +1,223 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// QueueApplyConfiguration represents a declarative configuration of the Queue type for use
// with apply.
type QueueApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *QueueSpecApplyConfiguration `json:"spec,omitempty"`
Status *QueueStatusApplyConfiguration `json:"status,omitempty"`
}
// Queue constructs a declarative configuration of the Queue type for use with
// apply.
func Queue(name string) *QueueApplyConfiguration {
b := &QueueApplyConfiguration{}
b.WithName(name)
b.WithKind("Queue")
b.WithAPIVersion("scheduling.volcano.sh/v1beta1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithKind(value string) *QueueApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithAPIVersion(value string) *QueueApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithName(value string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithGenerateName(value string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithNamespace(value string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithUID(value types.UID) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithResourceVersion(value string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithGeneration(value int64) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithCreationTimestamp(value metav1.Time) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *QueueApplyConfiguration) WithLabels(entries map[string]string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *QueueApplyConfiguration) WithAnnotations(entries map[string]string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *QueueApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *QueueApplyConfiguration) WithFinalizers(values ...string) *QueueApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *QueueApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithSpec(value *QueueSpecApplyConfiguration) *QueueApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *QueueApplyConfiguration) WithStatus(value *QueueStatusApplyConfiguration) *QueueApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *QueueApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,128 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
)
// QueueSpecApplyConfiguration represents a declarative configuration of the QueueSpec type for use
// with apply.
type QueueSpecApplyConfiguration struct {
Weight *int32 `json:"weight,omitempty"`
Capability *v1.ResourceList `json:"capability,omitempty"`
Reclaimable *bool `json:"reclaimable,omitempty"`
ExtendClusters []ClusterApplyConfiguration `json:"extendClusters,omitempty"`
Guarantee *GuaranteeApplyConfiguration `json:"guarantee,omitempty"`
Affinity *AffinityApplyConfiguration `json:"affinity,omitempty"`
Type *string `json:"type,omitempty"`
Parent *string `json:"parent,omitempty"`
Deserved *v1.ResourceList `json:"deserved,omitempty"`
Priority *int32 `json:"priority,omitempty"`
}
// QueueSpecApplyConfiguration constructs a declarative configuration of the QueueSpec type for use with
// apply.
func QueueSpec() *QueueSpecApplyConfiguration {
return &QueueSpecApplyConfiguration{}
}
// WithWeight sets the Weight field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Weight field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithWeight(value int32) *QueueSpecApplyConfiguration {
b.Weight = &value
return b
}
// WithCapability sets the Capability field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Capability field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithCapability(value v1.ResourceList) *QueueSpecApplyConfiguration {
b.Capability = &value
return b
}
// WithReclaimable sets the Reclaimable field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Reclaimable field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithReclaimable(value bool) *QueueSpecApplyConfiguration {
b.Reclaimable = &value
return b
}
// WithExtendClusters adds the given value to the ExtendClusters field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ExtendClusters field.
func (b *QueueSpecApplyConfiguration) WithExtendClusters(values ...*ClusterApplyConfiguration) *QueueSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithExtendClusters")
}
b.ExtendClusters = append(b.ExtendClusters, *values[i])
}
return b
}
// WithGuarantee sets the Guarantee field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Guarantee field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithGuarantee(value *GuaranteeApplyConfiguration) *QueueSpecApplyConfiguration {
b.Guarantee = value
return b
}
// WithAffinity sets the Affinity field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Affinity field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithAffinity(value *AffinityApplyConfiguration) *QueueSpecApplyConfiguration {
b.Affinity = value
return b
}
// WithType sets the Type field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Type field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithType(value string) *QueueSpecApplyConfiguration {
b.Type = &value
return b
}
// WithParent sets the Parent field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Parent field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithParent(value string) *QueueSpecApplyConfiguration {
b.Parent = &value
return b
}
// WithDeserved sets the Deserved field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Deserved field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithDeserved(value v1.ResourceList) *QueueSpecApplyConfiguration {
b.Deserved = &value
return b
}
// WithPriority sets the Priority field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Priority field is set to the value of the last call.
func (b *QueueSpecApplyConfiguration) WithPriority(value int32) *QueueSpecApplyConfiguration {
b.Priority = &value
return b
}

View File

@ -0,0 +1,106 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
)
// QueueStatusApplyConfiguration represents a declarative configuration of the QueueStatus type for use
// with apply.
type QueueStatusApplyConfiguration struct {
State *schedulingv1beta1.QueueState `json:"state,omitempty"`
Unknown *int32 `json:"unknown,omitempty"`
Pending *int32 `json:"pending,omitempty"`
Running *int32 `json:"running,omitempty"`
Inqueue *int32 `json:"inqueue,omitempty"`
Completed *int32 `json:"completed,omitempty"`
Reservation *ReservationApplyConfiguration `json:"reservation,omitempty"`
Allocated *v1.ResourceList `json:"allocated,omitempty"`
}
// QueueStatusApplyConfiguration constructs a declarative configuration of the QueueStatus type for use with
// apply.
func QueueStatus() *QueueStatusApplyConfiguration {
return &QueueStatusApplyConfiguration{}
}
// WithState sets the State field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the State field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithState(value schedulingv1beta1.QueueState) *QueueStatusApplyConfiguration {
b.State = &value
return b
}
// WithUnknown sets the Unknown field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Unknown field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithUnknown(value int32) *QueueStatusApplyConfiguration {
b.Unknown = &value
return b
}
// WithPending sets the Pending field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Pending field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithPending(value int32) *QueueStatusApplyConfiguration {
b.Pending = &value
return b
}
// WithRunning sets the Running field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Running field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithRunning(value int32) *QueueStatusApplyConfiguration {
b.Running = &value
return b
}
// WithInqueue sets the Inqueue field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Inqueue field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithInqueue(value int32) *QueueStatusApplyConfiguration {
b.Inqueue = &value
return b
}
// WithCompleted sets the Completed field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Completed field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithCompleted(value int32) *QueueStatusApplyConfiguration {
b.Completed = &value
return b
}
// WithReservation sets the Reservation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Reservation field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithReservation(value *ReservationApplyConfiguration) *QueueStatusApplyConfiguration {
b.Reservation = value
return b
}
// WithAllocated sets the Allocated field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Allocated field is set to the value of the last call.
func (b *QueueStatusApplyConfiguration) WithAllocated(value v1.ResourceList) *QueueStatusApplyConfiguration {
b.Allocated = &value
return b
}

View File

@ -0,0 +1,53 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1beta1
import (
v1 "k8s.io/api/core/v1"
)
// ReservationApplyConfiguration represents a declarative configuration of the Reservation type for use
// with apply.
type ReservationApplyConfiguration struct {
Nodes []string `json:"nodes,omitempty"`
Resource *v1.ResourceList `json:"resource,omitempty"`
}
// ReservationApplyConfiguration constructs a declarative configuration of the Reservation type for use with
// apply.
func Reservation() *ReservationApplyConfiguration {
return &ReservationApplyConfiguration{}
}
// WithNodes adds the given value to the Nodes field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Nodes field.
func (b *ReservationApplyConfiguration) WithNodes(values ...string) *ReservationApplyConfiguration {
for i := range values {
b.Nodes = append(b.Nodes, values[i])
}
return b
}
// WithResource sets the Resource field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Resource field is set to the value of the last call.
func (b *ReservationApplyConfiguration) WithResource(value v1.ResourceList) *ReservationApplyConfiguration {
b.Resource = &value
return b
}

View File

@ -0,0 +1,38 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// ExactMatchApplyConfiguration represents a declarative configuration of the ExactMatch type for use
// with apply.
type ExactMatchApplyConfiguration struct {
Name *string `json:"name,omitempty"`
}
// ExactMatchApplyConfiguration constructs a declarative configuration of the ExactMatch type for use with
// apply.
func ExactMatch() *ExactMatchApplyConfiguration {
return &ExactMatchApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *ExactMatchApplyConfiguration) WithName(value string) *ExactMatchApplyConfiguration {
b.Name = &value
return b
}

View File

@ -0,0 +1,223 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// HyperNodeApplyConfiguration represents a declarative configuration of the HyperNode type for use
// with apply.
type HyperNodeApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *HyperNodeSpecApplyConfiguration `json:"spec,omitempty"`
Status *HyperNodeStatusApplyConfiguration `json:"status,omitempty"`
}
// HyperNode constructs a declarative configuration of the HyperNode type for use with
// apply.
func HyperNode(name string) *HyperNodeApplyConfiguration {
b := &HyperNodeApplyConfiguration{}
b.WithName(name)
b.WithKind("HyperNode")
b.WithAPIVersion("topology.volcano.sh/v1alpha1")
return b
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithKind(value string) *HyperNodeApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithAPIVersion(value string) *HyperNodeApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithName(value string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithGenerateName(value string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithNamespace(value string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithUID(value types.UID) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithResourceVersion(value string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithGeneration(value int64) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *HyperNodeApplyConfiguration) WithLabels(entries map[string]string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *HyperNodeApplyConfiguration) WithAnnotations(entries map[string]string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *HyperNodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *HyperNodeApplyConfiguration) WithFinalizers(values ...string) *HyperNodeApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *HyperNodeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithSpec(value *HyperNodeSpecApplyConfiguration) *HyperNodeApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *HyperNodeApplyConfiguration) WithStatus(value *HyperNodeStatusApplyConfiguration) *HyperNodeApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *HyperNodeApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@ -0,0 +1,52 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// HyperNodeSpecApplyConfiguration represents a declarative configuration of the HyperNodeSpec type for use
// with apply.
type HyperNodeSpecApplyConfiguration struct {
Tier *int `json:"tier,omitempty"`
Members []MemberSpecApplyConfiguration `json:"members,omitempty"`
}
// HyperNodeSpecApplyConfiguration constructs a declarative configuration of the HyperNodeSpec type for use with
// apply.
func HyperNodeSpec() *HyperNodeSpecApplyConfiguration {
return &HyperNodeSpecApplyConfiguration{}
}
// WithTier sets the Tier field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Tier field is set to the value of the last call.
func (b *HyperNodeSpecApplyConfiguration) WithTier(value int) *HyperNodeSpecApplyConfiguration {
b.Tier = &value
return b
}
// WithMembers adds the given value to the Members field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Members field.
func (b *HyperNodeSpecApplyConfiguration) WithMembers(values ...*MemberSpecApplyConfiguration) *HyperNodeSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithMembers")
}
b.Members = append(b.Members, *values[i])
}
return b
}

View File

@ -0,0 +1,56 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// HyperNodeStatusApplyConfiguration represents a declarative configuration of the HyperNodeStatus type for use
// with apply.
type HyperNodeStatusApplyConfiguration struct {
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
NodeCount *int64 `json:"nodeCount,omitempty"`
}
// HyperNodeStatusApplyConfiguration constructs a declarative configuration of the HyperNodeStatus type for use with
// apply.
func HyperNodeStatus() *HyperNodeStatusApplyConfiguration {
return &HyperNodeStatusApplyConfiguration{}
}
// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
func (b *HyperNodeStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *HyperNodeStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
}
b.Conditions = append(b.Conditions, *values[i])
}
return b
}
// WithNodeCount sets the NodeCount field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the NodeCount field is set to the value of the last call.
func (b *HyperNodeStatusApplyConfiguration) WithNodeCount(value int64) *HyperNodeStatusApplyConfiguration {
b.NodeCount = &value
return b
}

View File

@ -0,0 +1,60 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// MemberSelectorApplyConfiguration represents a declarative configuration of the MemberSelector type for use
// with apply.
type MemberSelectorApplyConfiguration struct {
ExactMatch *ExactMatchApplyConfiguration `json:"exactMatch,omitempty"`
RegexMatch *RegexMatchApplyConfiguration `json:"regexMatch,omitempty"`
LabelMatch *v1.LabelSelectorApplyConfiguration `json:"labelMatch,omitempty"`
}
// MemberSelectorApplyConfiguration constructs a declarative configuration of the MemberSelector type for use with
// apply.
func MemberSelector() *MemberSelectorApplyConfiguration {
return &MemberSelectorApplyConfiguration{}
}
// WithExactMatch sets the ExactMatch field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ExactMatch field is set to the value of the last call.
func (b *MemberSelectorApplyConfiguration) WithExactMatch(value *ExactMatchApplyConfiguration) *MemberSelectorApplyConfiguration {
b.ExactMatch = value
return b
}
// WithRegexMatch sets the RegexMatch field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the RegexMatch field is set to the value of the last call.
func (b *MemberSelectorApplyConfiguration) WithRegexMatch(value *RegexMatchApplyConfiguration) *MemberSelectorApplyConfiguration {
b.RegexMatch = value
return b
}
// WithLabelMatch sets the LabelMatch field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LabelMatch field is set to the value of the last call.
func (b *MemberSelectorApplyConfiguration) WithLabelMatch(value *v1.LabelSelectorApplyConfiguration) *MemberSelectorApplyConfiguration {
b.LabelMatch = value
return b
}

View File

@ -0,0 +1,51 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1"
)
// MemberSpecApplyConfiguration represents a declarative configuration of the MemberSpec type for use
// with apply.
type MemberSpecApplyConfiguration struct {
Type *topologyv1alpha1.MemberType `json:"type,omitempty"`
Selector *MemberSelectorApplyConfiguration `json:"selector,omitempty"`
}
// MemberSpecApplyConfiguration constructs a declarative configuration of the MemberSpec type for use with
// apply.
func MemberSpec() *MemberSpecApplyConfiguration {
return &MemberSpecApplyConfiguration{}
}
// WithType sets the Type field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Type field is set to the value of the last call.
func (b *MemberSpecApplyConfiguration) WithType(value topologyv1alpha1.MemberType) *MemberSpecApplyConfiguration {
b.Type = &value
return b
}
// WithSelector sets the Selector field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Selector field is set to the value of the last call.
func (b *MemberSpecApplyConfiguration) WithSelector(value *MemberSelectorApplyConfiguration) *MemberSpecApplyConfiguration {
b.Selector = value
return b
}

View File

@ -0,0 +1,38 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
// RegexMatchApplyConfiguration represents a declarative configuration of the RegexMatch type for use
// with apply.
type RegexMatchApplyConfiguration struct {
Pattern *string `json:"pattern,omitempty"`
}
// RegexMatchApplyConfiguration constructs a declarative configuration of the RegexMatch type for use with
// apply.
func RegexMatch() *RegexMatchApplyConfiguration {
return &RegexMatchApplyConfiguration{}
}
// WithPattern sets the Pattern field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Pattern field is set to the value of the last call.
func (b *RegexMatchApplyConfiguration) WithPattern(value string) *RegexMatchApplyConfiguration {
b.Pattern = &value
return b
}

View File

@ -0,0 +1,165 @@
/*
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package applyconfiguration
import (
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
testing "k8s.io/client-go/testing"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
busv1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
nodeinfov1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
v1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1"
batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
applyconfigurationbusv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/bus/v1alpha1"
applyconfigurationflowv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/flow/v1alpha1"
internal "volcano.sh/apis/pkg/client/applyconfiguration/internal"
applyconfigurationnodeinfov1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/nodeinfo/v1alpha1"
schedulingv1beta1 "volcano.sh/apis/pkg/client/applyconfiguration/scheduling/v1beta1"
applyconfigurationtopologyv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/topology/v1alpha1"
)
// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
// apply configuration type exists for the given GroupVersionKind.
func ForKind(kind schema.GroupVersionKind) interface{} {
switch kind {
// Group=batch.volcano.sh, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithKind("DependsOn"):
return &batchv1alpha1.DependsOnApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("Job"):
return &batchv1alpha1.JobApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("JobCondition"):
return &batchv1alpha1.JobConditionApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("JobSpec"):
return &batchv1alpha1.JobSpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("JobState"):
return &batchv1alpha1.JobStateApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("JobStatus"):
return &batchv1alpha1.JobStatusApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("LifecyclePolicy"):
return &batchv1alpha1.LifecyclePolicyApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("NetworkTopologySpec"):
return &batchv1alpha1.NetworkTopologySpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("TaskSpec"):
return &batchv1alpha1.TaskSpecApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("TaskState"):
return &batchv1alpha1.TaskStateApplyConfiguration{}
case v1alpha1.SchemeGroupVersion.WithKind("VolumeSpec"):
return &batchv1alpha1.VolumeSpecApplyConfiguration{}
// Group=bus.volcano.sh, Version=v1alpha1
case busv1alpha1.SchemeGroupVersion.WithKind("Command"):
return &applyconfigurationbusv1alpha1.CommandApplyConfiguration{}
// Group=flow.volcano.sh, Version=v1alpha1
case flowv1alpha1.SchemeGroupVersion.WithKind("Condition"):
return &applyconfigurationflowv1alpha1.ConditionApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("DependsOn"):
return &applyconfigurationflowv1alpha1.DependsOnApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("Flow"):
return &applyconfigurationflowv1alpha1.FlowApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("HttpGet"):
return &applyconfigurationflowv1alpha1.HttpGetApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobFlow"):
return &applyconfigurationflowv1alpha1.JobFlowApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobFlowSpec"):
return &applyconfigurationflowv1alpha1.JobFlowSpecApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobFlowStatus"):
return &applyconfigurationflowv1alpha1.JobFlowStatusApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobRunningHistory"):
return &applyconfigurationflowv1alpha1.JobRunningHistoryApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobStatus"):
return &applyconfigurationflowv1alpha1.JobStatusApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobTemplate"):
return &applyconfigurationflowv1alpha1.JobTemplateApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("JobTemplateStatus"):
return &applyconfigurationflowv1alpha1.JobTemplateStatusApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("Probe"):
return &applyconfigurationflowv1alpha1.ProbeApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("State"):
return &applyconfigurationflowv1alpha1.StateApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("TaskStatus"):
return &applyconfigurationflowv1alpha1.TaskStatusApplyConfiguration{}
case flowv1alpha1.SchemeGroupVersion.WithKind("TcpSocket"):
return &applyconfigurationflowv1alpha1.TcpSocketApplyConfiguration{}
// Group=nodeinfo.volcano.sh, Version=v1alpha1
case nodeinfov1alpha1.SchemeGroupVersion.WithKind("CPUInfo"):
return &applyconfigurationnodeinfov1alpha1.CPUInfoApplyConfiguration{}
case nodeinfov1alpha1.SchemeGroupVersion.WithKind("Numatopology"):
return &applyconfigurationnodeinfov1alpha1.NumatopologyApplyConfiguration{}
case nodeinfov1alpha1.SchemeGroupVersion.WithKind("NumatopoSpec"):
return &applyconfigurationnodeinfov1alpha1.NumatopoSpecApplyConfiguration{}
case nodeinfov1alpha1.SchemeGroupVersion.WithKind("ResourceInfo"):
return &applyconfigurationnodeinfov1alpha1.ResourceInfoApplyConfiguration{}
// Group=scheduling.volcano.sh, Version=v1beta1
case v1beta1.SchemeGroupVersion.WithKind("Affinity"):
return &schedulingv1beta1.AffinityApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("Cluster"):
return &schedulingv1beta1.ClusterApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("Guarantee"):
return &schedulingv1beta1.GuaranteeApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("NetworkTopologySpec"):
return &schedulingv1beta1.NetworkTopologySpecApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("NodeGroupAffinity"):
return &schedulingv1beta1.NodeGroupAffinityApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("NodeGroupAntiAffinity"):
return &schedulingv1beta1.NodeGroupAntiAffinityApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodGroup"):
return &schedulingv1beta1.PodGroupApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodGroupCondition"):
return &schedulingv1beta1.PodGroupConditionApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodGroupSpec"):
return &schedulingv1beta1.PodGroupSpecApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("PodGroupStatus"):
return &schedulingv1beta1.PodGroupStatusApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("Queue"):
return &schedulingv1beta1.QueueApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("QueueSpec"):
return &schedulingv1beta1.QueueSpecApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("QueueStatus"):
return &schedulingv1beta1.QueueStatusApplyConfiguration{}
case v1beta1.SchemeGroupVersion.WithKind("Reservation"):
return &schedulingv1beta1.ReservationApplyConfiguration{}
// Group=topology.volcano.sh, Version=v1alpha1
case topologyv1alpha1.SchemeGroupVersion.WithKind("ExactMatch"):
return &applyconfigurationtopologyv1alpha1.ExactMatchApplyConfiguration{}
case topologyv1alpha1.SchemeGroupVersion.WithKind("HyperNode"):
return &applyconfigurationtopologyv1alpha1.HyperNodeApplyConfiguration{}
case topologyv1alpha1.SchemeGroupVersion.WithKind("HyperNodeSpec"):
return &applyconfigurationtopologyv1alpha1.HyperNodeSpecApplyConfiguration{}
case topologyv1alpha1.SchemeGroupVersion.WithKind("HyperNodeStatus"):
return &applyconfigurationtopologyv1alpha1.HyperNodeStatusApplyConfiguration{}
case topologyv1alpha1.SchemeGroupVersion.WithKind("MemberSelector"):
return &applyconfigurationtopologyv1alpha1.MemberSelectorApplyConfiguration{}
case topologyv1alpha1.SchemeGroupVersion.WithKind("MemberSpec"):
return &applyconfigurationtopologyv1alpha1.MemberSpecApplyConfiguration{}
case topologyv1alpha1.SchemeGroupVersion.WithKind("RegexMatch"):
return &applyconfigurationtopologyv1alpha1.RegexMatchApplyConfiguration{}
}
return nil
}
func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
}

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,8 +18,8 @@ limitations under the License.
package versioned
import (
"fmt"
"net/http"
fmt "fmt"
http "net/http"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
@ -29,6 +29,7 @@ import (
flowv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1"
nodeinfov1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1"
schedulingv1beta1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1"
topologyv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/topology/v1alpha1"
)
type Interface interface {
@ -38,6 +39,7 @@ type Interface interface {
FlowV1alpha1() flowv1alpha1.FlowV1alpha1Interface
NodeinfoV1alpha1() nodeinfov1alpha1.NodeinfoV1alpha1Interface
SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface
TopologyV1alpha1() topologyv1alpha1.TopologyV1alpha1Interface
}
// Clientset contains the clients for groups.
@ -48,6 +50,7 @@ type Clientset struct {
flowV1alpha1 *flowv1alpha1.FlowV1alpha1Client
nodeinfoV1alpha1 *nodeinfov1alpha1.NodeinfoV1alpha1Client
schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client
topologyV1alpha1 *topologyv1alpha1.TopologyV1alpha1Client
}
// BatchV1alpha1 retrieves the BatchV1alpha1Client
@ -75,6 +78,11 @@ func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Inter
return c.schedulingV1beta1
}
// TopologyV1alpha1 retrieves the TopologyV1alpha1Client
func (c *Clientset) TopologyV1alpha1() topologyv1alpha1.TopologyV1alpha1Interface {
return c.topologyV1alpha1
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
@ -139,6 +147,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
if err != nil {
return nil, err
}
cs.topologyV1alpha1, err = topologyv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
@ -165,6 +177,7 @@ func New(c rest.Interface) *Clientset {
cs.flowV1alpha1 = flowv1alpha1.New(c)
cs.nodeinfoV1alpha1 = nodeinfov1alpha1.New(c)
cs.schedulingV1beta1 = schedulingv1beta1.New(c)
cs.topologyV1alpha1 = topologyv1alpha1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,11 +18,13 @@ limitations under the License.
package fake
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
applyconfiguration "volcano.sh/apis/pkg/client/applyconfiguration"
clientset "volcano.sh/apis/pkg/client/clientset/versioned"
batchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1"
fakebatchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake"
@ -34,12 +36,18 @@ import (
fakenodeinfov1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1/fake"
schedulingv1beta1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1"
fakeschedulingv1beta1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1/fake"
topologyv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/topology/v1alpha1"
faketopologyv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/topology/v1alpha1/fake"
)
// 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 {
@ -52,9 +60,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
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) {
var opts metav1.ListOptions
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
opts = watchActcion.ListOptions
}
gvr := action.GetResource()
ns := action.GetNamespace()
watch, err := o.Watch(gvr, ns)
watch, err := o.Watch(gvr, ns, opts)
if err != nil {
return false, nil, err
}
@ -81,6 +93,42 @@ 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) {
var opts metav1.ListOptions
if watchActcion, ok := action.(testing.WatchActionImpl); ok {
opts = watchActcion.ListOptions
}
gvr := action.GetResource()
ns := action.GetNamespace()
watch, err := o.Watch(gvr, ns, opts)
if err != nil {
return false, nil, err
}
return true, watch, nil
})
return cs
}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
@ -110,3 +158,8 @@ func (c *Clientset) NodeinfoV1alpha1() nodeinfov1alpha1.NodeinfoV1alpha1Interfac
func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface {
return &fakeschedulingv1beta1.FakeSchedulingV1beta1{Fake: &c.Fake}
}
// TopologyV1alpha1 retrieves the TopologyV1alpha1Client
func (c *Clientset) TopologyV1alpha1() topologyv1alpha1.TopologyV1alpha1Interface {
return &faketopologyv1alpha1.FakeTopologyV1alpha1{Fake: &c.Fake}
}

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -28,6 +28,7 @@ import (
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
nodeinfov1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1"
)
var scheme = runtime.NewScheme()
@ -39,6 +40,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
flowv1alpha1.AddToScheme,
nodeinfov1alpha1.AddToScheme,
schedulingv1beta1.AddToScheme,
topologyv1alpha1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -28,6 +28,7 @@ import (
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
nodeinfov1alpha1 "volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1"
schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1"
topologyv1alpha1 "volcano.sh/apis/pkg/apis/topology/v1alpha1"
)
var Scheme = runtime.NewScheme()
@ -39,6 +40,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
flowv1alpha1.AddToScheme,
nodeinfov1alpha1.AddToScheme,
schedulingv1beta1.AddToScheme,
topologyv1alpha1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,11 +18,11 @@ limitations under the License.
package v1alpha1
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
"volcano.sh/apis/pkg/client/clientset/versioned/scheme"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
)
type BatchV1alpha1Interface interface {
@ -44,9 +44,7 @@ func (c *BatchV1alpha1Client) Jobs(namespace string) JobInterface {
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*BatchV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
setConfigDefaults(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
@ -58,9 +56,7 @@ func NewForConfig(c *rest.Config) (*BatchV1alpha1Client, error) {
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
setConfigDefaults(&config)
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
@ -83,17 +79,15 @@ func New(c rest.Interface) *BatchV1alpha1Client {
return &BatchV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
func setConfigDefaults(config *rest.Config) {
gv := batchv1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@ type FakeBatchV1alpha1 struct {
}
func (c *FakeBatchV1alpha1) Jobs(namespace string) v1alpha1.JobInterface {
return &FakeJobs{c, namespace}
return newFakeJobs(c, namespace)
}
// RESTClient returns a RESTClient that is used to communicate

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,123 +18,31 @@ limitations under the License.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
gentype "k8s.io/client-go/gentype"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
batchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
typedbatchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1"
)
// FakeJobs implements JobInterface
type FakeJobs struct {
// fakeJobs implements JobInterface
type fakeJobs struct {
*gentype.FakeClientWithListAndApply[*v1alpha1.Job, *v1alpha1.JobList, *batchv1alpha1.JobApplyConfiguration]
Fake *FakeBatchV1alpha1
ns string
}
var jobsResource = v1alpha1.SchemeGroupVersion.WithResource("jobs")
var jobsKind = v1alpha1.SchemeGroupVersion.WithKind("Job")
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *FakeJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1alpha1.Job{})
if obj == nil {
return nil, err
func newFakeJobs(fake *FakeBatchV1alpha1, namespace string) typedbatchv1alpha1.JobInterface {
return &fakeJobs{
gentype.NewFakeClientWithListAndApply[*v1alpha1.Job, *v1alpha1.JobList, *batchv1alpha1.JobApplyConfiguration](
fake.Fake,
namespace,
v1alpha1.SchemeGroupVersion.WithResource("jobs"),
v1alpha1.SchemeGroupVersion.WithKind("Job"),
func() *v1alpha1.Job { return &v1alpha1.Job{} },
func() *v1alpha1.JobList { return &v1alpha1.JobList{} },
func(dst, src *v1alpha1.JobList) { dst.ListMeta = src.ListMeta },
func(list *v1alpha1.JobList) []*v1alpha1.Job { return gentype.ToPointerSlice(list.Items) },
func(list *v1alpha1.JobList, items []*v1alpha1.Job) { list.Items = gentype.FromPointerSlice(items) },
),
fake,
}
return obj.(*v1alpha1.Job), err
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *FakeJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &v1alpha1.JobList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.JobList{ListMeta: obj.(*v1alpha1.JobList).ListMeta}
for _, item := range obj.(*v1alpha1.JobList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *FakeJobs) Create(ctx context.Context, job *v1alpha1.Job, opts v1.CreateOptions) (result *v1alpha1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1alpha1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Job), err
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *FakeJobs) Update(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1alpha1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Job), 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 *FakeJobs) UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (*v1alpha1.Job, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1alpha1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Job), err
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *FakeJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteActionWithOptions(jobsResource, c.ns, name, opts), &v1alpha1.Job{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.JobList{})
return err
}
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Job, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Job{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Job), err
}

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,14 +18,14 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
context "context"
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"
v1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
gentype "k8s.io/client-go/gentype"
batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1"
applyconfigurationbatchv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/batch/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
)
@ -37,158 +37,37 @@ type JobsGetter interface {
// JobInterface has methods to work with Job resources.
type JobInterface interface {
Create(ctx context.Context, job *v1alpha1.Job, opts v1.CreateOptions) (*v1alpha1.Job, error)
Update(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (*v1alpha1.Job, error)
UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (*v1alpha1.Job, error)
Create(ctx context.Context, job *batchv1alpha1.Job, opts v1.CreateOptions) (*batchv1alpha1.Job, error)
Update(ctx context.Context, job *batchv1alpha1.Job, opts v1.UpdateOptions) (*batchv1alpha1.Job, error)
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
UpdateStatus(ctx context.Context, job *batchv1alpha1.Job, opts v1.UpdateOptions) (*batchv1alpha1.Job, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Job, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.JobList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*batchv1alpha1.Job, error)
List(ctx context.Context, opts v1.ListOptions) (*batchv1alpha1.JobList, error)
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 *v1alpha1.Job, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *batchv1alpha1.Job, err error)
Apply(ctx context.Context, job *applyconfigurationbatchv1alpha1.JobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1alpha1.Job, err error)
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
ApplyStatus(ctx context.Context, job *applyconfigurationbatchv1alpha1.JobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1alpha1.Job, err error)
JobExpansion
}
// jobs implements JobInterface
type jobs struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*batchv1alpha1.Job, *batchv1alpha1.JobList, *applyconfigurationbatchv1alpha1.JobApplyConfiguration]
}
// newJobs returns a Jobs
func newJobs(c *BatchV1alpha1Client, namespace string) *jobs {
return &jobs{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*batchv1alpha1.Job, *batchv1alpha1.JobList, *applyconfigurationbatchv1alpha1.JobApplyConfiguration](
"jobs",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *batchv1alpha1.Job { return &batchv1alpha1.Job{} },
func() *batchv1alpha1.JobList { return &batchv1alpha1.JobList{} },
),
}
}
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *jobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.JobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) 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("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Create(ctx context.Context, job *v1alpha1.Job, opts v1.CreateOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Post().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Update(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
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 *jobs) UpdateStatus(ctx context.Context, job *v1alpha1.Job, opts v1.UpdateOptions) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(job).
Do(ctx).
Into(result)
return
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) 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("jobs").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched job.
func (c *jobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Job, err error) {
result = &v1alpha1.Job{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("jobs").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,11 +18,11 @@ limitations under the License.
package v1alpha1
import (
"net/http"
http "net/http"
rest "k8s.io/client-go/rest"
v1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
"volcano.sh/apis/pkg/client/clientset/versioned/scheme"
busv1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
)
type BusV1alpha1Interface interface {
@ -44,9 +44,7 @@ func (c *BusV1alpha1Client) Commands(namespace string) CommandInterface {
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*BusV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
setConfigDefaults(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
@ -58,9 +56,7 @@ func NewForConfig(c *rest.Config) (*BusV1alpha1Client, error) {
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BusV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
setConfigDefaults(&config)
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
@ -83,17 +79,15 @@ func New(c rest.Interface) *BusV1alpha1Client {
return &BusV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
func setConfigDefaults(config *rest.Config) {
gv := busv1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate

View File

@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright The Volcano Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -18,14 +18,14 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
context "context"
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"
v1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
gentype "k8s.io/client-go/gentype"
busv1alpha1 "volcano.sh/apis/pkg/apis/bus/v1alpha1"
applyconfigurationbusv1alpha1 "volcano.sh/apis/pkg/client/applyconfiguration/bus/v1alpha1"
scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme"
)
@ -37,141 +37,33 @@ type CommandsGetter interface {
// CommandInterface has methods to work with Command resources.
type CommandInterface interface {
Create(ctx context.Context, command *v1alpha1.Command, opts v1.CreateOptions) (*v1alpha1.Command, error)
Update(ctx context.Context, command *v1alpha1.Command, opts v1.UpdateOptions) (*v1alpha1.Command, error)
Create(ctx context.Context, command *busv1alpha1.Command, opts v1.CreateOptions) (*busv1alpha1.Command, error)
Update(ctx context.Context, command *busv1alpha1.Command, opts v1.UpdateOptions) (*busv1alpha1.Command, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Command, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.CommandList, error)
Get(ctx context.Context, name string, opts v1.GetOptions) (*busv1alpha1.Command, error)
List(ctx context.Context, opts v1.ListOptions) (*busv1alpha1.CommandList, error)
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 *v1alpha1.Command, err error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *busv1alpha1.Command, err error)
Apply(ctx context.Context, command *applyconfigurationbusv1alpha1.CommandApplyConfiguration, opts v1.ApplyOptions) (result *busv1alpha1.Command, err error)
CommandExpansion
}
// commands implements CommandInterface
type commands struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*busv1alpha1.Command, *busv1alpha1.CommandList, *applyconfigurationbusv1alpha1.CommandApplyConfiguration]
}
// newCommands returns a Commands
func newCommands(c *BusV1alpha1Client, namespace string) *commands {
return &commands{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*busv1alpha1.Command, *busv1alpha1.CommandList, *applyconfigurationbusv1alpha1.CommandApplyConfiguration](
"commands",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *busv1alpha1.Command { return &busv1alpha1.Command{} },
func() *busv1alpha1.CommandList { return &busv1alpha1.CommandList{} },
),
}
}
// Get takes name of the command, and returns the corresponding command object, and an error if there is any.
func (c *commands) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Get().
Namespace(c.ns).
Resource("commands").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Commands that match those selectors.
func (c *commands) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CommandList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.CommandList{}
err = c.client.Get().
Namespace(c.ns).
Resource("commands").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested commands.
func (c *commands) 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("commands").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a command and creates it. Returns the server's representation of the command, and an error, if there is any.
func (c *commands) Create(ctx context.Context, command *v1alpha1.Command, opts v1.CreateOptions) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Post().
Namespace(c.ns).
Resource("commands").
VersionedParams(&opts, scheme.ParameterCodec).
Body(command).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a command and updates it. Returns the server's representation of the command, and an error, if there is any.
func (c *commands) Update(ctx context.Context, command *v1alpha1.Command, opts v1.UpdateOptions) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Put().
Namespace(c.ns).
Resource("commands").
Name(command.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(command).
Do(ctx).
Into(result)
return
}
// Delete takes name of the command and deletes it. Returns an error if one occurs.
func (c *commands) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("commands").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *commands) 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("commands").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched command.
func (c *commands) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Command, err error) {
result = &v1alpha1.Command{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("commands").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

Some files were not shown because too many files have changed in this diff Show More