diff --git a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml index f008832..25cc6f5 100644 --- a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml +++ b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml @@ -4660,6 +4660,10 @@ spec: description: WorkloadDetails contains release details for each workload items: properties: + availableReplicas: + description: AvailableReplicas is the number of service available pods targeted by workload. + format: int32 + type: integer cluster: description: Cluster defines which cluster the workload is in. type: string @@ -4697,6 +4701,7 @@ spec: description: UpdatedRevision is the updated template revision used to generate pods. type: string required: + - availableReplicas - replicas - updatedAvailableReplicas - updatedReadyReplicas @@ -4758,6 +4763,10 @@ spec: description: WorkloadDetails contains release details for each workload items: properties: + availableReplicas: + description: AvailableReplicas is the number of service available pods targeted by workload. + format: int32 + type: integer cluster: description: Cluster defines which cluster the workload is in. type: string @@ -4795,6 +4804,7 @@ spec: description: UpdatedRevision is the updated template revision used to generate pods. type: string required: + - availableReplicas - replicas - updatedAvailableReplicas - updatedReadyReplicas @@ -4892,6 +4902,10 @@ spec: description: TargetStatuses describes the referenced workloads status items: properties: + availableReplicas: + description: AvailableReplicas is the number of service available pods targeted by workload. + format: int32 + type: integer cluster: description: Cluster defines which cluster the workload is in. type: string @@ -4929,6 +4943,7 @@ spec: description: UpdatedRevision is the updated template revision used to generate pods. type: string required: + - availableReplicas - replicas - updatedAvailableReplicas - updatedReadyReplicas diff --git a/config/crd/rollout/rollout.kusionstack.io_scaleruns.yaml b/config/crd/rollout/rollout.kusionstack.io_scaleruns.yaml new file mode 100644 index 0000000..2b8b3ab --- /dev/null +++ b/config/crd/rollout/rollout.kusionstack.io_scaleruns.yaml @@ -0,0 +1,555 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.15.0 + name: scaleruns.rollout.kusionstack.io +spec: + group: rollout.kusionstack.io + names: + kind: ScaleRun + listKind: ScaleRunList + plural: scaleruns + shortNames: + - scr + singular: scalerun + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.phase + name: Phase + type: string + - jsonPath: .status.batchStatus.currentBatchIndex + name: Batch Index + type: string + - jsonPath: .status.batchStatus.currentBatchState + name: Batch State + type: string + - jsonPath: .status.error.code + name: Error + type: string + - format: date-time + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + 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 + kind: + 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 + metadata: + type: object + spec: + properties: + batch: + description: Scale Batch Strategy + properties: + batches: + description: Batches define the order of phases to execute scale + in batch + items: + properties: + breakpoint: + description: If set to true, the scale will be paused before + the step starts. + type: boolean + properties: + additionalProperties: + type: string + description: Properties contains additional information + for step + type: object + targets: + description: desired target replicas + items: + description: ScaleRunStepTarget defines the target resource + of scale + properties: + cluster: + description: Cluster indicates the name of cluster + type: string + name: + description: Name is the resource name + type: string + replicas: + description: Replicas is the replicas of the scale + task, which represents the replicas of the target + resource + format: int32 + type: integer + required: + - name + - replicas + type: object + type: array + required: + - targets + type: object + type: array + type: object + rollback: + description: Rollback Batch Strategy + properties: + batches: + description: Batches define the order of phases to execute scale + in batch + items: + properties: + breakpoint: + description: If set to true, the scale will be paused before + the step starts. + type: boolean + properties: + additionalProperties: + type: string + description: Properties contains additional information + for step + type: object + targets: + description: desired target replicas + items: + description: ScaleRunStepTarget defines the target resource + of scale + properties: + cluster: + description: Cluster indicates the name of cluster + type: string + name: + description: Name is the resource name + type: string + replicas: + description: Replicas is the replicas of the scale + task, which represents the replicas of the target + resource + format: int32 + type: integer + required: + - name + - replicas + type: object + type: array + required: + - targets + type: object + type: array + type: object + targetType: + description: TargetType defines the GroupVersionKind of target resource + properties: + apiVersion: + description: |- + APIVersion is the group/version for the resource being referenced. + If APIVersion is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIVersion is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + required: + - kind + type: object + webhooks: + description: Webhooks defines scale webhook configuration + items: + properties: + clientConfig: + description: |- + ClientConfig defines how to communicate with the hook. + Required + properties: + caBundle: + description: |- + `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. + If unspecified, system trust roots' CA on the node. + format: byte + type: string + periodSeconds: + default: 10 + description: |- + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + minimum: 1 + type: integer + timeoutSeconds: + default: 10 + description: |- + TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, + the webhook call will be ignored or the API call will fail based on the + failure policy. + format: int32 + type: integer + url: + description: |- + `url` gives the location of the webhook, in standard URL form + (`scheme://host:port/path`). Exactly one of `url` or `service` + must be specified. + + + The `host` should not refer to a service running in the cluster; use + the `service` field instead. The host might be resolved via external + DNS in some apiservers (e.g., `kube-apiserver` cannot resolve + in-cluster DNS as that would be a layering violation). `host` may + also be an IP address. + + + Please note that using `localhost` or `127.0.0.1` as a `host` is + risky unless you take great care to run this webhook on all hosts + which run an apiserver which might need to make calls to this + webhook. Such installs are likely to be non-portable, i.e., not easy + to turn up in a new cluster. + + + The scheme must be "https"; the URL must begin with "https://". + + + A path is optional, and if present may be any string permissible in + a URL. You may use the path to pass an arbitrary string to the + webhook, for example, a cluster identifier. + + + Attempting to use a user or basic auth e.g. "user:password@" is not + allowed. Fragments ("#...") and query parameters ("?...") are not + allowed, either. + type: string + type: object + failurePolicy: + description: |- + FailurePolicy defines how unrecognized errors from the admission endpoint are handled - + allowed values are Ignore or Fail. Defaults to Ignore. + type: string + failureThreshold: + default: 3 + description: |- + Minimum consecutive failures for the probe to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + format: int32 + minimum: 1 + type: integer + hookTypes: + description: |- + HookTypes defines when to communicate with the hook, specifies the types of events + that trigger the webhook. + Required + items: + description: Webhook type + type: string + type: array + name: + description: Name is the identity of webhook + type: string + properties: + additionalProperties: + type: string + description: Properties provide additional data for webhook. + type: object + provider: + description: |- + By default, rollout communicates with the webhook through the structure RolloutWebhookReview. + If provider is set, then the protocol of the interaction will be determined by the provider + type: string + type: object + type: array + type: object + status: + properties: + batches: + description: Batches describes the state of the active scale batch. + properties: + currentBatchIndex: + description: CurrentBatchIndex defines the current batch index + of batch release progress. + format: int32 + type: integer + currentBatchState: + description: CurrentBatchState indicates the current batch state. + type: string + records: + description: Records contains all batches status details. + items: + properties: + finishTime: + description: FinishTime is the time when the stage finished + format: date-time + type: string + index: + description: Index is the id of the batch + format: int32 + type: integer + startTime: + description: StartTime is the time when the stage started + format: date-time + type: string + state: + description: State is Rollout step state + type: string + targets: + description: Targets contains release details for each workload + items: + properties: + availableReplicas: + description: AvailableReplicas is the available number + of pods targeted by workload + format: int32 + type: integer + cluster: + description: Cluster defines which cluster the workload + is in. + type: string + currentReplicas: + description: CurrentReplicas is the number of current + existed pods targeted by workload + format: int32 + type: integer + name: + description: Name is the workload name + type: string + replicas: + description: Replicas is the desired number of pods + targeted by workload + format: int32 + type: integer + scaleFrom: + description: ScaleFrom is the number of replicas to + scale from. + format: int32 + type: integer + scaleTo: + description: |- + ScaleTo is the number of replicas to scale to. + It is the final number of replicas after scale operation. + format: int32 + type: integer + required: + - availableReplicas + - currentReplicas + - replicas + - scaleFrom + - scaleTo + type: object + type: array + webhooks: + description: Webhooks contains webhook status + items: + properties: + code: + description: Code is a globally unique identifier + type: string + failureCount: + description: Failure count + format: int32 + type: integer + hookType: + description: Webhook Type + type: string + message: + description: A human-readable message indicating details + about the transition. + type: string + name: + description: Webhook Name + type: string + reason: + description: A human-readable short word + type: string + state: + description: Current webhook worker state + type: string + type: object + type: array + type: object + type: array + required: + - currentBatchIndex + type: object + conditions: + description: Conditions is the list of conditions + items: + description: |- + Condition defines the condition of a resource + See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. + format: date-time + type: string + lastUpdateTime: + description: The last time this condition was updated. + format: date-time + type: string + message: + description: A human-readable message indicating details about + the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of the condition. + type: string + required: + - status + - type + type: object + type: array + error: + description: Error indicates the error info of progressing. + properties: + code: + description: Code is a globally unique identifier + type: string + message: + description: A human-readable message indicating details about + the transition. + type: string + reason: + description: A human-readable short word + type: string + type: object + lastUpdateTime: + description: The last time this status was updated. + format: date-time + type: string + observedGeneration: + description: |- + ObservedGeneration is the most recent generation observed for this ScaleRun. It corresponds to the + ScaleRun's generation, which is updated on mutation by the API Server. + format: int64 + type: integer + phase: + description: Phase indecates the current phase of scale + type: string + rollback: + description: Rollback describes the state of the active rollback batch. + properties: + currentBatchIndex: + description: CurrentBatchIndex defines the current batch index + of batch release progress. + format: int32 + type: integer + currentBatchState: + description: CurrentBatchState indicates the current batch state. + type: string + records: + description: Records contains all batches status details. + items: + properties: + finishTime: + description: FinishTime is the time when the stage finished + format: date-time + type: string + index: + description: Index is the id of the batch + format: int32 + type: integer + startTime: + description: StartTime is the time when the stage started + format: date-time + type: string + state: + description: State is Rollout step state + type: string + targets: + description: Targets contains release details for each workload + items: + properties: + availableReplicas: + description: AvailableReplicas is the available number + of pods targeted by workload + format: int32 + type: integer + cluster: + description: Cluster defines which cluster the workload + is in. + type: string + currentReplicas: + description: CurrentReplicas is the number of current + existed pods targeted by workload + format: int32 + type: integer + name: + description: Name is the workload name + type: string + replicas: + description: Replicas is the desired number of pods + targeted by workload + format: int32 + type: integer + scaleFrom: + description: ScaleFrom is the number of replicas to + scale from. + format: int32 + type: integer + scaleTo: + description: |- + ScaleTo is the number of replicas to scale to. + It is the final number of replicas after scale operation. + format: int32 + type: integer + required: + - availableReplicas + - currentReplicas + - replicas + - scaleFrom + - scaleTo + type: object + type: array + webhooks: + description: Webhooks contains webhook status + items: + properties: + code: + description: Code is a globally unique identifier + type: string + failureCount: + description: Failure count + format: int32 + type: integer + hookType: + description: Webhook Type + type: string + message: + description: A human-readable message indicating details + about the transition. + type: string + name: + description: Webhook Name + type: string + reason: + description: A human-readable short word + type: string + state: + description: Current webhook worker state + type: string + type: object + type: array + type: object + type: array + required: + - currentBatchIndex + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 0763b7b..1edb1ac 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -178,6 +178,8 @@ type RolloutBatchStatus struct { type RolloutReplicasSummary struct { // Replicas is the desired number of pods targeted by workload Replicas int32 `json:"replicas"` + // AvailableReplicas is the number of service available pods targeted by workload. + AvailableReplicas int32 `json:"availableReplicas"` // UpdatedReplicas is the number of pods targeted by workload that have the updated template spec. UpdatedReplicas int32 `json:"updatedReplicas"` // UpdatedReadyReplicas is the number of ready pods targeted by workload that have the updated template spec. diff --git a/rollout/v1alpha1/scalerun_types.go b/rollout/v1alpha1/scalerun_types.go new file mode 100644 index 0000000..eec1e60 --- /dev/null +++ b/rollout/v1alpha1/scalerun_types.go @@ -0,0 +1,170 @@ +// Copyright 2023 The KusionStack Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:resource:shortName=scr +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" +// +kubebuilder:printcolumn:name="Batch Index",type="string",JSONPath=".status.batchStatus.currentBatchIndex" +// +kubebuilder:printcolumn:name="Batch State",type="string",JSONPath=".status.batchStatus.currentBatchState" +// +kubebuilder:printcolumn:name="Error",type="string",JSONPath=".status.error.code" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp",format="date-time" + +type ScaleRun struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ScaleRunSpec `json:"spec,omitempty"` + Status ScaleRunStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true + +// ScaleRunList contains a list of ScaleRun +type ScaleRunList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ScaleRun `json:"items"` +} + +type ScaleRunSpec struct { + // TargetType defines the GroupVersionKind of target resource + TargetType ObjectTypeRef `json:"targetType,omitempty"` + + // Scale Batch Strategy + Batch *ScaleRunBatchStrategy `json:"batch,omitempty"` + + // Rollback Batch Strategy + Rollback *ScaleRunBatchStrategy `json:"rollback,omitempty"` + + // Webhooks defines scale webhook configuration + // +optional + Webhooks []RolloutWebhook `json:"webhooks,omitempty"` +} + +type ScaleRunBatchStrategy struct { + // Batches define the order of phases to execute scale in batch + Batches []ScaleRunStep `json:"batches,omitempty"` +} + +type ScaleRunStep struct { + // desired target replicas + Targets []ScaleRunStepTarget `json:"targets"` + + // If set to true, the scale will be paused before the step starts. + // +optional + Breakpoint bool `json:"breakpoint,omitempty"` + + // Properties contains additional information for step + // +optional + Properties map[string]string `json:"properties,omitempty"` +} + +// ScaleRunStepTarget defines the target resource of scale +type ScaleRunStepTarget struct { + CrossClusterObjectNameReference `json:",inline"` + + // Replicas is the replicas of the scale task, which represents the replicas of the target resource + Replicas int32 `json:"replicas"` +} + +type MultipleReplia struct { + // GroupName is the name of current group + GroupName string `json:"groupName,omitempty"` + // Value is the replicas of current group + Value int32 `json:"value"` +} + +type ScaleRunStatus struct { + // ObservedGeneration is the most recent generation observed for this ScaleRun. It corresponds to the + // ScaleRun's generation, which is updated on mutation by the API Server. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // Conditions is the list of conditions + Conditions []Condition `json:"conditions,omitempty"` + // Phase indecates the current phase of scale + Phase RolloutRunPhase `json:"phase,omitempty"` + // The last time this status was updated. + // +optional + LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` + // Error indicates the error info of progressing. + Error *CodeReasonMessage `json:"error,omitempty"` + // Batches describes the state of the active scale batch. + // +optional + Batches *ScaleRunBatchStatus `json:"batches,omitempty"` + // Rollback describes the state of the active rollback batch. + // +optional + Rollback *ScaleRunBatchStatus `json:"rollback,omitempty"` +} + +type ScaleRunBatchStatus struct { + // RolloutBatchStatus contains status of current batch + RolloutBatchStatus `json:",inline"` + // Records contains all batches status details. + Records []ScaleRunStepStatus `json:"records,omitempty"` +} + +type ScaleRunStepStatus struct { + // Index is the id of the batch + Index *int32 `json:"index,omitempty"` + // State is Rollout step state + State RolloutStepState `json:"state,omitempty"` + // StartTime is the time when the stage started + // +optional + StartTime *metav1.Time `json:"startTime,omitempty"` + // FinishTime is the time when the stage finished + // +optional + FinishTime *metav1.Time `json:"finishTime,omitempty"` + // Targets contains release details for each workload + // +optional + Targets []ScaleWorkloadStatus `json:"targets,omitempty"` + // Webhooks contains webhook status + // +optional + Webhooks []RolloutWebhookStatus `json:"webhooks,omitempty"` +} + +type ScaleWorkloadStatus struct { + // Name is the workload name + Name string `json:"name,omitempty"` + // Cluster defines which cluster the workload is in. + Cluster string `json:"cluster,omitempty"` + // Replicas is the desired number of pods targeted by workload + Replicas int32 `json:"replicas"` + // CurrentReplicas is the number of current existed pods targeted by workload + CurrentReplicas int32 `json:"currentReplicas"` + // AvailableReplicas is the available number of pods targeted by workload + AvailableReplicas int32 `json:"availableReplicas"` + // ScaleFrom is the number of replicas to scale from. + ScaleFrom int32 `json:"scaleFrom"` + // ScaleTo is the number of replicas to scale to. + // It is the final number of replicas after scale operation. + ScaleTo int32 `json:"scaleTo"` +} + +func (r *ScaleRun) IsCompleted() bool { + if r == nil { + return false + } + return r.Status.Phase == RolloutRunPhaseSucceeded || r.Status.Phase == RolloutRunPhaseCanceled +} diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index b0902a1..13f7eb6 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -754,6 +754,22 @@ func (in *MetadataPatch) DeepCopy() *MetadataPatch { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MultipleReplia) DeepCopyInto(out *MultipleReplia) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultipleReplia. +func (in *MultipleReplia) DeepCopy() *MultipleReplia { + if in == nil { + return nil + } + out := new(MultipleReplia) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ObjectTypeRef) DeepCopyInto(out *ObjectTypeRef) { *out = *in @@ -1669,6 +1685,290 @@ func (in *RouteRef) DeepCopy() *RouteRef { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRun) DeepCopyInto(out *ScaleRun) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRun. +func (in *ScaleRun) DeepCopy() *ScaleRun { + if in == nil { + return nil + } + out := new(ScaleRun) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScaleRun) 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 *ScaleRunBatchStatus) DeepCopyInto(out *ScaleRunBatchStatus) { + *out = *in + out.RolloutBatchStatus = in.RolloutBatchStatus + if in.Records != nil { + in, out := &in.Records, &out.Records + *out = make([]ScaleRunStepStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunBatchStatus. +func (in *ScaleRunBatchStatus) DeepCopy() *ScaleRunBatchStatus { + if in == nil { + return nil + } + out := new(ScaleRunBatchStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRunBatchStrategy) DeepCopyInto(out *ScaleRunBatchStrategy) { + *out = *in + if in.Batches != nil { + in, out := &in.Batches, &out.Batches + *out = make([]ScaleRunStep, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunBatchStrategy. +func (in *ScaleRunBatchStrategy) DeepCopy() *ScaleRunBatchStrategy { + if in == nil { + return nil + } + out := new(ScaleRunBatchStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRunList) DeepCopyInto(out *ScaleRunList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ScaleRun, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunList. +func (in *ScaleRunList) DeepCopy() *ScaleRunList { + if in == nil { + return nil + } + out := new(ScaleRunList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScaleRunList) 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 *ScaleRunSpec) DeepCopyInto(out *ScaleRunSpec) { + *out = *in + out.TargetType = in.TargetType + if in.Batch != nil { + in, out := &in.Batch, &out.Batch + *out = new(ScaleRunBatchStrategy) + (*in).DeepCopyInto(*out) + } + if in.Rollback != nil { + in, out := &in.Rollback, &out.Rollback + *out = new(ScaleRunBatchStrategy) + (*in).DeepCopyInto(*out) + } + if in.Webhooks != nil { + in, out := &in.Webhooks, &out.Webhooks + *out = make([]RolloutWebhook, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunSpec. +func (in *ScaleRunSpec) DeepCopy() *ScaleRunSpec { + if in == nil { + return nil + } + out := new(ScaleRunSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRunStatus) DeepCopyInto(out *ScaleRunStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LastUpdateTime != nil { + in, out := &in.LastUpdateTime, &out.LastUpdateTime + *out = (*in).DeepCopy() + } + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(CodeReasonMessage) + **out = **in + } + if in.Batches != nil { + in, out := &in.Batches, &out.Batches + *out = new(ScaleRunBatchStatus) + (*in).DeepCopyInto(*out) + } + if in.Rollback != nil { + in, out := &in.Rollback, &out.Rollback + *out = new(ScaleRunBatchStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunStatus. +func (in *ScaleRunStatus) DeepCopy() *ScaleRunStatus { + if in == nil { + return nil + } + out := new(ScaleRunStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRunStep) DeepCopyInto(out *ScaleRunStep) { + *out = *in + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]ScaleRunStepTarget, len(*in)) + copy(*out, *in) + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunStep. +func (in *ScaleRunStep) DeepCopy() *ScaleRunStep { + if in == nil { + return nil + } + out := new(ScaleRunStep) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRunStepStatus) DeepCopyInto(out *ScaleRunStepStatus) { + *out = *in + if in.Index != nil { + in, out := &in.Index, &out.Index + *out = new(int32) + **out = **in + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = (*in).DeepCopy() + } + if in.FinishTime != nil { + in, out := &in.FinishTime, &out.FinishTime + *out = (*in).DeepCopy() + } + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]ScaleWorkloadStatus, len(*in)) + copy(*out, *in) + } + if in.Webhooks != nil { + in, out := &in.Webhooks, &out.Webhooks + *out = make([]RolloutWebhookStatus, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunStepStatus. +func (in *ScaleRunStepStatus) DeepCopy() *ScaleRunStepStatus { + if in == nil { + return nil + } + out := new(ScaleRunStepStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleRunStepTarget) DeepCopyInto(out *ScaleRunStepTarget) { + *out = *in + out.CrossClusterObjectNameReference = in.CrossClusterObjectNameReference + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleRunStepTarget. +func (in *ScaleRunStepTarget) DeepCopy() *ScaleRunStepTarget { + if in == nil { + return nil + } + out := new(ScaleRunStepTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScaleWorkloadStatus) DeepCopyInto(out *ScaleWorkloadStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScaleWorkloadStatus. +func (in *ScaleWorkloadStatus) DeepCopy() *ScaleWorkloadStatus { + if in == nil { + return nil + } + out := new(ScaleWorkloadStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StableHTTPForwarding) DeepCopyInto(out *StableHTTPForwarding) { *out = *in diff --git a/rollout/v1alpha1/zz_generated.register.go b/rollout/v1alpha1/zz_generated.register.go index 97975a0..cfc5db3 100644 --- a/rollout/v1alpha1/zz_generated.register.go +++ b/rollout/v1alpha1/zz_generated.register.go @@ -67,6 +67,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &RolloutStrategy{}, &RolloutStrategyList{}, &RolloutWebhookReview{}, + &ScaleRun{}, + &ScaleRunList{}, &TrafficTopology{}, &TrafficTopologyList{}, )