diff --git a/config/crd/bases/batch.volcano.sh_jobs.yaml b/config/crd/bases/batch.volcano.sh_jobs.yaml index 0d32d22bfca..f5716d1e39c 100644 --- a/config/crd/bases/batch.volcano.sh_jobs.yaml +++ b/config/crd/bases/batch.volcano.sh_jobs.yaml @@ -32,6 +32,10 @@ spec: - jsonPath: .metadata.creationTimestamp name: AGE type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string name: v1alpha1 schema: openAPIV3Schema: diff --git a/config/crd/bases/scheduling.volcano.sh_podgroups.yaml b/config/crd/bases/scheduling.volcano.sh_podgroups.yaml index 904d7bd6242..788ce0fd014 100644 --- a/config/crd/bases/scheduling.volcano.sh_podgroups.yaml +++ b/config/crd/bases/scheduling.volcano.sh_podgroups.yaml @@ -19,7 +19,24 @@ spec: singular: podgroup scope: Namespaced versions: - - name: v1beta1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: STATUS + type: string + - jsonPath: .spec.minMember + name: minMember + type: integer + - jsonPath: .status.running + name: RUNNINGS + type: integer + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string + name: v1beta1 schema: openAPIV3Schema: description: PodGroup is a collection of Pod; used for batch workload. @@ -132,6 +149,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" diff --git a/config/crd/bases/scheduling.volcano.sh_queues.yaml b/config/crd/bases/scheduling.volcano.sh_queues.yaml index a3101e9dfb6..4609ba8d922 100644 --- a/config/crd/bases/scheduling.volcano.sh_queues.yaml +++ b/config/crd/bases/scheduling.volcano.sh_queues.yaml @@ -40,6 +40,39 @@ spec: description: 'Specification of the desired behavior of the queue. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' properties: + affinity: + description: If specified, the pod owned by the queue will be scheduled + with constraint + properties: + nodeGroupAffinity: + description: Describes nodegroup affinity scheduling rules for + the queue(e.g. putting pods of the queue in the nodes of the + nodegroup) + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + nodeGroupAntiAffinity: + description: Describes nodegroup anti-affinity scheduling rules + for the queue(e.g. avoid putting pods of the queue in the nodes + of the nodegroup). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + type: object capability: additionalProperties: anyOf: diff --git a/config/crd/v1beta1/batch.volcano.sh_jobs.yaml b/config/crd/v1beta1/batch.volcano.sh_jobs.yaml index bda12cde3bb..bf9e8b4511c 100644 --- a/config/crd/v1beta1/batch.volcano.sh_jobs.yaml +++ b/config/crd/v1beta1/batch.volcano.sh_jobs.yaml @@ -21,6 +21,10 @@ spec: - JSONPath: .metadata.creationTimestamp name: AGE type: date + - JSONPath: .spec.queue + name: QUEUE + priority: 1 + type: string group: batch.volcano.sh names: kind: Job diff --git a/config/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml b/config/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml index f95a991d675..5cc9a6ea4d9 100644 --- a/config/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml +++ b/config/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml @@ -8,6 +8,23 @@ metadata: creationTimestamp: null name: podgroups.scheduling.volcano.sh spec: + additionalPrinterColumns: + - JSONPath: .status.phase + name: STATUS + type: string + - JSONPath: .spec.minMember + name: minMember + type: integer + - JSONPath: .status.running + name: RUNNINGS + type: integer + - JSONPath: .metadata.creationTimestamp + name: AGE + type: date + - JSONPath: .spec.queue + name: QUEUE + priority: 1 + type: string group: scheduling.volcano.sh names: kind: PodGroup @@ -18,6 +35,7 @@ spec: - podgroup-v1beta1 singular: podgroup scope: Namespaced + subresources: {} validation: openAPIV3Schema: description: PodGroup is a collection of Pod; used for batch workload. diff --git a/config/crd/v1beta1/scheduling.volcano.sh_queues.yaml b/config/crd/v1beta1/scheduling.volcano.sh_queues.yaml index 4145dbae712..e1fdf7dcb57 100644 --- a/config/crd/v1beta1/scheduling.volcano.sh_queues.yaml +++ b/config/crd/v1beta1/scheduling.volcano.sh_queues.yaml @@ -40,6 +40,38 @@ spec: description: 'Specification of the desired behavior of the queue. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' properties: + affinity: + description: If specified, the pod owned by the queue will be scheduled + with constraint + properties: + nodeGroupAffinity: + description: Describes nodegroup affinity scheduling rules for the + queue(e.g. putting pods of the queue in the nodes of the nodegroup) + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + nodeGroupAntiAffinity: + description: Describes nodegroup anti-affinity scheduling rules + for the queue(e.g. avoid putting pods of the queue in the nodes + of the nodegroup). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + type: object capability: additionalProperties: anyOf: diff --git a/go.mod b/go.mod index cc19419128b..35dc7a0fd96 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/agiledragon/gomonkey/v2 v2.1.0 - github.com/fsnotify/fsnotify v1.4.9 + github.com/fsnotify/fsnotify v1.5.1 github.com/golang/mock v1.6.0 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/hashicorp/go-multierror v1.0.0 @@ -29,9 +29,9 @@ require ( k8s.io/klog v1.0.0 k8s.io/kubernetes v1.23.0 k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b - sigs.k8s.io/yaml v1.2.0 + sigs.k8s.io/yaml v1.3.0 stathat.com/c/consistent v1.0.0 - volcano.sh/apis v1.5.0-beta.0.0.20220427084719-22d3dd007a8f + volcano.sh/apis v0.0.0-20220705062437-edd428c7d2fd ) require ( @@ -104,7 +104,7 @@ require ( k8s.io/kube-scheduler v0.0.0 // indirect k8s.io/mount-utils v0.23.0 // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect ) replace ( diff --git a/go.sum b/go.sum index fb969d8bfef..163c8383e86 100644 --- a/go.sum +++ b/go.sum @@ -191,8 +191,9 @@ github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNy github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= @@ -472,8 +473,9 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -885,8 +887,10 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1192,11 +1196,13 @@ sigs.k8s.io/kustomize/cmd/config v0.10.2/go.mod h1:K2aW7nXJ0AaT+VA/eO0/dzFLxmpFc sigs.k8s.io/kustomize/kustomize/v4 v4.4.1/go.mod h1:qOKJMMz2mBP+vcS7vK+mNz4HBLjaQSWRY22EF6Tb7Io= sigs.k8s.io/kustomize/kyaml v0.13.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/structured-merge-diff/v4 v4.2.0 h1:kDvPBbnPk+qYmkHmSo8vKGp438IASWofnbbUKDE/bv0= +sigs.k8s.io/structured-merge-diff/v4 v4.2.0/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= stathat.com/c/consistent v1.0.0 h1:ezyc51EGcRPJUxfHGSgJjWzJdj3NiMU9pNfLNGiXV0c= stathat.com/c/consistent v1.0.0/go.mod h1:QkzMWzcbB+yQBL2AttO6sgsQS/JSTapcDISJalmCDS0= -volcano.sh/apis v1.5.0-beta.0.0.20220427084719-22d3dd007a8f h1:+7iBzMkQlcUvLvgXxdDSyZHjFweUiGVale2Vcdx+Aas= -volcano.sh/apis v1.5.0-beta.0.0.20220427084719-22d3dd007a8f/go.mod h1:5SH/3xDpBUk9iV/tm63rT4tBsETbYV6XIMmoYAbnGz8= +volcano.sh/apis v0.0.0-20220705062437-edd428c7d2fd h1:b48P7vnI1FHyw2ZaAwtgH8D2vCNyxWJxFU15PqSFmn8= +volcano.sh/apis v0.0.0-20220705062437-edd428c7d2fd/go.mod h1:drNMGuHPn1ew7oBSDQb5KRey6tXOQksbUtw3gPxF3Vo= diff --git a/installer/helm/chart/volcano/crd/bases/batch.volcano.sh_jobs.yaml b/installer/helm/chart/volcano/crd/bases/batch.volcano.sh_jobs.yaml index 5d1f315235d..6544fa70231 100644 --- a/installer/helm/chart/volcano/crd/bases/batch.volcano.sh_jobs.yaml +++ b/installer/helm/chart/volcano/crd/bases/batch.volcano.sh_jobs.yaml @@ -30,6 +30,10 @@ spec: - jsonPath: .metadata.creationTimestamp name: AGE type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string name: v1alpha1 schema: openAPIV3Schema: diff --git a/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_podgroups.yaml b/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_podgroups.yaml index 19840e373e2..6307407ecae 100644 --- a/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_podgroups.yaml +++ b/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_podgroups.yaml @@ -17,7 +17,24 @@ spec: singular: podgroup scope: Namespaced versions: - - name: v1beta1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: STATUS + type: string + - jsonPath: .spec.minMember + name: minMember + type: integer + - jsonPath: .status.running + name: RUNNINGS + type: integer + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string + name: v1beta1 schema: openAPIV3Schema: description: PodGroup is a collection of Pod; used for batch workload. @@ -130,6 +147,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" diff --git a/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_queues.yaml b/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_queues.yaml index 2c7f5306eac..1d417da0617 100644 --- a/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_queues.yaml +++ b/installer/helm/chart/volcano/crd/bases/scheduling.volcano.sh_queues.yaml @@ -38,6 +38,39 @@ spec: description: 'Specification of the desired behavior of the queue. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' properties: + affinity: + description: If specified, the pod owned by the queue will be scheduled + with constraint + properties: + nodeGroupAffinity: + description: Describes nodegroup affinity scheduling rules for + the queue(e.g. putting pods of the queue in the nodes of the + nodegroup) + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + nodeGroupAntiAffinity: + description: Describes nodegroup anti-affinity scheduling rules + for the queue(e.g. avoid putting pods of the queue in the nodes + of the nodegroup). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + type: object capability: additionalProperties: anyOf: diff --git a/installer/helm/chart/volcano/crd/v1beta1/batch.volcano.sh_jobs.yaml b/installer/helm/chart/volcano/crd/v1beta1/batch.volcano.sh_jobs.yaml index 40204b02e6d..320efad0456 100644 --- a/installer/helm/chart/volcano/crd/v1beta1/batch.volcano.sh_jobs.yaml +++ b/installer/helm/chart/volcano/crd/v1beta1/batch.volcano.sh_jobs.yaml @@ -19,6 +19,10 @@ spec: - JSONPath: .metadata.creationTimestamp name: AGE type: date + - JSONPath: .spec.queue + name: QUEUE + priority: 1 + type: string group: batch.volcano.sh names: kind: Job diff --git a/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml b/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml index d6e84371496..fa3d7a1c3c2 100644 --- a/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml +++ b/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_podgroups.yaml @@ -6,6 +6,23 @@ metadata: creationTimestamp: null name: podgroups.scheduling.volcano.sh spec: + additionalPrinterColumns: + - JSONPath: .status.phase + name: STATUS + type: string + - JSONPath: .spec.minMember + name: minMember + type: integer + - JSONPath: .status.running + name: RUNNINGS + type: integer + - JSONPath: .metadata.creationTimestamp + name: AGE + type: date + - JSONPath: .spec.queue + name: QUEUE + priority: 1 + type: string group: scheduling.volcano.sh names: kind: PodGroup @@ -16,6 +33,7 @@ spec: - podgroup-v1beta1 singular: podgroup scope: Namespaced + subresources: {} validation: openAPIV3Schema: description: PodGroup is a collection of Pod; used for batch workload. diff --git a/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_queues.yaml b/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_queues.yaml index 93af360f65e..b422f3c9de0 100644 --- a/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_queues.yaml +++ b/installer/helm/chart/volcano/crd/v1beta1/scheduling.volcano.sh_queues.yaml @@ -38,6 +38,38 @@ spec: description: 'Specification of the desired behavior of the queue. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' properties: + affinity: + description: If specified, the pod owned by the queue will be scheduled + with constraint + properties: + nodeGroupAffinity: + description: Describes nodegroup affinity scheduling rules for the + queue(e.g. putting pods of the queue in the nodes of the nodegroup) + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + nodeGroupAntiAffinity: + description: Describes nodegroup anti-affinity scheduling rules + for the queue(e.g. avoid putting pods of the queue in the nodes + of the nodegroup). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + type: object capability: additionalProperties: anyOf: diff --git a/installer/volcano-development-arm64.yaml b/installer/volcano-development-arm64.yaml index 04b686beb23..2d916331eef 100644 --- a/installer/volcano-development-arm64.yaml +++ b/installer/volcano-development-arm64.yaml @@ -217,6 +217,10 @@ spec: - jsonPath: .metadata.creationTimestamp name: AGE type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string name: v1alpha1 schema: openAPIV3Schema: @@ -8687,7 +8691,24 @@ spec: singular: podgroup scope: Namespaced versions: - - name: v1beta1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: STATUS + type: string + - jsonPath: .spec.minMember + name: minMember + type: integer + - jsonPath: .status.running + name: RUNNINGS + type: integer + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string + name: v1beta1 schema: openAPIV3Schema: description: PodGroup is a collection of Pod; used for batch workload. @@ -8800,6 +8821,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" @@ -8848,6 +8870,39 @@ spec: description: 'Specification of the desired behavior of the queue. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' properties: + affinity: + description: If specified, the pod owned by the queue will be scheduled + with constraint + properties: + nodeGroupAffinity: + description: Describes nodegroup affinity scheduling rules for + the queue(e.g. putting pods of the queue in the nodes of the + nodegroup) + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + nodeGroupAntiAffinity: + description: Describes nodegroup anti-affinity scheduling rules + for the queue(e.g. avoid putting pods of the queue in the nodes + of the nodegroup). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + type: object capability: additionalProperties: anyOf: diff --git a/installer/volcano-development.yaml b/installer/volcano-development.yaml index db6bc052fff..94b7a385e67 100644 --- a/installer/volcano-development.yaml +++ b/installer/volcano-development.yaml @@ -217,6 +217,10 @@ spec: - jsonPath: .metadata.creationTimestamp name: AGE type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string name: v1alpha1 schema: openAPIV3Schema: @@ -8687,7 +8691,24 @@ spec: singular: podgroup scope: Namespaced versions: - - name: v1beta1 + - additionalPrinterColumns: + - jsonPath: .status.phase + name: STATUS + type: string + - jsonPath: .spec.minMember + name: minMember + type: integer + - jsonPath: .status.running + name: RUNNINGS + type: integer + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .spec.queue + name: QUEUE + priority: 1 + type: string + name: v1beta1 schema: openAPIV3Schema: description: PodGroup is a collection of Pod; used for batch workload. @@ -8800,6 +8821,7 @@ spec: type: object served: true storage: true + subresources: {} status: acceptedNames: kind: "" @@ -8848,6 +8870,39 @@ spec: description: 'Specification of the desired behavior of the queue. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' properties: + affinity: + description: If specified, the pod owned by the queue will be scheduled + with constraint + properties: + nodeGroupAffinity: + description: Describes nodegroup affinity scheduling rules for + the queue(e.g. putting pods of the queue in the nodes of the + nodegroup) + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + nodeGroupAntiAffinity: + description: Describes nodegroup anti-affinity scheduling rules + for the queue(e.g. avoid putting pods of the queue in the nodes + of the nodegroup). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + requiredDuringSchedulingIgnoredDuringExecution: + items: + type: string + type: array + type: object + type: object capability: additionalProperties: anyOf: diff --git a/vendor/github.com/fsnotify/fsnotify/.mailmap b/vendor/github.com/fsnotify/fsnotify/.mailmap new file mode 100644 index 00000000000..a04f2907fed --- /dev/null +++ b/vendor/github.com/fsnotify/fsnotify/.mailmap @@ -0,0 +1,2 @@ +Chris Howey +Nathan Youngman <4566+nathany@users.noreply.github.com> diff --git a/vendor/github.com/fsnotify/fsnotify/.travis.yml b/vendor/github.com/fsnotify/fsnotify/.travis.yml deleted file mode 100644 index a9c30165cdd..00000000000 --- a/vendor/github.com/fsnotify/fsnotify/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -sudo: false -language: go - -go: - - "stable" - - "1.11.x" - - "1.10.x" - - "1.9.x" - -matrix: - include: - - go: "stable" - env: GOLINT=true - allow_failures: - - go: tip - fast_finish: true - - -before_install: - - if [ ! -z "${GOLINT}" ]; then go get -u golang.org/x/lint/golint; fi - -script: - - go test --race ./... - -after_script: - - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" - - if [ ! -z "${GOLINT}" ]; then echo running golint; golint --set_exit_status ./...; else echo skipping golint; fi - - go vet ./... - -os: - - linux - - osx - - windows - -notifications: - email: false diff --git a/vendor/github.com/fsnotify/fsnotify/AUTHORS b/vendor/github.com/fsnotify/fsnotify/AUTHORS index 5ab5d41c547..6cbabe5ef50 100644 --- a/vendor/github.com/fsnotify/fsnotify/AUTHORS +++ b/vendor/github.com/fsnotify/fsnotify/AUTHORS @@ -4,35 +4,44 @@ # You can update this list using the following command: # -# $ git shortlog -se | awk '{print $2 " " $3 " " $4}' +# $ (head -n10 AUTHORS && git shortlog -se | sed -E 's/^\s+[0-9]+\t//') | tee AUTHORS # Please keep the list sorted. Aaron L Adrien Bustany +Alexey Kazakov Amit Krishnan Anmol Sethi Bjørn Erik Pedersen +Brian Goff Bruno Bigras Caleb Spare Case Nelson -Chris Howey +Chris Howey Christoffer Buchholz Daniel Wagner-Hall Dave Cheney +Eric Lin Evan Phoenix Francisco Souza +Gautam Dey Hari haran -John C Barstow +Ichinose Shogo +Johannes Ebke +John C Barstow Kelvin Fo Ken-ichirou MATSUZAWA Matt Layher +Matthias Stone Nathan Youngman Nickolai Zeldovich +Oliver Bristow Patrick Paul Hammond Pawel Knap Pieter Droogendijk +Pratik Shinde Pursuit92 Riku Voipio Rob Figueiredo @@ -41,6 +50,7 @@ Slawek Ligus Soge Zhang Tiffany Jernigan Tilak Sharma +Tobias Klauser Tom Payne Travis Cline Tudor Golubenco diff --git a/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md index be4d7ea2c14..a438fe4b4a5 100644 --- a/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md +++ b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md @@ -1,6 +1,28 @@ # Changelog -## v1.4.7 / 2018-01-09 +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.5.1] - 2021-08-24 + +* Revert Add AddRaw to not follow symlinks + +## [1.5.0] - 2021-08-20 + +* Go: Increase minimum required version to Go 1.12 [#381](https://github.com/fsnotify/fsnotify/pull/381) +* Feature: Add AddRaw method which does not follow symlinks when adding a watch [#289](https://github.com/fsnotify/fsnotify/pull/298) +* Windows: Follow symlinks by default like on all other systems [#289](https://github.com/fsnotify/fsnotify/pull/289) +* CI: Use GitHub Actions for CI and cover go 1.12-1.17 + [#378](https://github.com/fsnotify/fsnotify/pull/378) + [#381](https://github.com/fsnotify/fsnotify/pull/381) + [#385](https://github.com/fsnotify/fsnotify/pull/385) +* Go 1.14+: Fix unsafe pointer conversion [#325](https://github.com/fsnotify/fsnotify/pull/325) + +## [1.4.7] - 2018-01-09 * BSD/macOS: Fix possible deadlock on closing the watcher on kqueue (thanks @nhooyr and @glycerine) * Tests: Fix missing verb on format string (thanks @rchiossi) @@ -10,62 +32,62 @@ * Linux: Properly handle inotify's IN_Q_OVERFLOW event (thanks @zeldovich) * Docs: replace references to OS X with macOS -## v1.4.2 / 2016-10-10 +## [1.4.2] - 2016-10-10 * Linux: use InotifyInit1 with IN_CLOEXEC to stop leaking a file descriptor to a child process when using fork/exec [#178](https://github.com/fsnotify/fsnotify/pull/178) (thanks @pattyshack) -## v1.4.1 / 2016-10-04 +## [1.4.1] - 2016-10-04 * Fix flaky inotify stress test on Linux [#177](https://github.com/fsnotify/fsnotify/pull/177) (thanks @pattyshack) -## v1.4.0 / 2016-10-01 +## [1.4.0] - 2016-10-01 * add a String() method to Event.Op [#165](https://github.com/fsnotify/fsnotify/pull/165) (thanks @oozie) -## v1.3.1 / 2016-06-28 +## [1.3.1] - 2016-06-28 * Windows: fix for double backslash when watching the root of a drive [#151](https://github.com/fsnotify/fsnotify/issues/151) (thanks @brunoqc) -## v1.3.0 / 2016-04-19 +## [1.3.0] - 2016-04-19 * Support linux/arm64 by [patching](https://go-review.googlesource.com/#/c/21971/) x/sys/unix and switching to to it from syscall (thanks @suihkulokki) [#135](https://github.com/fsnotify/fsnotify/pull/135) -## v1.2.10 / 2016-03-02 +## [1.2.10] - 2016-03-02 * Fix golint errors in windows.go [#121](https://github.com/fsnotify/fsnotify/pull/121) (thanks @tiffanyfj) -## v1.2.9 / 2016-01-13 +## [1.2.9] - 2016-01-13 kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsnotify/pull/111) (thanks @bep) -## v1.2.8 / 2015-12-17 +## [1.2.8] - 2015-12-17 * kqueue: fix race condition in Close [#105](https://github.com/fsnotify/fsnotify/pull/105) (thanks @djui for reporting the issue and @ppknap for writing a failing test) * inotify: fix race in test * enable race detection for continuous integration (Linux, Mac, Windows) -## v1.2.5 / 2015-10-17 +## [1.2.5] - 2015-10-17 * inotify: use epoll_create1 for arm64 support (requires Linux 2.6.27 or later) [#100](https://github.com/fsnotify/fsnotify/pull/100) (thanks @suihkulokki) * inotify: fix path leaks [#73](https://github.com/fsnotify/fsnotify/pull/73) (thanks @chamaken) * kqueue: watch for rename events on subdirectories [#83](https://github.com/fsnotify/fsnotify/pull/83) (thanks @guotie) * kqueue: avoid infinite loops from symlinks cycles [#101](https://github.com/fsnotify/fsnotify/pull/101) (thanks @illicitonion) -## v1.2.1 / 2015-10-14 +## [1.2.1] - 2015-10-14 * kqueue: don't watch named pipes [#98](https://github.com/fsnotify/fsnotify/pull/98) (thanks @evanphx) -## v1.2.0 / 2015-02-08 +## [1.2.0] - 2015-02-08 * inotify: use epoll to wake up readEvents [#66](https://github.com/fsnotify/fsnotify/pull/66) (thanks @PieterD) * inotify: closing watcher should now always shut down goroutine [#63](https://github.com/fsnotify/fsnotify/pull/63) (thanks @PieterD) * kqueue: close kqueue after removing watches, fixes [#59](https://github.com/fsnotify/fsnotify/issues/59) -## v1.1.1 / 2015-02-05 +## [1.1.1] - 2015-02-05 * inotify: Retry read on EINTR [#61](https://github.com/fsnotify/fsnotify/issues/61) (thanks @PieterD) -## v1.1.0 / 2014-12-12 +## [1.1.0] - 2014-12-12 * kqueue: rework internals [#43](https://github.com/fsnotify/fsnotify/pull/43) * add low-level functions @@ -77,22 +99,22 @@ kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsn * kqueue: fix regression in rework causing subdirectories to be watched [#48](https://github.com/fsnotify/fsnotify/issues/48) * kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) -## v1.0.4 / 2014-09-07 +## [1.0.4] - 2014-09-07 * kqueue: add dragonfly to the build tags. * Rename source code files, rearrange code so exported APIs are at the top. * Add done channel to example code. [#37](https://github.com/fsnotify/fsnotify/pull/37) (thanks @chenyukang) -## v1.0.3 / 2014-08-19 +## [1.0.3] - 2014-08-19 * [Fix] Windows MOVED_TO now translates to Create like on BSD and Linux. [#36](https://github.com/fsnotify/fsnotify/issues/36) -## v1.0.2 / 2014-08-17 +## [1.0.2] - 2014-08-17 * [Fix] Missing create events on macOS. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) * [Fix] Make ./path and path equivalent. (thanks @zhsso) -## v1.0.0 / 2014-08-15 +## [1.0.0] - 2014-08-15 * [API] Remove AddWatch on Windows, use Add. * Improve documentation for exported identifiers. [#30](https://github.com/fsnotify/fsnotify/issues/30) @@ -146,51 +168,51 @@ kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsn * no tests for the current implementation * not fully implemented on Windows [#93](https://github.com/howeyc/fsnotify/issues/93#issuecomment-39285195) -## v0.9.3 / 2014-12-31 +## [0.9.3] - 2014-12-31 * kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) -## v0.9.2 / 2014-08-17 +## [0.9.2] - 2014-08-17 * [Backport] Fix missing create events on macOS. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) -## v0.9.1 / 2014-06-12 +## [0.9.1] - 2014-06-12 * Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) -## v0.9.0 / 2014-01-17 +## [0.9.0] - 2014-01-17 * IsAttrib() for events that only concern a file's metadata [#79][] (thanks @abustany) * [Fix] kqueue: fix deadlock [#77][] (thanks @cespare) * [NOTICE] Development has moved to `code.google.com/p/go.exp/fsnotify` in preparation for inclusion in the Go standard library. -## v0.8.12 / 2013-11-13 +## [0.8.12] - 2013-11-13 * [API] Remove FD_SET and friends from Linux adapter -## v0.8.11 / 2013-11-02 +## [0.8.11] - 2013-11-02 * [Doc] Add Changelog [#72][] (thanks @nathany) * [Doc] Spotlight and double modify events on macOS [#62][] (reported by @paulhammond) -## v0.8.10 / 2013-10-19 +## [0.8.10] - 2013-10-19 * [Fix] kqueue: remove file watches when parent directory is removed [#71][] (reported by @mdwhatcott) * [Fix] kqueue: race between Close and readEvents [#70][] (reported by @bernerdschaefer) * [Doc] specify OS-specific limits in README (thanks @debrando) -## v0.8.9 / 2013-09-08 +## [0.8.9] - 2013-09-08 * [Doc] Contributing (thanks @nathany) * [Doc] update package path in example code [#63][] (thanks @paulhammond) * [Doc] GoCI badge in README (Linux only) [#60][] * [Doc] Cross-platform testing with Vagrant [#59][] (thanks @nathany) -## v0.8.8 / 2013-06-17 +## [0.8.8] - 2013-06-17 * [Fix] Windows: handle `ERROR_MORE_DATA` on Windows [#49][] (thanks @jbowtie) -## v0.8.7 / 2013-06-03 +## [0.8.7] - 2013-06-03 * [API] Make syscall flags internal * [Fix] inotify: ignore event changes @@ -198,74 +220,74 @@ kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsn * [Fix] tests on Windows * lower case error messages -## v0.8.6 / 2013-05-23 +## [0.8.6] - 2013-05-23 * kqueue: Use EVT_ONLY flag on Darwin * [Doc] Update README with full example -## v0.8.5 / 2013-05-09 +## [0.8.5] - 2013-05-09 * [Fix] inotify: allow monitoring of "broken" symlinks (thanks @tsg) -## v0.8.4 / 2013-04-07 +## [0.8.4] - 2013-04-07 * [Fix] kqueue: watch all file events [#40][] (thanks @ChrisBuchholz) -## v0.8.3 / 2013-03-13 +## [0.8.3] - 2013-03-13 * [Fix] inoitfy/kqueue memory leak [#36][] (reported by @nbkolchin) * [Fix] kqueue: use fsnFlags for watching a directory [#33][] (reported by @nbkolchin) -## v0.8.2 / 2013-02-07 +## [0.8.2] - 2013-02-07 * [Doc] add Authors * [Fix] fix data races for map access [#29][] (thanks @fsouza) -## v0.8.1 / 2013-01-09 +## [0.8.1] - 2013-01-09 * [Fix] Windows path separators * [Doc] BSD License -## v0.8.0 / 2012-11-09 +## [0.8.0] - 2012-11-09 * kqueue: directory watching improvements (thanks @vmirage) * inotify: add `IN_MOVED_TO` [#25][] (requested by @cpisto) * [Fix] kqueue: deleting watched directory [#24][] (reported by @jakerr) -## v0.7.4 / 2012-10-09 +## [0.7.4] - 2012-10-09 * [Fix] inotify: fixes from https://codereview.appspot.com/5418045/ (ugorji) * [Fix] kqueue: preserve watch flags when watching for delete [#21][] (reported by @robfig) * [Fix] kqueue: watch the directory even if it isn't a new watch (thanks @robfig) * [Fix] kqueue: modify after recreation of file -## v0.7.3 / 2012-09-27 +## [0.7.3] - 2012-09-27 * [Fix] kqueue: watch with an existing folder inside the watched folder (thanks @vmirage) * [Fix] kqueue: no longer get duplicate CREATE events -## v0.7.2 / 2012-09-01 +## [0.7.2] - 2012-09-01 * kqueue: events for created directories -## v0.7.1 / 2012-07-14 +## [0.7.1] - 2012-07-14 * [Fix] for renaming files -## v0.7.0 / 2012-07-02 +## [0.7.0] - 2012-07-02 * [Feature] FSNotify flags * [Fix] inotify: Added file name back to event path -## v0.6.0 / 2012-06-06 +## [0.6.0] - 2012-06-06 * kqueue: watch files after directory created (thanks @tmc) -## v0.5.1 / 2012-05-22 +## [0.5.1] - 2012-05-22 * [Fix] inotify: remove all watches before Close() -## v0.5.0 / 2012-05-03 +## [0.5.0] - 2012-05-03 * [API] kqueue: return errors during watch instead of sending over channel * kqueue: match symlink behavior on Linux @@ -273,22 +295,22 @@ kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsn * [Fix] kqueue: handle EINTR (reported by @robfig) * [Doc] Godoc example [#1][] (thanks @davecheney) -## v0.4.0 / 2012-03-30 +## [0.4.0] - 2012-03-30 * Go 1 released: build with go tool * [Feature] Windows support using winfsnotify * Windows does not have attribute change notifications * Roll attribute notifications into IsModify -## v0.3.0 / 2012-02-19 +## [0.3.0] - 2012-02-19 * kqueue: add files when watch directory -## v0.2.0 / 2011-12-30 +## [0.2.0] - 2011-12-30 * update to latest Go weekly code -## v0.1.0 / 2011-10-19 +## [0.1.0] - 2011-10-19 * kqueue: add watch on file creation to match inotify * kqueue: create file event diff --git a/vendor/github.com/fsnotify/fsnotify/README.md b/vendor/github.com/fsnotify/fsnotify/README.md index b2629e5229c..df57b1b282c 100644 --- a/vendor/github.com/fsnotify/fsnotify/README.md +++ b/vendor/github.com/fsnotify/fsnotify/README.md @@ -12,9 +12,9 @@ Cross platform: Windows, Linux, BSD and macOS. | Adapter | OS | Status | | --------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| inotify | Linux 2.6.27 or later, Android\* | Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify) | -| kqueue | BSD, macOS, iOS\* | Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify) | -| ReadDirectoryChangesW | Windows | Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify) | +| inotify | Linux 2.6.27 or later, Android\* | Supported | +| kqueue | BSD, macOS, iOS\* | Supported | +| ReadDirectoryChangesW | Windows | Supported | | FSEvents | macOS | [Planned](https://github.com/fsnotify/fsnotify/issues/11) | | FEN | Solaris 11 | [In Progress](https://github.com/fsnotify/fsnotify/issues/12) | | fanotify | Linux 2.6.37+ | [Planned](https://github.com/fsnotify/fsnotify/issues/114) | diff --git a/vendor/github.com/fsnotify/fsnotify/fen.go b/vendor/github.com/fsnotify/fsnotify/fen.go index ced39cb881e..b3ac3d8f55f 100644 --- a/vendor/github.com/fsnotify/fsnotify/fen.go +++ b/vendor/github.com/fsnotify/fsnotify/fen.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build solaris // +build solaris package fsnotify diff --git a/vendor/github.com/fsnotify/fsnotify/fsnotify.go b/vendor/github.com/fsnotify/fsnotify/fsnotify.go index 89cab046d12..0f4ee52e8aa 100644 --- a/vendor/github.com/fsnotify/fsnotify/fsnotify.go +++ b/vendor/github.com/fsnotify/fsnotify/fsnotify.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !plan9 // +build !plan9 // Package fsnotify provides a platform-independent interface for file system notifications. diff --git a/vendor/github.com/fsnotify/fsnotify/inotify.go b/vendor/github.com/fsnotify/fsnotify/inotify.go index d9fd1b88a05..eb87699b5b4 100644 --- a/vendor/github.com/fsnotify/fsnotify/inotify.go +++ b/vendor/github.com/fsnotify/fsnotify/inotify.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux // +build linux package fsnotify @@ -272,7 +273,7 @@ func (w *Watcher) readEvents() { if nameLen > 0 { // Point "bytes" at the first byte of the filename - bytes := (*[unix.PathMax]byte)(unsafe.Pointer(&buf[offset+unix.SizeofInotifyEvent])) + bytes := (*[unix.PathMax]byte)(unsafe.Pointer(&buf[offset+unix.SizeofInotifyEvent]))[:nameLen:nameLen] // The filename is padded with NULL bytes. TrimRight() gets rid of those. name += "/" + strings.TrimRight(string(bytes[0:nameLen]), "\000") } diff --git a/vendor/github.com/fsnotify/fsnotify/inotify_poller.go b/vendor/github.com/fsnotify/fsnotify/inotify_poller.go index b33f2b4d4b7..e9ff9439f7f 100644 --- a/vendor/github.com/fsnotify/fsnotify/inotify_poller.go +++ b/vendor/github.com/fsnotify/fsnotify/inotify_poller.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux // +build linux package fsnotify diff --git a/vendor/github.com/fsnotify/fsnotify/kqueue.go b/vendor/github.com/fsnotify/fsnotify/kqueue.go index 86e76a3d676..368f5b790d4 100644 --- a/vendor/github.com/fsnotify/fsnotify/kqueue.go +++ b/vendor/github.com/fsnotify/fsnotify/kqueue.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build freebsd || openbsd || netbsd || dragonfly || darwin // +build freebsd openbsd netbsd dragonfly darwin package fsnotify diff --git a/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go b/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go index 2306c4620bf..36cc3845b6e 100644 --- a/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go +++ b/vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build freebsd || openbsd || netbsd || dragonfly // +build freebsd openbsd netbsd dragonfly package fsnotify diff --git a/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go b/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go index 870c4d6d184..98cd8476ffb 100644 --- a/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go +++ b/vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin // +build darwin package fsnotify diff --git a/vendor/github.com/fsnotify/fsnotify/windows.go b/vendor/github.com/fsnotify/fsnotify/windows.go index 09436f31d82..c02b75f7c37 100644 --- a/vendor/github.com/fsnotify/fsnotify/windows.go +++ b/vendor/github.com/fsnotify/fsnotify/windows.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows package fsnotify diff --git a/vendor/modules.txt b/vendor/modules.txt index 8a6b73db50d..f48d45e81e8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -45,7 +45,7 @@ github.com/emicklei/go-restful/log # github.com/evanphx/json-patch v4.12.0+incompatible ## explicit github.com/evanphx/json-patch -# github.com/fsnotify/fsnotify v1.4.9 +# github.com/fsnotify/fsnotify v1.5.1 ## explicit; go 1.13 github.com/fsnotify/fsnotify # github.com/go-logr/logr v1.2.0 @@ -1033,22 +1033,23 @@ k8s.io/utils/trace ## explicit; go 1.16 sigs.k8s.io/json sigs.k8s.io/json/internal/golang/encoding/json -# sigs.k8s.io/structured-merge-diff/v4 v4.1.2 +# sigs.k8s.io/structured-merge-diff/v4 v4.2.0 ## explicit; go 1.13 sigs.k8s.io/structured-merge-diff/v4/fieldpath sigs.k8s.io/structured-merge-diff/v4/schema sigs.k8s.io/structured-merge-diff/v4/typed sigs.k8s.io/structured-merge-diff/v4/value -# sigs.k8s.io/yaml v1.2.0 +# sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml # stathat.com/c/consistent v1.0.0 ## explicit stathat.com/c/consistent -# volcano.sh/apis v1.5.0-beta.0.0.20220427084719-22d3dd007a8f +# volcano.sh/apis v0.0.0-20220705062437-edd428c7d2fd ## explicit; go 1.17 volcano.sh/apis/pkg/apis/batch/v1alpha1 volcano.sh/apis/pkg/apis/bus/v1alpha1 +volcano.sh/apis/pkg/apis/flow/v1alpha1 volcano.sh/apis/pkg/apis/helpers volcano.sh/apis/pkg/apis/nodeinfo/v1alpha1 volcano.sh/apis/pkg/apis/scheduling @@ -1062,6 +1063,8 @@ volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1 volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1 volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1/fake +volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1 +volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1 volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1/fake volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1 @@ -1071,6 +1074,8 @@ volcano.sh/apis/pkg/client/informers/externalversions/batch volcano.sh/apis/pkg/client/informers/externalversions/batch/v1alpha1 volcano.sh/apis/pkg/client/informers/externalversions/bus volcano.sh/apis/pkg/client/informers/externalversions/bus/v1alpha1 +volcano.sh/apis/pkg/client/informers/externalversions/flow +volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1 volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces volcano.sh/apis/pkg/client/informers/externalversions/nodeinfo volcano.sh/apis/pkg/client/informers/externalversions/nodeinfo/v1alpha1 @@ -1078,6 +1083,7 @@ volcano.sh/apis/pkg/client/informers/externalversions/scheduling volcano.sh/apis/pkg/client/informers/externalversions/scheduling/v1beta1 volcano.sh/apis/pkg/client/listers/batch/v1alpha1 volcano.sh/apis/pkg/client/listers/bus/v1alpha1 +volcano.sh/apis/pkg/client/listers/flow/v1alpha1 volcano.sh/apis/pkg/client/listers/nodeinfo/v1alpha1 volcano.sh/apis/pkg/client/listers/scheduling/v1beta1 # github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3 diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go index 7e20f4083a7..afec9f3cfd8 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/merge.go @@ -172,55 +172,51 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err } out := make([]interface{}, 0, int(math.Max(float64(rLen), float64(lLen)))) - // TODO: ordering is totally wrong. - // TODO: might as well make the map order work the same way. + lhsOrder := make([]fieldpath.PathElement, 0, lLen) - // This is a cheap hack to at least make the output order stable. - rhsOrder := make([]fieldpath.PathElement, 0, rLen) - - // First, collect all RHS children. - observedRHS := fieldpath.MakePathElementValueMap(rLen) - if rhs != nil { - for i := 0; i < rhs.Length(); i++ { - child := rhs.At(i) + // First, collect all LHS children. + observedLHS := fieldpath.MakePathElementValueMap(lLen) + if lhs != nil { + for i := 0; i < lhs.Length(); i++ { + child := lhs.At(i) pe, err := listItemToPathElement(w.allocator, w.schema, t, i, child) if err != nil { - errs = append(errs, errorf("rhs: element %v: %v", i, err.Error())...) + errs = append(errs, errorf("lhs: element %v: %v", i, err.Error())...) // If we can't construct the path element, we can't // even report errors deeper in the schema, so bail on // this element. continue } - if _, ok := observedRHS.Get(pe); ok { - errs = append(errs, errorf("rhs: duplicate entries for key %v", pe.String())...) + if _, ok := observedLHS.Get(pe); ok { + errs = append(errs, errorf("lhs: duplicate entries for key %v", pe.String())...) } - observedRHS.Insert(pe, child) - rhsOrder = append(rhsOrder, pe) + observedLHS.Insert(pe, child) + lhsOrder = append(lhsOrder, pe) } } - // Then merge with LHS children. - observedLHS := fieldpath.MakePathElementSet(lLen) - if lhs != nil { - for i := 0; i < lhs.Length(); i++ { - child := lhs.At(i) + // Then merge with RHS children. + observedRHS := fieldpath.MakePathElementSet(rLen) + if rhs != nil { + for i := 0; i < rhs.Length(); i++ { + child := rhs.At(i) pe, err := listItemToPathElement(w.allocator, w.schema, t, i, child) if err != nil { - errs = append(errs, errorf("lhs: element %v: %v", i, err.Error())...) + errs = append(errs, errorf("rhs: element %v: %v", i, err.Error())...) // If we can't construct the path element, we can't // even report errors deeper in the schema, so bail on // this element. continue } - if observedLHS.Has(pe) { - errs = append(errs, errorf("lhs: duplicate entries for key %v", pe.String())...) + if observedRHS.Has(pe) { + errs = append(errs, errorf("rhs: duplicate entries for key %v", pe.String())...) continue } - observedLHS.Insert(pe) + observedRHS.Insert(pe) w2 := w.prepareDescent(pe, t.ElementType) - w2.lhs = value.Value(child) - if rchild, ok := observedRHS.Get(pe); ok { - w2.rhs = rchild + w2.rhs = child + if lchild, ok := observedLHS.Get(pe); ok { + w2.lhs = lchild } errs = append(errs, w2.merge(pe.String)...) if w2.out != nil { @@ -230,13 +226,13 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err } } - for _, pe := range rhsOrder { - if observedLHS.Has(pe) { + for _, pe := range lhsOrder { + if observedRHS.Has(pe) { continue } - value, _ := observedRHS.Get(pe) + value, _ := observedLHS.Get(pe) w2 := w.prepareDescent(pe, t.ElementType) - w2.rhs = value + w2.lhs = value errs = append(errs, w2.merge(pe.String)...) if w2.out != nil { out = append(out, *w2.out) diff --git a/vendor/sigs.k8s.io/yaml/.gitignore b/vendor/sigs.k8s.io/yaml/.gitignore index e256a31e00a..2dc92904ef5 100644 --- a/vendor/sigs.k8s.io/yaml/.gitignore +++ b/vendor/sigs.k8s.io/yaml/.gitignore @@ -6,6 +6,10 @@ .project .settings/** +# Idea files +.idea/** +.idea/ + # Emacs save files *~ diff --git a/vendor/sigs.k8s.io/yaml/.travis.yml b/vendor/sigs.k8s.io/yaml/.travis.yml index d20e23eff43..54ed8f9cb96 100644 --- a/vendor/sigs.k8s.io/yaml/.travis.yml +++ b/vendor/sigs.k8s.io/yaml/.travis.yml @@ -1,8 +1,7 @@ language: go -dist: xenial -go: - - 1.12.x - - 1.13.x +arch: arm64 +dist: focal +go: 1.15.x script: - diff -u <(echo -n) <(gofmt -d *.go) - diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) diff --git a/vendor/sigs.k8s.io/yaml/README.md b/vendor/sigs.k8s.io/yaml/README.md index 5a651d91633..e81cc426be6 100644 --- a/vendor/sigs.k8s.io/yaml/README.md +++ b/vendor/sigs.k8s.io/yaml/README.md @@ -107,8 +107,8 @@ func main() { } fmt.Println(string(y)) /* Output: - name: John age: 30 + name: John */ j2, err := yaml.YAMLToJSON(y) if err != nil { diff --git a/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/job.go b/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/job.go index 99a65f9ebd2..830b2071173 100644 --- a/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/job.go +++ b/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/job.go @@ -33,6 +33,7 @@ import ( // +kubebuilder:printcolumn:name="minAvailable",type=integer,JSONPath=`.status.minAvailable` // +kubebuilder:printcolumn:name="RUNNINGS",type=integer,JSONPath=`.status.running` // +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:printcolumn:name="QUEUE",type=string,priority=1,JSONPath=`.spec.queue` type Job struct { metav1.TypeMeta `json:",inline"` diff --git a/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go b/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go index b567ac731ed..254cd9680f6 100644 --- a/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/volcano.sh/apis/pkg/apis/batch/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Volcano Authors. +Copyright 2022 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. @@ -16,6 +16,7 @@ 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 diff --git a/vendor/volcano.sh/apis/pkg/apis/bus/v1alpha1/zz_generated.deepcopy.go b/vendor/volcano.sh/apis/pkg/apis/bus/v1alpha1/zz_generated.deepcopy.go index ee8b6864be7..9451421ec9b 100644 --- a/vendor/volcano.sh/apis/pkg/apis/bus/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/volcano.sh/apis/pkg/apis/bus/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Volcano Authors. +Copyright 2022 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. @@ -16,6 +16,7 @@ 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 diff --git a/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/doc.go b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/doc.go new file mode 100644 index 00000000000..8042c983d9e --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2021 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 contains API Schema definitions for the batch v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=flow.volcano.sh +// +k8s:deepcopy-gen=package +package v1alpha1 diff --git a/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/jobflow_types.go b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/jobflow_types.go new file mode 100644 index 00000000000..edeb83dd6d5 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/jobflow_types.go @@ -0,0 +1,154 @@ +/* +Copyright 2021. + +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 ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "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"` +} + +// Flow defines the dependent of jobs +type Flow struct { + Name string `json:"name"` + DependsOn *DependsOn `json:"dependsOn,omitempty"` +} + +type DependsOn struct { + Targets []string `json:"targets,omitempty"` + Probe *Probe `json:"probe,omitempty"` +} + +type Probe struct { + HttpGetList []HttpGet `json:"httpGetList,omitempty"` + TcpSocketList []TcpSocket `json:"tcpSocketList,omitempty"` + TaskStatusList []TaskStatus `json:"taskStatusList,omitempty"` +} + +type HttpGet struct { + TaskName string `json:"taskName,omitempty"` + Path string `json:"path,omitempty"` + Port int `json:"port,omitempty"` + HTTPHeader v1.HTTPHeader `json:"httpHeader,omitempty"` +} + +type TcpSocket struct { + TaskName string `json:"taskName,omitempty"` + Port int `json:"port"` +} + +type TaskStatus struct { + TaskName string `json:"taskName,omitempty"` + 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"` +} + +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"` + 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"` +} + +type State struct { + Phase Phase `json:"phase,omitempty"` +} + +type Phase string + +const ( + Retain = "retain" + Delete = "delete" +) + +const ( + Succeed Phase = "Succeed" + Terminating Phase = "Terminating" + Failed Phase = "Failed" + Running Phase = "Running" + Pending Phase = "Pending" +) + +type Condition struct { + Phase v1alpha1.JobPhase `json:"phase,omitempty"` + CreateTimestamp metav1.Time `json:"createTime,omitempty"` + RunningDuration *metav1.Duration `json:"runningDuration,omitempty"` + TaskStatusCount map[string]v1alpha1.TaskState `json:"taskStatusCount,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +//+kubebuilder:object:root=true +//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.state.phase" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:path=jobflows,shortName=jf +//+kubebuilder:subresource:status + +// JobFlow is the Schema for the jobflows API +type JobFlow struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec JobFlowSpec `json:"spec,omitempty"` + Status JobFlowStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +//+kubebuilder:object:root=true + +// JobFlowList contains a list of JobFlow +type JobFlowList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []JobFlow `json:"items"` +} diff --git a/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/jobtemplate_types.go b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/jobtemplate_types.go new file mode 100644 index 00000000000..ee447b6569f --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/jobtemplate_types.go @@ -0,0 +1,68 @@ +/* +Copyright 2021. + +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" + "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 +} + +// 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 []string `json:"jobDependsOnList,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +//+kubebuilder:object:root=true +// +kubebuilder:resource:path=jobtemplates,shortName=jt +//+kubebuilder:subresource:status + +// JobTemplate is the Schema for the jobtemplates API +type JobTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec v1alpha1.JobSpec `json:"spec,omitempty"` + Status JobTemplateStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +//+kubebuilder:object:root=true + +// JobTemplateList contains a list of JobTemplate +type JobTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []JobTemplate `json:"items"` +} diff --git a/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/register.go b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/register.go new file mode 100644 index 00000000000..7124d7d2cee --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/register.go @@ -0,0 +1,57 @@ +/* +Copyright 2021. + +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 contains API Schema definitions for the flow v1alpha1 API group +//+kubebuilder:object:generate=true +//+groupName=flow.volcano.sh +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name used in this package. +const GroupName = "flow.volcano.sh" + +// SchemeGroupVersion is the group version used to register these objects. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +var ( + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// 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, + &JobFlow{}, + &JobFlowList{}, + &JobTemplate{}, + &JobTemplateList{}, + ) + + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/zz_generated.deepcopy.go b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000000..1a346840f10 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/apis/flow/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,486 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2021 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" + batchv1alpha1 "volcano.sh/apis/pkg/apis/batch/v1alpha1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.CreateTimestamp.DeepCopyInto(&out.CreateTimestamp) + if in.RunningDuration != nil { + in, out := &in.RunningDuration, &out.RunningDuration + *out = new(v1.Duration) + **out = **in + } + if in.TaskStatusCount != nil { + in, out := &in.TaskStatusCount, &out.TaskStatusCount + *out = make(map[string]batchv1alpha1.TaskState, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DependsOn) DeepCopyInto(out *DependsOn) { + *out = *in + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Probe != nil { + in, out := &in.Probe, &out.Probe + *out = new(Probe) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependsOn. +func (in *DependsOn) DeepCopy() *DependsOn { + if in == nil { + return nil + } + out := new(DependsOn) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Flow) DeepCopyInto(out *Flow) { + *out = *in + if in.DependsOn != nil { + in, out := &in.DependsOn, &out.DependsOn + *out = new(DependsOn) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flow. +func (in *Flow) DeepCopy() *Flow { + if in == nil { + return nil + } + out := new(Flow) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HttpGet) DeepCopyInto(out *HttpGet) { + *out = *in + out.HTTPHeader = in.HTTPHeader + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpGet. +func (in *HttpGet) DeepCopy() *HttpGet { + if in == nil { + return nil + } + out := new(HttpGet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobFlow) DeepCopyInto(out *JobFlow) { + *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 JobFlow. +func (in *JobFlow) DeepCopy() *JobFlow { + if in == nil { + return nil + } + out := new(JobFlow) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobFlow) 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 *JobFlowList) DeepCopyInto(out *JobFlowList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobFlow, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFlowList. +func (in *JobFlowList) DeepCopy() *JobFlowList { + if in == nil { + return nil + } + out := new(JobFlowList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobFlowList) 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 *JobFlowSpec) DeepCopyInto(out *JobFlowSpec) { + *out = *in + if in.Flows != nil { + in, out := &in.Flows, &out.Flows + *out = make([]Flow, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFlowSpec. +func (in *JobFlowSpec) DeepCopy() *JobFlowSpec { + if in == nil { + return nil + } + out := new(JobFlowSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobFlowStatus) DeepCopyInto(out *JobFlowStatus) { + *out = *in + if in.PendingJobs != nil { + in, out := &in.PendingJobs, &out.PendingJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RunningJobs != nil { + in, out := &in.RunningJobs, &out.RunningJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.FailedJobs != nil { + in, out := &in.FailedJobs, &out.FailedJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.CompletedJobs != nil { + in, out := &in.CompletedJobs, &out.CompletedJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TerminatedJobs != nil { + in, out := &in.TerminatedJobs, &out.TerminatedJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UnKnowJobs != nil { + in, out := &in.UnKnowJobs, &out.UnKnowJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.JobStatusList != nil { + in, out := &in.JobStatusList, &out.JobStatusList + *out = make([]JobStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(map[string]Condition, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + out.State = in.State + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobFlowStatus. +func (in *JobFlowStatus) DeepCopy() *JobFlowStatus { + if in == nil { + return nil + } + out := new(JobFlowStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobRunningHistory) DeepCopyInto(out *JobRunningHistory) { + *out = *in + in.StartTimestamp.DeepCopyInto(&out.StartTimestamp) + in.EndTimestamp.DeepCopyInto(&out.EndTimestamp) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobRunningHistory. +func (in *JobRunningHistory) DeepCopy() *JobRunningHistory { + if in == nil { + return nil + } + out := new(JobRunningHistory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobStatus) DeepCopyInto(out *JobStatus) { + *out = *in + in.StartTimestamp.DeepCopyInto(&out.StartTimestamp) + in.EndTimestamp.DeepCopyInto(&out.EndTimestamp) + if in.RunningHistories != nil { + in, out := &in.RunningHistories, &out.RunningHistories + *out = make([]JobRunningHistory, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus. +func (in *JobStatus) DeepCopy() *JobStatus { + if in == nil { + return nil + } + out := new(JobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobTemplate) DeepCopyInto(out *JobTemplate) { + *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 JobTemplate. +func (in *JobTemplate) DeepCopy() *JobTemplate { + if in == nil { + return nil + } + out := new(JobTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobTemplate) 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 *JobTemplateList) DeepCopyInto(out *JobTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobTemplateList. +func (in *JobTemplateList) DeepCopy() *JobTemplateList { + if in == nil { + return nil + } + out := new(JobTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobTemplateList) 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 *JobTemplateSpec) DeepCopyInto(out *JobTemplateSpec) { + *out = *in + in.JobSpec.DeepCopyInto(&out.JobSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobTemplateSpec. +func (in *JobTemplateSpec) DeepCopy() *JobTemplateSpec { + if in == nil { + return nil + } + out := new(JobTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobTemplateStatus) DeepCopyInto(out *JobTemplateStatus) { + *out = *in + if in.JobDependsOnList != nil { + in, out := &in.JobDependsOnList, &out.JobDependsOnList + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobTemplateStatus. +func (in *JobTemplateStatus) DeepCopy() *JobTemplateStatus { + if in == nil { + return nil + } + out := new(JobTemplateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Probe) DeepCopyInto(out *Probe) { + *out = *in + if in.HttpGetList != nil { + in, out := &in.HttpGetList, &out.HttpGetList + *out = make([]HttpGet, len(*in)) + copy(*out, *in) + } + if in.TcpSocketList != nil { + in, out := &in.TcpSocketList, &out.TcpSocketList + *out = make([]TcpSocket, len(*in)) + copy(*out, *in) + } + if in.TaskStatusList != nil { + in, out := &in.TaskStatusList, &out.TaskStatusList + *out = make([]TaskStatus, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe. +func (in *Probe) DeepCopy() *Probe { + if in == nil { + return nil + } + out := new(Probe) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *State) DeepCopyInto(out *State) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new State. +func (in *State) DeepCopy() *State { + if in == nil { + return nil + } + out := new(State) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TaskStatus) DeepCopyInto(out *TaskStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskStatus. +func (in *TaskStatus) DeepCopy() *TaskStatus { + if in == nil { + return nil + } + out := new(TaskStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TcpSocket) DeepCopyInto(out *TcpSocket) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TcpSocket. +func (in *TcpSocket) DeepCopy() *TcpSocket { + if in == nil { + return nil + } + out := new(TcpSocket) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/volcano.sh/apis/pkg/apis/helpers/helpers.go b/vendor/volcano.sh/apis/pkg/apis/helpers/helpers.go index 28aa5580948..df21f62bfbc 100644 --- a/vendor/volcano.sh/apis/pkg/apis/helpers/helpers.go +++ b/vendor/volcano.sh/apis/pkg/apis/helpers/helpers.go @@ -38,6 +38,7 @@ import ( vcbatch "volcano.sh/apis/pkg/apis/batch/v1alpha1" vcbus "volcano.sh/apis/pkg/apis/bus/v1alpha1" + flow "volcano.sh/apis/pkg/apis/flow/v1alpha1" schedulerv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1" ) @@ -50,6 +51,12 @@ var CommandKind = vcbus.SchemeGroupVersion.WithKind("Command") // V1beta1QueueKind is queue kind with v1alpha2 version. var V1beta1QueueKind = schedulerv1beta1.SchemeGroupVersion.WithKind("Queue") +// JobFlowKind creates jobflow GroupVersionKind. +var JobFlowKind = flow.SchemeGroupVersion.WithKind("JobFlow") + +// JobTemplateKind creates jobtemplate GroupVersionKind. +var JobTemplateKind = flow.SchemeGroupVersion.WithKind("JobTemplate") + // CreateOrUpdateConfigMap creates config map if not present or updates config map if necessary. func CreateOrUpdateConfigMap(job *vcbatch.Job, kubeClients kubernetes.Interface, data map[string]string, cmName string) error { // If ConfigMap does not exist, create one for Job. diff --git a/vendor/volcano.sh/apis/pkg/apis/scheduling/types.go b/vendor/volcano.sh/apis/pkg/apis/scheduling/types.go index 445212566fd..35d2b08f6b1 100644 --- a/vendor/volcano.sh/apis/pkg/apis/scheduling/types.go +++ b/vendor/volcano.sh/apis/pkg/apis/scheduling/types.go @@ -143,6 +143,7 @@ const ( // +kubebuilder:printcolumn:name="minMember",type=integer,JSONPath=`.spec.minMember` // +kubebuilder:printcolumn:name="RUNNINGS",type=integer,JSONPath=`.status.running` // +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:printcolumn:name="QUEUE",type=string,priority=1,JSONPath=`.spec.queue` type PodGroup struct { metav1.TypeMeta // Standard object's metadata. @@ -289,11 +290,37 @@ type QueueStatus struct { // CluterSpec represents the template of Cluster type Cluster struct { - Name string - Weight int32 + Name string + Weight int32 Capacity v1.ResourceList } + +// Affinity is a group of affinity scheduling rules. +type Affinity struct { + // Describes nodegroup affinity scheduling rules for the queue. + // +optional + NodeGroupAffinity *NodeGroupAffinity `json:"nodeGroupAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeGroupAffinity"` + + // Describes nodegroup affinity scheduling rules for the queue. + // +optional + NodeGroupAntiAffinity *NodeGroupAntiAffinity `json:"nodeGroupAntiAffinity,omitempty" protobuf:"bytes,2,opt,name=nodeGroupAntiAffinity"` +} + +type NodeGroupAffinity struct { + // +optional + RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` + // +optional + PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` +} + +type NodeGroupAntiAffinity struct { + // +optional + RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` + // +optional + PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` +} + // QueueSpec represents the template of Queue. type QueueSpec struct { Weight int32 @@ -309,6 +336,10 @@ type QueueSpec struct { // Guarantee indicate configuration about resource reservation Guarantee Guarantee `json:"guarantee,omitempty" protobuf:"bytes,4,opt,name=guarantee"` + + // If specified, the queue's scheduling constraints + // +optional + Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,6,opt,name=affinity"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/types.go b/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/types.go index 84f96b40312..6c053ab09b1 100644 --- a/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/types.go +++ b/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/types.go @@ -145,6 +145,11 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true // +kubebuilder:resource:path=podgroups,shortName=pg;podgroup-v1beta1 +// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.phase` +// +kubebuilder:printcolumn:name="minMember",type=integer,JSONPath=`.spec.minMember` +// +kubebuilder:printcolumn:name="RUNNINGS",type=integer,JSONPath=`.status.running` +// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:printcolumn:name="QUEUE",type=string,priority=1,JSONPath=`.spec.queue` // PodGroup is a collection of Pod; used for batch workload. type PodGroup struct { @@ -301,11 +306,36 @@ type QueueStatus struct { // 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"` + Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` + Weight int32 `json:"weight,omitempty" protobuf:"bytes,2,opt,name=weight"` Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,opt,name=capacity"` } +// Affinity is a group of affinity scheduling rules. +type Affinity struct { + // Describes nodegroup affinity scheduling rules for the queue(e.g. putting pods of the queue in the nodes of the nodegroup) + // +optional + NodeGroupAffinity *NodeGroupAffinity `json:"nodeGroupAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeGroupAffinity"` + + // Describes nodegroup anti-affinity scheduling rules for the queue(e.g. avoid putting pods of the queue in the nodes of the nodegroup). + // +optional + NodeGroupAntiAffinity *NodeGroupAntiAffinity `json:"nodeGroupAntiAffinity,omitempty" protobuf:"bytes,2,opt,name=nodeGroupAntiAffinity"` +} + +type NodeGroupAffinity struct { + // +optional + RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` + // +optional + PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` +} + +type NodeGroupAntiAffinity struct { + // +optional + RequiredDuringSchedulingIgnoredDuringExecution []string `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` + // +optional + PreferredDuringSchedulingIgnoredDuringExecution []string `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` +} + // QueueSpec represents the template of Queue. type QueueSpec struct { Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"` @@ -314,11 +344,15 @@ type QueueSpec struct { // Reclaimable indicate whether the queue can be reclaimed by other queue Reclaimable *bool `json:"reclaimable,omitempty" protobuf:"bytes,3,opt,name=reclaimable"` - // extendCluster indicate the jobs in this Queue will be dispatched to these clusters. + // extendCluster indicate the jobs in this Queue will be dispatched to these clusters. ExtendClusters []Cluster `json:"extendClusters,omitempty" protobuf:"bytes,4,opt,name=extendClusters"` // Guarantee indicate configuration about resource reservation - Guarantee Guarantee `json:"guarantee,omitempty" protobuf:"bytes,4,opt,name=guarantee"` + Guarantee Guarantee `json:"guarantee,omitempty" protobuf:"bytes,5,opt,name=guarantee"` + + // If specified, the pod owned by the queue will be scheduled with constraint + // +optional + Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,6,opt,name=affinity"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.conversion.go b/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.conversion.go index 07f7ec8a569..dd8b4b47fbd 100644 --- a/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.conversion.go +++ b/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.conversion.go @@ -36,6 +36,16 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*Affinity)(nil), (*scheduling.Affinity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Affinity_To_scheduling_Affinity(a.(*Affinity), b.(*scheduling.Affinity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*scheduling.Affinity)(nil), (*Affinity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_scheduling_Affinity_To_v1beta1_Affinity(a.(*scheduling.Affinity), b.(*Affinity), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*scheduling.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Cluster_To_scheduling_Cluster(a.(*Cluster), b.(*scheduling.Cluster), scope) }); err != nil { @@ -56,6 +66,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); 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 { + return err + } + if err := s.AddGeneratedConversionFunc((*scheduling.NodeGroupAffinity)(nil), (*NodeGroupAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_scheduling_NodeGroupAffinity_To_v1beta1_NodeGroupAffinity(a.(*scheduling.NodeGroupAffinity), b.(*NodeGroupAffinity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NodeGroupAntiAffinity)(nil), (*scheduling.NodeGroupAntiAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NodeGroupAntiAffinity_To_scheduling_NodeGroupAntiAffinity(a.(*NodeGroupAntiAffinity), b.(*scheduling.NodeGroupAntiAffinity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*scheduling.NodeGroupAntiAffinity)(nil), (*NodeGroupAntiAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_scheduling_NodeGroupAntiAffinity_To_v1beta1_NodeGroupAntiAffinity(a.(*scheduling.NodeGroupAntiAffinity), b.(*NodeGroupAntiAffinity), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*PodGroup)(nil), (*scheduling.PodGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_PodGroup_To_scheduling_PodGroup(a.(*PodGroup), b.(*scheduling.PodGroup), scope) }); err != nil { @@ -159,6 +189,28 @@ func RegisterConversions(s *runtime.Scheme) error { return nil } +func autoConvert_v1beta1_Affinity_To_scheduling_Affinity(in *Affinity, out *scheduling.Affinity, s conversion.Scope) error { + out.NodeGroupAffinity = (*scheduling.NodeGroupAffinity)(unsafe.Pointer(in.NodeGroupAffinity)) + out.NodeGroupAntiAffinity = (*scheduling.NodeGroupAntiAffinity)(unsafe.Pointer(in.NodeGroupAntiAffinity)) + return nil +} + +// Convert_v1beta1_Affinity_To_scheduling_Affinity is an autogenerated conversion function. +func Convert_v1beta1_Affinity_To_scheduling_Affinity(in *Affinity, out *scheduling.Affinity, s conversion.Scope) error { + return autoConvert_v1beta1_Affinity_To_scheduling_Affinity(in, out, s) +} + +func autoConvert_scheduling_Affinity_To_v1beta1_Affinity(in *scheduling.Affinity, out *Affinity, s conversion.Scope) error { + out.NodeGroupAffinity = (*NodeGroupAffinity)(unsafe.Pointer(in.NodeGroupAffinity)) + out.NodeGroupAntiAffinity = (*NodeGroupAntiAffinity)(unsafe.Pointer(in.NodeGroupAntiAffinity)) + return nil +} + +// Convert_scheduling_Affinity_To_v1beta1_Affinity is an autogenerated conversion function. +func Convert_scheduling_Affinity_To_v1beta1_Affinity(in *scheduling.Affinity, out *Affinity, s conversion.Scope) error { + return autoConvert_scheduling_Affinity_To_v1beta1_Affinity(in, out, s) +} + func autoConvert_v1beta1_Cluster_To_scheduling_Cluster(in *Cluster, out *scheduling.Cluster, s conversion.Scope) error { out.Name = in.Name out.Weight = in.Weight @@ -203,6 +255,50 @@ func Convert_scheduling_Guarantee_To_v1beta1_Guarantee(in *scheduling.Guarantee, return autoConvert_scheduling_Guarantee_To_v1beta1_Guarantee(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)) + return nil +} + +// Convert_v1beta1_NodeGroupAffinity_To_scheduling_NodeGroupAffinity is an autogenerated conversion function. +func Convert_v1beta1_NodeGroupAffinity_To_scheduling_NodeGroupAffinity(in *NodeGroupAffinity, out *scheduling.NodeGroupAffinity, s conversion.Scope) error { + return autoConvert_v1beta1_NodeGroupAffinity_To_scheduling_NodeGroupAffinity(in, out, s) +} + +func autoConvert_scheduling_NodeGroupAffinity_To_v1beta1_NodeGroupAffinity(in *scheduling.NodeGroupAffinity, out *NodeGroupAffinity, s conversion.Scope) error { + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) + return nil +} + +// Convert_scheduling_NodeGroupAffinity_To_v1beta1_NodeGroupAffinity is an autogenerated conversion function. +func Convert_scheduling_NodeGroupAffinity_To_v1beta1_NodeGroupAffinity(in *scheduling.NodeGroupAffinity, out *NodeGroupAffinity, s conversion.Scope) error { + return autoConvert_scheduling_NodeGroupAffinity_To_v1beta1_NodeGroupAffinity(in, out, s) +} + +func autoConvert_v1beta1_NodeGroupAntiAffinity_To_scheduling_NodeGroupAntiAffinity(in *NodeGroupAntiAffinity, out *scheduling.NodeGroupAntiAffinity, s conversion.Scope) error { + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) + return nil +} + +// Convert_v1beta1_NodeGroupAntiAffinity_To_scheduling_NodeGroupAntiAffinity is an autogenerated conversion function. +func Convert_v1beta1_NodeGroupAntiAffinity_To_scheduling_NodeGroupAntiAffinity(in *NodeGroupAntiAffinity, out *scheduling.NodeGroupAntiAffinity, s conversion.Scope) error { + return autoConvert_v1beta1_NodeGroupAntiAffinity_To_scheduling_NodeGroupAntiAffinity(in, out, s) +} + +func autoConvert_scheduling_NodeGroupAntiAffinity_To_v1beta1_NodeGroupAntiAffinity(in *scheduling.NodeGroupAntiAffinity, out *NodeGroupAntiAffinity, s conversion.Scope) error { + out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) + out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]string)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) + return nil +} + +// Convert_scheduling_NodeGroupAntiAffinity_To_v1beta1_NodeGroupAntiAffinity is an autogenerated conversion function. +func Convert_scheduling_NodeGroupAntiAffinity_To_v1beta1_NodeGroupAntiAffinity(in *scheduling.NodeGroupAntiAffinity, out *NodeGroupAntiAffinity, s conversion.Scope) error { + return autoConvert_scheduling_NodeGroupAntiAffinity_To_v1beta1_NodeGroupAntiAffinity(in, out, s) +} + func autoConvert_v1beta1_PodGroup_To_scheduling_PodGroup(in *PodGroup, out *scheduling.PodGroup, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1beta1_PodGroupSpec_To_scheduling_PodGroupSpec(&in.Spec, &out.Spec, s); err != nil { @@ -425,6 +521,7 @@ func autoConvert_v1beta1_QueueSpec_To_scheduling_QueueSpec(in *QueueSpec, out *s if err := Convert_v1beta1_Guarantee_To_scheduling_Guarantee(&in.Guarantee, &out.Guarantee, s); err != nil { return err } + out.Affinity = (*scheduling.Affinity)(unsafe.Pointer(in.Affinity)) return nil } @@ -442,6 +539,7 @@ func autoConvert_scheduling_QueueSpec_To_v1beta1_QueueSpec(in *scheduling.QueueS if err := Convert_scheduling_Guarantee_To_v1beta1_Guarantee(&in.Guarantee, &out.Guarantee, s); err != nil { return err } + out.Affinity = (*Affinity)(unsafe.Pointer(in.Affinity)) return nil } diff --git a/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.deepcopy.go b/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.deepcopy.go index e51b1d7b3b0..898040fd4d3 100644 --- a/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.deepcopy.go +++ b/vendor/volcano.sh/apis/pkg/apis/scheduling/v1beta1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2021 The Volcano Authors. +Copyright 2022 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. @@ -16,6 +16,7 @@ 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 v1beta1 @@ -26,6 +27,32 @@ import ( 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 *Affinity) DeepCopyInto(out *Affinity) { + *out = *in + if in.NodeGroupAffinity != nil { + in, out := &in.NodeGroupAffinity, &out.NodeGroupAffinity + *out = new(NodeGroupAffinity) + (*in).DeepCopyInto(*out) + } + if in.NodeGroupAntiAffinity != nil { + in, out := &in.NodeGroupAntiAffinity, &out.NodeGroupAntiAffinity + *out = new(NodeGroupAntiAffinity) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Affinity. +func (in *Affinity) DeepCopy() *Affinity { + if in == nil { + return nil + } + out := new(Affinity) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in @@ -72,6 +99,58 @@ 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 *NodeGroupAffinity) DeepCopyInto(out *NodeGroupAffinity) { + *out = *in + if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupAffinity. +func (in *NodeGroupAffinity) DeepCopy() *NodeGroupAffinity { + if in == nil { + return nil + } + out := new(NodeGroupAffinity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroupAntiAffinity) DeepCopyInto(out *NodeGroupAntiAffinity) { + *out = *in + if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupAntiAffinity. +func (in *NodeGroupAntiAffinity) DeepCopy() *NodeGroupAntiAffinity { + if in == nil { + return nil + } + out := new(NodeGroupAntiAffinity) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodGroup) DeepCopyInto(out *PodGroup) { *out = *in @@ -291,6 +370,11 @@ func (in *QueueSpec) DeepCopyInto(out *QueueSpec) { } } in.Guarantee.DeepCopyInto(&out.Guarantee) + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(Affinity) + (*in).DeepCopyInto(*out) + } return } diff --git a/vendor/volcano.sh/apis/pkg/apis/scheduling/zz_generated.deepcopy.go b/vendor/volcano.sh/apis/pkg/apis/scheduling/zz_generated.deepcopy.go index 96ebc961f76..8d3e48ee060 100644 --- a/vendor/volcano.sh/apis/pkg/apis/scheduling/zz_generated.deepcopy.go +++ b/vendor/volcano.sh/apis/pkg/apis/scheduling/zz_generated.deepcopy.go @@ -26,6 +26,32 @@ import ( 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 *Affinity) DeepCopyInto(out *Affinity) { + *out = *in + if in.NodeGroupAffinity != nil { + in, out := &in.NodeGroupAffinity, &out.NodeGroupAffinity + *out = new(NodeGroupAffinity) + (*in).DeepCopyInto(*out) + } + if in.NodeGroupAntiAffinity != nil { + in, out := &in.NodeGroupAntiAffinity, &out.NodeGroupAntiAffinity + *out = new(NodeGroupAntiAffinity) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Affinity. +func (in *Affinity) DeepCopy() *Affinity { + if in == nil { + return nil + } + out := new(Affinity) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in @@ -72,6 +98,58 @@ 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 *NodeGroupAffinity) DeepCopyInto(out *NodeGroupAffinity) { + *out = *in + if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupAffinity. +func (in *NodeGroupAffinity) DeepCopy() *NodeGroupAffinity { + if in == nil { + return nil + } + out := new(NodeGroupAffinity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroupAntiAffinity) DeepCopyInto(out *NodeGroupAntiAffinity) { + *out = *in + if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { + in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroupAntiAffinity. +func (in *NodeGroupAntiAffinity) DeepCopy() *NodeGroupAntiAffinity { + if in == nil { + return nil + } + out := new(NodeGroupAntiAffinity) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodGroup) DeepCopyInto(out *PodGroup) { *out = *in @@ -291,6 +369,11 @@ func (in *QueueSpec) DeepCopyInto(out *QueueSpec) { } } in.Guarantee.DeepCopyInto(&out.Guarantee) + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(Affinity) + (*in).DeepCopyInto(*out) + } return } diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/clientset.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/clientset.go index abbb279395a..9aa2c31c1c6 100644 --- a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/clientset.go +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/clientset.go @@ -26,6 +26,7 @@ import ( flowcontrol "k8s.io/client-go/util/flowcontrol" batchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1" busv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1" + 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" ) @@ -34,6 +35,7 @@ type Interface interface { Discovery() discovery.DiscoveryInterface BatchV1alpha1() batchv1alpha1.BatchV1alpha1Interface BusV1alpha1() busv1alpha1.BusV1alpha1Interface + FlowV1alpha1() flowv1alpha1.FlowV1alpha1Interface NodeinfoV1alpha1() nodeinfov1alpha1.NodeinfoV1alpha1Interface SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface } @@ -44,6 +46,7 @@ type Clientset struct { *discovery.DiscoveryClient batchV1alpha1 *batchv1alpha1.BatchV1alpha1Client busV1alpha1 *busv1alpha1.BusV1alpha1Client + flowV1alpha1 *flowv1alpha1.FlowV1alpha1Client nodeinfoV1alpha1 *nodeinfov1alpha1.NodeinfoV1alpha1Client schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client } @@ -58,6 +61,11 @@ func (c *Clientset) BusV1alpha1() busv1alpha1.BusV1alpha1Interface { return c.busV1alpha1 } +// FlowV1alpha1 retrieves the FlowV1alpha1Client +func (c *Clientset) FlowV1alpha1() flowv1alpha1.FlowV1alpha1Interface { + return c.flowV1alpha1 +} + // NodeinfoV1alpha1 retrieves the NodeinfoV1alpha1Client func (c *Clientset) NodeinfoV1alpha1() nodeinfov1alpha1.NodeinfoV1alpha1Interface { return c.nodeinfoV1alpha1 @@ -116,6 +124,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.flowV1alpha1, err = flowv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.nodeinfoV1alpha1, err = nodeinfov1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -147,6 +159,7 @@ func New(c rest.Interface) *Clientset { var cs Clientset cs.batchV1alpha1 = batchv1alpha1.New(c) cs.busV1alpha1 = busv1alpha1.New(c) + cs.flowV1alpha1 = flowv1alpha1.New(c) cs.nodeinfoV1alpha1 = nodeinfov1alpha1.New(c) cs.schedulingV1beta1 = schedulingv1beta1.New(c) diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/clientset_generated.go index 5ae665fbb36..87a67dbe8bb 100644 --- a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -28,6 +28,8 @@ import ( fakebatchv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/batch/v1alpha1/fake" busv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1" fakebusv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/bus/v1alpha1/fake" + flowv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1" + fakeflowv1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake" nodeinfov1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1" fakenodeinfov1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/nodeinfo/v1alpha1/fake" schedulingv1beta1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/scheduling/v1beta1" @@ -94,6 +96,11 @@ func (c *Clientset) BusV1alpha1() busv1alpha1.BusV1alpha1Interface { return &fakebusv1alpha1.FakeBusV1alpha1{Fake: &c.Fake} } +// FlowV1alpha1 retrieves the FlowV1alpha1Client +func (c *Clientset) FlowV1alpha1() flowv1alpha1.FlowV1alpha1Interface { + return &fakeflowv1alpha1.FakeFlowV1alpha1{Fake: &c.Fake} +} + // NodeinfoV1alpha1 retrieves the NodeinfoV1alpha1Client func (c *Clientset) NodeinfoV1alpha1() nodeinfov1alpha1.NodeinfoV1alpha1Interface { return &fakenodeinfov1alpha1.FakeNodeinfoV1alpha1{Fake: &c.Fake} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/register.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/register.go index 614192a00be..8a5ae87ac98 100644 --- a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/register.go +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/fake/register.go @@ -25,6 +25,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" batchv1alpha1 "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" schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1" ) @@ -35,6 +36,7 @@ var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ batchv1alpha1.AddToScheme, busv1alpha1.AddToScheme, + flowv1alpha1.AddToScheme, nodeinfov1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, } diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/scheme/register.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/scheme/register.go index b6928800cdb..d90320b6afa 100644 --- a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/scheme/register.go +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/scheme/register.go @@ -25,6 +25,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" batchv1alpha1 "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" schedulingv1beta1 "volcano.sh/apis/pkg/apis/scheduling/v1beta1" ) @@ -35,6 +36,7 @@ var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ batchv1alpha1.AddToScheme, busv1alpha1.AddToScheme, + flowv1alpha1.AddToScheme, nodeinfov1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, } diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/doc.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/doc.go new file mode 100644 index 00000000000..e49de87c494 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/doc.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/doc.go new file mode 100644 index 00000000000..3bc0494e794 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_flow_client.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_flow_client.go new file mode 100644 index 00000000000..66fc76c4832 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_flow_client.go @@ -0,0 +1,43 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1" +) + +type FakeFlowV1alpha1 struct { + *testing.Fake +} + +func (c *FakeFlowV1alpha1) JobFlows(namespace string) v1alpha1.JobFlowInterface { + return &FakeJobFlows{c, namespace} +} + +func (c *FakeFlowV1alpha1) JobTemplates(namespace string) v1alpha1.JobTemplateInterface { + return &FakeJobTemplates{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeFlowV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_jobflow.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_jobflow.go new file mode 100644 index 00000000000..aa7351c2560 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_jobflow.go @@ -0,0 +1,141 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" +) + +// FakeJobFlows implements JobFlowInterface +type FakeJobFlows struct { + Fake *FakeFlowV1alpha1 + ns string +} + +var jobflowsResource = schema.GroupVersionResource{Group: "flow.volcano.sh", Version: "v1alpha1", Resource: "jobflows"} + +var jobflowsKind = schema.GroupVersionKind{Group: "flow.volcano.sh", Version: "v1alpha1", Kind: "JobFlow"} + +// Get takes name of the jobFlow, and returns the corresponding jobFlow object, and an error if there is any. +func (c *FakeJobFlows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(jobflowsResource, c.ns, name), &v1alpha1.JobFlow{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobFlow), err +} + +// List takes label and field selectors, and returns the list of JobFlows that match those selectors. +func (c *FakeJobFlows) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobFlowList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(jobflowsResource, jobflowsKind, c.ns, opts), &v1alpha1.JobFlowList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.JobFlowList{ListMeta: obj.(*v1alpha1.JobFlowList).ListMeta} + for _, item := range obj.(*v1alpha1.JobFlowList).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 jobFlows. +func (c *FakeJobFlows) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(jobflowsResource, c.ns, opts)) + +} + +// Create takes the representation of a jobFlow and creates it. Returns the server's representation of the jobFlow, and an error, if there is any. +func (c *FakeJobFlows) Create(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.CreateOptions) (result *v1alpha1.JobFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(jobflowsResource, c.ns, jobFlow), &v1alpha1.JobFlow{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobFlow), err +} + +// Update takes the representation of a jobFlow and updates it. Returns the server's representation of the jobFlow, and an error, if there is any. +func (c *FakeJobFlows) Update(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(jobflowsResource, c.ns, jobFlow), &v1alpha1.JobFlow{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobFlow), 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 *FakeJobFlows) UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (*v1alpha1.JobFlow, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(jobflowsResource, "status", c.ns, jobFlow), &v1alpha1.JobFlow{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobFlow), err +} + +// Delete takes name of the jobFlow and deletes it. Returns an error if one occurs. +func (c *FakeJobFlows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(jobflowsResource, c.ns, name, opts), &v1alpha1.JobFlow{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobFlows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(jobflowsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.JobFlowList{}) + return err +} + +// Patch applies the patch and returns the patched jobFlow. +func (c *FakeJobFlows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(jobflowsResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobFlow{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobFlow), err +} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_jobtemplate.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_jobtemplate.go new file mode 100644 index 00000000000..86ce3c1e947 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/fake/fake_jobtemplate.go @@ -0,0 +1,141 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" +) + +// FakeJobTemplates implements JobTemplateInterface +type FakeJobTemplates struct { + Fake *FakeFlowV1alpha1 + ns string +} + +var jobtemplatesResource = schema.GroupVersionResource{Group: "flow.volcano.sh", Version: "v1alpha1", Resource: "jobtemplates"} + +var jobtemplatesKind = schema.GroupVersionKind{Group: "flow.volcano.sh", Version: "v1alpha1", Kind: "JobTemplate"} + +// Get takes name of the jobTemplate, and returns the corresponding jobTemplate object, and an error if there is any. +func (c *FakeJobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(jobtemplatesResource, c.ns, name), &v1alpha1.JobTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobTemplate), err +} + +// List takes label and field selectors, and returns the list of JobTemplates that match those selectors. +func (c *FakeJobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(jobtemplatesResource, jobtemplatesKind, c.ns, opts), &v1alpha1.JobTemplateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.JobTemplateList{ListMeta: obj.(*v1alpha1.JobTemplateList).ListMeta} + for _, item := range obj.(*v1alpha1.JobTemplateList).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 jobTemplates. +func (c *FakeJobTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(jobtemplatesResource, c.ns, opts)) + +} + +// Create takes the representation of a jobTemplate and creates it. Returns the server's representation of the jobTemplate, and an error, if there is any. +func (c *FakeJobTemplates) Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (result *v1alpha1.JobTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(jobtemplatesResource, c.ns, jobTemplate), &v1alpha1.JobTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobTemplate), err +} + +// Update takes the representation of a jobTemplate and updates it. Returns the server's representation of the jobTemplate, and an error, if there is any. +func (c *FakeJobTemplates) Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(jobtemplatesResource, c.ns, jobTemplate), &v1alpha1.JobTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobTemplate), 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 *FakeJobTemplates) UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (*v1alpha1.JobTemplate, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(jobtemplatesResource, "status", c.ns, jobTemplate), &v1alpha1.JobTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobTemplate), err +} + +// Delete takes name of the jobTemplate and deletes it. Returns an error if one occurs. +func (c *FakeJobTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(jobtemplatesResource, c.ns, name, opts), &v1alpha1.JobTemplate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(jobtemplatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.JobTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched jobTemplate. +func (c *FakeJobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(jobtemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobTemplate), err +} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/flow_client.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/flow_client.go new file mode 100644 index 00000000000..a62d69876aa --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/flow_client.go @@ -0,0 +1,111 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" + "volcano.sh/apis/pkg/client/clientset/versioned/scheme" +) + +type FlowV1alpha1Interface interface { + RESTClient() rest.Interface + JobFlowsGetter + JobTemplatesGetter +} + +// FlowV1alpha1Client is used to interact with features provided by the flow.volcano.sh group. +type FlowV1alpha1Client struct { + restClient rest.Interface +} + +func (c *FlowV1alpha1Client) JobFlows(namespace string) JobFlowInterface { + return newJobFlows(c, namespace) +} + +func (c *FlowV1alpha1Client) JobTemplates(namespace string) JobTemplateInterface { + return newJobTemplates(c, namespace) +} + +// NewForConfig creates a new FlowV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*FlowV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new FlowV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &FlowV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new FlowV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *FlowV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new FlowV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *FlowV1alpha1Client { + return &FlowV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FlowV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/generated_expansion.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/generated_expansion.go new file mode 100644 index 00000000000..c6eb4f4470c --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/generated_expansion.go @@ -0,0 +1,22 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +type JobFlowExpansion interface{} + +type JobTemplateExpansion interface{} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/jobflow.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/jobflow.go new file mode 100644 index 00000000000..af4c31f9b87 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/jobflow.go @@ -0,0 +1,194 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + 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/flow/v1alpha1" + scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme" +) + +// JobFlowsGetter has a method to return a JobFlowInterface. +// A group's client should implement this interface. +type JobFlowsGetter interface { + JobFlows(namespace string) JobFlowInterface +} + +// JobFlowInterface has methods to work with JobFlow resources. +type JobFlowInterface interface { + Create(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.CreateOptions) (*v1alpha1.JobFlow, error) + Update(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (*v1alpha1.JobFlow, error) + UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (*v1alpha1.JobFlow, 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.JobFlow, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.JobFlowList, 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.JobFlow, err error) + JobFlowExpansion +} + +// jobFlows implements JobFlowInterface +type jobFlows struct { + client rest.Interface + ns string +} + +// newJobFlows returns a JobFlows +func newJobFlows(c *FlowV1alpha1Client, namespace string) *jobFlows { + return &jobFlows{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the jobFlow, and returns the corresponding jobFlow object, and an error if there is any. +func (c *jobFlows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobFlow, err error) { + result = &v1alpha1.JobFlow{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobflows"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobFlows that match those selectors. +func (c *jobFlows) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobFlowList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.JobFlowList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobflows"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobFlows. +func (c *jobFlows) 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("jobflows"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobFlow and creates it. Returns the server's representation of the jobFlow, and an error, if there is any. +func (c *jobFlows) Create(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.CreateOptions) (result *v1alpha1.JobFlow, err error) { + result = &v1alpha1.JobFlow{} + err = c.client.Post(). + Namespace(c.ns). + Resource("jobflows"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobFlow). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobFlow and updates it. Returns the server's representation of the jobFlow, and an error, if there is any. +func (c *jobFlows) Update(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) { + result = &v1alpha1.JobFlow{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobflows"). + Name(jobFlow.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobFlow). + 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 *jobFlows) UpdateStatus(ctx context.Context, jobFlow *v1alpha1.JobFlow, opts v1.UpdateOptions) (result *v1alpha1.JobFlow, err error) { + result = &v1alpha1.JobFlow{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobflows"). + Name(jobFlow.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobFlow). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobFlow and deletes it. Returns an error if one occurs. +func (c *jobFlows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobflows"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobFlows) 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("jobflows"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobFlow. +func (c *jobFlows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobFlow, err error) { + result = &v1alpha1.JobFlow{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobflows"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/jobtemplate.go b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/jobtemplate.go new file mode 100644 index 00000000000..a5f5e0b50db --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/clientset/versioned/typed/flow/v1alpha1/jobtemplate.go @@ -0,0 +1,194 @@ +/* +Copyright 2021 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + 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/flow/v1alpha1" + scheme "volcano.sh/apis/pkg/client/clientset/versioned/scheme" +) + +// JobTemplatesGetter has a method to return a JobTemplateInterface. +// A group's client should implement this interface. +type JobTemplatesGetter interface { + JobTemplates(namespace string) JobTemplateInterface +} + +// JobTemplateInterface has methods to work with JobTemplate resources. +type JobTemplateInterface interface { + Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (*v1alpha1.JobTemplate, error) + Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (*v1alpha1.JobTemplate, error) + UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (*v1alpha1.JobTemplate, 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.JobTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.JobTemplateList, 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.JobTemplate, err error) + JobTemplateExpansion +} + +// jobTemplates implements JobTemplateInterface +type jobTemplates struct { + client rest.Interface + ns string +} + +// newJobTemplates returns a JobTemplates +func newJobTemplates(c *FlowV1alpha1Client, namespace string) *jobTemplates { + return &jobTemplates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the jobTemplate, and returns the corresponding jobTemplate object, and an error if there is any. +func (c *jobTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobTemplate, err error) { + result = &v1alpha1.JobTemplate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobtemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobTemplates that match those selectors. +func (c *jobTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.JobTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobTemplates. +func (c *jobTemplates) 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("jobtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobTemplate and creates it. Returns the server's representation of the jobTemplate, and an error, if there is any. +func (c *jobTemplates) Create(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.CreateOptions) (result *v1alpha1.JobTemplate, err error) { + result = &v1alpha1.JobTemplate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("jobtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobTemplate and updates it. Returns the server's representation of the jobTemplate, and an error, if there is any. +func (c *jobTemplates) Update(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) { + result = &v1alpha1.JobTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobtemplates"). + Name(jobTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobTemplate). + 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 *jobTemplates) UpdateStatus(ctx context.Context, jobTemplate *v1alpha1.JobTemplate, opts v1.UpdateOptions) (result *v1alpha1.JobTemplate, err error) { + result = &v1alpha1.JobTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobtemplates"). + Name(jobTemplate.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobTemplate and deletes it. Returns an error if one occurs. +func (c *jobTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobtemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobTemplates) 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("jobtemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobTemplate. +func (c *jobTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobTemplate, err error) { + result = &v1alpha1.JobTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobtemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/factory.go b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/factory.go index 0216bb9bb00..05dc6a0a45c 100644 --- a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/factory.go +++ b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/factory.go @@ -29,6 +29,7 @@ import ( versioned "volcano.sh/apis/pkg/client/clientset/versioned" batch "volcano.sh/apis/pkg/client/informers/externalversions/batch" bus "volcano.sh/apis/pkg/client/informers/externalversions/bus" + flow "volcano.sh/apis/pkg/client/informers/externalversions/flow" internalinterfaces "volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces" nodeinfo "volcano.sh/apis/pkg/client/informers/externalversions/nodeinfo" scheduling "volcano.sh/apis/pkg/client/informers/externalversions/scheduling" @@ -176,6 +177,7 @@ type SharedInformerFactory interface { Batch() batch.Interface Bus() bus.Interface + Flow() flow.Interface Nodeinfo() nodeinfo.Interface Scheduling() scheduling.Interface } @@ -188,6 +190,10 @@ func (f *sharedInformerFactory) Bus() bus.Interface { return bus.New(f, f.namespace, f.tweakListOptions) } +func (f *sharedInformerFactory) Flow() flow.Interface { + return flow.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Nodeinfo() nodeinfo.Interface { return nodeinfo.New(f, f.namespace, f.tweakListOptions) } diff --git a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/interface.go b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/interface.go new file mode 100644 index 00000000000..6deeaf3a9a2 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/interface.go @@ -0,0 +1,45 @@ +/* +Copyright 2021 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 informer-gen. DO NOT EDIT. + +package flow + +import ( + v1alpha1 "volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1" + internalinterfaces "volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/interface.go b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/interface.go new file mode 100644 index 00000000000..53fbb13026c --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/interface.go @@ -0,0 +1,51 @@ +/* +Copyright 2021 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 informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // JobFlows returns a JobFlowInformer. + JobFlows() JobFlowInformer + // JobTemplates returns a JobTemplateInformer. + JobTemplates() JobTemplateInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// JobFlows returns a JobFlowInformer. +func (v *version) JobFlows() JobFlowInformer { + return &jobFlowInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// JobTemplates returns a JobTemplateInformer. +func (v *version) JobTemplates() JobTemplateInformer { + return &jobTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/jobflow.go b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/jobflow.go new file mode 100644 index 00000000000..f5c33f923b6 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/jobflow.go @@ -0,0 +1,89 @@ +/* +Copyright 2021 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 informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" + versioned "volcano.sh/apis/pkg/client/clientset/versioned" + internalinterfaces "volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "volcano.sh/apis/pkg/client/listers/flow/v1alpha1" +) + +// JobFlowInformer provides access to a shared informer and lister for +// JobFlows. +type JobFlowInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.JobFlowLister +} + +type jobFlowInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewJobFlowInformer constructs a new informer for JobFlow type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobFlowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobFlowInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredJobFlowInformer constructs a new informer for JobFlow type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobFlowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowV1alpha1().JobFlows(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowV1alpha1().JobFlows(namespace).Watch(context.TODO(), options) + }, + }, + &flowv1alpha1.JobFlow{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobFlowInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobFlowInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobFlowInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&flowv1alpha1.JobFlow{}, f.defaultInformer) +} + +func (f *jobFlowInformer) Lister() v1alpha1.JobFlowLister { + return v1alpha1.NewJobFlowLister(f.Informer().GetIndexer()) +} diff --git a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/jobtemplate.go b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/jobtemplate.go new file mode 100644 index 00000000000..d3d512a7bbe --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/flow/v1alpha1/jobtemplate.go @@ -0,0 +1,89 @@ +/* +Copyright 2021 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 informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" + versioned "volcano.sh/apis/pkg/client/clientset/versioned" + internalinterfaces "volcano.sh/apis/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "volcano.sh/apis/pkg/client/listers/flow/v1alpha1" +) + +// JobTemplateInformer provides access to a shared informer and lister for +// JobTemplates. +type JobTemplateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.JobTemplateLister +} + +type jobTemplateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewJobTemplateInformer constructs a new informer for JobTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobTemplateInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobTemplateInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredJobTemplateInformer constructs a new informer for JobTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobTemplateInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowV1alpha1().JobTemplates(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowV1alpha1().JobTemplates(namespace).Watch(context.TODO(), options) + }, + }, + &flowv1alpha1.JobTemplate{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobTemplateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobTemplateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobTemplateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&flowv1alpha1.JobTemplate{}, f.defaultInformer) +} + +func (f *jobTemplateInformer) Lister() v1alpha1.JobTemplateLister { + return v1alpha1.NewJobTemplateLister(f.Informer().GetIndexer()) +} diff --git a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/generic.go b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/generic.go index 2b065497b8f..1021deb1140 100644 --- a/vendor/volcano.sh/apis/pkg/client/informers/externalversions/generic.go +++ b/vendor/volcano.sh/apis/pkg/client/informers/externalversions/generic.go @@ -24,6 +24,7 @@ import ( cache "k8s.io/client-go/tools/cache" 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" ) @@ -62,6 +63,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case busv1alpha1.SchemeGroupVersion.WithResource("commands"): return &genericInformer{resource: resource.GroupResource(), informer: f.Bus().V1alpha1().Commands().Informer()}, nil + // Group=flow.volcano.sh, Version=v1alpha1 + case flowv1alpha1.SchemeGroupVersion.WithResource("jobflows"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Flow().V1alpha1().JobFlows().Informer()}, nil + case flowv1alpha1.SchemeGroupVersion.WithResource("jobtemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Flow().V1alpha1().JobTemplates().Informer()}, nil + // Group=nodeinfo.volcano.sh, Version=v1alpha1 case nodeinfov1alpha1.SchemeGroupVersion.WithResource("numatopologies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Nodeinfo().V1alpha1().Numatopologies().Informer()}, nil diff --git a/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/expansion_generated.go b/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/expansion_generated.go new file mode 100644 index 00000000000..12bb7ec5456 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/expansion_generated.go @@ -0,0 +1,34 @@ +/* +Copyright 2021 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 lister-gen. DO NOT EDIT. + +package v1alpha1 + +// JobFlowListerExpansion allows custom methods to be added to +// JobFlowLister. +type JobFlowListerExpansion interface{} + +// JobFlowNamespaceListerExpansion allows custom methods to be added to +// JobFlowNamespaceLister. +type JobFlowNamespaceListerExpansion interface{} + +// JobTemplateListerExpansion allows custom methods to be added to +// JobTemplateLister. +type JobTemplateListerExpansion interface{} + +// JobTemplateNamespaceListerExpansion allows custom methods to be added to +// JobTemplateNamespaceLister. +type JobTemplateNamespaceListerExpansion interface{} diff --git a/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/jobflow.go b/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/jobflow.go new file mode 100644 index 00000000000..02976353858 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/jobflow.go @@ -0,0 +1,98 @@ +/* +Copyright 2021 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 lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" +) + +// JobFlowLister helps list JobFlows. +// All objects returned here must be treated as read-only. +type JobFlowLister interface { + // List lists all JobFlows in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.JobFlow, err error) + // JobFlows returns an object that can list and get JobFlows. + JobFlows(namespace string) JobFlowNamespaceLister + JobFlowListerExpansion +} + +// jobFlowLister implements the JobFlowLister interface. +type jobFlowLister struct { + indexer cache.Indexer +} + +// NewJobFlowLister returns a new JobFlowLister. +func NewJobFlowLister(indexer cache.Indexer) JobFlowLister { + return &jobFlowLister{indexer: indexer} +} + +// List lists all JobFlows in the indexer. +func (s *jobFlowLister) List(selector labels.Selector) (ret []*v1alpha1.JobFlow, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.JobFlow)) + }) + return ret, err +} + +// JobFlows returns an object that can list and get JobFlows. +func (s *jobFlowLister) JobFlows(namespace string) JobFlowNamespaceLister { + return jobFlowNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// JobFlowNamespaceLister helps list and get JobFlows. +// All objects returned here must be treated as read-only. +type JobFlowNamespaceLister interface { + // List lists all JobFlows in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.JobFlow, err error) + // Get retrieves the JobFlow from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.JobFlow, error) + JobFlowNamespaceListerExpansion +} + +// jobFlowNamespaceLister implements the JobFlowNamespaceLister +// interface. +type jobFlowNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all JobFlows in the indexer for a given namespace. +func (s jobFlowNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JobFlow, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.JobFlow)) + }) + return ret, err +} + +// Get retrieves the JobFlow from the indexer for a given namespace and name. +func (s jobFlowNamespaceLister) Get(name string) (*v1alpha1.JobFlow, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("jobflow"), name) + } + return obj.(*v1alpha1.JobFlow), nil +} diff --git a/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/jobtemplate.go b/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/jobtemplate.go new file mode 100644 index 00000000000..96947956833 --- /dev/null +++ b/vendor/volcano.sh/apis/pkg/client/listers/flow/v1alpha1/jobtemplate.go @@ -0,0 +1,98 @@ +/* +Copyright 2021 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 lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1" +) + +// JobTemplateLister helps list JobTemplates. +// All objects returned here must be treated as read-only. +type JobTemplateLister interface { + // List lists all JobTemplates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.JobTemplate, err error) + // JobTemplates returns an object that can list and get JobTemplates. + JobTemplates(namespace string) JobTemplateNamespaceLister + JobTemplateListerExpansion +} + +// jobTemplateLister implements the JobTemplateLister interface. +type jobTemplateLister struct { + indexer cache.Indexer +} + +// NewJobTemplateLister returns a new JobTemplateLister. +func NewJobTemplateLister(indexer cache.Indexer) JobTemplateLister { + return &jobTemplateLister{indexer: indexer} +} + +// List lists all JobTemplates in the indexer. +func (s *jobTemplateLister) List(selector labels.Selector) (ret []*v1alpha1.JobTemplate, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.JobTemplate)) + }) + return ret, err +} + +// JobTemplates returns an object that can list and get JobTemplates. +func (s *jobTemplateLister) JobTemplates(namespace string) JobTemplateNamespaceLister { + return jobTemplateNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// JobTemplateNamespaceLister helps list and get JobTemplates. +// All objects returned here must be treated as read-only. +type JobTemplateNamespaceLister interface { + // List lists all JobTemplates in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.JobTemplate, err error) + // Get retrieves the JobTemplate from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.JobTemplate, error) + JobTemplateNamespaceListerExpansion +} + +// jobTemplateNamespaceLister implements the JobTemplateNamespaceLister +// interface. +type jobTemplateNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all JobTemplates in the indexer for a given namespace. +func (s jobTemplateNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.JobTemplate, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.JobTemplate)) + }) + return ret, err +} + +// Get retrieves the JobTemplate from the indexer for a given namespace and name. +func (s jobTemplateNamespaceLister) Get(name string) (*v1alpha1.JobTemplate, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("jobtemplate"), name) + } + return obj.(*v1alpha1.JobTemplate), nil +}