Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
|
09b60c9cd2 | |
|
8f1a2ead57 | |
|
aa204718cc | |
|
7e4db51c55 | |
|
bc7731fc53 | |
|
3aaf0eafa4 | |
|
e960de5653 | |
|
fb3acc0764 | |
|
fba43ee6a7 | |
|
6c60af6bb6 | |
|
0631c9ba99 |
|
@ -0,0 +1,30 @@
|
|||
name: Update schema files when api changes
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'apps/**'
|
||||
- 'policy/**'
|
||||
- 'rollouts/**'
|
||||
|
||||
jobs:
|
||||
update-schemas:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.19
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Update Schema
|
||||
run: |
|
||||
go mod tidy
|
||||
make gen-openapi-schema
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Updated OpenAPI schema files
|
35
Makefile
35
Makefile
|
@ -1,3 +1,4 @@
|
|||
CURRENT_DIR=$(shell pwd)
|
||||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
|
||||
ifeq (,$(shell go env GOBIN))
|
||||
GOBIN=$(shell go env GOPATH)/bin
|
||||
|
@ -11,16 +12,30 @@ vet:
|
|||
|
||||
# Generate code
|
||||
generate: controller-gen
|
||||
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
||||
#$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
|
||||
@hack/generate_client.sh
|
||||
|
||||
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen-0.7
|
||||
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
|
||||
controller-gen: ## Download controller-gen locally if necessary.
|
||||
$(call go-get-tool-with-alias,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0,controller-gen)
|
||||
ifeq ("$(shell $(CONTROLLER_GEN) --version 2> /dev/null)", "Version: v0.16.5")
|
||||
else
|
||||
rm -rf $(CONTROLLER_GEN)
|
||||
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5)
|
||||
endif
|
||||
|
||||
OPENAPI_GEN = $(shell pwd)/bin/openapi-gen
|
||||
module=$(shell go list -f '{{.Module}}' k8s.io/kube-openapi/cmd/openapi-gen | awk '{print $$1}')
|
||||
module_version=$(shell go list -m $(module) | awk '{print $$NF}' | head -1)
|
||||
openapi-gen: ## Download openapi-gen locally if necessary.
|
||||
ifeq ("$(shell command -v $(OPENAPI_GEN) 2> /dev/null)", "")
|
||||
$(call go-get-tool,$(OPENAPI_GEN),k8s.io/kube-openapi/cmd/openapi-gen@$(module_version))
|
||||
else
|
||||
@echo "openapi-gen is already installed."
|
||||
endif
|
||||
|
||||
# go-get-tool will 'go get' any package $2 and install it to $1.
|
||||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
define go-get-tool-with-alias
|
||||
define go-get-tool
|
||||
@[ -f $(1) ] || { \
|
||||
set -e ;\
|
||||
TMP_DIR=$$(mktemp -d) ;\
|
||||
|
@ -29,6 +44,16 @@ go mod init tmp ;\
|
|||
echo "Downloading $(2)" ;\
|
||||
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
|
||||
rm -rf $$TMP_DIR ;\
|
||||
mv $(PROJECT_DIR)/bin/$(3) $(1);\
|
||||
}
|
||||
endef
|
||||
|
||||
.PHONY: gen-schema-only
|
||||
gen-schema-only:
|
||||
go run cmd/gen-schema/main.go
|
||||
|
||||
.PHONY: gen-openapi-schema
|
||||
gen-openapi-schema: gen-all-openapi
|
||||
go run cmd/gen-schema/main.go
|
||||
|
||||
.PHONY: gen-all-openapi
|
||||
@hack/generate_openapi.sh
|
||||
|
|
34
README.md
34
README.md
|
@ -4,22 +4,44 @@ Schema of the API types that are served by Kruise.
|
|||
|
||||
## Purpose
|
||||
|
||||
This library is the canonical location of the Kruise API definition.
|
||||
This library is the canonical location of the Kruise API definition and client.
|
||||
|
||||
We recommend using the go types in this repo. You may serialize them directly to JSON.
|
||||
|
||||
## Compatibility matrix
|
||||
## What's included
|
||||
* The `client` package contains the clientset to access Kruise API.
|
||||
* The `apps` and `policy` packages contain api definition in go
|
||||
* The `schema` directory contains corresponding openapi schema of kruise source
|
||||
|
||||
| Kubernetes Version in your Project | Import Kruise-api < v0.10 | Import Kruise-api >= v0.10 |
|
||||
|------------------------------------|----------------------------|----------------------------|
|
||||
| < 1.18 | v0.x.y (x <= 9) | v0.x.y-legacy (x >= 10) |
|
||||
| >= 1.18 | v0.x.y-1.18 (7 <= x <= 9) | v0.x.y (x >= 10) |
|
||||
## Versioning
|
||||
For each `v1.x.y` Kruise release, the corresponding kruise-api will `v1.x.z`.
|
||||
|
||||
Bugfixes in kruise-api will result in the patch version (third digit `z`) changing. PRs that are cherry-picked into an older Kruise release branch will result in an update to the corresponding branch in client-go, with a corresponding new tag changing the patch version.
|
||||
|
||||
## Where does it come from?
|
||||
|
||||
`kruise-api` is synced from [https://github.com/openkruise/kruise/tree/master/apis](https://github.com/openkruise/kruise/tree/master/apis).
|
||||
Code changes are made in that location, merged into `openkruise/kruise` and later synced here.
|
||||
|
||||
|
||||
### How to get it
|
||||
|
||||
To get the latest version, use go1.16+ and fetch using the `go get` command. For example:
|
||||
|
||||
```
|
||||
go get github.com/openkruise/kruise-api@latest
|
||||
```
|
||||
|
||||
To get a specific version, use go1.11+ and fetch the desired version using the `go get` command. For example:
|
||||
|
||||
```
|
||||
go get github.com/openkruise/kruise-api@v1.6.0
|
||||
```
|
||||
|
||||
### How to use it
|
||||
|
||||
please refer to the [example](examples/create-update-delete-cloneset)
|
||||
|
||||
## Things you should NOT do
|
||||
|
||||
[https://github.com/openkruise/kruise/tree/master/apis](https://github.com/openkruise/kruise/tree/master/apis) is synced to here.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2019 The Kruise Authors.
|
||||
Copyright 2021 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise 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 apis
|
||||
|
||||
import (
|
||||
"github.com/openkruise/kruise-api/rollouts/v1alpha1"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
|
||||
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme)
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
Copyright 2019 The Kruise 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 apps contains apps API versions
|
||||
package apps
|
|
@ -62,12 +62,21 @@ type InPlaceUpdateState struct {
|
|||
// UpdateEnvFromMetadata indicates there are envs from annotations/labels that should be in-place update.
|
||||
UpdateEnvFromMetadata bool `json:"updateEnvFromMetadata,omitempty"`
|
||||
|
||||
// UpdateResources indicates there are resources that should be in-place update.
|
||||
UpdateResources bool `json:"updateResources,omitempty"`
|
||||
|
||||
// UpdateImages indicates there are images that should be in-place update.
|
||||
UpdateImages bool `json:"updateImages,omitempty"`
|
||||
|
||||
// NextContainerImages is the containers with lower priority that waiting for in-place update images in next batch.
|
||||
NextContainerImages map[string]string `json:"nextContainerImages,omitempty"`
|
||||
|
||||
// NextContainerRefMetadata is the containers with lower priority that waiting for in-place update labels/annotations in next batch.
|
||||
NextContainerRefMetadata map[string]metav1.ObjectMeta `json:"nextContainerRefMetadata,omitempty"`
|
||||
|
||||
// NextContainerResources is the containers with lower priority that waiting for in-place update resources in next batch.
|
||||
NextContainerResources map[string]v1.ResourceRequirements `json:"nextContainerResources,omitempty"`
|
||||
|
||||
// PreCheckBeforeNext is the pre-check that must pass before the next containers can be in-place update.
|
||||
PreCheckBeforeNext *InPlaceUpdatePreCheckBeforeNext `json:"preCheckBeforeNext,omitempty"`
|
||||
|
||||
|
@ -140,6 +149,10 @@ type RuntimeContainerHashes struct {
|
|||
// PlainHash is the hash that directly calculated from pod.spec.container[x].
|
||||
// Usually it is calculated by Kubelet and will be in annotation of each runtime container.
|
||||
PlainHash uint64 `json:"plainHash"`
|
||||
// PlainHashWithoutResources is the hash that directly calculated from pod.spec.container[x]
|
||||
// over fields with Resources field zero'd out.
|
||||
// Usually it is calculated by Kubelet and will be in annotation of each runtime container.
|
||||
PlainHashWithoutResources uint64 `json:"plainHashWithoutResources"`
|
||||
// ExtractedEnvFromMetadataHash is the hash that calculated from pod.spec.container[x],
|
||||
// whose envs from annotations/labels have already been extracted to the real values.
|
||||
ExtractedEnvFromMetadataHash uint64 `json:"extractedEnvFromMetadataHash,omitempty"`
|
||||
|
|
|
@ -29,4 +29,8 @@ const (
|
|||
ContainerLaunchPriorityKey = "apps.kruise.io/container-launch-priority"
|
||||
// ContainerLaunchOrdered is the annotation value that indicates containers in pod should be launched by ordinal.
|
||||
ContainerLaunchOrdered = "Ordered"
|
||||
|
||||
// ContainerLaunchPriorityCompletedKey is the annotation indicates the pod has all its priorities
|
||||
// patched into its barrier configmap.
|
||||
ContainerLaunchPriorityCompletedKey = "apps.kruise.io/container-launch-priority-completed"
|
||||
)
|
||||
|
|
|
@ -20,10 +20,22 @@ const (
|
|||
LifecycleStateKey = "lifecycle.apps.kruise.io/state"
|
||||
LifecycleTimestampKey = "lifecycle.apps.kruise.io/timestamp"
|
||||
|
||||
LifecycleStateNormal LifecycleStateType = "Normal"
|
||||
// LifecycleStatePreparingNormal means the Pod is created but unavailable.
|
||||
// It will translate to Normal state if Lifecycle.PreNormal is hooked.
|
||||
LifecycleStatePreparingNormal LifecycleStateType = "PreparingNormal"
|
||||
// LifecycleStateNormal is a necessary condition for Pod to be available.
|
||||
LifecycleStateNormal LifecycleStateType = "Normal"
|
||||
// LifecycleStatePreparingUpdate means pod is being prepared to update.
|
||||
// It will translate to Updating state if Lifecycle.InPlaceUpdate is Not hooked.
|
||||
LifecycleStatePreparingUpdate LifecycleStateType = "PreparingUpdate"
|
||||
LifecycleStateUpdating LifecycleStateType = "Updating"
|
||||
LifecycleStateUpdated LifecycleStateType = "Updated"
|
||||
// LifecycleStateUpdating means the Pod is being updated.
|
||||
// It will translate to Updated state if the in-place update of the Pod is done.
|
||||
LifecycleStateUpdating LifecycleStateType = "Updating"
|
||||
// LifecycleStateUpdated means the Pod is updated, but unavailable.
|
||||
// It will translate to Normal state if Lifecycle.InPlaceUpdate is hooked.
|
||||
LifecycleStateUpdated LifecycleStateType = "Updated"
|
||||
// LifecycleStatePreparingDelete means the Pod is prepared to delete.
|
||||
// The Pod will be deleted by workload if Lifecycle.PreDelete is Not hooked.
|
||||
LifecycleStatePreparingDelete LifecycleStateType = "PreparingDelete"
|
||||
)
|
||||
|
||||
|
@ -35,6 +47,8 @@ type Lifecycle struct {
|
|||
PreDelete *LifecycleHook `json:"preDelete,omitempty"`
|
||||
// InPlaceUpdate is the hook before Pod to update and after Pod has been updated.
|
||||
InPlaceUpdate *LifecycleHook `json:"inPlaceUpdate,omitempty"`
|
||||
// PreNormal is the hook after Pod to be created and ready to be Normal.
|
||||
PreNormal *LifecycleHook `json:"preNormal,omitempty"`
|
||||
}
|
||||
|
||||
type LifecycleHook struct {
|
||||
|
@ -43,6 +57,7 @@ type LifecycleHook struct {
|
|||
// MarkPodNotReady = true means:
|
||||
// - Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state.
|
||||
// - Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state.
|
||||
// Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook.
|
||||
// Default to false.
|
||||
MarkPodNotReady bool `json:"markPodNotReady,omitempty"`
|
||||
}
|
||||
|
|
|
@ -0,0 +1,532 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2021 The Kruise 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 openapi-gen. DO NOT EDIT.
|
||||
|
||||
// This file was autogenerated by openapi-gen. Do not edit it manually!
|
||||
|
||||
package pub
|
||||
|
||||
import (
|
||||
common "k8s.io/kube-openapi/pkg/common"
|
||||
spec "k8s.io/kube-openapi/pkg/validation/spec"
|
||||
)
|
||||
|
||||
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
|
||||
return map[string]common.OpenAPIDefinition{
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateContainerBatch": schema_kruise_apis_apps_pub_InPlaceUpdateContainerBatch(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateContainerStatus": schema_kruise_apis_apps_pub_InPlaceUpdateContainerStatus(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdatePreCheckBeforeNext": schema_kruise_apis_apps_pub_InPlaceUpdatePreCheckBeforeNext(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateState": schema_kruise_apis_apps_pub_InPlaceUpdateState(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateStrategy": schema_kruise_apis_apps_pub_InPlaceUpdateStrategy(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.Lifecycle": schema_kruise_apis_apps_pub_Lifecycle(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.LifecycleHook": schema_kruise_apis_apps_pub_LifecycleHook(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.RuntimeContainerHashes": schema_kruise_apis_apps_pub_RuntimeContainerHashes(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.RuntimeContainerMeta": schema_kruise_apis_apps_pub_RuntimeContainerMeta(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.RuntimeContainerMetaSet": schema_kruise_apis_apps_pub_RuntimeContainerMetaSet(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.UpdatePriorityOrderTerm": schema_kruise_apis_apps_pub_UpdatePriorityOrderTerm(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.UpdatePriorityStrategy": schema_kruise_apis_apps_pub_UpdatePriorityStrategy(ref),
|
||||
"github.com/openkruise/kruise-api/apps/pub.UpdatePriorityWeightTerm": schema_kruise_apis_apps_pub_UpdatePriorityWeightTerm(ref),
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_InPlaceUpdateContainerBatch(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdateContainerBatch indicates the timestamp and containers for a batch update",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"timestamp": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Timestamp is the time for this update batch",
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
|
||||
},
|
||||
},
|
||||
"containers": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Containers is the name list of containers for this update batch",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"timestamp", "containers"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1.Time"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_InPlaceUpdateContainerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdateContainerStatus records the statuses of the container that are mainly used to determine whether the InPlaceUpdate is completed.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"imageID": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_InPlaceUpdatePreCheckBeforeNext(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdatePreCheckBeforeNext contains the pre-check that must pass before the next containers can be in-place update.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"containersRequiredReady": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_InPlaceUpdateState(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdateState records latest inplace-update state, including old statuses of containers.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"revision": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Revision is the updated revision hash.",
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"updateTimestamp": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UpdateTimestamp is the start time when the in-place update happens.",
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
|
||||
},
|
||||
},
|
||||
"lastContainerStatuses": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "LastContainerStatuses records the before-in-place-update container statuses. It is a map from ContainerName to InPlaceUpdateContainerStatus",
|
||||
Type: []string{"object"},
|
||||
AdditionalProperties: &spec.SchemaOrBool{
|
||||
Allows: true,
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateContainerStatus"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"updateEnvFromMetadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UpdateEnvFromMetadata indicates there are envs from annotations/labels that should be in-place update.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"nextContainerImages": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "NextContainerImages is the containers with lower priority that waiting for in-place update images in next batch.",
|
||||
Type: []string{"object"},
|
||||
AdditionalProperties: &spec.SchemaOrBool{
|
||||
Allows: true,
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"nextContainerRefMetadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "NextContainerRefMetadata is the containers with lower priority that waiting for in-place update labels/annotations in next batch.",
|
||||
Type: []string{"object"},
|
||||
AdditionalProperties: &spec.SchemaOrBool{
|
||||
Allows: true,
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"preCheckBeforeNext": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PreCheckBeforeNext is the pre-check that must pass before the next containers can be in-place update.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.InPlaceUpdatePreCheckBeforeNext"),
|
||||
},
|
||||
},
|
||||
"containerBatchesRecord": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ContainerBatchesRecord records the update batches that have patched in this revision.",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateContainerBatch"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"revision", "updateTimestamp", "lastContainerStatuses"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateContainerBatch", "github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateContainerStatus", "github.com/openkruise/kruise-api/apps/pub.InPlaceUpdatePreCheckBeforeNext", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_InPlaceUpdateStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdateStrategy defines the strategies for in-place update.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"gracePeriodSeconds": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec when in-place update a Pod.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_Lifecycle(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Lifecycle contains the hooks for Pod lifecycle.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"preDelete": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PreDelete is the hook before Pod to be deleted.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.LifecycleHook"),
|
||||
},
|
||||
},
|
||||
"inPlaceUpdate": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdate is the hook before Pod to update and after Pod has been updated.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.LifecycleHook"),
|
||||
},
|
||||
},
|
||||
"preNormal": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PreNormal is the hook after Pod to be created and ready to be Normal.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.LifecycleHook"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.LifecycleHook"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_LifecycleHook(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"labelsHandler": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"object"},
|
||||
AdditionalProperties: &spec.SchemaOrBool{
|
||||
Allows: true,
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"finalizersHandler": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"markPodNotReady": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "MarkPodNotReady = true means: - Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state. - Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state. Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook. Default to false.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_RuntimeContainerHashes(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "RuntimeContainerHashes contains the hashes of such container.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"plainHash": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PlainHash is the hash that directly calculated from pod.spec.container[x]. Usually it is calculated by Kubelet and will be in annotation of each runtime container.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int64",
|
||||
},
|
||||
},
|
||||
"extractedEnvFromMetadataHash": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ExtractedEnvFromMetadataHash is the hash that calculated from pod.spec.container[x], whose envs from annotations/labels have already been extracted to the real values.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int64",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"plainHash"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_RuntimeContainerMeta(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "RuntimeContainerMeta contains the meta data of a runtime container.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"name": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"containerID": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"restartCount": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"hashes": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.RuntimeContainerHashes"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"name", "containerID", "restartCount", "hashes"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.RuntimeContainerHashes"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_RuntimeContainerMetaSet(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "RuntimeContainerMetaSet contains all the containers' meta of the Pod.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"containers": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.RuntimeContainerMeta"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"containers"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.RuntimeContainerMeta"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_UpdatePriorityOrderTerm(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UpdatePriorityOrderTerm defines order priority.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"orderedKey": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Calculate priority by value of this key. Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value, such as getting 5 in value '5', getting 10 in value 'sts-10'.",
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"orderedKey"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_UpdatePriorityStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UpdatePriorityStrategy is the strategy to define priority for pods update. Only one of orderPriority and weightPriority can be set.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"orderPriority": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Order priority terms, pods will be sorted by the value of orderedKey. For example: ``` orderPriority: - orderedKey: key1 - orderedKey: key2 ``` First, all pods which have key1 in labels will be sorted by the value of key1. Then, the left pods which have no key1 but have key2 in labels will be sorted by the value of key2 and put behind those pods have key1.",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.UpdatePriorityOrderTerm"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"weightPriority": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Weight priority terms, pods will be sorted by the sum of all terms weight.",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.UpdatePriorityWeightTerm"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.UpdatePriorityOrderTerm", "github.com/openkruise/kruise-api/apps/pub.UpdatePriorityWeightTerm"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_pub_UpdatePriorityWeightTerm(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UpdatePriorityWeightTerm defines weight priority.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"weight": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Weight associated with matching the corresponding matchExpressions, in the range 1-100.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"matchSelector": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "MatchSelector is used to select by pod's labels.",
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"weight", "matchSelector"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"},
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ type UpdatePriorityStrategy struct {
|
|||
WeightPriority []UpdatePriorityWeightTerm `json:"weightPriority,omitempty"`
|
||||
}
|
||||
|
||||
// UpdatePriorityOrder defines order priority.
|
||||
// UpdatePriorityOrderTerm defines order priority.
|
||||
type UpdatePriorityOrderTerm struct {
|
||||
// Calculate priority by value of this key.
|
||||
// Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value,
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2021 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -22,6 +21,7 @@ limitations under the License.
|
|||
package pub
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
|
@ -106,6 +106,13 @@ func (in *InPlaceUpdateState) DeepCopyInto(out *InPlaceUpdateState) {
|
|||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
}
|
||||
if in.NextContainerResources != nil {
|
||||
in, out := &in.NextContainerResources, &out.NextContainerResources
|
||||
*out = make(map[string]corev1.ResourceRequirements, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
}
|
||||
if in.PreCheckBeforeNext != nil {
|
||||
in, out := &in.PreCheckBeforeNext, &out.PreCheckBeforeNext
|
||||
*out = new(InPlaceUpdatePreCheckBeforeNext)
|
||||
|
@ -158,6 +165,11 @@ func (in *Lifecycle) DeepCopyInto(out *Lifecycle) {
|
|||
*out = new(LifecycleHook)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PreNormal != nil {
|
||||
in, out := &in.PreNormal, &out.PreNormal
|
||||
*out = new(LifecycleHook)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Lifecycle.
|
||||
|
|
|
@ -36,8 +36,6 @@ type AdvancedCronJobSpec struct {
|
|||
// +optional
|
||||
TimeZone *string `json:"timeZone,omitempty" protobuf:"bytes,8,opt,name=timeZone"`
|
||||
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
|
||||
// Optional deadline in seconds for starting the job if it misses scheduled
|
||||
// time for any reason. Missed jobs executions will be counted as failed ones.
|
||||
// +optional
|
||||
|
@ -55,15 +53,11 @@ type AdvancedCronJobSpec struct {
|
|||
// +optional
|
||||
Paused *bool `json:"paused,omitempty" protobuf:"bytes,4,opt,name=paused"`
|
||||
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
|
||||
// The number of successful finished jobs to retain.
|
||||
// This is a pointer to distinguish between explicit zero and not specified.
|
||||
// +optional
|
||||
SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty" protobuf:"varint,5,opt,name=successfulJobsHistoryLimit"`
|
||||
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
|
||||
// The number of failed finished jobs to retain.
|
||||
// This is a pointer to distinguish between explicit zero and not specified.
|
||||
// +optional
|
||||
|
|
|
@ -17,10 +17,11 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
appspub "github.com/openkruise/kruise-api/apps/pub"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
appspub "github.com/openkruise/kruise-api/apps/pub"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -79,7 +80,7 @@ type CloneSetSpec struct {
|
|||
// Defaults to 0 (pod will be considered available as soon as it is ready)
|
||||
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
|
||||
|
||||
// Lifecycle defines the lifecycle hooks for Pods pre-delete, in-place update.
|
||||
// Lifecycle defines the lifecycle hooks for Pods pre-available(pre-normal), pre-delete, in-place update.
|
||||
Lifecycle *appspub.Lifecycle `json:"lifecycle,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -93,6 +94,10 @@ type CloneSetScaleStrategy struct {
|
|||
// The scale will fail if the number of unavailable pods were greater than this MaxUnavailable at scaling up.
|
||||
// MaxUnavailable works only when scaling up.
|
||||
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
|
||||
|
||||
// Indicate if cloneSet will reuse already existed pvc to
|
||||
// rebuild a new pod
|
||||
DisablePVCReuse bool `json:"disablePVCReuse,omitempty"`
|
||||
}
|
||||
|
||||
// CloneSetUpdateStrategy defines strategies for pods update.
|
||||
|
@ -172,6 +177,12 @@ type CloneSetStatus struct {
|
|||
// indicated by updateRevision and have a Ready Condition.
|
||||
UpdatedReadyReplicas int32 `json:"updatedReadyReplicas"`
|
||||
|
||||
// UpdatedAvailableReplicas is the number of Pods created by the CloneSet controller from the CloneSet version
|
||||
// indicated by updateRevision and have a Ready Condition for at least minReadySeconds.
|
||||
// Notice: when enable InPlaceWorkloadVerticalScaling, pod during resource resizing will also be unavailable.
|
||||
// This means these pod will be counted in maxUnavailable.
|
||||
UpdatedAvailableReplicas int32 `json:"updatedAvailableReplicas,omitempty"`
|
||||
|
||||
// ExpectedUpdatedReplicas is the number of Pods that should be updated by CloneSet controller.
|
||||
// This field is calculated via Replicas - Partition.
|
||||
ExpectedUpdatedReplicas int32 `json:"expectedUpdatedReplicas,omitempty"`
|
||||
|
@ -229,6 +240,7 @@ type CloneSetCondition struct {
|
|||
// +kubebuilder:printcolumn:name="DESIRED",type="integer",JSONPath=".spec.replicas",description="The desired number of pods."
|
||||
// +kubebuilder:printcolumn:name="UPDATED",type="integer",JSONPath=".status.updatedReplicas",description="The number of pods updated."
|
||||
// +kubebuilder:printcolumn:name="UPDATED_READY",type="integer",JSONPath=".status.updatedReadyReplicas",description="The number of pods updated and ready."
|
||||
// +kubebuilder:printcolumn:name="UPDATED_AVAILABLE",type="integer",JSONPath=".status.updatedAvailableReplicas",description="The number of pods updated and available."
|
||||
// +kubebuilder:printcolumn:name="READY",type="integer",JSONPath=".status.readyReplicas",description="The number of pods ready."
|
||||
// +kubebuilder:printcolumn:name="TOTAL",type="integer",JSONPath=".status.replicas",description="The number of currently all pods."
|
||||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp",description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC."
|
||||
|
|
|
@ -44,7 +44,9 @@ type ContainerRecreateRequestSpec struct {
|
|||
// PodName is name of the Pod that owns the recreated containers.
|
||||
PodName string `json:"podName"`
|
||||
// Containers contains the containers that need to recreate in the Pod.
|
||||
Containers []ContainerRecreateRequestContainer `json:"containers"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
Containers []ContainerRecreateRequestContainer `json:"containers" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
// Strategy defines strategies for containers recreation.
|
||||
Strategy *ContainerRecreateRequestStrategy `json:"strategy,omitempty"`
|
||||
// ActiveDeadlineSeconds is the deadline duration of this ContainerRecreateRequest.
|
||||
|
@ -106,6 +108,8 @@ type ContainerRecreateRequestStrategy struct {
|
|||
FailurePolicy ContainerRecreateRequestFailurePolicyType `json:"failurePolicy,omitempty"`
|
||||
// OrderedRecreate indicates whether to recreate the next container only if the previous one has recreated completely.
|
||||
OrderedRecreate bool `json:"orderedRecreate,omitempty"`
|
||||
// ForceRecreate indicates whether to force kill the container even if the previous container is starting.
|
||||
ForceRecreate bool `json:"forceRecreate,omitempty"`
|
||||
// TerminationGracePeriodSeconds is the optional duration in seconds to wait the container terminating gracefully.
|
||||
// Value must be non-negative integer. The value zero indicates delete immediately.
|
||||
// If this value is nil, we will use pod.Spec.TerminationGracePeriodSeconds as default value.
|
||||
|
@ -158,6 +162,8 @@ type ContainerRecreateRequestContainerRecreateState struct {
|
|||
Phase ContainerRecreateRequestPhase `json:"phase"`
|
||||
// A human readable message indicating details about this state.
|
||||
Message string `json:"message,omitempty"`
|
||||
// Containers are killed by kruise daemon
|
||||
IsKilled bool `json:"isKilled,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerRecreateRequestSyncContainerStatus only uses in the annotation `crr.apps.kruise.io/sync-container-statuses`.
|
||||
|
|
|
@ -17,11 +17,12 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
appspub "github.com/openkruise/kruise-api/apps/pub"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
||||
appspub "github.com/openkruise/kruise-api/apps/pub"
|
||||
)
|
||||
|
||||
// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.
|
||||
|
@ -91,7 +92,7 @@ type RollingUpdateDaemonSet struct {
|
|||
// pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
|
||||
// on that node is marked deleted. If the old pod becomes unavailable for any
|
||||
// reason (Ready transitions to false, is evicted, or is drained) an updated
|
||||
// pod is immediatedly created on that node without considering surge limits.
|
||||
// pod is immediately created on that node without considering surge limits.
|
||||
// Allowing surge implies the possibility that the resources consumed by the
|
||||
// daemonset on any given node can double if the readiness check fails, and
|
||||
// so resource intensive daemonsets should take into account that they may
|
||||
|
|
|
@ -75,7 +75,9 @@ type EphemeralContainerTemplateSpec struct {
|
|||
// EphemeralContainers defines ephemeral container list in match pods.
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// +kubebuilder:validation:Schemaless
|
||||
EphemeralContainers []v1.EphemeralContainer `json:"ephemeralContainers"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
EphemeralContainers []v1.EphemeralContainer `json:"ephemeralContainers" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
}
|
||||
|
||||
// EphemeralJobStatus defines the observed state of EphemeralJob
|
||||
|
|
|
@ -20,8 +20,8 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"github.com/openkruise/kruise-api/utils/scheme"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"github.com/openkruise/kruise-api/utils/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
Copyright 2023 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ImageListPullJobSpec defines the desired state of ImageListPullJob
|
||||
type ImageListPullJobSpec struct {
|
||||
// Images is the image list to be pulled by the job
|
||||
Images []string `json:"images"`
|
||||
|
||||
ImagePullJobTemplate `json:",inline"`
|
||||
}
|
||||
|
||||
// ImageListPullJobStatus defines the observed state of ImageListPullJob
|
||||
type ImageListPullJobStatus struct {
|
||||
// Represents time when the job was acknowledged by the job controller.
|
||||
// It is not guaranteed to be set in happens-before order across separate operations.
|
||||
// It is represented in RFC3339 form and is in UTC.
|
||||
// +optional
|
||||
StartTime *metav1.Time `json:"startTime,omitempty"`
|
||||
|
||||
// Represents time when the all the image pull job was completed. It is not guaranteed to
|
||||
// be set in happens-before order across separate operations.
|
||||
// It is represented in RFC3339 form and is in UTC.
|
||||
// +optional
|
||||
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
|
||||
|
||||
// The desired number of ImagePullJobs, this is typically equal to the number of len(spec.Images).
|
||||
Desired int32 `json:"desired"`
|
||||
|
||||
// The number of running ImagePullJobs which are acknowledged by the imagepulljob controller.
|
||||
// +optional
|
||||
Active int32 `json:"active"`
|
||||
|
||||
// The number of ImagePullJobs which are finished
|
||||
// +optional
|
||||
Completed int32 `json:"completed"`
|
||||
|
||||
// The number of image pull job which are finished and status.Succeeded==status.Desired.
|
||||
// +optional
|
||||
Succeeded int32 `json:"succeeded"`
|
||||
|
||||
// The status of ImagePullJob which has the failed nodes(status.Failed>0) .
|
||||
// +optional
|
||||
FailedImageStatuses []*FailedImageStatus `json:"failedImageStatuses,omitempty"`
|
||||
}
|
||||
|
||||
// FailedImageStatus the state of ImagePullJob which has the failed nodes(status.Failed>0)
|
||||
type FailedImageStatus struct {
|
||||
// The name of ImagePullJob which has the failed nodes(status.Failed>0)
|
||||
// +optional
|
||||
ImagePullJob string `json:"imagePullJob,omitempty"`
|
||||
|
||||
// Name of the image
|
||||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// The text prompt for job running status.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="TOTAL",type="integer",JSONPath=".status.desired",description="Number of image pull job"
|
||||
// +kubebuilder:printcolumn:name="SUCCEEDED",type="integer",JSONPath=".status.succeeded",description="Number of image pull job succeeded"
|
||||
// +kubebuilder:printcolumn:name="COMPLETED",type="integer",JSONPath=".status.completed",description="Number of ImagePullJobs which are finished"
|
||||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp",description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC."
|
||||
|
||||
// ImageListPullJob is the Schema for the imagelistpulljobs API
|
||||
type ImageListPullJob struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ImageListPullJobSpec `json:"spec,omitempty"`
|
||||
Status ImageListPullJobStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
// ImageListPullJobList contains a list of ImageListPullJob
|
||||
type ImageListPullJobList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ImageListPullJob `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&ImageListPullJob{}, &ImageListPullJobList{})
|
||||
}
|
|
@ -27,10 +27,25 @@ const (
|
|||
ImagePreDownloadMinUpdatedReadyPods = "apps.kruise.io/image-predownload-min-updated-ready-pods"
|
||||
)
|
||||
|
||||
// ImagePullPolicy describes a policy for if/when to pull a container image
|
||||
// +enum
|
||||
type ImagePullPolicy string
|
||||
|
||||
const (
|
||||
// PullAlways means that kruise-daemon always attempts to pull the latest image.
|
||||
PullAlways ImagePullPolicy = "Always"
|
||||
// PullIfNotPresent means that kruise-daemon pulls if the image isn't present on disk.
|
||||
PullIfNotPresent ImagePullPolicy = "IfNotPresent"
|
||||
)
|
||||
|
||||
// ImagePullJobSpec defines the desired state of ImagePullJob
|
||||
type ImagePullJobSpec struct {
|
||||
// Image is the image to be pulled by the job
|
||||
Image string `json:"image"`
|
||||
Image string `json:"image"`
|
||||
ImagePullJobTemplate `json:",inline"`
|
||||
}
|
||||
|
||||
type ImagePullJobTemplate struct {
|
||||
|
||||
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling the image.
|
||||
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
|
||||
|
@ -61,6 +76,15 @@ type ImagePullJobSpec struct {
|
|||
// CompletionPolicy indicates the completion policy of the job.
|
||||
// Default is Always CompletionPolicyType.
|
||||
CompletionPolicy CompletionPolicy `json:"completionPolicy"`
|
||||
|
||||
// SandboxConfig support attach metadata in PullImage CRI interface during ImagePulljobs
|
||||
// +optional
|
||||
SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"`
|
||||
|
||||
// Image pull policy.
|
||||
// One of Always, IfNotPresent. Defaults to IfNotPresent.
|
||||
// +optional
|
||||
ImagePullPolicy ImagePullPolicy `json:"imagePullPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// ImagePullJobPodSelector is a selector over pods
|
||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
|
@ -32,6 +33,8 @@ type PodProbe struct {
|
|||
Namespace string `json:"namespace"`
|
||||
// pod uid
|
||||
UID string `json:"uid"`
|
||||
// pod ip
|
||||
IP string `json:"IP"`
|
||||
// Custom container probe, supports Exec, Tcp, and returns the result to Pod yaml
|
||||
Probes []ContainerProbe `json:"probes,omitempty"`
|
||||
}
|
||||
|
@ -85,6 +88,17 @@ const (
|
|||
ProbeUnknown ProbeState = "Unknown"
|
||||
)
|
||||
|
||||
func (p ProbeState) IsEqualPodConditionStatus(status corev1.ConditionStatus) bool {
|
||||
switch status {
|
||||
case corev1.ConditionTrue:
|
||||
return p == ProbeSucceeded
|
||||
case corev1.ConditionFalse:
|
||||
return p == ProbeFailed
|
||||
default:
|
||||
return p == ProbeUnknown
|
||||
}
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:openapi-gen=true
|
||||
|
|
|
@ -38,6 +38,10 @@ type ImageSpec struct {
|
|||
|
||||
// Tags is a list of versions of this image
|
||||
Tags []ImageTagSpec `json:"tags"`
|
||||
|
||||
// SandboxConfig support attach metadata in PullImage CRI interface during ImagePulljobs
|
||||
// +optional
|
||||
SandboxConfig *SandboxConfig `json:"sandboxConfig,omitempty"`
|
||||
}
|
||||
|
||||
// ReferenceObject comprises a resource name, with a mandatory namespace,
|
||||
|
@ -76,6 +80,11 @@ type ImageTagSpec struct {
|
|||
// Value must be treated as opaque by clients and .
|
||||
// +optional
|
||||
Version int64 `json:"version,omitempty"`
|
||||
|
||||
// Image pull policy.
|
||||
// One of Always, IfNotPresent. Defaults to IfNotPresent.
|
||||
// +optional
|
||||
ImagePullPolicy ImagePullPolicy `json:"imagePullPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// ImageTagPullPolicy defines the policy of the pulling task
|
||||
|
@ -144,7 +153,7 @@ type ImageTagStatus struct {
|
|||
// Represents the image pulling task phase.
|
||||
Phase ImagePullPhase `json:"phase"`
|
||||
|
||||
// Represents the pulling progress of this tag, which is beetween 0-100. There is no guarantee
|
||||
// Represents the pulling progress of this tag, which is between 0-100. There is no guarantee
|
||||
// of monotonic consistency, and it may be a rollback due to retry during pulling.
|
||||
Progress int32 `json:"progress,omitempty"`
|
||||
|
||||
|
@ -168,7 +177,7 @@ type ImageTagStatus struct {
|
|||
// +optional
|
||||
ImageID string `json:"imageID,omitempty"`
|
||||
|
||||
// Represents the summary informations of this node
|
||||
// Represents the summary information of this node
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -35,6 +35,10 @@ const (
|
|||
// for example kruise.io/preferred-persistent-topology: kubernetes.io/hostname[,xxx]
|
||||
// optional
|
||||
AnnotationPreferredPersistentTopology = "kruise.io/preferred-persistent-topology"
|
||||
// AnnotationPersistentPodAnnotations Pod needs persistent annotations
|
||||
// for example kruise.io/persistent-pod-annotations: cni.projectcalico.org/podIP[,xxx]
|
||||
// optional
|
||||
AnnotationPersistentPodAnnotations = "kruise.io/persistent-pod-annotations"
|
||||
)
|
||||
|
||||
// PersistentPodStateSpec defines the desired state of PersistentPodState
|
||||
|
@ -44,6 +48,9 @@ type PersistentPodStateSpec struct {
|
|||
// current only support StatefulSet
|
||||
TargetReference TargetReference `json:"targetRef"`
|
||||
|
||||
// Persist the annotations information of the pods that need to be saved
|
||||
PersistentPodAnnotations []PersistentPodAnnotation `json:"persistentPodAnnotations,omitempty"`
|
||||
|
||||
// Pod rebuilt topology required for node labels
|
||||
// for example kubernetes.io/hostname, failure-domain.beta.kubernetes.io/zone
|
||||
RequiredPersistentTopology *NodeTopologyTerm `json:"requiredPersistentTopology,omitempty"`
|
||||
|
@ -67,6 +74,10 @@ type NodeTopologyTerm struct {
|
|||
NodeTopologyKeys []string `json:"nodeTopologyKeys"`
|
||||
}
|
||||
|
||||
type PersistentPodAnnotation struct {
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
type PersistentPodStateRetentionPolicyType string
|
||||
|
||||
const (
|
||||
|
@ -91,6 +102,8 @@ type PodState struct {
|
|||
// node topology labels key=value
|
||||
// for example kubernetes.io/hostname=node-1
|
||||
NodeTopologyLabels map[string]string `json:"nodeTopologyLabels,omitempty"`
|
||||
// pod persistent annotations
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
|
|
|
@ -21,6 +21,31 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
// PodProbeMarkerAnnotationKey records the Probe Spec, mainly used for serverless Pod scenarios, as follows:
|
||||
// annotations:
|
||||
// kruise.io/podprobe: |
|
||||
// [
|
||||
// {
|
||||
// "containerName": "minecraft",
|
||||
// "name": "healthy",
|
||||
// "podConditionType": "game.kruise.io/healthy",
|
||||
// "probe": {
|
||||
// "exec": {
|
||||
// "command": [
|
||||
// "bash",
|
||||
// "/data/probe.sh"
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
PodProbeMarkerAnnotationKey = "kruise.io/podprobe"
|
||||
// PodProbeMarkerListAnnotationKey records the injected PodProbeMarker Name List
|
||||
// example: kruise.io/podprobemarker-list="probe-marker-1,probe-marker-2"
|
||||
PodProbeMarkerListAnnotationKey = "kruise.io/podprobemarker-list"
|
||||
)
|
||||
|
||||
// PodProbeMarkerSpec defines the desired state of PodProbeMarker
|
||||
type PodProbeMarkerSpec struct {
|
||||
// Selector is a label query over pods that should exec custom probe
|
||||
|
@ -31,7 +56,9 @@ type PodProbeMarkerSpec struct {
|
|||
// Probe Result will record in Pod.Status.Conditions, and condition.type=probe.name.
|
||||
// condition.status=True indicates probe success
|
||||
// condition.status=False indicates probe fails
|
||||
Probes []PodContainerProbe `json:"probes"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
Probes []PodContainerProbe `json:"probes" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
}
|
||||
|
||||
type PodContainerProbe struct {
|
||||
|
@ -44,7 +71,9 @@ type PodContainerProbe struct {
|
|||
// According to the execution result of ContainerProbe, perform specific actions,
|
||||
// such as: patch Pod labels, annotations, ReadinessGate Condition
|
||||
// It cannot be null at the same time as PodConditionType.
|
||||
MarkerPolicy []ProbeMarkerPolicy `json:"markerPolicy,omitempty"`
|
||||
// +patchMergeKey=state
|
||||
// +patchStrategy=merge
|
||||
MarkerPolicy []ProbeMarkerPolicy `json:"markerPolicy,omitempty" patchStrategy:"merge" patchMergeKey:"state"`
|
||||
// If it is not empty, the Probe execution result will be recorded on the Pod condition.
|
||||
// It cannot be null at the same time as MarkerPolicy.
|
||||
// For example PodConditionType=game.kruise.io/healthy, pod.status.condition.type = game.kruise.io/healthy.
|
||||
|
|
|
@ -69,8 +69,10 @@ type ResourceDistributionTargetNamespaces struct {
|
|||
Pattern string `json:"pattern,omitempty"`
|
||||
*/
|
||||
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
// +optional
|
||||
List []ResourceDistributionNamespace `json:"list,omitempty"`
|
||||
List []ResourceDistributionNamespace `json:"list,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
}
|
||||
|
||||
// ResourceDistributionNamespace contains a namespace name
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2023 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -14,10 +14,12 @@ 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 BatchReleaseExpansion interface{}
|
||||
|
||||
type RolloutExpansion interface{}
|
||||
// SandboxConfig support attach metadata in PullImage CRI interface during ImagePulljobs
|
||||
type SandboxConfig struct {
|
||||
// +optional
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
// +optional
|
||||
Annotations map[string]string `json:"annotations,omitempty"`
|
||||
}
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
appspub "github.com/openkruise/kruise-api/apps/pub"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
|
@ -41,18 +42,28 @@ type SidecarSetSpec struct {
|
|||
// otherwise, match pods in all namespaces(in cluster)
|
||||
Namespace string `json:"namespace,omitempty"`
|
||||
|
||||
// NamespaceSelector select which namespaces to inject sidecar containers.
|
||||
// Default to the empty LabelSelector, which matches everything.
|
||||
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
|
||||
|
||||
// InitContainers is the list of init containers to be injected into the selected pod
|
||||
// We will inject those containers by their name in ascending order
|
||||
// We only inject init containers when a new pod is created, it does not apply to any existing pod
|
||||
InitContainers []SidecarContainer `json:"initContainers,omitempty"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
InitContainers []SidecarContainer `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
|
||||
// Containers is the list of sidecar containers to be injected into the selected pod
|
||||
Containers []SidecarContainer `json:"containers,omitempty"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
Containers []SidecarContainer `json:"containers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
|
||||
// List of volumes that can be mounted by sidecar containers
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// +kubebuilder:validation:Schemaless
|
||||
Volumes []corev1.Volume `json:"volumes,omitempty"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
|
||||
// The sidecarset updateStrategy to use to replace existing pods with new ones.
|
||||
UpdateStrategy SidecarSetUpdateStrategy `json:"updateStrategy,omitempty"`
|
||||
|
@ -61,7 +72,9 @@ type SidecarSetSpec struct {
|
|||
InjectionStrategy SidecarSetInjectionStrategy `json:"injectionStrategy,omitempty"`
|
||||
|
||||
// List of the names of secrets required by pulling sidecar container images
|
||||
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
|
||||
// RevisionHistoryLimit indicates the maximum quantity of stored revisions about the SidecarSet.
|
||||
// default value is 10
|
||||
|
@ -203,7 +216,8 @@ type SidecarSetInjectRevision struct {
|
|||
// + optional
|
||||
RevisionName *string `json:"revisionName,omitempty"`
|
||||
// Policy describes the behavior of revision injection.
|
||||
// Defaults to Always.
|
||||
// +kubebuilder:validation:Enum=Always;Partial;
|
||||
// +kubebuilder:default=Always
|
||||
Policy SidecarSetInjectRevisionPolicy `json:"policy,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -213,9 +227,15 @@ const (
|
|||
// AlwaysSidecarSetInjectRevisionPolicy means the SidecarSet will always inject
|
||||
// the specific revision to Pods when pod creating, except matching UpdateStrategy.Selector.
|
||||
AlwaysSidecarSetInjectRevisionPolicy SidecarSetInjectRevisionPolicy = "Always"
|
||||
// PartitionBasedSidecarSetInjectRevisionPolicy means the SidecarSet will inject the
|
||||
// specific or the latest revision according to Partition.
|
||||
//PartitionBasedSidecarSetInjectRevisionPolicy SidecarSetInjectRevisionPolicy = "PartitionBased"
|
||||
|
||||
// PartialSidecarSetInjectRevisionPolicy means the SidecarSet will inject the specific or the latest revision according to UpdateStrategy.
|
||||
//
|
||||
// If UpdateStrategy.Pause is not true, only when a newly created Pod is **not** selected by the Selector explicitly
|
||||
// configured in `UpdateStrategy` will it be injected with the specified version of the Sidecar.
|
||||
// Under all other conditions, newly created Pods have a probability of being injected with the latest Sidecar,
|
||||
// where the probability is `1 - UpdateStrategy.Partition`.
|
||||
// If `Partition` is not a percentage or is not configured, its value is considered to be 0%.
|
||||
PartialSidecarSetInjectRevisionPolicy SidecarSetInjectRevisionPolicy = "Partial"
|
||||
)
|
||||
|
||||
// SidecarSetUpdateStrategy indicates the strategy that the SidecarSet
|
||||
|
@ -229,11 +249,15 @@ type SidecarSetUpdateStrategy struct {
|
|||
Type SidecarSetUpdateStrategyType `json:"type,omitempty"`
|
||||
|
||||
// Paused indicates that the SidecarSet is paused to update the injected pods,
|
||||
// but it don't affect the webhook inject sidecar container into the newly created pods.
|
||||
// default is false
|
||||
// For the impact on the injection behavior for newly created Pods, please refer to the comments of Selector.
|
||||
Paused bool `json:"paused,omitempty"`
|
||||
|
||||
// If selector is not nil, this upgrade will only update the selected pods.
|
||||
//
|
||||
// Starting from Kruise 1.8.0, the updateStrategy.Selector affects the version of the Sidecar container
|
||||
// injected into newly created Pods by a SidecarSet configured with an injectionStrategy.
|
||||
// In most cases, all newly created Pods are injected with the specified Sidecar version as configured in injectionStrategy.revision,
|
||||
// which is consistent with previous versions.
|
||||
Selector *metav1.LabelSelector `json:"selector,omitempty"`
|
||||
|
||||
// Partition is the desired number of pods in old revisions. It means when partition
|
||||
|
@ -248,7 +272,9 @@ type SidecarSetUpdateStrategy struct {
|
|||
// This cannot be 0.
|
||||
// Default value is 1.
|
||||
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
|
||||
|
||||
// Priorities are the rules for calculating the priority of updating pods.
|
||||
// Each pod to be updated, will pass through these terms and get a sum of weights.
|
||||
PriorityStrategy *appspub.UpdatePriorityStrategy `json:"priorityStrategy,omitempty"`
|
||||
// ScatterStrategy defines the scatter rules to make pods been scattered when update.
|
||||
// This will avoid pods with the same key-value to be updated in one batch.
|
||||
// - Note that pods will be scattered after priority sort. So, although priority strategy and scatter strategy can be applied together, we suggest to use either one of them.
|
||||
|
|
|
@ -17,10 +17,13 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
)
|
||||
|
||||
|
@ -159,8 +162,14 @@ type ManualUpdate struct {
|
|||
type Topology struct {
|
||||
// Contains the details of each subset. Each element in this array represents one subset
|
||||
// which will be provisioned and managed by UnitedDeployment.
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
// +optional
|
||||
Subsets []Subset `json:"subsets,omitempty"`
|
||||
Subsets []Subset `json:"subsets,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
|
||||
// ScheduleStrategy indicates the strategy the UnitedDeployment used to preform the schedule between each of subsets.
|
||||
// +optional
|
||||
ScheduleStrategy UnitedDeploymentScheduleStrategy `json:"scheduleStrategy,omitempty"`
|
||||
}
|
||||
|
||||
// Subset defines the detail of a subset.
|
||||
|
@ -185,8 +194,96 @@ type Subset struct {
|
|||
// percentage like '10%', which means 10% of UnitedDeployment replicas of pods will be distributed
|
||||
// under this subset. If nil, the number of replicas in this subset is determined by controller.
|
||||
// Controller will try to keep all the subsets with nil replicas have average pods.
|
||||
// Replicas and MinReplicas/MaxReplicas are mutually exclusive in a UnitedDeployment.
|
||||
// +optional
|
||||
Replicas *intstr.IntOrString `json:"replicas,omitempty"`
|
||||
|
||||
// Indicates the lower bounded replicas of the subset.
|
||||
// MinReplicas must be more than or equal to 0 if it is set.
|
||||
// Controller will prioritize satisfy minReplicas for each subset
|
||||
// according to the order of Topology.Subsets.
|
||||
// Defaults to 0.
|
||||
// +optional
|
||||
MinReplicas *intstr.IntOrString `json:"minReplicas,omitempty"`
|
||||
|
||||
// Indicates the upper bounded replicas of the subset.
|
||||
// MaxReplicas must be more than or equal to MinReplicas.
|
||||
// MaxReplicas == nil means no limitation.
|
||||
// Please ensure that at least one subset has empty MaxReplicas(no limitation) to avoid stuck scaling.
|
||||
// Defaults to nil.
|
||||
// +optional
|
||||
MaxReplicas *intstr.IntOrString `json:"maxReplicas,omitempty"`
|
||||
|
||||
// Patch indicates patching to the templateSpec.
|
||||
// Patch takes precedence over other fields
|
||||
// If the Patch also modifies the Replicas, NodeSelectorTerm or Tolerations, use value in the Patch
|
||||
// +optional
|
||||
// +kubebuilder:pruning:PreserveUnknownFields
|
||||
// +kubebuilder:validation:Schemaless
|
||||
Patch runtime.RawExtension `json:"patch,omitempty"`
|
||||
}
|
||||
|
||||
// UnitedDeploymentScheduleStrategyType is a string enumeration type that enumerates
|
||||
// all possible schedule strategies for the UnitedDeployment controller.
|
||||
// +kubebuilder:validation:Enum=Adaptive;Fixed;""
|
||||
type UnitedDeploymentScheduleStrategyType string
|
||||
|
||||
const (
|
||||
// AdaptiveUnitedDeploymentScheduleStrategyType represents that when a pod is stuck in the pending status and cannot
|
||||
// be scheduled, allow it to be rescheduled to another subset.
|
||||
AdaptiveUnitedDeploymentScheduleStrategyType UnitedDeploymentScheduleStrategyType = "Adaptive"
|
||||
// FixedUnitedDeploymentScheduleStrategyType represents that pods are strictly scheduled to the selected subset
|
||||
// even if scheduling fail.
|
||||
FixedUnitedDeploymentScheduleStrategyType UnitedDeploymentScheduleStrategyType = "Fixed"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultRescheduleCriticalDuration = 30 * time.Second
|
||||
DefaultUnschedulableStatusLastDuration = 300 * time.Second
|
||||
)
|
||||
|
||||
// AdaptiveUnitedDeploymentStrategy is used to communicate parameters when Type is AdaptiveUnitedDeploymentScheduleStrategyType.
|
||||
type AdaptiveUnitedDeploymentStrategy struct {
|
||||
// RescheduleCriticalSeconds indicates how long controller will reschedule a schedule failed Pod to the subset that has
|
||||
// redundant capacity after the subset where the Pod lives. If a Pod was scheduled failed and still in an unschedulabe status
|
||||
// over RescheduleCriticalSeconds duration, the controller will reschedule it to a suitable subset. Default is 30 seconds.
|
||||
// +optional
|
||||
RescheduleCriticalSeconds *int32 `json:"rescheduleCriticalSeconds,omitempty"`
|
||||
|
||||
// UnschedulableLastSeconds is used to set the number of seconds for a Subset to recover from an unschedulable state,
|
||||
// with a default value of 300 seconds.
|
||||
// +optional
|
||||
UnschedulableLastSeconds *int32 `json:"unschedulableLastSeconds,omitempty"`
|
||||
}
|
||||
|
||||
// UnitedDeploymentScheduleStrategy defines the schedule performance of UnitedDeployment.
|
||||
type UnitedDeploymentScheduleStrategy struct {
|
||||
// Type indicates the type of the UnitedDeploymentScheduleStrategy.
|
||||
// Default is Fixed
|
||||
// +optional
|
||||
Type UnitedDeploymentScheduleStrategyType `json:"type,omitempty"`
|
||||
|
||||
// Adaptive is used to communicate parameters when Type is AdaptiveUnitedDeploymentScheduleStrategyType.
|
||||
// +optional
|
||||
Adaptive *AdaptiveUnitedDeploymentStrategy `json:"adaptive,omitempty"`
|
||||
}
|
||||
|
||||
func (s *UnitedDeploymentScheduleStrategy) IsAdaptive() bool {
|
||||
return s.Type == AdaptiveUnitedDeploymentScheduleStrategyType
|
||||
}
|
||||
|
||||
func (s *UnitedDeploymentScheduleStrategy) GetRescheduleCriticalDuration() time.Duration {
|
||||
if s.Adaptive == nil || s.Adaptive.RescheduleCriticalSeconds == nil {
|
||||
return DefaultRescheduleCriticalDuration
|
||||
}
|
||||
return time.Duration(*s.Adaptive.RescheduleCriticalSeconds) * time.Second
|
||||
}
|
||||
|
||||
func (s *UnitedDeploymentScheduleStrategy) GetUnschedulableLastDuration() time.Duration {
|
||||
if s.Adaptive == nil || s.Adaptive.UnschedulableLastSeconds == nil {
|
||||
return DefaultUnschedulableStatusLastDuration
|
||||
}
|
||||
return time.Duration(*s.Adaptive.UnschedulableLastSeconds) * time.Second
|
||||
}
|
||||
|
||||
// UnitedDeploymentStatus defines the observed state of UnitedDeployment.
|
||||
|
@ -223,6 +320,8 @@ type UnitedDeploymentStatus struct {
|
|||
// +optional
|
||||
SubsetReplicas map[string]int32 `json:"subsetReplicas,omitempty"`
|
||||
|
||||
// Record the conditions of each subset.
|
||||
SubsetStatuses []UnitedDeploymentSubsetStatus `json:"subsetStatuses,omitempty"`
|
||||
// Represents the latest available observations of a UnitedDeployment's current state.
|
||||
// +optional
|
||||
Conditions []UnitedDeploymentCondition `json:"conditions,omitempty"`
|
||||
|
@ -230,6 +329,26 @@ type UnitedDeploymentStatus struct {
|
|||
// Records the information of update progress.
|
||||
// +optional
|
||||
UpdateStatus *UpdateStatus `json:"updateStatus,omitempty"`
|
||||
|
||||
// LabelSelector is label selectors for query over pods that should match the replica count used by HPA.
|
||||
LabelSelector string `json:"labelSelector,omitempty"`
|
||||
}
|
||||
|
||||
func (s *UnitedDeploymentStatus) GetSubsetStatus(subset string) *UnitedDeploymentSubsetStatus {
|
||||
for i, subsetStatus := range s.SubsetStatuses {
|
||||
if subsetStatus.Name == subset {
|
||||
return &s.SubsetStatuses[i]
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *UnitedDeployment) InitSubsetStatuses() {
|
||||
for _, subset := range u.Spec.Topology.Subsets {
|
||||
if u.Status.GetSubsetStatus(subset.Name) == nil {
|
||||
u.Status.SubsetStatuses = append(u.Status.SubsetStatuses, UnitedDeploymentSubsetStatus{Name: subset.Name})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UnitedDeploymentCondition describes current state of a UnitedDeployment.
|
||||
|
@ -246,7 +365,7 @@ type UnitedDeploymentCondition struct {
|
|||
// The reason for the condition's last transition.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
|
||||
// A human readable message indicating details about the transition.
|
||||
// A human-readable message indicating details about the transition.
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -261,13 +380,69 @@ type UpdateStatus struct {
|
|||
CurrentPartitions map[string]int32 `json:"currentPartitions,omitempty"`
|
||||
}
|
||||
|
||||
type UnitedDeploymentSubsetStatus struct {
|
||||
// Subset name specified in Topology.Subsets
|
||||
Name string `json:"name,omitempty"`
|
||||
// Recores the current replicas. Currently unused.
|
||||
Replicas int32 `json:"replicas,omitempty"`
|
||||
// Records the current partition. Currently unused.
|
||||
Partition int32 `json:"partition,omitempty"`
|
||||
// Conditions is an array of current observed subset conditions.
|
||||
Conditions []UnitedDeploymentSubsetCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
func (s *UnitedDeploymentSubsetStatus) GetCondition(condType UnitedDeploymentSubsetConditionType) *UnitedDeploymentSubsetCondition {
|
||||
for _, condition := range s.Conditions {
|
||||
if condition.Type == condType {
|
||||
return &condition
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *UnitedDeploymentSubsetStatus) SetCondition(condType UnitedDeploymentSubsetConditionType, status corev1.ConditionStatus, reason, message string) {
|
||||
var currentCond *UnitedDeploymentSubsetCondition
|
||||
for i, c := range s.Conditions {
|
||||
if c.Type == condType {
|
||||
currentCond = &s.Conditions[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
if currentCond != nil && currentCond.Status == status && currentCond.Reason == reason {
|
||||
return
|
||||
}
|
||||
if currentCond == nil {
|
||||
s.Conditions = append(s.Conditions, UnitedDeploymentSubsetCondition{Type: condType})
|
||||
currentCond = &s.Conditions[len(s.Conditions)-1]
|
||||
}
|
||||
currentCond.LastTransitionTime = metav1.Now()
|
||||
currentCond.Status = status
|
||||
currentCond.Reason = reason
|
||||
currentCond.Message = message
|
||||
}
|
||||
|
||||
type UnitedDeploymentSubsetConditionType string
|
||||
|
||||
const (
|
||||
// UnitedDeploymentSubsetSchedulable means new pods allocated into the subset will keep pending.
|
||||
UnitedDeploymentSubsetSchedulable UnitedDeploymentSubsetConditionType = "Schedulable"
|
||||
)
|
||||
|
||||
type UnitedDeploymentSubsetCondition struct {
|
||||
Type UnitedDeploymentSubsetConditionType `json:"type"`
|
||||
Status corev1.ConditionStatus `json:"status"`
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
|
||||
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
|
||||
// +k8s:openapi-gen=true
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
|
||||
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector
|
||||
// +kubebuilder:resource:shortName=ud
|
||||
// +kubebuilder:printcolumn:name="DESIRED",type="integer",JSONPath=".spec.replicas",description="The desired number of pods."
|
||||
// +kubebuilder:printcolumn:name="CURRENT",type="integer",JSONPath=".status.replicas",description="The number of currently all pods."
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
Copyright 2020 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// UpdatePriorityStrategy is the strategy to define priority for pods update.
|
||||
// Only one of orderPriority and weightPriority can be set.
|
||||
type UpdatePriorityStrategy struct {
|
||||
// Order priority terms, pods will be sorted by the value of orderedKey.
|
||||
// For example:
|
||||
// ```
|
||||
// orderPriority:
|
||||
// - orderedKey: key1
|
||||
// - orderedKey: key2
|
||||
// ```
|
||||
// First, all pods which have key1 in labels will be sorted by the value of key1.
|
||||
// Then, the left pods which have no key1 but have key2 in labels will be sorted by
|
||||
// the value of key2 and put behind those pods have key1.
|
||||
OrderPriority []UpdatePriorityOrderTerm `json:"orderPriority,omitempty"`
|
||||
// Weight priority terms, pods will be sorted by the sum of all terms weight.
|
||||
WeightPriority []UpdatePriorityWeightTerm `json:"weightPriority,omitempty"`
|
||||
}
|
||||
|
||||
// UpdatePriorityOrder defines order priority.
|
||||
type UpdatePriorityOrderTerm struct {
|
||||
// Calculate priority by value of this key.
|
||||
// Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value,
|
||||
// such as getting 5 in value '5', getting 10 in value 'sts-10'.
|
||||
OrderedKey string `json:"orderedKey"`
|
||||
}
|
||||
|
||||
// UpdatePriorityWeightTerm defines weight priority.
|
||||
type UpdatePriorityWeightTerm struct {
|
||||
// Weight associated with matching the corresponding matchExpressions, in the range 1-100.
|
||||
Weight int32 `json:"weight"`
|
||||
// MatchSelector is used to select by pod's labels.
|
||||
MatchSelector metav1.LabelSelector `json:"matchSelector"`
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package v1alpha1
|
||||
|
||||
const (
|
||||
// AnnotationUsingEnhancedLiveness indicates that the enhanced liveness probe of pod is enabled.
|
||||
AnnotationUsingEnhancedLiveness = "apps.kruise.io/using-enhanced-liveness"
|
||||
// AnnotationUsingEnhancedLiveness indicates the backup probe (json types) of the pod native container livnessprobe configuration.
|
||||
AnnotationNativeContainerProbeContext = "apps.kruise.io/container-probe-context"
|
||||
)
|
|
@ -15,4 +15,18 @@ const (
|
|||
|
||||
// ImagePreDownloadIgnoredKey indicates the images of this revision have been ignored to pre-download
|
||||
ImagePreDownloadIgnoredKey = "apps.kruise.io/image-predownload-ignored"
|
||||
// AnnotationSubsetPatchKey indicates the patch for every subset
|
||||
AnnotationSubsetPatchKey = "apps.kruise.io/subset-patch"
|
||||
)
|
||||
|
||||
// Sidecar container environment variable definitions which are used to enable SidecarTerminator to take effect on the sidecar container.
|
||||
const (
|
||||
// KruiseTerminateSidecarEnv is an env name, which represents a switch to enable sidecar terminator.
|
||||
// The corresponding value is "true", which means apply a crr to kill sidecar using kruise-daemon.
|
||||
KruiseTerminateSidecarEnv = "KRUISE_TERMINATE_SIDECAR_WHEN_JOB_EXIT"
|
||||
|
||||
// KruiseTerminateSidecarWithImageEnv is an env name, which refers to an image that will replace the original image
|
||||
// using in-place update strategy to kill sidecar. This image must be given if you want to use in-place update
|
||||
// strategy to terminate sidecar containers.
|
||||
KruiseTerminateSidecarWithImageEnv = "KRUISE_TERMINATE_SIDECAR_WHEN_JOB_EXIT_WITH_IMAGE"
|
||||
)
|
||||
|
|
|
@ -28,8 +28,15 @@ type WorkloadSpreadSpec struct {
|
|||
// TargetReference is the target workload that WorkloadSpread want to control.
|
||||
TargetReference *TargetReference `json:"targetRef"`
|
||||
|
||||
// TargetFilter allows WorkloadSpread to manage only a portion of the Pods in the TargetReference:
|
||||
// by specifying the criteria for the Pods to be managed through a label selector,
|
||||
// and by specifying how to obtain the total number of these selected Pods from the workload using replicasPaths.
|
||||
TargetFilter *TargetFilter `json:"targetFilter,omitempty"`
|
||||
|
||||
// Subsets describes the pods distribution details between each of subsets.
|
||||
Subsets []WorkloadSpreadSubset `json:"subsets"`
|
||||
// +patchMergeKey=name
|
||||
// +patchStrategy=merge
|
||||
Subsets []WorkloadSpreadSubset `json:"subsets" patchStrategy:"merge" patchMergeKey:"name"`
|
||||
|
||||
// ScheduleStrategy indicates the strategy the WorkloadSpread used to preform the schedule between each of subsets.
|
||||
// +optional
|
||||
|
@ -46,6 +53,58 @@ type TargetReference struct {
|
|||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
/*
|
||||
TargetFilter is an optional parameter that allows WorkloadSpread to manage only a subset of the Pods generated by the target workload.
|
||||
|
||||
For example, suppose a WorkloadSpread points to the following Kubeflow TFJob resource:
|
||||
|
||||
```yaml
|
||||
apiVersion: kubeflow.org/v1
|
||||
kind: TFJob
|
||||
spec:
|
||||
tfReplicaSpecs:
|
||||
PS:
|
||||
replicas: 1
|
||||
...
|
||||
MASTER:
|
||||
replicas: 1
|
||||
...
|
||||
Worker:
|
||||
replicas: 2
|
||||
...
|
||||
```
|
||||
|
||||
If you want to manage only the 2 Worker Pods that are generated, you need to configure the TargetFilter as follows:
|
||||
|
||||
```yaml
|
||||
targetFilter:
|
||||
selector:
|
||||
matchLabels:
|
||||
role: worker
|
||||
replicasPathList:
|
||||
- spec.tfReplicaSpecs.Worker.replicas
|
||||
```
|
||||
|
||||
With this configuration, the PS Pods and Master Pods generated by the TFJob will not be managed by WorkloadSpread and will not be
|
||||
counted toward the total number of replicas.
|
||||
*/
|
||||
type TargetFilter struct {
|
||||
// Selector is used to filter the Pods to be managed.
|
||||
//
|
||||
//+optional
|
||||
Selector *metav1.LabelSelector `json:"selector,omitempty"`
|
||||
|
||||
// ReplicasPathList is a list of resource paths used to specify how to determine the total number of replicas of
|
||||
// the target workload after filtering. If this list is not empty, WorkloadSpread will look for the corresponding
|
||||
// values in the target resource according to each path, and treat the sum of these values as the total number of replicas after filtering.
|
||||
//
|
||||
// The replicas path is a dot-separated path, similar to "spec.replicas". If there are arrays, you can use numbers to denote indexes, like "subsets.1.replicas".
|
||||
// The real values of these paths must be integers.
|
||||
//
|
||||
// +optional
|
||||
ReplicasPathList []string `json:"replicasPathList,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadSpreadScheduleStrategyType is a string enumeration type that enumerates
|
||||
// all possible schedule strategies for the WorkloadSpread controller.
|
||||
// +kubebuilder:validation:Enum=Adaptive;Fixed;""
|
||||
|
@ -128,6 +187,11 @@ type WorkloadSpreadStatus struct {
|
|||
// Contains the status of each subset. Each element in this array represents one subset
|
||||
// +optional
|
||||
SubsetStatuses []WorkloadSpreadSubsetStatus `json:"subsetStatuses,omitempty"`
|
||||
|
||||
// VersionedSubsetStatuses is to solve rolling-update problems, where the creation of new-version pod
|
||||
// may be earlier than deletion of old-version pod. We have to calculate the pod subset distribution for
|
||||
// each version.
|
||||
VersionedSubsetStatuses map[string][]WorkloadSpreadSubsetStatus `json:"versionedSubsetStatuses,omitempty"`
|
||||
}
|
||||
|
||||
type WorkloadSpreadSubsetConditionType string
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2021 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -31,6 +30,31 @@ import (
|
|||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AdaptiveUnitedDeploymentStrategy) DeepCopyInto(out *AdaptiveUnitedDeploymentStrategy) {
|
||||
*out = *in
|
||||
if in.RescheduleCriticalSeconds != nil {
|
||||
in, out := &in.RescheduleCriticalSeconds, &out.RescheduleCriticalSeconds
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
if in.UnschedulableLastSeconds != nil {
|
||||
in, out := &in.UnschedulableLastSeconds, &out.UnschedulableLastSeconds
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdaptiveUnitedDeploymentStrategy.
|
||||
func (in *AdaptiveUnitedDeploymentStrategy) DeepCopy() *AdaptiveUnitedDeploymentStrategy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AdaptiveUnitedDeploymentStrategy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AdaptiveWorkloadSpreadStrategy) DeepCopyInto(out *AdaptiveWorkloadSpreadStrategy) {
|
||||
*out = *in
|
||||
|
@ -1203,6 +1227,21 @@ func (in *EphemeralJobStatus) DeepCopy() *EphemeralJobStatus {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FailedImageStatus) DeepCopyInto(out *FailedImageStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailedImageStatus.
|
||||
func (in *FailedImageStatus) DeepCopy() *FailedImageStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(FailedImageStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *FailurePolicy) DeepCopyInto(out *FailurePolicy) {
|
||||
*out = *in
|
||||
|
@ -1218,6 +1257,120 @@ func (in *FailurePolicy) DeepCopy() *FailurePolicy {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImageListPullJob) DeepCopyInto(out *ImageListPullJob) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageListPullJob.
|
||||
func (in *ImageListPullJob) DeepCopy() *ImageListPullJob {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImageListPullJob)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ImageListPullJob) 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 *ImageListPullJobList) DeepCopyInto(out *ImageListPullJobList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ImageListPullJob, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageListPullJobList.
|
||||
func (in *ImageListPullJobList) DeepCopy() *ImageListPullJobList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImageListPullJobList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ImageListPullJobList) 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 *ImageListPullJobSpec) DeepCopyInto(out *ImageListPullJobSpec) {
|
||||
*out = *in
|
||||
if in.Images != nil {
|
||||
in, out := &in.Images, &out.Images
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
in.ImagePullJobTemplate.DeepCopyInto(&out.ImagePullJobTemplate)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageListPullJobSpec.
|
||||
func (in *ImageListPullJobSpec) DeepCopy() *ImageListPullJobSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImageListPullJobSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImageListPullJobStatus) DeepCopyInto(out *ImageListPullJobStatus) {
|
||||
*out = *in
|
||||
if in.StartTime != nil {
|
||||
in, out := &in.StartTime, &out.StartTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.CompletionTime != nil {
|
||||
in, out := &in.CompletionTime, &out.CompletionTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.FailedImageStatuses != nil {
|
||||
in, out := &in.FailedImageStatuses, &out.FailedImageStatuses
|
||||
*out = make([]*FailedImageStatus, len(*in))
|
||||
for i := range *in {
|
||||
if (*in)[i] != nil {
|
||||
in, out := &(*in)[i], &(*out)[i]
|
||||
*out = new(FailedImageStatus)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageListPullJobStatus.
|
||||
func (in *ImageListPullJobStatus) DeepCopy() *ImageListPullJobStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImageListPullJobStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImagePullJob) DeepCopyInto(out *ImagePullJob) {
|
||||
*out = *in
|
||||
|
@ -1317,32 +1470,7 @@ func (in *ImagePullJobPodSelector) DeepCopy() *ImagePullJobPodSelector {
|
|||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImagePullJobSpec) DeepCopyInto(out *ImagePullJobSpec) {
|
||||
*out = *in
|
||||
if in.PullSecrets != nil {
|
||||
in, out := &in.PullSecrets, &out.PullSecrets
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = new(ImagePullJobNodeSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodSelector != nil {
|
||||
in, out := &in.PodSelector, &out.PodSelector
|
||||
*out = new(ImagePullJobPodSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Parallelism != nil {
|
||||
in, out := &in.Parallelism, &out.Parallelism
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.PullPolicy != nil {
|
||||
in, out := &in.PullPolicy, &out.PullPolicy
|
||||
*out = new(PullPolicy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.CompletionPolicy.DeepCopyInto(&out.CompletionPolicy)
|
||||
in.ImagePullJobTemplate.DeepCopyInto(&out.ImagePullJobTemplate)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullJobSpec.
|
||||
|
@ -1383,6 +1511,52 @@ func (in *ImagePullJobStatus) DeepCopy() *ImagePullJobStatus {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImagePullJobTemplate) DeepCopyInto(out *ImagePullJobTemplate) {
|
||||
*out = *in
|
||||
if in.PullSecrets != nil {
|
||||
in, out := &in.PullSecrets, &out.PullSecrets
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = new(ImagePullJobNodeSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodSelector != nil {
|
||||
in, out := &in.PodSelector, &out.PodSelector
|
||||
*out = new(ImagePullJobPodSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Parallelism != nil {
|
||||
in, out := &in.Parallelism, &out.Parallelism
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.PullPolicy != nil {
|
||||
in, out := &in.PullPolicy, &out.PullPolicy
|
||||
*out = new(PullPolicy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
in.CompletionPolicy.DeepCopyInto(&out.CompletionPolicy)
|
||||
if in.SandboxConfig != nil {
|
||||
in, out := &in.SandboxConfig, &out.SandboxConfig
|
||||
*out = new(SandboxConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullJobTemplate.
|
||||
func (in *ImagePullJobTemplate) DeepCopy() *ImagePullJobTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImagePullJobTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImageSpec) DeepCopyInto(out *ImageSpec) {
|
||||
*out = *in
|
||||
|
@ -1398,6 +1572,11 @@ func (in *ImageSpec) DeepCopyInto(out *ImageSpec) {
|
|||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.SandboxConfig != nil {
|
||||
in, out := &in.SandboxConfig, &out.SandboxConfig
|
||||
*out = new(SandboxConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec.
|
||||
|
@ -1789,6 +1968,21 @@ func (in *NodeTopologyTerm) DeepCopy() *NodeTopologyTerm {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PersistentPodAnnotation) DeepCopyInto(out *PersistentPodAnnotation) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistentPodAnnotation.
|
||||
func (in *PersistentPodAnnotation) DeepCopy() *PersistentPodAnnotation {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PersistentPodAnnotation)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PersistentPodState) DeepCopyInto(out *PersistentPodState) {
|
||||
*out = *in
|
||||
|
@ -1852,6 +2046,11 @@ func (in *PersistentPodStateList) DeepCopyObject() runtime.Object {
|
|||
func (in *PersistentPodStateSpec) DeepCopyInto(out *PersistentPodStateSpec) {
|
||||
*out = *in
|
||||
out.TargetReference = in.TargetReference
|
||||
if in.PersistentPodAnnotations != nil {
|
||||
in, out := &in.PersistentPodAnnotations, &out.PersistentPodAnnotations
|
||||
*out = make([]PersistentPodAnnotation, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.RequiredPersistentTopology != nil {
|
||||
in, out := &in.RequiredPersistentTopology, &out.RequiredPersistentTopology
|
||||
*out = new(NodeTopologyTerm)
|
||||
|
@ -2076,6 +2275,13 @@ func (in *PodState) DeepCopyInto(out *PodState) {
|
|||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodState.
|
||||
|
@ -2455,6 +2661,35 @@ func (in *RollingUpdateStatefulSetStrategy) DeepCopy() *RollingUpdateStatefulSet
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SandboxConfig) DeepCopyInto(out *SandboxConfig) {
|
||||
*out = *in
|
||||
if in.Labels != nil {
|
||||
in, out := &in.Labels, &out.Labels
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
in, out := &in.Annotations, &out.Annotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SandboxConfig.
|
||||
func (in *SandboxConfig) DeepCopy() *SandboxConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SandboxConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ShareVolumePolicy) DeepCopyInto(out *ShareVolumePolicy) {
|
||||
*out = *in
|
||||
|
@ -2644,6 +2879,11 @@ func (in *SidecarSetSpec) DeepCopyInto(out *SidecarSetSpec) {
|
|||
*out = new(metav1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.NamespaceSelector != nil {
|
||||
in, out := &in.NamespaceSelector, &out.NamespaceSelector
|
||||
*out = new(metav1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.InitContainers != nil {
|
||||
in, out := &in.InitContainers, &out.InitContainers
|
||||
*out = make([]SidecarContainer, len(*in))
|
||||
|
@ -2734,6 +2974,11 @@ func (in *SidecarSetUpdateStrategy) DeepCopyInto(out *SidecarSetUpdateStrategy)
|
|||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.PriorityStrategy != nil {
|
||||
in, out := &in.PriorityStrategy, &out.PriorityStrategy
|
||||
*out = new(pub.UpdatePriorityStrategy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ScatterStrategy != nil {
|
||||
in, out := &in.ScatterStrategy, &out.ScatterStrategy
|
||||
*out = make(UpdateScatterStrategy, len(*in))
|
||||
|
@ -2949,6 +3194,17 @@ func (in *Subset) DeepCopyInto(out *Subset) {
|
|||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.MinReplicas != nil {
|
||||
in, out := &in.MinReplicas, &out.MinReplicas
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
if in.MaxReplicas != nil {
|
||||
in, out := &in.MaxReplicas, &out.MaxReplicas
|
||||
*out = new(intstr.IntOrString)
|
||||
**out = **in
|
||||
}
|
||||
in.Patch.DeepCopyInto(&out.Patch)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subset.
|
||||
|
@ -3012,6 +3268,31 @@ func (in *SyncStatus) DeepCopy() *SyncStatus {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetFilter) DeepCopyInto(out *TargetFilter) {
|
||||
*out = *in
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = new(metav1.LabelSelector)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ReplicasPathList != nil {
|
||||
in, out := &in.ReplicasPathList, &out.ReplicasPathList
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetFilter.
|
||||
func (in *TargetFilter) DeepCopy() *TargetFilter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetFilter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetReference) DeepCopyInto(out *TargetReference) {
|
||||
*out = *in
|
||||
|
@ -3037,6 +3318,7 @@ func (in *Topology) DeepCopyInto(out *Topology) {
|
|||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
in.ScheduleStrategy.DeepCopyInto(&out.ScheduleStrategy)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology.
|
||||
|
@ -3149,6 +3431,26 @@ func (in *UnitedDeploymentList) DeepCopyObject() runtime.Object {
|
|||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UnitedDeploymentScheduleStrategy) DeepCopyInto(out *UnitedDeploymentScheduleStrategy) {
|
||||
*out = *in
|
||||
if in.Adaptive != nil {
|
||||
in, out := &in.Adaptive, &out.Adaptive
|
||||
*out = new(AdaptiveUnitedDeploymentStrategy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnitedDeploymentScheduleStrategy.
|
||||
func (in *UnitedDeploymentScheduleStrategy) DeepCopy() *UnitedDeploymentScheduleStrategy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UnitedDeploymentScheduleStrategy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UnitedDeploymentSpec) DeepCopyInto(out *UnitedDeploymentSpec) {
|
||||
*out = *in
|
||||
|
@ -3197,6 +3499,13 @@ func (in *UnitedDeploymentStatus) DeepCopyInto(out *UnitedDeploymentStatus) {
|
|||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.SubsetStatuses != nil {
|
||||
in, out := &in.SubsetStatuses, &out.SubsetStatuses
|
||||
*out = make([]UnitedDeploymentSubsetStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]UnitedDeploymentCondition, len(*in))
|
||||
|
@ -3221,6 +3530,44 @@ func (in *UnitedDeploymentStatus) DeepCopy() *UnitedDeploymentStatus {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UnitedDeploymentSubsetCondition) DeepCopyInto(out *UnitedDeploymentSubsetCondition) {
|
||||
*out = *in
|
||||
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnitedDeploymentSubsetCondition.
|
||||
func (in *UnitedDeploymentSubsetCondition) DeepCopy() *UnitedDeploymentSubsetCondition {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UnitedDeploymentSubsetCondition)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UnitedDeploymentSubsetStatus) DeepCopyInto(out *UnitedDeploymentSubsetStatus) {
|
||||
*out = *in
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]UnitedDeploymentSubsetCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnitedDeploymentSubsetStatus.
|
||||
func (in *UnitedDeploymentSubsetStatus) DeepCopy() *UnitedDeploymentSubsetStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UnitedDeploymentSubsetStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UnitedDeploymentUpdateStrategy) DeepCopyInto(out *UnitedDeploymentUpdateStrategy) {
|
||||
*out = *in
|
||||
|
@ -3261,64 +3608,6 @@ func (in *UnorderedUpdateStrategy) DeepCopy() *UnorderedUpdateStrategy {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UpdatePriorityOrderTerm) DeepCopyInto(out *UpdatePriorityOrderTerm) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatePriorityOrderTerm.
|
||||
func (in *UpdatePriorityOrderTerm) DeepCopy() *UpdatePriorityOrderTerm {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UpdatePriorityOrderTerm)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UpdatePriorityStrategy) DeepCopyInto(out *UpdatePriorityStrategy) {
|
||||
*out = *in
|
||||
if in.OrderPriority != nil {
|
||||
in, out := &in.OrderPriority, &out.OrderPriority
|
||||
*out = make([]UpdatePriorityOrderTerm, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.WeightPriority != nil {
|
||||
in, out := &in.WeightPriority, &out.WeightPriority
|
||||
*out = make([]UpdatePriorityWeightTerm, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatePriorityStrategy.
|
||||
func (in *UpdatePriorityStrategy) DeepCopy() *UpdatePriorityStrategy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UpdatePriorityStrategy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *UpdatePriorityWeightTerm) DeepCopyInto(out *UpdatePriorityWeightTerm) {
|
||||
*out = *in
|
||||
in.MatchSelector.DeepCopyInto(&out.MatchSelector)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatePriorityWeightTerm.
|
||||
func (in *UpdatePriorityWeightTerm) DeepCopy() *UpdatePriorityWeightTerm {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(UpdatePriorityWeightTerm)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in UpdateScatterStrategy) DeepCopyInto(out *UpdateScatterStrategy) {
|
||||
{
|
||||
|
@ -3462,6 +3751,11 @@ func (in *WorkloadSpreadSpec) DeepCopyInto(out *WorkloadSpreadSpec) {
|
|||
*out = new(TargetReference)
|
||||
**out = **in
|
||||
}
|
||||
if in.TargetFilter != nil {
|
||||
in, out := &in.TargetFilter, &out.TargetFilter
|
||||
*out = new(TargetFilter)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Subsets != nil {
|
||||
in, out := &in.Subsets, &out.Subsets
|
||||
*out = make([]WorkloadSpreadSubset, len(*in))
|
||||
|
@ -3492,6 +3786,24 @@ func (in *WorkloadSpreadStatus) DeepCopyInto(out *WorkloadSpreadStatus) {
|
|||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.VersionedSubsetStatuses != nil {
|
||||
in, out := &in.VersionedSubsetStatuses, &out.VersionedSubsetStatuses
|
||||
*out = make(map[string][]WorkloadSpreadSubsetStatus, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal []WorkloadSpreadSubsetStatus
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
inVal := (*in)[key]
|
||||
in, out := &inVal, &outVal
|
||||
*out = make([]WorkloadSpreadSubsetStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
(*out)[key] = outVal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpreadStatus.
|
||||
|
|
|
@ -20,8 +20,8 @@ limitations under the License.
|
|||
package v1beta1
|
||||
|
||||
import (
|
||||
"github.com/openkruise/kruise-api/utils/scheme"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"github.com/openkruise/kruise-api/utils/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -0,0 +1,532 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2021 The Kruise 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 openapi-gen. DO NOT EDIT.
|
||||
|
||||
// This file was autogenerated by openapi-gen. Do not edit it manually!
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
common "k8s.io/kube-openapi/pkg/common"
|
||||
spec "k8s.io/kube-openapi/pkg/validation/spec"
|
||||
)
|
||||
|
||||
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
|
||||
return map[string]common.OpenAPIDefinition{
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.RollingUpdateStatefulSetStrategy": schema_kruise_apis_apps_v1beta1_RollingUpdateStatefulSetStrategy(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSet": schema_kruise_apis_apps_v1beta1_StatefulSet(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetList": schema_kruise_apis_apps_v1beta1_StatefulSetList(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetPersistentVolumeClaimRetentionPolicy": schema_kruise_apis_apps_v1beta1_StatefulSetPersistentVolumeClaimRetentionPolicy(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetScaleStrategy": schema_kruise_apis_apps_v1beta1_StatefulSetScaleStrategy(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetSpec": schema_kruise_apis_apps_v1beta1_StatefulSetSpec(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetStatus": schema_kruise_apis_apps_v1beta1_StatefulSetStatus(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetUpdateStrategy": schema_kruise_apis_apps_v1beta1_StatefulSetUpdateStrategy(ref),
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.UnorderedUpdateStrategy": schema_kruise_apis_apps_v1beta1_UnorderedUpdateStrategy(ref),
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_RollingUpdateStatefulSetStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"partition": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Partition indicates the ordinal at which the StatefulSet should be partitioned by default. But if unorderedUpdate has been set:\n - Partition indicates the number of pods with non-updated revisions when rolling update.\n - It means controller will update $(replicas - partition) number of pod.\nDefault value is 0.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"maxUnavailable": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy. Defaults to 1.",
|
||||
Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"),
|
||||
},
|
||||
},
|
||||
"podUpdatePolicy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodUpdatePolicy indicates how pods should be updated Default value is \"ReCreate\"",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"paused": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Paused indicates that the StatefulSet is paused. Default value is false",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"unorderedUpdate": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UnorderedUpdate contains strategies for non-ordered update. If it is not nil, pods will be updated with non-ordered sequence. Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.UnorderedUpdateStrategy"),
|
||||
},
|
||||
},
|
||||
"inPlaceUpdateStrategy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "InPlaceUpdateStrategy contains strategies for in-place update.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateStrategy"),
|
||||
},
|
||||
},
|
||||
"minReadySeconds": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "MinReadySeconds indicates how long will the pod be considered ready after it's updated. MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy. It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady. Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy. Default value is 0, max is 300.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.InPlaceUpdateStrategy", "github.com/openkruise/kruise-api/apps/v1beta1.UnorderedUpdateStrategy", "k8s.io/apimachinery/pkg/util/intstr.IntOrString"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSet(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSet is the Schema for the statefulsets API",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"kind": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"apiVersion": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
|
||||
},
|
||||
},
|
||||
"spec": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetSpec"),
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetStatus"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetSpec", "github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSetList(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSetList contains a list of StatefulSet",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"kind": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"apiVersion": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
|
||||
},
|
||||
},
|
||||
"items": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.StatefulSet"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"items"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.StatefulSet", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSetPersistentVolumeClaimRetentionPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the StatefulSet VolumeClaimTemplates.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"whenDeleted": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "WhenDeleted specifies what happens to PVCs created from StatefulSet VolumeClaimTemplates when the StatefulSet is deleted. The default policy of `Retain` causes PVCs to not be affected by StatefulSet deletion. The `Delete` policy causes those PVCs to be deleted.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"whenScaled": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "WhenScaled specifies what happens to PVCs created from StatefulSet VolumeClaimTemplates when the StatefulSet is scaled down. The default policy of `Retain` causes PVCs to not be affected by a scaledown. The `Delete` policy causes the associated PVCs for any excess pods above the replica count to be deleted.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSetScaleStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSetScaleStrategy defines strategies for pods scale.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"maxUnavailable": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "The maximum number of pods that can be unavailable during scaling. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. It can just be allowed to work with Parallel podManagementPolicy.",
|
||||
Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"k8s.io/apimachinery/pkg/util/intstr.IntOrString"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSetSpec defines the desired state of StatefulSet",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"replicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"selector": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors",
|
||||
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"),
|
||||
},
|
||||
},
|
||||
"template": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet.",
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"),
|
||||
},
|
||||
},
|
||||
"volumeClaimTemplates": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"serviceName": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"podManagementPolicy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"updateStrategy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.",
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetUpdateStrategy"),
|
||||
},
|
||||
},
|
||||
"revisionHistoryLimit": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"reserveOrdinals": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "reserveOrdinals controls the ordinal numbers that should be reserved, and the replicas will always be the expectation number of running Pods. For a sts with replicas=3 and its Pods in [0, 1, 2]: - If you want to migrate Pod-1 and reserve this ordinal, just set spec.reserveOrdinal to [1].\n Then controller will delete Pod-1 and create Pod-3 (existing Pods will be [0, 2, 3])\n- If you just want to delete Pod-1, you should set spec.reserveOrdinal to [1] and spec.replicas to 2.\n Then controller will delete Pod-1 (existing Pods will be [0, 2])",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"lifecycle": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Lifecycle defines the lifecycle hooks for Pods pre-delete, in-place update.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.Lifecycle"),
|
||||
},
|
||||
},
|
||||
"scaleStrategy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "scaleStrategy indicates the StatefulSetScaleStrategy that will be employed to scale Pods in the StatefulSet.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetScaleStrategy"),
|
||||
},
|
||||
},
|
||||
"persistentVolumeClaimRetentionPolicy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the StatefulSet VolumeClaimTemplates. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetPersistentVolumeClaimRetentionPolicy"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"selector", "template"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.Lifecycle", "github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetPersistentVolumeClaimRetentionPolicy", "github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetScaleStrategy", "github.com/openkruise/kruise-api/apps/v1beta1.StatefulSetUpdateStrategy", "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/api/core/v1.PodTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSetStatus defines the observed state of StatefulSet",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"observedGeneration": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet's generation, which is updated on mutation by the API Server.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int64",
|
||||
},
|
||||
},
|
||||
"replicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "replicas is the number of Pods created by the StatefulSet controller.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"readyReplicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"availableReplicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "AvailableReplicas is the number of Pods created by the StatefulSet controller that have been ready for minReadySeconds.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"currentReplicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"updatedReplicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.",
|
||||
Default: 0,
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"updatedReadyReplicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "updatedReadyReplicas is the number of updated Pods created by the StatefulSet controller that have a Ready Condition.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"updatedAvailableReplicas": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "updatedAvailableReplicas is the number of updated Pods created by the StatefulSet controller that have a Ready condition for atleast minReadySeconds.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"currentRevision": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"updateRevision": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"collisionCount": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"conditions": {
|
||||
VendorExtensible: spec.VendorExtensible{
|
||||
Extensions: spec.Extensions{
|
||||
"x-kubernetes-patch-merge-key": "type",
|
||||
"x-kubernetes-patch-strategy": "merge",
|
||||
},
|
||||
},
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Represents the latest available observations of a statefulset's current state.",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("k8s.io/api/apps/v1.StatefulSetCondition"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"labelSelector": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "LabelSelector is label selectors for query over pods that should match the replica count used by HPA.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"replicas", "readyReplicas", "availableReplicas", "currentReplicas", "updatedReplicas"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"k8s.io/api/apps/v1.StatefulSetCondition"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_StatefulSetUpdateStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"type": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"rollingUpdate": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/v1beta1.RollingUpdateStatefulSetStrategy"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/v1beta1.RollingUpdateStatefulSetStrategy"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_kruise_apis_apps_v1beta1_UnorderedUpdateStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "UnorderedUpdateStrategy defines strategies for non-ordered update.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"priorityStrategy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Priorities are the rules for calculating the priority of updating pods. Each pod to be updated, will pass through these terms and get a sum of weights.",
|
||||
Ref: ref("github.com/openkruise/kruise-api/apps/pub.UpdatePriorityStrategy"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/openkruise/kruise-api/apps/pub.UpdatePriorityStrategy"},
|
||||
}
|
||||
}
|
|
@ -29,6 +29,39 @@ const (
|
|||
MaxMinReadySeconds = 300
|
||||
)
|
||||
|
||||
// VolumeClaimUpdateStrategyType defines the update strategy types for volume claims.
|
||||
// It is an enumerated type that provides two different update strategies.
|
||||
// +enum
|
||||
type VolumeClaimUpdateStrategyType string
|
||||
|
||||
const (
|
||||
// OnPodRollingUpdateVolumeClaimUpdateStrategyType indicates that volume claim updates are triggered when associated Pods undergo rolling updates.
|
||||
// This strategy ensures that storage availability and integrity are maintained during the update process.
|
||||
OnPodRollingUpdateVolumeClaimUpdateStrategyType VolumeClaimUpdateStrategyType = "OnPodRollingUpdate"
|
||||
|
||||
// OnPVCDeleteVolumeClaimUpdateStrategyType indicates that updates are triggered when a Persistent Volume Claim (PVC) is deleted.
|
||||
// This strategy places full control of the update timing in the hands of the user, typically executed after ensuring data has been backed up or there are no data security concerns,
|
||||
// allowing for storage resource management that aligns with specific user requirements and security policies.
|
||||
OnPVCDeleteVolumeClaimUpdateStrategyType VolumeClaimUpdateStrategyType = "OnDelete"
|
||||
)
|
||||
|
||||
// VolumeClaimStatus describes the status of a volume claim template.
|
||||
// It provides details about the compatibility and readiness of the volume claim.
|
||||
type VolumeClaimStatus struct {
|
||||
// VolumeClaimName is the name of the volume claim.
|
||||
// This is a unique identifier used to reference a specific volume claim.
|
||||
VolumeClaimName string `json:"volumeClaimName"`
|
||||
// CompatibleReplicas is the number of replicas currently compatible with the volume claim.
|
||||
// It indicates how many replicas can function properly, being compatible with this volume claim.
|
||||
// Compatibility is determined by whether the PVC spec storage requests are greater than or equal to the template spec storage requests
|
||||
CompatibleReplicas int32 `json:"compatibleReplicas"`
|
||||
// CompatibleReadyReplicas is the number of replicas that are both ready and compatible with the volume claim.
|
||||
// It highlights that these replicas are not only compatible but also ready to be put into service immediately.
|
||||
// Compatibility is determined by whether the pvc spec storage requests are greater than or equal to the template spec storage requests
|
||||
// The "ready" status is determined by whether the PVC status capacity is greater than or equal to the PVC spec storage requests.
|
||||
CompatibleReadyReplicas int32 `json:"compatibleReadyReplicas"`
|
||||
}
|
||||
|
||||
// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet
|
||||
// controller will use to perform updates. It includes any additional parameters
|
||||
// necessary to perform the update for the indicated strategy.
|
||||
|
@ -42,11 +75,18 @@ type StatefulSetUpdateStrategy struct {
|
|||
RollingUpdate *RollingUpdateStatefulSetStrategy `json:"rollingUpdate,omitempty"`
|
||||
}
|
||||
|
||||
// VolumeClaimUpdateStrategy defines the strategy for updating volume claims.
|
||||
// This structure is used to control how updates to PersistentVolumeClaims are handled during pod rolling updates or PersistentVolumeClaim deletions.
|
||||
type VolumeClaimUpdateStrategy struct {
|
||||
// Type specifies the type of update strategy, possible values include:
|
||||
// OnPodRollingUpdateVolumeClaimUpdateStrategyType: Apply the update strategy during pod rolling updates.
|
||||
// OnPVCDeleteVolumeClaimUpdateStrategyType: Apply the update strategy when a PersistentVolumeClaim is deleted.
|
||||
Type VolumeClaimUpdateStrategyType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
|
||||
type RollingUpdateStatefulSetStrategy struct {
|
||||
// Partition indicates the ordinal at which the StatefulSet should be partitioned by default.
|
||||
// But if unorderedUpdate has been set:
|
||||
// - Partition indicates the number of pods with non-updated revisions when rolling update.
|
||||
// Partition indicates the number of pods the StatefulSet should be partitioned by default.
|
||||
// - It means controller will update $(replicas - partition) number of pod.
|
||||
// Default value is 0.
|
||||
// +optional
|
||||
|
@ -128,7 +168,7 @@ const (
|
|||
)
|
||||
|
||||
// StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs
|
||||
// created from the StatefulSet VolumeClaimTemplates.
|
||||
// created from the StatefulSet VolumeClaims.
|
||||
type StatefulSetPersistentVolumeClaimRetentionPolicy struct {
|
||||
// WhenDeleted specifies what happens to PVCs created from StatefulSet
|
||||
// VolumeClaimTemplates when the StatefulSet is deleted. The default policy
|
||||
|
@ -143,6 +183,21 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct {
|
|||
WhenScaled PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"`
|
||||
}
|
||||
|
||||
// StatefulSetOrdinals describes the policy used for replica ordinal assignment
|
||||
// in this StatefulSet.
|
||||
type StatefulSetOrdinals struct {
|
||||
// start is the number representing the first replica's index. It may be used
|
||||
// to number replicas from an alternate index (eg: 1-indexed) over the default
|
||||
// 0-indexed names, or to orchestrate progressive movement of replicas from
|
||||
// one StatefulSet to another.
|
||||
// If set, replica indices will be in the range:
|
||||
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
|
||||
// If unset, defaults to 0. Replica indices will be in the range:
|
||||
// [0, .spec.replicas).
|
||||
// +optional
|
||||
Start int32 `json:"start" protobuf:"varint,1,opt,name=start"`
|
||||
}
|
||||
|
||||
// StatefulSetSpec defines the desired state of StatefulSet
|
||||
type StatefulSetSpec struct {
|
||||
// replicas is the desired number of replicas of the given Template.
|
||||
|
@ -178,6 +233,11 @@ type StatefulSetSpec struct {
|
|||
// +kubebuilder:validation:Schemaless
|
||||
VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
|
||||
|
||||
// VolumeClaimUpdateStrategy specifies the strategy for updating VolumeClaimTemplates within a StatefulSet.
|
||||
// This field is currently only effective if the StatefulSetAutoResizePVCGate is enabled.
|
||||
// +optional
|
||||
VolumeClaimUpdateStrategy VolumeClaimUpdateStrategy `json:"volumeClaimUpdateStrategy,omitempty"`
|
||||
|
||||
// serviceName is the name of the service that governs this StatefulSet.
|
||||
// This service must exist before the StatefulSet, and is responsible for
|
||||
// the network identity of the set. Pods get DNS/hostnames that follow the
|
||||
|
@ -214,7 +274,8 @@ type StatefulSetSpec struct {
|
|||
// Then controller will delete Pod-1 and create Pod-3 (existing Pods will be [0, 2, 3])
|
||||
// - If you just want to delete Pod-1, you should set spec.reserveOrdinal to [1] and spec.replicas to 2.
|
||||
// Then controller will delete Pod-1 (existing Pods will be [0, 2])
|
||||
ReserveOrdinals []int `json:"reserveOrdinals,omitempty"`
|
||||
// You can also use ranges along with numbers, such as [1, 3-5], which is a shortcut for [1, 3, 4, 5].
|
||||
ReserveOrdinals []intstr.IntOrString `json:"reserveOrdinals,omitempty"`
|
||||
|
||||
// Lifecycle defines the lifecycle hooks for Pods pre-delete, in-place update.
|
||||
Lifecycle *appspub.Lifecycle `json:"lifecycle,omitempty"`
|
||||
|
@ -228,6 +289,14 @@ type StatefulSetSpec struct {
|
|||
// StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha.
|
||||
// +optional
|
||||
PersistentVolumeClaimRetentionPolicy *StatefulSetPersistentVolumeClaimRetentionPolicy `json:"persistentVolumeClaimRetentionPolicy,omitempty"`
|
||||
|
||||
// ordinals controls the numbering of replica indices in a StatefulSet. The
|
||||
// default ordinals behavior assigns a "0" index to the first replica and
|
||||
// increments the index by one for each additional replica requested. Using
|
||||
// the ordinals field requires the StatefulSetStartOrdinal feature gate to be
|
||||
// enabled, which is beta.
|
||||
// +optional
|
||||
Ordinals *StatefulSetOrdinals `json:"ordinals,omitempty"`
|
||||
}
|
||||
|
||||
// StatefulSetScaleStrategy defines strategies for pods scale.
|
||||
|
@ -267,6 +336,10 @@ type StatefulSetStatus struct {
|
|||
// updatedReadyReplicas is the number of updated Pods created by the StatefulSet controller that have a Ready Condition.
|
||||
UpdatedReadyReplicas int32 `json:"updatedReadyReplicas,omitempty"`
|
||||
|
||||
// updatedAvailableReplicas is the number of updated Pods created by the StatefulSet controller that have a Ready condition
|
||||
//for atleast minReadySeconds.
|
||||
UpdatedAvailableReplicas int32 `json:"updatedAvailableReplicas,omitempty"`
|
||||
|
||||
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
|
||||
// sequence [0,currentReplicas).
|
||||
CurrentRevision string `json:"currentRevision,omitempty"`
|
||||
|
@ -289,6 +362,12 @@ type StatefulSetStatus struct {
|
|||
|
||||
// LabelSelector is label selectors for query over pods that should match the replica count used by HPA.
|
||||
LabelSelector string `json:"labelSelector,omitempty"`
|
||||
|
||||
// VolumeClaims represents the status of compatibility between existing PVCs
|
||||
// and their respective templates. It tracks whether the PersistentVolumeClaims have been updated
|
||||
// to match any changes made to the volumeClaimTemplates, ensuring synchronization
|
||||
// between the defined templates and the actual PersistentVolumeClaims in use.
|
||||
VolumeClaims []VolumeClaimStatus `json:"volumeClaims,omitempty"`
|
||||
}
|
||||
|
||||
// These are valid conditions of a statefulset.
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2021 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -129,6 +128,21 @@ func (in *StatefulSetList) DeepCopyObject() runtime.Object {
|
|||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StatefulSetOrdinals) DeepCopyInto(out *StatefulSetOrdinals) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetOrdinals.
|
||||
func (in *StatefulSetOrdinals) DeepCopy() *StatefulSetOrdinals {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StatefulSetOrdinals)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StatefulSetPersistentVolumeClaimRetentionPolicy) DeepCopyInto(out *StatefulSetPersistentVolumeClaimRetentionPolicy) {
|
||||
*out = *in
|
||||
|
@ -185,6 +199,7 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
|
|||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
out.VolumeClaimUpdateStrategy = in.VolumeClaimUpdateStrategy
|
||||
in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy)
|
||||
if in.RevisionHistoryLimit != nil {
|
||||
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
|
||||
|
@ -193,7 +208,7 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
|
|||
}
|
||||
if in.ReserveOrdinals != nil {
|
||||
in, out := &in.ReserveOrdinals, &out.ReserveOrdinals
|
||||
*out = make([]int, len(*in))
|
||||
*out = make([]intstr.IntOrString, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Lifecycle != nil {
|
||||
|
@ -211,6 +226,11 @@ func (in *StatefulSetSpec) DeepCopyInto(out *StatefulSetSpec) {
|
|||
*out = new(StatefulSetPersistentVolumeClaimRetentionPolicy)
|
||||
**out = **in
|
||||
}
|
||||
if in.Ordinals != nil {
|
||||
in, out := &in.Ordinals, &out.Ordinals
|
||||
*out = new(StatefulSetOrdinals)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetSpec.
|
||||
|
@ -238,6 +258,11 @@ func (in *StatefulSetStatus) DeepCopyInto(out *StatefulSetStatus) {
|
|||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
if in.VolumeClaims != nil {
|
||||
in, out := &in.VolumeClaims, &out.VolumeClaims
|
||||
*out = make([]VolumeClaimStatus, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetStatus.
|
||||
|
@ -289,3 +314,33 @@ func (in *UnorderedUpdateStrategy) DeepCopy() *UnorderedUpdateStrategy {
|
|||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeClaimStatus) DeepCopyInto(out *VolumeClaimStatus) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeClaimStatus.
|
||||
func (in *VolumeClaimStatus) DeepCopy() *VolumeClaimStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeClaimStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *VolumeClaimUpdateStrategy) DeepCopyInto(out *VolumeClaimUpdateStrategy) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeClaimUpdateStrategy.
|
||||
func (in *VolumeClaimUpdateStrategy) DeepCopy() *VolumeClaimUpdateStrategy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(VolumeClaimUpdateStrategy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -20,11 +20,11 @@ package versioned
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
appsv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/apps/v1alpha1"
|
||||
appsv1beta1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/apps/v1beta1"
|
||||
policyv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/policy/v1alpha1"
|
||||
rolloutsv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/rollouts/v1alpha1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
|
@ -35,17 +35,14 @@ type Interface interface {
|
|||
AppsV1alpha1() appsv1alpha1.AppsV1alpha1Interface
|
||||
AppsV1beta1() appsv1beta1.AppsV1beta1Interface
|
||||
PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface
|
||||
RolloutsV1alpha1() rolloutsv1alpha1.RolloutsV1alpha1Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
// version included in a Clientset.
|
||||
// Clientset contains the clients for groups.
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
appsV1alpha1 *appsv1alpha1.AppsV1alpha1Client
|
||||
appsV1beta1 *appsv1beta1.AppsV1beta1Client
|
||||
policyV1alpha1 *policyv1alpha1.PolicyV1alpha1Client
|
||||
rolloutsV1alpha1 *rolloutsv1alpha1.RolloutsV1alpha1Client
|
||||
appsV1alpha1 *appsv1alpha1.AppsV1alpha1Client
|
||||
appsV1beta1 *appsv1beta1.AppsV1beta1Client
|
||||
policyV1alpha1 *policyv1alpha1.PolicyV1alpha1Client
|
||||
}
|
||||
|
||||
// AppsV1alpha1 retrieves the AppsV1alpha1Client
|
||||
|
@ -63,11 +60,6 @@ func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface {
|
|||
return c.policyV1alpha1
|
||||
}
|
||||
|
||||
// RolloutsV1alpha1 retrieves the RolloutsV1alpha1Client
|
||||
func (c *Clientset) RolloutsV1alpha1() rolloutsv1alpha1.RolloutsV1alpha1Interface {
|
||||
return c.rolloutsV1alpha1
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
|
@ -79,34 +71,53 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
|||
// NewForConfig creates a new Clientset for the given config.
|
||||
// If config's RateLimiter is not set and QPS and Burst are acceptable,
|
||||
// NewForConfig will generate a rate-limiter in configShallowCopy.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
|
||||
if configShallowCopy.UserAgent == "" {
|
||||
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
// share the transport between all clients
|
||||
httpClient, err := rest.HTTPClientFor(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
}
|
||||
|
||||
// NewForConfigAndClient creates a new Clientset for the given config and http client.
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
// If config's RateLimiter is not set and QPS and Burst are acceptable,
|
||||
// NewForConfigAndClient will generate a rate-limiter in configShallowCopy.
|
||||
func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
|
||||
if configShallowCopy.Burst <= 0 {
|
||||
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
|
||||
}
|
||||
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
|
||||
}
|
||||
|
||||
var cs Clientset
|
||||
var err error
|
||||
cs.appsV1alpha1, err = appsv1alpha1.NewForConfig(&configShallowCopy)
|
||||
cs.appsV1alpha1, err = appsv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.appsV1beta1, err = appsv1beta1.NewForConfig(&configShallowCopy)
|
||||
cs.appsV1beta1, err = appsv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.policyV1alpha1, err = policyv1alpha1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.rolloutsV1alpha1, err = rolloutsv1alpha1.NewForConfig(&configShallowCopy)
|
||||
cs.policyV1alpha1, err = policyv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -116,14 +127,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
|||
// NewForConfigOrDie creates a new Clientset for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
var cs Clientset
|
||||
cs.appsV1alpha1 = appsv1alpha1.NewForConfigOrDie(c)
|
||||
cs.appsV1beta1 = appsv1beta1.NewForConfigOrDie(c)
|
||||
cs.policyV1alpha1 = policyv1alpha1.NewForConfigOrDie(c)
|
||||
cs.rolloutsV1alpha1 = rolloutsv1alpha1.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
cs, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return cs
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
|
@ -132,7 +140,6 @@ func New(c rest.Interface) *Clientset {
|
|||
cs.appsV1alpha1 = appsv1alpha1.New(c)
|
||||
cs.appsV1beta1 = appsv1beta1.New(c)
|
||||
cs.policyV1alpha1 = policyv1alpha1.New(c)
|
||||
cs.rolloutsV1alpha1 = rolloutsv1alpha1.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise 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 clientset.
|
||||
package versioned
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -26,8 +26,6 @@ import (
|
|||
fakeappsv1beta1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/apps/v1beta1/fake"
|
||||
policyv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/policy/v1alpha1"
|
||||
fakepolicyv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/policy/v1alpha1/fake"
|
||||
rolloutsv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/rollouts/v1alpha1"
|
||||
fakerolloutsv1alpha1 "github.com/openkruise/kruise-api/client/clientset/versioned/typed/rollouts/v1alpha1/fake"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
|
@ -99,8 +97,3 @@ func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface {
|
|||
func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface {
|
||||
return &fakepolicyv1alpha1.FakePolicyV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// RolloutsV1alpha1 retrieves the RolloutsV1alpha1Client
|
||||
func (c *Clientset) RolloutsV1alpha1() rolloutsv1alpha1.RolloutsV1alpha1Interface {
|
||||
return &fakerolloutsv1alpha1.FakeRolloutsV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -22,7 +22,6 @@ import (
|
|||
appsv1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
appsv1beta1 "github.com/openkruise/kruise-api/apps/v1beta1"
|
||||
policyv1alpha1 "github.com/openkruise/kruise-api/policy/v1alpha1"
|
||||
rolloutsv1alpha1 "github.com/openkruise/kruise-api/rollouts/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
@ -37,20 +36,19 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
|||
appsv1alpha1.AddToScheme,
|
||||
appsv1beta1.AddToScheme,
|
||||
policyv1alpha1.AddToScheme,
|
||||
rolloutsv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -22,7 +22,6 @@ import (
|
|||
appsv1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
appsv1beta1 "github.com/openkruise/kruise-api/apps/v1beta1"
|
||||
policyv1alpha1 "github.com/openkruise/kruise-api/policy/v1alpha1"
|
||||
rolloutsv1alpha1 "github.com/openkruise/kruise-api/rollouts/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
@ -37,20 +36,19 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
|||
appsv1alpha1.AddToScheme,
|
||||
appsv1beta1.AddToScheme,
|
||||
policyv1alpha1.AddToScheme,
|
||||
rolloutsv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
"github.com/openkruise/kruise-api/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -32,6 +34,7 @@ type AppsV1alpha1Interface interface {
|
|||
ContainerRecreateRequestsGetter
|
||||
DaemonSetsGetter
|
||||
EphemeralJobsGetter
|
||||
ImageListPullJobsGetter
|
||||
ImagePullJobsGetter
|
||||
NodeImagesGetter
|
||||
NodePodProbesGetter
|
||||
|
@ -73,6 +76,10 @@ func (c *AppsV1alpha1Client) EphemeralJobs(namespace string) EphemeralJobInterfa
|
|||
return newEphemeralJobs(c, namespace)
|
||||
}
|
||||
|
||||
func (c *AppsV1alpha1Client) ImageListPullJobs(namespace string) ImageListPullJobInterface {
|
||||
return newImageListPullJobs(c, namespace)
|
||||
}
|
||||
|
||||
func (c *AppsV1alpha1Client) ImagePullJobs(namespace string) ImagePullJobInterface {
|
||||
return newImagePullJobs(c, namespace)
|
||||
}
|
||||
|
@ -114,12 +121,28 @@ func (c *AppsV1alpha1Client) WorkloadSpreads(namespace string) WorkloadSpreadInt
|
|||
}
|
||||
|
||||
// NewForConfig creates a new AppsV1alpha1Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*AppsV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewForConfigAndClient(&config, httpClient)
|
||||
}
|
||||
|
||||
// NewForConfigAndClient creates a new AppsV1alpha1Client 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) (*AppsV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeAdvancedCronJobs struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var advancedcronjobsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "advancedcronjobs"}
|
||||
var advancedcronjobsResource = v1alpha1.SchemeGroupVersion.WithResource("advancedcronjobs")
|
||||
|
||||
var advancedcronjobsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "AdvancedCronJob"}
|
||||
var advancedcronjobsKind = v1alpha1.SchemeGroupVersion.WithKind("AdvancedCronJob")
|
||||
|
||||
// Get takes name of the advancedCronJob, and returns the corresponding advancedCronJob object, and an error if there is any.
|
||||
func (c *FakeAdvancedCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AdvancedCronJob, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeAdvancedCronJobs) UpdateStatus(ctx context.Context, advancedCronJob
|
|||
// Delete takes name of the advancedCronJob and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeAdvancedCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(advancedcronjobsResource, c.ns, name), &v1alpha1.AdvancedCronJob{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(advancedcronjobsResource, c.ns, name, opts), &v1alpha1.AdvancedCronJob{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -52,6 +52,10 @@ func (c *FakeAppsV1alpha1) EphemeralJobs(namespace string) v1alpha1.EphemeralJob
|
|||
return &FakeEphemeralJobs{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1alpha1) ImageListPullJobs(namespace string) v1alpha1.ImageListPullJobInterface {
|
||||
return &FakeImageListPullJobs{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1alpha1) ImagePullJobs(namespace string) v1alpha1.ImagePullJobInterface {
|
||||
return &FakeImagePullJobs{c, namespace}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeBroadcastJobs struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var broadcastjobsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "broadcastjobs"}
|
||||
var broadcastjobsResource = v1alpha1.SchemeGroupVersion.WithResource("broadcastjobs")
|
||||
|
||||
var broadcastjobsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "BroadcastJob"}
|
||||
var broadcastjobsKind = v1alpha1.SchemeGroupVersion.WithKind("BroadcastJob")
|
||||
|
||||
// Get takes name of the broadcastJob, and returns the corresponding broadcastJob object, and an error if there is any.
|
||||
func (c *FakeBroadcastJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BroadcastJob, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeBroadcastJobs) UpdateStatus(ctx context.Context, broadcastJob *v1al
|
|||
// Delete takes name of the broadcastJob and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeBroadcastJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(broadcastjobsResource, c.ns, name), &v1alpha1.BroadcastJob{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(broadcastjobsResource, c.ns, name, opts), &v1alpha1.BroadcastJob{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -25,7 +25,6 @@ import (
|
|||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
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"
|
||||
|
@ -37,9 +36,9 @@ type FakeCloneSets struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var clonesetsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "clonesets"}
|
||||
var clonesetsResource = v1alpha1.SchemeGroupVersion.WithResource("clonesets")
|
||||
|
||||
var clonesetsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "CloneSet"}
|
||||
var clonesetsKind = v1alpha1.SchemeGroupVersion.WithKind("CloneSet")
|
||||
|
||||
// Get takes name of the cloneSet, and returns the corresponding cloneSet object, and an error if there is any.
|
||||
func (c *FakeCloneSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CloneSet, err error) {
|
||||
|
@ -118,7 +117,7 @@ func (c *FakeCloneSets) UpdateStatus(ctx context.Context, cloneSet *v1alpha1.Clo
|
|||
// Delete takes name of the cloneSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeCloneSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(clonesetsResource, c.ns, name), &v1alpha1.CloneSet{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clonesetsResource, c.ns, name, opts), &v1alpha1.CloneSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeContainerRecreateRequests struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var containerrecreaterequestsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "containerrecreaterequests"}
|
||||
var containerrecreaterequestsResource = v1alpha1.SchemeGroupVersion.WithResource("containerrecreaterequests")
|
||||
|
||||
var containerrecreaterequestsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "ContainerRecreateRequest"}
|
||||
var containerrecreaterequestsKind = v1alpha1.SchemeGroupVersion.WithKind("ContainerRecreateRequest")
|
||||
|
||||
// Get takes name of the containerRecreateRequest, and returns the corresponding containerRecreateRequest object, and an error if there is any.
|
||||
func (c *FakeContainerRecreateRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ContainerRecreateRequest, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeContainerRecreateRequests) UpdateStatus(ctx context.Context, contai
|
|||
// Delete takes name of the containerRecreateRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeContainerRecreateRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(containerrecreaterequestsResource, c.ns, name), &v1alpha1.ContainerRecreateRequest{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(containerrecreaterequestsResource, c.ns, name, opts), &v1alpha1.ContainerRecreateRequest{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeDaemonSets struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var daemonsetsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "daemonsets"}
|
||||
var daemonsetsResource = v1alpha1.SchemeGroupVersion.WithResource("daemonsets")
|
||||
|
||||
var daemonsetsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "DaemonSet"}
|
||||
var daemonsetsKind = v1alpha1.SchemeGroupVersion.WithKind("DaemonSet")
|
||||
|
||||
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
|
||||
func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.DaemonSet, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1alpha1.D
|
|||
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &v1alpha1.DaemonSet{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1alpha1.DaemonSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeEphemeralJobs struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var ephemeraljobsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "ephemeraljobs"}
|
||||
var ephemeraljobsResource = v1alpha1.SchemeGroupVersion.WithResource("ephemeraljobs")
|
||||
|
||||
var ephemeraljobsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "EphemeralJob"}
|
||||
var ephemeraljobsKind = v1alpha1.SchemeGroupVersion.WithKind("EphemeralJob")
|
||||
|
||||
// Get takes name of the ephemeralJob, and returns the corresponding ephemeralJob object, and an error if there is any.
|
||||
func (c *FakeEphemeralJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EphemeralJob, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeEphemeralJobs) UpdateStatus(ctx context.Context, ephemeralJob *v1al
|
|||
// Delete takes name of the ephemeralJob and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeEphemeralJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(ephemeraljobsResource, c.ns, name), &v1alpha1.EphemeralJob{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(ephemeraljobsResource, c.ns, name, opts), &v1alpha1.EphemeralJob{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
Copyright 2024 The Kruise 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"
|
||||
|
||||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeImageListPullJobs implements ImageListPullJobInterface
|
||||
type FakeImageListPullJobs struct {
|
||||
Fake *FakeAppsV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var imagelistpulljobsResource = v1alpha1.SchemeGroupVersion.WithResource("imagelistpulljobs")
|
||||
|
||||
var imagelistpulljobsKind = v1alpha1.SchemeGroupVersion.WithKind("ImageListPullJob")
|
||||
|
||||
// Get takes name of the imageListPullJob, and returns the corresponding imageListPullJob object, and an error if there is any.
|
||||
func (c *FakeImageListPullJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(imagelistpulljobsResource, c.ns, name), &v1alpha1.ImageListPullJob{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ImageListPullJob), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ImageListPullJobs that match those selectors.
|
||||
func (c *FakeImageListPullJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ImageListPullJobList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(imagelistpulljobsResource, imagelistpulljobsKind, c.ns, opts), &v1alpha1.ImageListPullJobList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.ImageListPullJobList{ListMeta: obj.(*v1alpha1.ImageListPullJobList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.ImageListPullJobList).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 imageListPullJobs.
|
||||
func (c *FakeImageListPullJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(imagelistpulljobsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a imageListPullJob and creates it. Returns the server's representation of the imageListPullJob, and an error, if there is any.
|
||||
func (c *FakeImageListPullJobs) Create(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.CreateOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(imagelistpulljobsResource, c.ns, imageListPullJob), &v1alpha1.ImageListPullJob{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ImageListPullJob), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a imageListPullJob and updates it. Returns the server's representation of the imageListPullJob, and an error, if there is any.
|
||||
func (c *FakeImageListPullJobs) Update(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.UpdateOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(imagelistpulljobsResource, c.ns, imageListPullJob), &v1alpha1.ImageListPullJob{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ImageListPullJob), 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 *FakeImageListPullJobs) UpdateStatus(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.UpdateOptions) (*v1alpha1.ImageListPullJob, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(imagelistpulljobsResource, "status", c.ns, imageListPullJob), &v1alpha1.ImageListPullJob{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ImageListPullJob), err
|
||||
}
|
||||
|
||||
// Delete takes name of the imageListPullJob and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeImageListPullJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(imagelistpulljobsResource, c.ns, name, opts), &v1alpha1.ImageListPullJob{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeImageListPullJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(imagelistpulljobsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.ImageListPullJobList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched imageListPullJob.
|
||||
func (c *FakeImageListPullJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(imagelistpulljobsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ImageListPullJob{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ImageListPullJob), err
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeImagePullJobs struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var imagepulljobsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "imagepulljobs"}
|
||||
var imagepulljobsResource = v1alpha1.SchemeGroupVersion.WithResource("imagepulljobs")
|
||||
|
||||
var imagepulljobsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "ImagePullJob"}
|
||||
var imagepulljobsKind = v1alpha1.SchemeGroupVersion.WithKind("ImagePullJob")
|
||||
|
||||
// Get takes name of the imagePullJob, and returns the corresponding imagePullJob object, and an error if there is any.
|
||||
func (c *FakeImagePullJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ImagePullJob, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeImagePullJobs) UpdateStatus(ctx context.Context, imagePullJob *v1al
|
|||
// Delete takes name of the imagePullJob and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeImagePullJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(imagepulljobsResource, c.ns, name), &v1alpha1.ImagePullJob{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(imagepulljobsResource, c.ns, name, opts), &v1alpha1.ImagePullJob{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -35,9 +34,9 @@ type FakeNodeImages struct {
|
|||
Fake *FakeAppsV1alpha1
|
||||
}
|
||||
|
||||
var nodeimagesResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "nodeimages"}
|
||||
var nodeimagesResource = v1alpha1.SchemeGroupVersion.WithResource("nodeimages")
|
||||
|
||||
var nodeimagesKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "NodeImage"}
|
||||
var nodeimagesKind = v1alpha1.SchemeGroupVersion.WithKind("NodeImage")
|
||||
|
||||
// Get takes name of the nodeImage, and returns the corresponding nodeImage object, and an error if there is any.
|
||||
func (c *FakeNodeImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeImage, err error) {
|
||||
|
@ -110,7 +109,7 @@ func (c *FakeNodeImages) UpdateStatus(ctx context.Context, nodeImage *v1alpha1.N
|
|||
// Delete takes name of the nodeImage and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeNodeImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(nodeimagesResource, name), &v1alpha1.NodeImage{})
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(nodeimagesResource, name, opts), &v1alpha1.NodeImage{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -35,9 +34,9 @@ type FakeNodePodProbes struct {
|
|||
Fake *FakeAppsV1alpha1
|
||||
}
|
||||
|
||||
var nodepodprobesResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "nodepodprobes"}
|
||||
var nodepodprobesResource = v1alpha1.SchemeGroupVersion.WithResource("nodepodprobes")
|
||||
|
||||
var nodepodprobesKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "NodePodProbe"}
|
||||
var nodepodprobesKind = v1alpha1.SchemeGroupVersion.WithKind("NodePodProbe")
|
||||
|
||||
// Get takes name of the nodePodProbe, and returns the corresponding nodePodProbe object, and an error if there is any.
|
||||
func (c *FakeNodePodProbes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodePodProbe, err error) {
|
||||
|
@ -110,7 +109,7 @@ func (c *FakeNodePodProbes) UpdateStatus(ctx context.Context, nodePodProbe *v1al
|
|||
// Delete takes name of the nodePodProbe and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeNodePodProbes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(nodepodprobesResource, name), &v1alpha1.NodePodProbe{})
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(nodepodprobesResource, name, opts), &v1alpha1.NodePodProbe{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakePersistentPodStates struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var persistentpodstatesResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "persistentpodstates"}
|
||||
var persistentpodstatesResource = v1alpha1.SchemeGroupVersion.WithResource("persistentpodstates")
|
||||
|
||||
var persistentpodstatesKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "PersistentPodState"}
|
||||
var persistentpodstatesKind = v1alpha1.SchemeGroupVersion.WithKind("PersistentPodState")
|
||||
|
||||
// Get takes name of the persistentPodState, and returns the corresponding persistentPodState object, and an error if there is any.
|
||||
func (c *FakePersistentPodStates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PersistentPodState, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakePersistentPodStates) UpdateStatus(ctx context.Context, persistentPo
|
|||
// Delete takes name of the persistentPodState and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePersistentPodStates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(persistentpodstatesResource, c.ns, name), &v1alpha1.PersistentPodState{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(persistentpodstatesResource, c.ns, name, opts), &v1alpha1.PersistentPodState{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakePodProbeMarkers struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var podprobemarkersResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "podprobemarkers"}
|
||||
var podprobemarkersResource = v1alpha1.SchemeGroupVersion.WithResource("podprobemarkers")
|
||||
|
||||
var podprobemarkersKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "PodProbeMarker"}
|
||||
var podprobemarkersKind = v1alpha1.SchemeGroupVersion.WithKind("PodProbeMarker")
|
||||
|
||||
// Get takes name of the podProbeMarker, and returns the corresponding podProbeMarker object, and an error if there is any.
|
||||
func (c *FakePodProbeMarkers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PodProbeMarker, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakePodProbeMarkers) UpdateStatus(ctx context.Context, podProbeMarker *
|
|||
// Delete takes name of the podProbeMarker and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePodProbeMarkers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(podprobemarkersResource, c.ns, name), &v1alpha1.PodProbeMarker{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(podprobemarkersResource, c.ns, name, opts), &v1alpha1.PodProbeMarker{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -35,9 +34,9 @@ type FakeResourceDistributions struct {
|
|||
Fake *FakeAppsV1alpha1
|
||||
}
|
||||
|
||||
var resourcedistributionsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "resourcedistributions"}
|
||||
var resourcedistributionsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcedistributions")
|
||||
|
||||
var resourcedistributionsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "ResourceDistribution"}
|
||||
var resourcedistributionsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceDistribution")
|
||||
|
||||
// Get takes name of the resourceDistribution, and returns the corresponding resourceDistribution object, and an error if there is any.
|
||||
func (c *FakeResourceDistributions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceDistribution, err error) {
|
||||
|
@ -110,7 +109,7 @@ func (c *FakeResourceDistributions) UpdateStatus(ctx context.Context, resourceDi
|
|||
// Delete takes name of the resourceDistribution and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeResourceDistributions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(resourcedistributionsResource, name), &v1alpha1.ResourceDistribution{})
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(resourcedistributionsResource, name, opts), &v1alpha1.ResourceDistribution{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -35,9 +34,9 @@ type FakeSidecarSets struct {
|
|||
Fake *FakeAppsV1alpha1
|
||||
}
|
||||
|
||||
var sidecarsetsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "sidecarsets"}
|
||||
var sidecarsetsResource = v1alpha1.SchemeGroupVersion.WithResource("sidecarsets")
|
||||
|
||||
var sidecarsetsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "SidecarSet"}
|
||||
var sidecarsetsKind = v1alpha1.SchemeGroupVersion.WithKind("SidecarSet")
|
||||
|
||||
// Get takes name of the sidecarSet, and returns the corresponding sidecarSet object, and an error if there is any.
|
||||
func (c *FakeSidecarSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.SidecarSet, err error) {
|
||||
|
@ -110,7 +109,7 @@ func (c *FakeSidecarSets) UpdateStatus(ctx context.Context, sidecarSet *v1alpha1
|
|||
// Delete takes name of the sidecarSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeSidecarSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(sidecarsetsResource, name), &v1alpha1.SidecarSet{})
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(sidecarsetsResource, name, opts), &v1alpha1.SidecarSet{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -25,7 +25,6 @@ import (
|
|||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
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"
|
||||
|
@ -37,9 +36,9 @@ type FakeStatefulSets struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var statefulsetsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "statefulsets"}
|
||||
var statefulsetsResource = v1alpha1.SchemeGroupVersion.WithResource("statefulsets")
|
||||
|
||||
var statefulsetsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "StatefulSet"}
|
||||
var statefulsetsKind = v1alpha1.SchemeGroupVersion.WithKind("StatefulSet")
|
||||
|
||||
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
|
||||
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StatefulSet, err error) {
|
||||
|
@ -118,7 +117,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1alph
|
|||
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1alpha1.StatefulSet{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1alpha1.StatefulSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -25,7 +25,6 @@ import (
|
|||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
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"
|
||||
|
@ -37,9 +36,9 @@ type FakeUnitedDeployments struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var uniteddeploymentsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "uniteddeployments"}
|
||||
var uniteddeploymentsResource = v1alpha1.SchemeGroupVersion.WithResource("uniteddeployments")
|
||||
|
||||
var uniteddeploymentsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "UnitedDeployment"}
|
||||
var uniteddeploymentsKind = v1alpha1.SchemeGroupVersion.WithKind("UnitedDeployment")
|
||||
|
||||
// Get takes name of the unitedDeployment, and returns the corresponding unitedDeployment object, and an error if there is any.
|
||||
func (c *FakeUnitedDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.UnitedDeployment, err error) {
|
||||
|
@ -118,7 +117,7 @@ func (c *FakeUnitedDeployments) UpdateStatus(ctx context.Context, unitedDeployme
|
|||
// Delete takes name of the unitedDeployment and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeUnitedDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(uniteddeploymentsResource, c.ns, name), &v1alpha1.UnitedDeployment{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(uniteddeploymentsResource, c.ns, name, opts), &v1alpha1.UnitedDeployment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakeWorkloadSpreads struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var workloadspreadsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1alpha1", Resource: "workloadspreads"}
|
||||
var workloadspreadsResource = v1alpha1.SchemeGroupVersion.WithResource("workloadspreads")
|
||||
|
||||
var workloadspreadsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1alpha1", Kind: "WorkloadSpread"}
|
||||
var workloadspreadsKind = v1alpha1.SchemeGroupVersion.WithKind("WorkloadSpread")
|
||||
|
||||
// Get takes name of the workloadSpread, and returns the corresponding workloadSpread object, and an error if there is any.
|
||||
func (c *FakeWorkloadSpreads) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.WorkloadSpread, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakeWorkloadSpreads) UpdateStatus(ctx context.Context, workloadSpread *
|
|||
// Delete takes name of the workloadSpread and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeWorkloadSpreads) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(workloadspreadsResource, c.ns, name), &v1alpha1.WorkloadSpread{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(workloadspreadsResource, c.ns, name, opts), &v1alpha1.WorkloadSpread{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -30,6 +30,8 @@ type DaemonSetExpansion interface{}
|
|||
|
||||
type EphemeralJobExpansion interface{}
|
||||
|
||||
type ImageListPullJobExpansion interface{}
|
||||
|
||||
type ImagePullJobExpansion interface{}
|
||||
|
||||
type NodeImageExpansion interface{}
|
||||
|
|
|
@ -0,0 +1,195 @@
|
|||
/*
|
||||
Copyright 2024 The Kruise 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"
|
||||
|
||||
v1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
|
||||
scheme "github.com/openkruise/kruise-api/client/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// ImageListPullJobsGetter has a method to return a ImageListPullJobInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ImageListPullJobsGetter interface {
|
||||
ImageListPullJobs(namespace string) ImageListPullJobInterface
|
||||
}
|
||||
|
||||
// ImageListPullJobInterface has methods to work with ImageListPullJob resources.
|
||||
type ImageListPullJobInterface interface {
|
||||
Create(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.CreateOptions) (*v1alpha1.ImageListPullJob, error)
|
||||
Update(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.UpdateOptions) (*v1alpha1.ImageListPullJob, error)
|
||||
UpdateStatus(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.UpdateOptions) (*v1alpha1.ImageListPullJob, 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.ImageListPullJob, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ImageListPullJobList, 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.ImageListPullJob, err error)
|
||||
ImageListPullJobExpansion
|
||||
}
|
||||
|
||||
// imageListPullJobs implements ImageListPullJobInterface
|
||||
type imageListPullJobs struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newImageListPullJobs returns a ImageListPullJobs
|
||||
func newImageListPullJobs(c *AppsV1alpha1Client, namespace string) *imageListPullJobs {
|
||||
return &imageListPullJobs{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the imageListPullJob, and returns the corresponding imageListPullJob object, and an error if there is any.
|
||||
func (c *imageListPullJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
result = &v1alpha1.ImageListPullJob{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ImageListPullJobs that match those selectors.
|
||||
func (c *imageListPullJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ImageListPullJobList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.ImageListPullJobList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested imageListPullJobs.
|
||||
func (c *imageListPullJobs) 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("imagelistpulljobs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a imageListPullJob and creates it. Returns the server's representation of the imageListPullJob, and an error, if there is any.
|
||||
func (c *imageListPullJobs) Create(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.CreateOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
result = &v1alpha1.ImageListPullJob{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(imageListPullJob).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a imageListPullJob and updates it. Returns the server's representation of the imageListPullJob, and an error, if there is any.
|
||||
func (c *imageListPullJobs) Update(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.UpdateOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
result = &v1alpha1.ImageListPullJob{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
Name(imageListPullJob.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(imageListPullJob).
|
||||
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 *imageListPullJobs) UpdateStatus(ctx context.Context, imageListPullJob *v1alpha1.ImageListPullJob, opts v1.UpdateOptions) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
result = &v1alpha1.ImageListPullJob{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
Name(imageListPullJob.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(imageListPullJob).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the imageListPullJob and deletes it. Returns an error if one occurs.
|
||||
func (c *imageListPullJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *imageListPullJobs) 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("imagelistpulljobs").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched imageListPullJob.
|
||||
func (c *imageListPullJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ImageListPullJob, err error) {
|
||||
result = &v1alpha1.ImageListPullJob{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("imagelistpulljobs").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1beta1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
v1beta1 "github.com/openkruise/kruise-api/apps/v1beta1"
|
||||
"github.com/openkruise/kruise-api/client/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -39,12 +41,28 @@ func (c *AppsV1beta1Client) StatefulSets(namespace string) StatefulSetInterface
|
|||
}
|
||||
|
||||
// NewForConfig creates a new AppsV1beta1Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewForConfigAndClient(&config, httpClient)
|
||||
}
|
||||
|
||||
// NewForConfigAndClient creates a new AppsV1beta1Client 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) (*AppsV1beta1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -25,7 +25,6 @@ import (
|
|||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
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"
|
||||
|
@ -37,9 +36,9 @@ type FakeStatefulSets struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var statefulsetsResource = schema.GroupVersionResource{Group: "apps.kruise.io", Version: "v1beta1", Resource: "statefulsets"}
|
||||
var statefulsetsResource = v1beta1.SchemeGroupVersion.WithResource("statefulsets")
|
||||
|
||||
var statefulsetsKind = schema.GroupVersionKind{Group: "apps.kruise.io", Version: "v1beta1", Kind: "StatefulSet"}
|
||||
var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet")
|
||||
|
||||
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
|
||||
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
|
@ -118,7 +117,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta
|
|||
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta1.StatefulSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -24,7 +24,6 @@ import (
|
|||
v1alpha1 "github.com/openkruise/kruise-api/policy/v1alpha1"
|
||||
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"
|
||||
|
@ -36,9 +35,9 @@ type FakePodUnavailableBudgets struct {
|
|||
ns string
|
||||
}
|
||||
|
||||
var podunavailablebudgetsResource = schema.GroupVersionResource{Group: "policy.kruise.io", Version: "v1alpha1", Resource: "podunavailablebudgets"}
|
||||
var podunavailablebudgetsResource = v1alpha1.SchemeGroupVersion.WithResource("podunavailablebudgets")
|
||||
|
||||
var podunavailablebudgetsKind = schema.GroupVersionKind{Group: "policy.kruise.io", Version: "v1alpha1", Kind: "PodUnavailableBudget"}
|
||||
var podunavailablebudgetsKind = v1alpha1.SchemeGroupVersion.WithKind("PodUnavailableBudget")
|
||||
|
||||
// Get takes name of the podUnavailableBudget, and returns the corresponding podUnavailableBudget object, and an error if there is any.
|
||||
func (c *FakePodUnavailableBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PodUnavailableBudget, err error) {
|
||||
|
@ -117,7 +116,7 @@ func (c *FakePodUnavailableBudgets) UpdateStatus(ctx context.Context, podUnavail
|
|||
// Delete takes name of the podUnavailableBudget and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePodUnavailableBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(podunavailablebudgetsResource, c.ns, name), &v1alpha1.PodUnavailableBudget{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(podunavailablebudgetsResource, c.ns, name, opts), &v1alpha1.PodUnavailableBudget{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise Authors.
|
||||
Copyright 2024 The Kruise Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/openkruise/kruise-api/client/clientset/versioned/scheme"
|
||||
v1alpha1 "github.com/openkruise/kruise-api/policy/v1alpha1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -39,12 +41,28 @@ func (c *PolicyV1alpha1Client) PodUnavailableBudgets(namespace string) PodUnavai
|
|||
}
|
||||
|
||||
// NewForConfig creates a new PolicyV1alpha1Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*PolicyV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewForConfigAndClient(&config, httpClient)
|
||||
}
|
||||
|
||||
// NewForConfigAndClient creates a new PolicyV1alpha1Client 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) (*PolicyV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -1,195 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise 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"
|
||||
|
||||
scheme "github.com/openkruise/kruise-api/client/clientset/versioned/scheme"
|
||||
v1alpha1 "github.com/openkruise/kruise-api/rollouts/v1alpha1"
|
||||
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"
|
||||
)
|
||||
|
||||
// BatchReleasesGetter has a method to return a BatchReleaseInterface.
|
||||
// A group's client should implement this interface.
|
||||
type BatchReleasesGetter interface {
|
||||
BatchReleases(namespace string) BatchReleaseInterface
|
||||
}
|
||||
|
||||
// BatchReleaseInterface has methods to work with BatchRelease resources.
|
||||
type BatchReleaseInterface interface {
|
||||
Create(ctx context.Context, batchRelease *v1alpha1.BatchRelease, opts v1.CreateOptions) (*v1alpha1.BatchRelease, error)
|
||||
Update(ctx context.Context, batchRelease *v1alpha1.BatchRelease, opts v1.UpdateOptions) (*v1alpha1.BatchRelease, error)
|
||||
UpdateStatus(ctx context.Context, batchRelease *v1alpha1.BatchRelease, opts v1.UpdateOptions) (*v1alpha1.BatchRelease, 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.BatchRelease, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BatchReleaseList, 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.BatchRelease, err error)
|
||||
BatchReleaseExpansion
|
||||
}
|
||||
|
||||
// batchReleases implements BatchReleaseInterface
|
||||
type batchReleases struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newBatchReleases returns a BatchReleases
|
||||
func newBatchReleases(c *RolloutsV1alpha1Client, namespace string) *batchReleases {
|
||||
return &batchReleases{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the batchRelease, and returns the corresponding batchRelease object, and an error if there is any.
|
||||
func (c *batchReleases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BatchRelease, err error) {
|
||||
result = &v1alpha1.BatchRelease{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of BatchReleases that match those selectors.
|
||||
func (c *batchReleases) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BatchReleaseList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.BatchReleaseList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested batchReleases.
|
||||
func (c *batchReleases) 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("batchreleases").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a batchRelease and creates it. Returns the server's representation of the batchRelease, and an error, if there is any.
|
||||
func (c *batchReleases) Create(ctx context.Context, batchRelease *v1alpha1.BatchRelease, opts v1.CreateOptions) (result *v1alpha1.BatchRelease, err error) {
|
||||
result = &v1alpha1.BatchRelease{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(batchRelease).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a batchRelease and updates it. Returns the server's representation of the batchRelease, and an error, if there is any.
|
||||
func (c *batchReleases) Update(ctx context.Context, batchRelease *v1alpha1.BatchRelease, opts v1.UpdateOptions) (result *v1alpha1.BatchRelease, err error) {
|
||||
result = &v1alpha1.BatchRelease{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
Name(batchRelease.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(batchRelease).
|
||||
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 *batchReleases) UpdateStatus(ctx context.Context, batchRelease *v1alpha1.BatchRelease, opts v1.UpdateOptions) (result *v1alpha1.BatchRelease, err error) {
|
||||
result = &v1alpha1.BatchRelease{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
Name(batchRelease.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(batchRelease).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the batchRelease and deletes it. Returns an error if one occurs.
|
||||
func (c *batchReleases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *batchReleases) 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("batchreleases").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched batchRelease.
|
||||
func (c *batchReleases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BatchRelease, err error) {
|
||||
result = &v1alpha1.BatchRelease{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("batchreleases").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
Copyright 2022 The Kruise 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
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue