diff --git a/apis/core.oam.dev/common/types.go b/apis/core.oam.dev/common/types.go index 05e902780..db288bae5 100644 --- a/apis/core.oam.dev/common/types.go +++ b/apis/core.oam.dev/common/types.go @@ -17,9 +17,11 @@ limitations under the License. package common import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" ) @@ -175,11 +177,11 @@ const ( type ApplicationComponentStatus struct { Name string `json:"name"` // WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1 - WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"` - Healthy bool `json:"healthy"` - Message string `json:"message,omitempty"` - Traits []ApplicationTraitStatus `json:"traits,omitempty"` - Scopes []runtimev1alpha1.TypedReference `json:"scopes,omitempty"` + WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"` + Healthy bool `json:"healthy"` + Message string `json:"message,omitempty"` + Traits []ApplicationTraitStatus `json:"traits,omitempty"` + Scopes []corev1.ObjectReference `json:"scopes,omitempty"` } // ApplicationTraitStatus records the trait health status @@ -213,15 +215,15 @@ type WorkflowStepStatus struct { // A human readable message indicating details about why the workflowStep is in this state. Message string `json:"message,omitempty"` // A brief CamelCase message indicating details about why the workflowStep is in this state. - Reason string `json:"reason,omitempty"` - ResourceRef runtimev1alpha1.TypedReference `json:"resourceRef,omitempty"` + Reason string `json:"reason,omitempty"` + ResourceRef corev1.ObjectReference `json:"resourceRef,omitempty"` } // AppStatus defines the observed state of Application type AppStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // The generation observed by the application controller. // +optional @@ -232,13 +234,13 @@ type AppStatus struct { Phase ApplicationPhase `json:"status,omitempty"` // Components record the related Components created by Application Controller - Components []runtimev1alpha1.TypedReference `json:"components,omitempty"` + Components []corev1.ObjectReference `json:"components,omitempty"` // Services record the status of the application services Services []ApplicationComponentStatus `json:"services,omitempty"` // ResourceTracker record the status of the ResourceTracker - ResourceTracker *runtimev1alpha1.TypedReference `json:"resourceTracker,omitempty"` + ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"` // Workflow record the status of workflow Workflow *WorkflowStatus `json:"workflow,omitempty"` @@ -250,12 +252,12 @@ type AppStatus struct { // WorkflowStatus record the status of workflow type WorkflowStatus struct { - AppRevision string `json:"appRevision,omitempty"` - StepIndex int `json:"stepIndex,omitempty"` - Suspend bool `json:"suspend"` - Terminated bool `json:"terminated"` - ContextBackend *runtimev1alpha1.TypedReference `json:"contextBackend"` - Steps []WorkflowStepStatus `json:"steps,omitempty"` + AppRevision string `json:"appRevision,omitempty"` + StepIndex int `json:"stepIndex,omitempty"` + Suspend bool `json:"suspend"` + Terminated bool `json:"terminated"` + ContextBackend *corev1.ObjectReference `json:"contextBackend"` + Steps []WorkflowStepStatus `json:"steps,omitempty"` } // WorkflowStepPhase describes the phase of a workflow step. diff --git a/apis/core.oam.dev/common/zz_generated.deepcopy.go b/apis/core.oam.dev/common/zz_generated.deepcopy.go index 2a87a711a..4718b3578 100644 --- a/apis/core.oam.dev/common/zz_generated.deepcopy.go +++ b/apis/core.oam.dev/common/zz_generated.deepcopy.go @@ -21,7 +21,7 @@ limitations under the License. package common import ( - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + v1 "k8s.io/api/core/v1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -47,7 +47,7 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) { in.Rollout.DeepCopyInto(&out.Rollout) if in.Components != nil { in, out := &in.Components, &out.Components - *out = make([]v1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } if in.Services != nil { @@ -59,7 +59,7 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) { } if in.ResourceTracker != nil { in, out := &in.ResourceTracker, &out.ResourceTracker - *out = new(v1alpha1.TypedReference) + *out = new(v1.ObjectReference) **out = **in } if in.Workflow != nil { @@ -95,7 +95,7 @@ func (in *ApplicationComponentStatus) DeepCopyInto(out *ApplicationComponentStat } if in.Scopes != nil { in, out := &in.Scopes, &out.Scopes - *out = make([]v1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } } @@ -348,7 +348,7 @@ func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) { *out = *in if in.ContextBackend != nil { in, out := &in.ContextBackend, &out.ContextBackend - *out = new(v1alpha1.TypedReference) + *out = new(v1.ObjectReference) **out = **in } if in.Steps != nil { diff --git a/apis/core.oam.dev/condition/condition.go b/apis/core.oam.dev/condition/condition.go new file mode 100644 index 000000000..5f895cebd --- /dev/null +++ b/apis/core.oam.dev/condition/condition.go @@ -0,0 +1,282 @@ +/* + +// This file is originally from https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/condition.go +// We copy it here to reduce dependency and add more + +Copyright 2021 The KubeVela Authors. +Copyright 2019 The Crossplane 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 condition + +import ( + "sort" + "time" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// A ConditionType represents a condition a resource could be in. +// nolint:golint +type ConditionType string + +// Condition types. +const ( + // TypeReady resources are believed to be ready to handle work. + TypeReady ConditionType = "Ready" + + // TypeSynced resources are believed to be in sync with the + // Kubernetes resources that manage their lifecycle. + TypeSynced ConditionType = "Synced" +) + +// A ConditionReason represents the reason a resource is in a condition. +// nolint:golint +type ConditionReason string + +// Reasons a resource is or is not ready. +const ( + ReasonAvailable ConditionReason = "Available" + ReasonUnavailable ConditionReason = "Unavailable" + ReasonCreating ConditionReason = "Creating" + ReasonDeleting ConditionReason = "Deleting" +) + +// Reasons a resource is or is not synced. +const ( + ReasonReconcileSuccess ConditionReason = "ReconcileSuccess" + ReasonReconcileError ConditionReason = "ReconcileError" +) + +// A Condition that may apply to a resource. +type Condition struct { + // Type of this condition. At most one of each condition type may apply to + // a resource at any point in time. + Type ConditionType `json:"type"` + + // Status of this condition; is it currently True, False, or Unknown? + Status corev1.ConditionStatus `json:"status"` + + // LastTransitionTime is the last time this condition transitioned from one + // status to another. + LastTransitionTime metav1.Time `json:"lastTransitionTime"` + + // A Reason for this condition's last transition from one status to another. + Reason ConditionReason `json:"reason"` + + // A Message containing details about this condition's last transition from + // one status to another, if any. + // +optional + Message string `json:"message,omitempty"` +} + +// Equal returns true if the condition is identical to the supplied condition, +// ignoring the LastTransitionTime. +func (c Condition) Equal(other Condition) bool { + return c.Type == other.Type && + c.Status == other.Status && + c.Reason == other.Reason && + c.Message == other.Message +} + +// WithMessage returns a condition by adding the provided message to existing +// condition. +func (c Condition) WithMessage(msg string) Condition { + c.Message = msg + return c +} + +// NOTE(negz): Conditions are implemented as a slice rather than a map to comply +// with Kubernetes API conventions. Ideally we'd comply by using a map that +// marshalled to a JSON array, but doing so confuses the CRD schema generator. +// https://github.com/kubernetes/community/blob/9bf8cd/contributors/devel/sig-architecture/api-conventions.md#lists-of-named-subobjects-preferred-over-maps + +// NOTE(negz): Do not manipulate Conditions directly. Use the Set method. + +// A ConditionedStatus reflects the observed status of a resource. Only +// one condition of each type may exist. +type ConditionedStatus struct { + // Conditions of the resource. + // +optional + Conditions []Condition `json:"conditions,omitempty"` +} + +// NewConditionedStatus returns a stat with the supplied conditions set. +func NewConditionedStatus(c ...Condition) *ConditionedStatus { + s := &ConditionedStatus{} + s.SetConditions(c...) + return s +} + +// GetCondition returns the condition for the given ConditionType if exists, +// otherwise returns nil +func (s *ConditionedStatus) GetCondition(ct ConditionType) Condition { + for _, c := range s.Conditions { + if c.Type == ct { + return c + } + } + + return Condition{Type: ct, Status: corev1.ConditionUnknown} +} + +// SetConditions sets the supplied conditions, replacing any existing conditions +// of the same type. This is a no-op if all supplied conditions are identical, +// ignoring the last transition time, to those already set. +func (s *ConditionedStatus) SetConditions(c ...Condition) { + for _, new := range c { + exists := false + for i, existing := range s.Conditions { + if existing.Type != new.Type { + continue + } + + if existing.Equal(new) { + exists = true + continue + } + + s.Conditions[i] = new + exists = true + } + if !exists { + s.Conditions = append(s.Conditions, new) + } + } +} + +// Equal returns true if the status is identical to the supplied status, +// ignoring the LastTransitionTimes and order of statuses. +func (s *ConditionedStatus) Equal(other *ConditionedStatus) bool { + if s == nil || other == nil { + return s == nil && other == nil + } + + if len(other.Conditions) != len(s.Conditions) { + return false + } + + sc := make([]Condition, len(s.Conditions)) + copy(sc, s.Conditions) + + oc := make([]Condition, len(other.Conditions)) + copy(oc, other.Conditions) + + // We should not have more than one condition of each type. + sort.Slice(sc, func(i, j int) bool { return sc[i].Type < sc[j].Type }) + sort.Slice(oc, func(i, j int) bool { return oc[i].Type < oc[j].Type }) + + for i := range sc { + if !sc[i].Equal(oc[i]) { + return false + } + } + + return true +} + +// Creating returns a condition that indicates the resource is currently +// being created. +func Creating() Condition { + return Condition{ + Type: TypeReady, + Status: corev1.ConditionFalse, + LastTransitionTime: metav1.Now(), + Reason: ReasonCreating, + } +} + +// Deleting returns a condition that indicates the resource is currently +// being deleted. +func Deleting() Condition { + return Condition{ + Type: TypeReady, + Status: corev1.ConditionFalse, + LastTransitionTime: metav1.Now(), + Reason: ReasonDeleting, + } +} + +// Available returns a condition that indicates the resource is +// currently observed to be available for use. +func Available() Condition { + return Condition{ + Type: TypeReady, + Status: corev1.ConditionTrue, + LastTransitionTime: metav1.Now(), + Reason: ReasonAvailable, + } +} + +// Unavailable returns a condition that indicates the resource is not +// currently available for use. Unavailable should be set only when Crossplane +// expects the resource to be available but knows it is not, for example +// because its API reports it is unhealthy. +func Unavailable() Condition { + return Condition{ + Type: TypeReady, + Status: corev1.ConditionFalse, + LastTransitionTime: metav1.Now(), + Reason: ReasonUnavailable, + } +} + +// ReconcileSuccess returns a condition indicating that Crossplane successfully +// completed the most recent reconciliation of the resource. +func ReconcileSuccess() Condition { + return Condition{ + Type: TypeSynced, + Status: corev1.ConditionTrue, + LastTransitionTime: metav1.Now(), + Reason: ReasonReconcileSuccess, + } +} + +// ReconcileError returns a condition indicating that Crossplane encountered an +// error while reconciling the resource. This could mean Crossplane was +// unable to update the resource to reflect its desired state, or that +// Crossplane was unable to determine the current actual state of the resource. +func ReconcileError(err error) Condition { + return Condition{ + Type: TypeSynced, + Status: corev1.ConditionFalse, + LastTransitionTime: metav1.Now(), + Reason: ReasonReconcileError, + Message: err.Error(), + } +} + +// ReadyCondition generate ready condition for conditionType +func ReadyCondition(tpy string) Condition { + return Condition{ + Type: ConditionType(tpy), + Status: corev1.ConditionTrue, + Reason: ReasonAvailable, + LastTransitionTime: metav1.NewTime(time.Now()), + } +} + +// ErrorCondition generate error condition for conditionType and error +func ErrorCondition(tpy string, err error) Condition { + return Condition{ + Type: ConditionType(tpy), + Status: corev1.ConditionFalse, + LastTransitionTime: metav1.NewTime(time.Now()), + Reason: ReasonReconcileError, + Message: err.Error(), + } +} diff --git a/apis/core.oam.dev/condition/condition_test.go b/apis/core.oam.dev/condition/condition_test.go new file mode 100644 index 000000000..636c935b9 --- /dev/null +++ b/apis/core.oam.dev/condition/condition_test.go @@ -0,0 +1,221 @@ +// This file is originally from https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/condition_test.go +// We copy it here to reduce dependency + +/* +Copyright 2019 The Crossplane 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 condition + +import ( + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestConditionEqual(t *testing.T) { + cases := map[string]struct { + a Condition + b Condition + want bool + }{ + "IdenticalIgnoringTimestamp": { + a: Condition{Type: TypeReady, LastTransitionTime: metav1.Now()}, + b: Condition{Type: TypeReady, LastTransitionTime: metav1.Now()}, + want: true, + }, + "DifferentType": { + a: Condition{Type: TypeReady}, + b: Condition{Type: TypeSynced}, + want: false, + }, + "DifferentStatus": { + a: Condition{Status: corev1.ConditionTrue}, + b: Condition{Status: corev1.ConditionFalse}, + want: false, + }, + "DifferentReason": { + a: Condition{Reason: ReasonCreating}, + b: Condition{Reason: ReasonDeleting}, + want: false, + }, + "DifferentMessage": { + a: Condition{Message: "cool"}, + b: Condition{Message: "uncool"}, + want: false, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + got := tc.a.Equal(tc.b) + + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Errorf("a.Equal(b): -want, +got:\n%s", diff) + } + }) + } +} + +func TestConditionedStatusEqual(t *testing.T) { + cases := map[string]struct { + a *ConditionedStatus + b *ConditionedStatus + want bool + }{ + "Identical": { + a: NewConditionedStatus(Available(), ReconcileSuccess()), + b: NewConditionedStatus(Available(), ReconcileSuccess()), + want: true, + }, + "IdenticalExceptOrder": { + a: NewConditionedStatus(Unavailable(), ReconcileSuccess()), + b: NewConditionedStatus(ReconcileSuccess(), Unavailable()), + want: true, + }, + "DifferentLength": { + a: NewConditionedStatus(Available(), ReconcileSuccess()), + b: NewConditionedStatus(ReconcileSuccess()), + want: false, + }, + "DifferentCondition": { + a: NewConditionedStatus(Creating(), ReconcileSuccess()), + b: NewConditionedStatus(Creating(), ReconcileError(errors.New("boom"))), + want: false, + }, + "AIsNil": { + a: nil, + b: NewConditionedStatus(Deleting(), ReconcileSuccess()), + want: false, + }, + "BIsNil": { + a: NewConditionedStatus(Available(), ReconcileSuccess()), + b: nil, + want: false, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + got := tc.a.Equal(tc.b) + + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Errorf("a.Equal(b): -want, +got:\n%s", diff) + } + }) + } +} + +func TestSetConditions(t *testing.T) { + cases := map[string]struct { + cs *ConditionedStatus + c []Condition + want *ConditionedStatus + }{ + "TypeIsIdentical": { + cs: NewConditionedStatus(Available()), + c: []Condition{Available()}, + want: NewConditionedStatus(Available()), + }, + "TypeIsDifferent": { + cs: NewConditionedStatus(Creating()), + c: []Condition{Available()}, + want: NewConditionedStatus(Available()), + }, + "TypeDoesNotExist": { + cs: NewConditionedStatus(ReconcileSuccess()), + c: []Condition{Available()}, + want: NewConditionedStatus(ReconcileSuccess(), Available()), + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + tc.cs.SetConditions(tc.c...) + + got := tc.cs + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Errorf("tc.cs.SetConditions(...): -want, +got:\n%s", diff) + } + }) + } +} + +func TestGetCondition(t *testing.T) { + cases := map[string]struct { + cs *ConditionedStatus + t ConditionType + want Condition + }{ + "ConditionExists": { + cs: NewConditionedStatus(Available()), + t: TypeReady, + want: Available(), + }, + "ConditionDoesNotExist": { + cs: NewConditionedStatus(Available()), + t: TypeSynced, + want: Condition{ + Type: TypeSynced, + Status: corev1.ConditionUnknown, + }, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + got := tc.cs.GetCondition(tc.t) + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Errorf("tc.cs.GetConditions(...): -want, +got:\n%s", diff) + } + }) + } +} + +func TestConditionWithMessage(t *testing.T) { + testMsg := "Something went wrong on cloud side" + cases := map[string]struct { + c Condition + msg string + want Condition + }{ + "MessageAdded": { + c: Condition{Type: TypeReady, Reason: ReasonUnavailable}, + msg: testMsg, + want: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg}, + }, + "MessageChanged": { + c: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: "Some other message"}, + msg: testMsg, + want: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg}, + }, + "MessageCleared": { + c: Condition{Type: TypeReady, Reason: ReasonUnavailable, Message: testMsg}, + msg: "", + want: Condition{Type: TypeReady, Reason: ReasonUnavailable}, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + got := tc.c.WithMessage(tc.msg) + + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Errorf("a.Equal(b): -want, +got:\n%s", diff) + } + }) + } +} diff --git a/apis/core.oam.dev/condition/doc.go b/apis/core.oam.dev/condition/doc.go new file mode 100644 index 000000000..3acbca0bd --- /dev/null +++ b/apis/core.oam.dev/condition/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2021 The KubeVela 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 condition contains condition types +// +kubebuilder:object:generate=true +package condition diff --git a/apis/core.oam.dev/condition/zz_generated.deepcopy.go b/apis/core.oam.dev/condition/zz_generated.deepcopy.go new file mode 100644 index 000000000..1d62c3330 --- /dev/null +++ b/apis/core.oam.dev/condition/zz_generated.deepcopy.go @@ -0,0 +1,59 @@ +// +build !ignore_autogenerated + +/* +Copyright 2021 The KubeVela 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 controller-gen. DO NOT EDIT. + +package condition + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConditionedStatus) DeepCopyInto(out *ConditionedStatus) { + *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]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionedStatus. +func (in *ConditionedStatus) DeepCopy() *ConditionedStatus { + if in == nil { + return nil + } + out := new(ConditionedStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/core.oam.dev/v1alpha2/application_types.go b/apis/core.oam.dev/v1alpha2/application_types.go index c8a68b2ed..9bd35a864 100644 --- a/apis/core.oam.dev/v1alpha2/application_types.go +++ b/apis/core.oam.dev/v1alpha2/application_types.go @@ -17,10 +17,9 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/runtime" - - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" @@ -38,13 +37,13 @@ type AppStatus struct { Phase common.ApplicationPhase `json:"status,omitempty"` // Components record the related Components created by Application Controller - Components []runtimev1alpha1.TypedReference `json:"components,omitempty"` + Components []corev1.ObjectReference `json:"components,omitempty"` // Services record the status of the application services Services []common.ApplicationComponentStatus `json:"services,omitempty"` // ResourceTracker record the status of the ResourceTracker - ResourceTracker *runtimev1alpha1.TypedReference `json:"resourceTracker,omitempty"` + ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"` // LatestRevision of the application configuration it generates // +optional diff --git a/apis/core.oam.dev/v1alpha2/componentdefinition_types.go b/apis/core.oam.dev/v1alpha2/componentdefinition_types.go index 63f345fed..01741460c 100644 --- a/apis/core.oam.dev/v1alpha2/componentdefinition_types.go +++ b/apis/core.oam.dev/v1alpha2/componentdefinition_types.go @@ -17,10 +17,11 @@ limitations under the License. package v1alpha2 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/apis/core.oam.dev/common" ) @@ -59,7 +60,7 @@ type ComponentDefinitionSpec struct { // ComponentDefinitionStatus is the status of ComponentDefinition type ComponentDefinitionStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters. ConfigMapRef string `json:"configMapRef,omitempty"` // LatestRevision of the component definition @@ -83,12 +84,12 @@ type ComponentDefinition struct { } // SetConditions set condition for WorkloadDefinition -func (cd *ComponentDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) { cd.Status.SetConditions(c...) } // GetCondition gets condition from WorkloadDefinition -func (cd *ComponentDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return cd.Status.GetCondition(conditionType) } diff --git a/apis/core.oam.dev/v1alpha2/core_scope_types.go b/apis/core.oam.dev/v1alpha2/core_scope_types.go index 89ae98d62..d2930c5f2 100644 --- a/apis/core.oam.dev/v1alpha2/core_scope_types.go +++ b/apis/core.oam.dev/v1alpha2/core_scope_types.go @@ -17,9 +17,11 @@ limitations under the License. package v1alpha2 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/pkg/oam" ) @@ -46,12 +48,12 @@ type HealthScopeSpec struct { ProbeInterval *int32 `json:"probe-interval,omitempty"` // WorkloadReferences to the workloads that are in this scope. - WorkloadReferences []runtimev1alpha1.TypedReference `json:"workloadRefs"` + WorkloadReferences []corev1.ObjectReference `json:"workloadRefs"` } // A HealthScopeStatus represents the observed state of a HealthScope. type HealthScopeStatus struct { - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // ScopeHealthCondition represents health condition summary of the scope ScopeHealthCondition ScopeHealthCondition `json:"scopeHealthCondition"` @@ -72,10 +74,10 @@ type ScopeHealthCondition struct { // WorkloadHealthCondition represents informative health condition. type WorkloadHealthCondition struct { // ComponentName represents the component name if target is a workload - ComponentName string `json:"componentName,omitempty"` - TargetWorkload runtimev1alpha1.TypedReference `json:"targetWorkload,omitempty"` - HealthStatus HealthStatus `json:"healthStatus"` - Diagnosis string `json:"diagnosis,omitempty"` + ComponentName string `json:"componentName,omitempty"` + TargetWorkload corev1.ObjectReference `json:"targetWorkload,omitempty"` + HealthStatus HealthStatus `json:"healthStatus"` + Diagnosis string `json:"diagnosis,omitempty"` // WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN. WorkloadStatus string `json:"workloadStatus,omitempty"` } diff --git a/apis/core.oam.dev/v1alpha2/core_trait_types.go b/apis/core.oam.dev/v1alpha2/core_trait_types.go index a310cfbb9..dd5950b38 100644 --- a/apis/core.oam.dev/v1alpha2/core_trait_types.go +++ b/apis/core.oam.dev/v1alpha2/core_trait_types.go @@ -17,9 +17,11 @@ limitations under the License. package v1alpha2 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/pkg/oam" ) @@ -31,13 +33,13 @@ type ManualScalerTraitSpec struct { ReplicaCount int32 `json:"replicaCount"` // WorkloadReference to the workload this trait applies to. - WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef"` + WorkloadReference corev1.ObjectReference `json:"workloadRef"` } // A ManualScalerTraitStatus represents the observed state of a // ManualScalerTrait. type ManualScalerTraitStatus struct { - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` } // +kubebuilder:object:root=true diff --git a/apis/core.oam.dev/v1alpha2/core_types.go b/apis/core.oam.dev/v1alpha2/core_types.go index 0f0d2d1bc..ab6212e9b 100644 --- a/apis/core.oam.dev/v1alpha2/core_types.go +++ b/apis/core.oam.dev/v1alpha2/core_types.go @@ -17,11 +17,13 @@ limitations under the License. package v1alpha2 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + 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" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/apis/core.oam.dev/common" "github.com/oam-dev/kubevela/apis/types" ) @@ -60,7 +62,7 @@ type WorkloadDefinitionSpec struct { // WorkloadDefinitionStatus is the status of WorkloadDefinition type WorkloadDefinitionStatus struct { - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` } // +kubebuilder:object:root=true @@ -80,12 +82,12 @@ type WorkloadDefinition struct { } // SetConditions set condition for WorkloadDefinition -func (wd *WorkloadDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) { wd.Status.SetConditions(c...) } // GetCondition gets condition from WorkloadDefinition -func (wd *WorkloadDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return wd.Status.GetCondition(conditionType) } @@ -151,7 +153,7 @@ type TraitDefinitionSpec struct { // TraitDefinitionStatus is the status of TraitDefinition type TraitDefinitionStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters. ConfigMapRef string `json:"configMapRef,omitempty"` // LatestRevision of the trait definition @@ -178,12 +180,12 @@ type TraitDefinition struct { } // SetConditions set condition for TraitDefinition -func (td *TraitDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (td *TraitDefinition) SetConditions(c ...condition.Condition) { td.Status.SetConditions(c...) } // GetCondition gets condition from TraitDefinition -func (td *TraitDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return td.Status.GetCondition(conditionType) } @@ -289,7 +291,7 @@ type ComponentStatus struct { // +optional ObservedGeneration int64 `json:"observedGeneration"` - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // LatestRevision of component // +optional @@ -351,7 +353,7 @@ type ComponentTrait struct { // A ComponentScope specifies a scope in which a component should exist. type ComponentScope struct { // A ScopeReference must refer to an OAM scope resource. - ScopeReference runtimev1alpha1.TypedReference `json:"scopeRef"` + ScopeReference corev1.ObjectReference `json:"scopeRef"` } // An ApplicationConfigurationComponent specifies a component of an @@ -408,7 +410,7 @@ type WorkloadTrait struct { Status TraitStatus `json:"status,omitempty"` // Reference to a trait created by an ApplicationConfiguration. - Reference runtimev1alpha1.TypedReference `json:"traitRef"` + Reference corev1.ObjectReference `json:"traitRef"` // Message will allow controller to leave some additional information for this trait Message string `json:"message,omitempty"` @@ -434,7 +436,7 @@ type WorkloadScope struct { Status ScopeStatus `json:"status,omitempty"` // Reference to a scope created by an ApplicationConfiguration. - Reference runtimev1alpha1.TypedReference `json:"scopeRef"` + Reference corev1.ObjectReference `json:"scopeRef"` } // A WorkloadStatus represents the status of a workload. @@ -456,7 +458,7 @@ type WorkloadStatus struct { AppliedComponentRevision string `json:"appliedComponentRevision,omitempty"` // Reference to a workload created by an ApplicationConfiguration. - Reference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"` + Reference corev1.ObjectReference `json:"workloadRef,omitempty"` // Traits associated with this workload. Traits []WorkloadTrait `json:"traits,omitempty"` @@ -471,7 +473,7 @@ type HistoryWorkload struct { Revision string `json:"revision,omitempty"` // Reference to running workload. - Reference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"` + Reference corev1.ObjectReference `json:"workloadRef,omitempty"` } // A ApplicationStatus represents the state of the entire application. @@ -480,7 +482,7 @@ type ApplicationStatus string // An ApplicationConfigurationStatus represents the observed state of a // ApplicationConfiguration. type ApplicationConfigurationStatus struct { - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // Status is a place holder for a customized controller to fill // if it needs a single place to summarize the status of the entire application @@ -518,14 +520,14 @@ type UnstaifiedDependency struct { // DependencyFromObject represents the object that dependency data comes from. type DependencyFromObject struct { - runtimev1alpha1.TypedReference `json:",inline"` - FieldPath string `json:"fieldPath,omitempty"` + corev1.ObjectReference `json:",inline"` + FieldPath string `json:"fieldPath,omitempty"` } // DependencyToObject represents the object that dependency data goes to. type DependencyToObject struct { - runtimev1alpha1.TypedReference `json:",inline"` - FieldPaths []string `json:"fieldPaths,omitempty"` + corev1.ObjectReference `json:",inline"` + FieldPaths []string `json:"fieldPaths,omitempty"` } // +kubebuilder:object:root=true @@ -569,7 +571,7 @@ type DataOutput struct { // StoreReference specifies the referenced object in DataOutput or DataInput type StoreReference struct { - runtimev1alpha1.TypedReference `json:",inline"` + corev1.ObjectReference `json:",inline"` // Operations specify the data processing operations Operations []DataOperation `json:"operations,omitempty"` } diff --git a/apis/core.oam.dev/v1alpha2/core_workload_types.go b/apis/core.oam.dev/v1alpha2/core_workload_types.go index 3d766c1f3..c4ca6760c 100644 --- a/apis/core.oam.dev/v1alpha2/core_workload_types.go +++ b/apis/core.oam.dev/v1alpha2/core_workload_types.go @@ -19,11 +19,13 @@ limitations under the License. package v1alpha2 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/pkg/oam" ) @@ -378,10 +380,10 @@ type ContainerizedWorkloadSpec struct { // A ContainerizedWorkloadStatus represents the observed state of a // ContainerizedWorkload. type ContainerizedWorkloadStatus struct { - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // Resources managed by this containerised workload. - Resources []runtimev1alpha1.TypedReference `json:"resources,omitempty"` + Resources []corev1.ObjectReference `json:"resources,omitempty"` } var _ oam.Workload = &ContainerizedWorkload{} diff --git a/apis/core.oam.dev/v1alpha2/methods.go b/apis/core.oam.dev/v1alpha2/methods.go index 296d6927d..5e2d16013 100644 --- a/apis/core.oam.dev/v1alpha2/methods.go +++ b/apis/core.oam.dev/v1alpha2/methods.go @@ -19,75 +19,77 @@ limitations under the License. package v1alpha2 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" + + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" ) // GetCondition of this ManualScalerTrait. -func (tr *ManualScalerTrait) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (tr *ManualScalerTrait) GetCondition(ct condition.ConditionType) condition.Condition { return tr.Status.GetCondition(ct) } // SetConditions of this ManualScalerTrait. -func (tr *ManualScalerTrait) SetConditions(c ...runtimev1alpha1.Condition) { +func (tr *ManualScalerTrait) SetConditions(c ...condition.Condition) { tr.Status.SetConditions(c...) } // GetWorkloadReference of this ManualScalerTrait. -func (tr *ManualScalerTrait) GetWorkloadReference() runtimev1alpha1.TypedReference { +func (tr *ManualScalerTrait) GetWorkloadReference() corev1.ObjectReference { return tr.Spec.WorkloadReference } // SetWorkloadReference of this ManualScalerTrait. -func (tr *ManualScalerTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) { +func (tr *ManualScalerTrait) SetWorkloadReference(r corev1.ObjectReference) { tr.Spec.WorkloadReference = r } // GetCondition of this ApplicationConfiguration. -func (ac *ApplicationConfiguration) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (ac *ApplicationConfiguration) GetCondition(ct condition.ConditionType) condition.Condition { return ac.Status.GetCondition(ct) } // SetConditions of this ApplicationConfiguration. -func (ac *ApplicationConfiguration) SetConditions(c ...runtimev1alpha1.Condition) { +func (ac *ApplicationConfiguration) SetConditions(c ...condition.Condition) { ac.Status.SetConditions(c...) } // GetCondition of this Component. -func (cm *Component) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (cm *Component) GetCondition(ct condition.ConditionType) condition.Condition { return cm.Status.GetCondition(ct) } // SetConditions of this Component. -func (cm *Component) SetConditions(c ...runtimev1alpha1.Condition) { +func (cm *Component) SetConditions(c ...condition.Condition) { cm.Status.SetConditions(c...) } // GetCondition of this ContainerizedWorkload. -func (wl *ContainerizedWorkload) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (wl *ContainerizedWorkload) GetCondition(ct condition.ConditionType) condition.Condition { return wl.Status.GetCondition(ct) } // SetConditions of this ContainerizedWorkload. -func (wl *ContainerizedWorkload) SetConditions(c ...runtimev1alpha1.Condition) { +func (wl *ContainerizedWorkload) SetConditions(c ...condition.Condition) { wl.Status.SetConditions(c...) } // GetCondition of this HealthScope. -func (hs *HealthScope) GetCondition(ct runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (hs *HealthScope) GetCondition(ct condition.ConditionType) condition.Condition { return hs.Status.GetCondition(ct) } // SetConditions of this HealthScope. -func (hs *HealthScope) SetConditions(c ...runtimev1alpha1.Condition) { +func (hs *HealthScope) SetConditions(c ...condition.Condition) { hs.Status.SetConditions(c...) } // GetWorkloadReferences to get all workload references for scope. -func (hs *HealthScope) GetWorkloadReferences() []runtimev1alpha1.TypedReference { +func (hs *HealthScope) GetWorkloadReferences() []corev1.ObjectReference { return hs.Spec.WorkloadReferences } // AddWorkloadReference to add a workload reference to this scope. -func (hs *HealthScope) AddWorkloadReference(r runtimev1alpha1.TypedReference) { +func (hs *HealthScope) AddWorkloadReference(r corev1.ObjectReference) { hs.Spec.WorkloadReferences = append(hs.Spec.WorkloadReferences, r) } diff --git a/apis/core.oam.dev/v1alpha2/zz_generated.deepcopy.go b/apis/core.oam.dev/v1alpha2/zz_generated.deepcopy.go index d45a12825..c22ccc15c 100644 --- a/apis/core.oam.dev/v1alpha2/zz_generated.deepcopy.go +++ b/apis/core.oam.dev/v1alpha2/zz_generated.deepcopy.go @@ -21,11 +21,11 @@ limitations under the License. package v1alpha2 import ( - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" - standard_oam_devv1alpha1 "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" + "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -135,7 +135,7 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) { in.RolloutStatus.DeepCopyInto(&out.RolloutStatus) if in.Components != nil { in, out := &in.Components, &out.Components - *out = make([]v1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } if in.Services != nil { @@ -147,7 +147,7 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) { } if in.ResourceTracker != nil { in, out := &in.ResourceTracker, &out.ResourceTracker - *out = new(v1alpha1.TypedReference) + *out = new(v1.ObjectReference) **out = **in } if in.LatestRevision != nil { @@ -608,7 +608,7 @@ func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec) { } if in.RolloutPlan != nil { in, out := &in.RolloutPlan, &out.RolloutPlan - *out = new(standard_oam_devv1alpha1.RolloutPlan) + *out = new(v1alpha1.RolloutPlan) (*in).DeepCopyInto(*out) } } @@ -1311,7 +1311,7 @@ func (in *ContainerizedWorkloadStatus) DeepCopyInto(out *ContainerizedWorkloadSt in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus) if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } } @@ -1418,7 +1418,7 @@ func (in *DataOutput) DeepCopy() *DataOutput { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DependencyFromObject) DeepCopyInto(out *DependencyFromObject) { *out = *in - out.TypedReference = in.TypedReference + out.ObjectReference = in.ObjectReference } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependencyFromObject. @@ -1456,7 +1456,7 @@ func (in *DependencyStatus) DeepCopy() *DependencyStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DependencyToObject) DeepCopyInto(out *DependencyToObject) { *out = *in - out.TypedReference = in.TypedReference + out.ObjectReference = in.ObjectReference if in.FieldPaths != nil { in, out := &in.FieldPaths, &out.FieldPaths *out = make([]string, len(*in)) @@ -1656,7 +1656,7 @@ func (in *HealthScopeSpec) DeepCopyInto(out *HealthScopeSpec) { } if in.WorkloadReferences != nil { in, out := &in.WorkloadReferences, &out.WorkloadReferences - *out = make([]v1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } } @@ -1934,7 +1934,7 @@ func (in *SecretKeySelector) DeepCopy() *SecretKeySelector { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StoreReference) DeepCopyInto(out *StoreReference) { *out = *in - out.TypedReference = in.TypedReference + out.ObjectReference = in.ObjectReference if in.Operations != nil { in, out := &in.Operations, &out.Operations *out = make([]DataOperation, len(*in)) diff --git a/apis/core.oam.dev/v1beta1/appdeployment_types.go b/apis/core.oam.dev/v1beta1/appdeployment_types.go index 97073550e..516dce94a 100644 --- a/apis/core.oam.dev/v1beta1/appdeployment_types.go +++ b/apis/core.oam.dev/v1beta1/appdeployment_types.go @@ -17,8 +17,9 @@ package v1beta1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" ) // AppDeploymentPhase defines the phase that the AppDeployment is undergoing. @@ -166,7 +167,7 @@ type AppDeploymentSpec struct { // AppDeploymentStatus defines the observed state of AppDeployment type AppDeploymentStatus struct { // Conditions represents the latest available observations of a CloneSet's current state. - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // Phase shows the phase that the AppDeployment is undergoing. // If Phase is Rolling, no update should be made to the spec. diff --git a/apis/core.oam.dev/v1beta1/application_types.go b/apis/core.oam.dev/v1beta1/application_types.go index 380b69ccd..ca02df527 100644 --- a/apis/core.oam.dev/v1beta1/application_types.go +++ b/apis/core.oam.dev/v1beta1/application_types.go @@ -17,11 +17,11 @@ package v1beta1 import ( - xpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" ) @@ -151,12 +151,12 @@ type ApplicationList struct { } // SetConditions set condition to application -func (app *Application) SetConditions(c ...xpv1alpha1.Condition) { +func (app *Application) SetConditions(c ...condition.Condition) { app.Status.SetConditions(c...) } // GetCondition get condition by given condition type -func (app *Application) GetCondition(t xpv1alpha1.ConditionType) xpv1alpha1.Condition { +func (app *Application) GetCondition(t condition.ConditionType) condition.Condition { return app.Status.GetCondition(t) } diff --git a/apis/core.oam.dev/v1beta1/approllout_types.go b/apis/core.oam.dev/v1beta1/approllout_types.go index 590aeaa78..6476f9eb4 100644 --- a/apis/core.oam.dev/v1beta1/approllout_types.go +++ b/apis/core.oam.dev/v1beta1/approllout_types.go @@ -20,6 +20,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" ) diff --git a/apis/core.oam.dev/v1beta1/componentdefinition_types.go b/apis/core.oam.dev/v1beta1/componentdefinition_types.go index e0f875d24..cf853b5e7 100644 --- a/apis/core.oam.dev/v1beta1/componentdefinition_types.go +++ b/apis/core.oam.dev/v1beta1/componentdefinition_types.go @@ -17,10 +17,11 @@ package v1beta1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/apis/core.oam.dev/common" ) @@ -59,7 +60,7 @@ type ComponentDefinitionSpec struct { // ComponentDefinitionStatus is the status of ComponentDefinition type ComponentDefinitionStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters. ConfigMapRef string `json:"configMapRef,omitempty"` // LatestRevision of the component definition @@ -84,12 +85,12 @@ type ComponentDefinition struct { } // SetConditions set condition for ComponentDefinition -func (cd *ComponentDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) { cd.Status.SetConditions(c...) } // GetCondition gets condition from ComponentDefinition -func (cd *ComponentDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return cd.Status.GetCondition(conditionType) } diff --git a/apis/core.oam.dev/v1beta1/core_types.go b/apis/core.oam.dev/v1beta1/core_types.go index e7c024d97..46486ca86 100644 --- a/apis/core.oam.dev/v1beta1/core_types.go +++ b/apis/core.oam.dev/v1beta1/core_types.go @@ -17,10 +17,11 @@ package v1beta1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" + + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" ) @@ -59,7 +60,7 @@ type WorkloadDefinitionSpec struct { // WorkloadDefinitionStatus is the status of WorkloadDefinition type WorkloadDefinitionStatus struct { - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` } // +kubebuilder:object:root=true @@ -81,12 +82,12 @@ type WorkloadDefinition struct { } // SetConditions set condition for WorkloadDefinition -func (wd *WorkloadDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) { wd.Status.SetConditions(c...) } // GetCondition gets condition from WorkloadDefinition -func (wd *WorkloadDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return wd.Status.GetCondition(conditionType) } @@ -156,7 +157,7 @@ type TraitDefinitionSpec struct { // TraitDefinitionStatus is the status of TraitDefinition type TraitDefinitionStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters. ConfigMapRef string `json:"configMapRef,omitempty"` // LatestRevision of the component definition @@ -184,12 +185,12 @@ type TraitDefinition struct { } // SetConditions set condition for TraitDefinition -func (td *TraitDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (td *TraitDefinition) SetConditions(c ...condition.Condition) { td.Status.SetConditions(c...) } // GetCondition gets condition from TraitDefinition -func (td *TraitDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return td.Status.GetCondition(conditionType) } @@ -259,28 +260,7 @@ type ResourceTracker struct { // ResourceTrackerStatus define the status of resourceTracker type ResourceTrackerStatus struct { - TrackedResources []TypedReference `json:"trackedResources,omitempty"` -} - -// A TypedReference refers to an object by Name, Kind, and APIVersion. It is -// commonly used to reference across-namespace objects -type TypedReference struct { - // APIVersion of the referenced object. - APIVersion string `json:"apiVersion"` - - // Kind of the referenced object. - Kind string `json:"kind"` - - // Name of the referenced object. - Name string `json:"name"` - - // Namespace of the objects outside the application namespace. - // +optional - Namespace string `json:"namespace,omitempty"` - - // UID of the referenced object. - // +optional - UID types.UID `json:"uid,omitempty"` + TrackedResources []corev1.ObjectReference `json:"trackedResources,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/core.oam.dev/v1beta1/initializer_type.go b/apis/core.oam.dev/v1beta1/initializer_type.go index a6af53b2b..d4417f778 100644 --- a/apis/core.oam.dev/v1beta1/initializer_type.go +++ b/apis/core.oam.dev/v1beta1/initializer_type.go @@ -17,9 +17,10 @@ package v1beta1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" ) // InitializerPhase is a label for the condition of a initializer at the current time @@ -52,7 +53,7 @@ type InitializerSpec struct { // InitializerStatus is the status of Initializer type InitializerStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` Phase InitializerPhase `json:"status,omitempty"` @@ -86,11 +87,11 @@ type InitializerList struct { } // SetConditions set condition for Initializer -func (i *Initializer) SetConditions(c ...runtimev1alpha1.Condition) { +func (i *Initializer) SetConditions(c ...condition.Condition) { i.Status.SetConditions(c...) } // GetCondition gets condition from Initializer -func (i *Initializer) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (i *Initializer) GetCondition(conditionType condition.ConditionType) condition.Condition { return i.Status.GetCondition(conditionType) } diff --git a/apis/core.oam.dev/v1beta1/policy_definition.go b/apis/core.oam.dev/v1beta1/policy_definition.go index 9db7ccd26..5f4e8bb13 100644 --- a/apis/core.oam.dev/v1beta1/policy_definition.go +++ b/apis/core.oam.dev/v1beta1/policy_definition.go @@ -17,9 +17,10 @@ package v1beta1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/apis/core.oam.dev/common" ) @@ -36,7 +37,7 @@ type PolicyDefinitionSpec struct { // PolicyDefinitionStatus is the status of PolicyDefinition type PolicyDefinitionStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // LatestRevision of the component definition // +optional @@ -44,12 +45,12 @@ type PolicyDefinitionStatus struct { } // SetConditions set condition for PolicyDefinition -func (d *PolicyDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (d *PolicyDefinition) SetConditions(c ...condition.Condition) { d.Status.SetConditions(c...) } // GetCondition gets condition from PolicyDefinition -func (d *PolicyDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (d *PolicyDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return d.Status.GetCondition(conditionType) } diff --git a/apis/core.oam.dev/v1beta1/workflow_step_definition.go b/apis/core.oam.dev/v1beta1/workflow_step_definition.go index 9578de03b..0664e9585 100644 --- a/apis/core.oam.dev/v1beta1/workflow_step_definition.go +++ b/apis/core.oam.dev/v1beta1/workflow_step_definition.go @@ -17,9 +17,10 @@ package v1beta1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/apis/core.oam.dev/common" ) @@ -36,7 +37,7 @@ type WorkflowStepDefinitionSpec struct { // WorkflowStepDefinitionStatus is the status of WorkflowStepDefinition type WorkflowStepDefinitionStatus struct { // ConditionedStatus reflects the observed status of a resource - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // LatestRevision of the component definition // +optional @@ -44,12 +45,12 @@ type WorkflowStepDefinitionStatus struct { } // SetConditions set condition for WorkflowStepDefinition -func (d *WorkflowStepDefinition) SetConditions(c ...runtimev1alpha1.Condition) { +func (d *WorkflowStepDefinition) SetConditions(c ...condition.Condition) { d.Status.SetConditions(c...) } // GetCondition gets condition from WorkflowStepDefinition -func (d *WorkflowStepDefinition) GetCondition(conditionType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (d *WorkflowStepDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition { return d.Status.GetCondition(conditionType) } diff --git a/apis/core.oam.dev/v1beta1/zz_generated.deepcopy.go b/apis/core.oam.dev/v1beta1/zz_generated.deepcopy.go index 4c18c3dbb..931b76e73 100644 --- a/apis/core.oam.dev/v1beta1/zz_generated.deepcopy.go +++ b/apis/core.oam.dev/v1beta1/zz_generated.deepcopy.go @@ -21,6 +21,7 @@ limitations under the License. package v1beta1 import ( + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" @@ -1229,7 +1230,7 @@ func (in *ResourceTrackerStatus) DeepCopyInto(out *ResourceTrackerStatus) { *out = *in if in.TrackedResources != nil { in, out := &in.TrackedResources, &out.TrackedResources - *out = make([]TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } } @@ -1514,21 +1515,6 @@ func (in *TraitDefinitionStatus) DeepCopy() *TraitDefinitionStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TypedReference) DeepCopyInto(out *TypedReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TypedReference. -func (in *TypedReference) DeepCopy() *TypedReference { - if in == nil { - return nil - } - out := new(TypedReference) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *URIMatch) DeepCopyInto(out *URIMatch) { *out = *in diff --git a/apis/standard.oam.dev/v1alpha1/podspecworkload_types.go b/apis/standard.oam.dev/v1alpha1/podspecworkload_types.go index a6ff69d67..996bf226e 100644 --- a/apis/standard.oam.dev/v1alpha1/podspecworkload_types.go +++ b/apis/standard.oam.dev/v1alpha1/podspecworkload_types.go @@ -17,10 +17,11 @@ limitations under the License. package v1alpha1 import ( - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/pkg/oam" ) @@ -38,10 +39,10 @@ type PodSpecWorkloadSpec struct { // PodSpecWorkloadStatus defines the observed state of PodSpecWorkload type PodSpecWorkloadStatus struct { - cpv1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // Resources managed by this workload. - Resources []cpv1alpha1.TypedReference `json:"resources,omitempty"` + Resources []v1.ObjectReference `json:"resources,omitempty"` } // +kubebuilder:object:root=true @@ -71,11 +72,11 @@ type PodSpecWorkloadList struct { var _ oam.Workload = &PodSpecWorkload{} // SetConditions set condition for this CR -func (in *PodSpecWorkload) SetConditions(c ...cpv1alpha1.Condition) { +func (in *PodSpecWorkload) SetConditions(c ...condition.Condition) { in.Status.SetConditions(c...) } // GetCondition set condition for this CR -func (in *PodSpecWorkload) GetCondition(c cpv1alpha1.ConditionType) cpv1alpha1.Condition { +func (in *PodSpecWorkload) GetCondition(c condition.ConditionType) condition.Condition { return in.Status.GetCondition(c) } diff --git a/apis/standard.oam.dev/v1alpha1/rollout_plan_types.go b/apis/standard.oam.dev/v1alpha1/rollout_plan_types.go index 52a63a8d9..c02cf5b1e 100644 --- a/apis/standard.oam.dev/v1alpha1/rollout_plan_types.go +++ b/apis/standard.oam.dev/v1alpha1/rollout_plan_types.go @@ -17,8 +17,10 @@ limitations under the License. package v1alpha1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" + + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" ) // RolloutStrategyType defines strategies for pods rollout @@ -228,7 +230,7 @@ type CanaryMetric struct { // TemplateRef references a metric template object // +optional - TemplateRef *runtimev1alpha1.TypedReference `json:"templateRef,omitempty"` + TemplateRef *corev1.ObjectReference `json:"templateRef,omitempty"` } // MetricsExpectedRange defines the range used for metrics validation @@ -245,7 +247,7 @@ type MetricsExpectedRange struct { // RolloutStatus defines the observed state of a rollout plan type RolloutStatus struct { // Conditions represents the latest available observations of a CloneSet's current state. - runtimev1alpha1.ConditionedStatus `json:",inline"` + condition.ConditionedStatus `json:",inline"` // RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification // and does not change until the rollout is restarted diff --git a/apis/standard.oam.dev/v1alpha1/rollout_state.go b/apis/standard.oam.dev/v1alpha1/rollout_state.go index f2a257211..aa36a46bb 100644 --- a/apis/standard.oam.dev/v1alpha1/rollout_state.go +++ b/apis/standard.oam.dev/v1alpha1/rollout_state.go @@ -20,7 +20,8 @@ import ( "fmt" "time" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" @@ -81,40 +82,40 @@ const ( // These are valid conditions of the rollout. const ( // RolloutSpecVerifying indicates that the rollout just started with verification - RolloutSpecVerifying runtimev1alpha1.ConditionType = "RolloutSpecVerifying" + RolloutSpecVerifying condition.ConditionType = "RolloutSpecVerifying" // RolloutInitializing means we start to initialize the cluster - RolloutInitializing runtimev1alpha1.ConditionType = "RolloutInitializing" + RolloutInitializing condition.ConditionType = "RolloutInitializing" // RolloutInProgress means we are upgrading resources. - RolloutInProgress runtimev1alpha1.ConditionType = "RolloutInProgress" + RolloutInProgress condition.ConditionType = "RolloutInProgress" // RolloutFinalizing means the rollout is finalizing - RolloutFinalizing runtimev1alpha1.ConditionType = "RolloutFinalizing" + RolloutFinalizing condition.ConditionType = "RolloutFinalizing" // RolloutFailing means the rollout is failing - RolloutFailing runtimev1alpha1.ConditionType = "RolloutFailing" + RolloutFailing condition.ConditionType = "RolloutFailing" // RolloutAbandoning means that the rollout is being abandoned. - RolloutAbandoning runtimev1alpha1.ConditionType = "RolloutAbandoning" + RolloutAbandoning condition.ConditionType = "RolloutAbandoning" // RolloutDeleting means that the rollout is being deleted. - RolloutDeleting runtimev1alpha1.ConditionType = "RolloutDeleting" + RolloutDeleting condition.ConditionType = "RolloutDeleting" // RolloutFailed means that the rollout failed. - RolloutFailed runtimev1alpha1.ConditionType = "RolloutFailed" + RolloutFailed condition.ConditionType = "RolloutFailed" // RolloutSucceed means that the rollout is done. - RolloutSucceed runtimev1alpha1.ConditionType = "RolloutSucceed" + RolloutSucceed condition.ConditionType = "RolloutSucceed" // BatchInitializing - BatchInitializing runtimev1alpha1.ConditionType = "BatchInitializing" + BatchInitializing condition.ConditionType = "BatchInitializing" // BatchPaused - BatchPaused runtimev1alpha1.ConditionType = "BatchPaused" + BatchPaused condition.ConditionType = "BatchPaused" // BatchVerifying - BatchVerifying runtimev1alpha1.ConditionType = "BatchVerifying" + BatchVerifying condition.ConditionType = "BatchVerifying" // BatchRolloutFailed - BatchRolloutFailed runtimev1alpha1.ConditionType = "BatchRolloutFailed" + BatchRolloutFailed condition.ConditionType = "BatchRolloutFailed" // BatchFinalizing - BatchFinalizing runtimev1alpha1.ConditionType = "BatchFinalizing" + BatchFinalizing condition.ConditionType = "BatchFinalizing" // BatchReady - BatchReady runtimev1alpha1.ConditionType = "BatchReady" + BatchReady condition.ConditionType = "BatchReady" ) // NewPositiveCondition creates a positive condition type -func NewPositiveCondition(condType runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { - return runtimev1alpha1.Condition{ +func NewPositiveCondition(condType condition.ConditionType) condition.Condition { + return condition.Condition{ Type: condType, Status: v1.ConditionTrue, LastTransitionTime: metav1.NewTime(time.Now()), @@ -122,8 +123,8 @@ func NewPositiveCondition(condType runtimev1alpha1.ConditionType) runtimev1alpha } // NewNegativeCondition creates a false condition type -func NewNegativeCondition(condType runtimev1alpha1.ConditionType, message string) runtimev1alpha1.Condition { - return runtimev1alpha1.Condition{ +func NewNegativeCondition(condType condition.ConditionType, message string) condition.Condition { + return condition.Condition{ Type: condType, Status: v1.ConditionFalse, LastTransitionTime: metav1.NewTime(time.Now()), @@ -135,7 +136,7 @@ const invalidRollingStateTransition = "the rollout state transition from `%s` st const invalidBatchRollingStateTransition = "the batch rolling state transition from `%s` state with `%s` is invalid" -func (r *RolloutStatus) getRolloutConditionType() runtimev1alpha1.ConditionType { +func (r *RolloutStatus) getRolloutConditionType() condition.ConditionType { // figure out which condition type should we put in the condition depends on its state switch r.RollingState { case VerifyingSpecState: @@ -220,7 +221,7 @@ func (r *RolloutStatus) ResetStatus() { // SetRolloutCondition sets the supplied condition, replacing any existing condition // of the same type unless they are identical. -func (r *RolloutStatus) SetRolloutCondition(new runtimev1alpha1.Condition) { +func (r *RolloutStatus) SetRolloutCondition(new condition.Condition) { exists := false for i, existing := range r.Conditions { if existing.Type != new.Type { diff --git a/apis/standard.oam.dev/v1alpha1/rollouttrait_types.go b/apis/standard.oam.dev/v1alpha1/rollouttrait_types.go index 46f1eeec2..53309348b 100644 --- a/apis/standard.oam.dev/v1alpha1/rollouttrait_types.go +++ b/apis/standard.oam.dev/v1alpha1/rollouttrait_types.go @@ -17,9 +17,11 @@ limitations under the License. package v1alpha1 import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/oam-dev/kubevela/pkg/oam" ) @@ -28,12 +30,12 @@ type RolloutTraitSpec struct { // TargetRef references a target resource that contains the newer version // of the software. We assumed that new resource already exists. // This is the only resource we work on if the resource is a stateful resource (cloneset/statefulset) - TargetRef runtimev1alpha1.TypedReference `json:"targetRef"` + TargetRef corev1.ObjectReference `json:"targetRef"` // SourceRef references the list of resources that contains the older version // of the software. We assume that it's the first time to deploy when we cannot find any source. // +optional - SourceRef []runtimev1alpha1.TypedReference `json:"sourceRef,omitempty"` + SourceRef []corev1.ObjectReference `json:"sourceRef,omitempty"` // RolloutPlan is the details on how to rollout the resources RolloutPlan RolloutPlan `json:"rolloutPlan"` @@ -68,21 +70,21 @@ func init() { var _ oam.Trait = &RolloutTrait{} // SetConditions for set CR condition -func (tr *RolloutTrait) SetConditions(c ...runtimev1alpha1.Condition) { +func (tr *RolloutTrait) SetConditions(c ...condition.Condition) { tr.Status.SetConditions(c...) } // GetCondition for get CR condition -func (tr *RolloutTrait) GetCondition(c runtimev1alpha1.ConditionType) runtimev1alpha1.Condition { +func (tr *RolloutTrait) GetCondition(c condition.ConditionType) condition.Condition { return tr.Status.GetCondition(c) } // GetWorkloadReference of this MetricsTrait. -func (tr *RolloutTrait) GetWorkloadReference() runtimev1alpha1.TypedReference { +func (tr *RolloutTrait) GetWorkloadReference() corev1.ObjectReference { return tr.Spec.TargetRef } // SetWorkloadReference of this MetricsTrait. -func (tr *RolloutTrait) SetWorkloadReference(r runtimev1alpha1.TypedReference) { +func (tr *RolloutTrait) SetWorkloadReference(r corev1.ObjectReference) { tr.Spec.TargetRef = r } diff --git a/apis/standard.oam.dev/v1alpha1/zz_generated.deepcopy.go b/apis/standard.oam.dev/v1alpha1/zz_generated.deepcopy.go index 2d4c0a9eb..330bde953 100644 --- a/apis/standard.oam.dev/v1alpha1/zz_generated.deepcopy.go +++ b/apis/standard.oam.dev/v1alpha1/zz_generated.deepcopy.go @@ -21,7 +21,7 @@ limitations under the License. package v1alpha1 import ( - corev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -36,7 +36,7 @@ func (in *CanaryMetric) DeepCopyInto(out *CanaryMetric) { } if in.TemplateRef != nil { in, out := &in.TemplateRef, &out.TemplateRef - *out = new(corev1alpha1.TypedReference) + *out = new(v1.ObjectReference) **out = **in } } @@ -178,7 +178,7 @@ func (in *PodSpecWorkloadStatus) DeepCopyInto(out *PodSpecWorkloadStatus) { in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus) if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]corev1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } } @@ -445,7 +445,7 @@ func (in *RolloutTraitSpec) DeepCopyInto(out *RolloutTraitSpec) { out.TargetRef = in.TargetRef if in.SourceRef != nil { in, out := &in.SourceRef, &out.SourceRef - *out = make([]corev1alpha1.TypedReference, len(*in)) + *out = make([]v1.ObjectReference, len(*in)) copy(*out, *in) } in.RolloutPlan.DeepCopyInto(&out.RolloutPlan) diff --git a/apis/types/capability.go b/apis/types/capability.go index 550930731..87ff44563 100644 --- a/apis/types/capability.go +++ b/apis/types/capability.go @@ -19,12 +19,12 @@ package types import ( "encoding/json" - "cuelang.org/go/cue" - "github.com/google/go-cmp/cmp" - "github.com/spf13/pflag" "k8s.io/apimachinery/pkg/runtime" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + + "cuelang.org/go/cue" + "github.com/spf13/pflag" ) // Source record the source of Capability @@ -39,38 +39,6 @@ type CRDInfo struct { Kind string `json:"kind"` } -// Capability defines the content of a capability -type Capability struct { - Name string `json:"name"` - Type CapType `json:"type"` - CueTemplate string `json:"template,omitempty"` - CueTemplateURI string `json:"templateURI,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` - CrdName string `json:"crdName,omitempty"` - Center string `json:"center,omitempty"` - Status string `json:"status,omitempty"` - Description string `json:"description,omitempty"` - Category CapabilityCategory `json:"category,omitempty"` - - // trait only - AppliesTo []string `json:"appliesTo,omitempty"` - - // Namespace represents it's a system-level or user-level capability. - Namespace string `json:"namespace,omitempty"` - - // Plugin Source - Source *Source `json:"source,omitempty"` - Install *Installation `json:"install,omitempty"` - CrdInfo *CRDInfo `json:"crdInfo,omitempty"` - - // Terraform - TerraformConfiguration string `json:"terraformConfiguration,omitempty"` - - // KubeTemplate - KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"` - KubeParameter []common.KubeParameter `json:"kubeparameter,omitempty"` -} - // Chart defines all necessary information to install a whole chart type Chart struct { Repo string `json:"repo"` @@ -183,72 +151,34 @@ func SetFlagBy(flags *pflag.FlagSet, v Parameter) { } } -// CapabilityCmpOptions will set compare option -var CapabilityCmpOptions = []cmp.Option{ - cmp.Comparer(func(a, b Parameter) bool { - if a.Name != b.Name || a.Short != b.Short || a.Required != b.Required || - a.Usage != b.Usage || a.Type != b.Type { - return false - } - // nolint:exhaustive - switch a.Type { - case cue.IntKind: - var va, vb int64 - switch vala := a.Default.(type) { - case int64: - va = vala - case json.Number: - va, _ = vala.Int64() - case int: - va = int64(vala) - case float64: - va = int64(vala) - } - switch valb := b.Default.(type) { - case int64: - vb = valb - case json.Number: - vb, _ = valb.Int64() - case int: - vb = int64(valb) - case float64: - vb = int64(valb) - } - return va == vb - case cue.StringKind: - return a.Default.(string) == b.Default.(string) - case cue.BoolKind: - return a.Default.(bool) == b.Default.(bool) - case cue.NumberKind, cue.FloatKind: - var va, vb float64 - switch vala := a.Default.(type) { - case int64: - va = float64(vala) - case json.Number: - va, _ = vala.Float64() - case int: - va = float64(vala) - case float64: - va = vala - } - switch valb := b.Default.(type) { - case int64: - vb = float64(valb) - case json.Number: - vb, _ = valb.Float64() - case int: - vb = float64(valb) - case float64: - vb = valb - } - return va == vb - default: - // complex type not supported, will regard them as not changed. - } - return true - })} +// Capability defines the content of a capability +type Capability struct { + Name string `json:"name"` + Type CapType `json:"type"` + CueTemplate string `json:"template,omitempty"` + CueTemplateURI string `json:"templateURI,omitempty"` + Parameters []Parameter `json:"parameters,omitempty"` + CrdName string `json:"crdName,omitempty"` + Center string `json:"center,omitempty"` + Status string `json:"status,omitempty"` + Description string `json:"description,omitempty"` + Category CapabilityCategory `json:"category,omitempty"` -// EqualCapability will check whether two capabilities is equal -func EqualCapability(a, b Capability) bool { - return cmp.Equal(a, b, CapabilityCmpOptions...) + // trait only + AppliesTo []string `json:"appliesTo,omitempty"` + + // Namespace represents it's a system-level or user-level capability. + Namespace string `json:"namespace,omitempty"` + + // Plugin Source + Source *Source `json:"source,omitempty"` + Install *Installation `json:"install,omitempty"` + CrdInfo *CRDInfo `json:"crdInfo,omitempty"` + + // Terraform + TerraformConfiguration string `json:"terraformConfiguration,omitempty"` + + // KubeTemplate + KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"` + KubeParameter []common.KubeParameter `json:"kubeparameter,omitempty"` } diff --git a/charts/oam-runtime/crds/core.oam.dev_applicationconfigurations.yaml b/charts/oam-runtime/crds/core.oam.dev_applicationconfigurations.yaml index 6e5506875..64c2a2e34 100644 --- a/charts/oam-runtime/crds/core.oam.dev_applicationconfigurations.yaml +++ b/charts/oam-runtime/crds/core.oam.dev_applicationconfigurations.yaml @@ -78,13 +78,19 @@ spec: description: InputStore specifies the object used to read intermediate data genereted by DataOutput properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -145,13 +151,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object strategyMergeKeys: description: StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array. The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append. If StrategyMergeKeys specified, we will check the key in the target array. If any key exist, do update; if no key exist, append. @@ -215,13 +220,19 @@ spec: description: OutputStore specifies the object used to store intermediate data generated by Operations properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -282,13 +293,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -323,21 +333,26 @@ spec: description: A ScopeReference must refer to an OAM scope resource. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - scopeRef @@ -383,13 +398,19 @@ spec: description: InputStore specifies the object used to read intermediate data genereted by DataOutput properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -450,13 +471,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object strategyMergeKeys: description: StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array. The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append. If StrategyMergeKeys specified, we will check the key in the target array. If any key exist, do update; if no key exist, append. @@ -520,13 +540,19 @@ spec: description: OutputStore specifies the object used to store intermediate data generated by Operations properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -587,13 +613,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -653,23 +678,26 @@ spec: description: DependencyFromObject represents the object that dependency data comes from. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. type: string fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object reason: type: string @@ -677,25 +705,30 @@ spec: description: DependencyToObject represents the object that dependency data goes to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string fieldPaths: items: type: string type: array kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - from @@ -716,21 +749,26 @@ spec: description: Reference to running workload. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -770,21 +808,26 @@ spec: description: Reference to a scope created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object status: description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the scope @@ -818,21 +861,26 @@ spec: description: Reference to a trait created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - traitRef @@ -842,21 +890,26 @@ spec: description: Reference to a workload created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array diff --git a/charts/oam-runtime/crds/core.oam.dev_containerizedworkloads.yaml b/charts/oam-runtime/crds/core.oam.dev_containerizedworkloads.yaml index cf3f78e14..e1177584c 100644 --- a/charts/oam-runtime/crds/core.oam.dev_containerizedworkloads.yaml +++ b/charts/oam-runtime/crds/core.oam.dev_containerizedworkloads.yaml @@ -437,24 +437,29 @@ spec: resources: description: Resources managed by this containerised workload. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/charts/oam-runtime/crds/core.oam.dev_healthscopes.yaml b/charts/oam-runtime/crds/core.oam.dev_healthscopes.yaml index 65e6007dd..55525f7fc 100644 --- a/charts/oam-runtime/crds/core.oam.dev_healthscopes.yaml +++ b/charts/oam-runtime/crds/core.oam.dev_healthscopes.yaml @@ -48,24 +48,29 @@ spec: workloadRefs: description: WorkloadReferences to the workloads that are in this scope. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array required: @@ -116,24 +121,29 @@ spec: description: HealthStatus represents health status strings. type: string targetWorkload: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object workloadStatus: description: WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN. diff --git a/charts/oam-runtime/crds/core.oam.dev_manualscalertraits.yaml b/charts/oam-runtime/crds/core.oam.dev_manualscalertraits.yaml index 6ab29c76d..477c8ec66 100644 --- a/charts/oam-runtime/crds/core.oam.dev_manualscalertraits.yaml +++ b/charts/oam-runtime/crds/core.oam.dev_manualscalertraits.yaml @@ -41,21 +41,26 @@ spec: description: WorkloadReference to the workload this trait applies to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - replicaCount diff --git a/charts/vela-core/crds/core.oam.dev_applicationcontexts.yaml b/charts/vela-core/crds/core.oam.dev_applicationcontexts.yaml index 22a5c3cc5..322c8f4cf 100644 --- a/charts/vela-core/crds/core.oam.dev_applicationcontexts.yaml +++ b/charts/vela-core/crds/core.oam.dev_applicationcontexts.yaml @@ -83,23 +83,26 @@ spec: description: DependencyFromObject represents the object that dependency data comes from. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. type: string fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object reason: type: string @@ -107,25 +110,30 @@ spec: description: DependencyToObject represents the object that dependency data goes to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string fieldPaths: items: type: string type: array kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - from @@ -146,21 +154,26 @@ spec: description: Reference to running workload. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -200,21 +213,26 @@ spec: description: Reference to a scope created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object status: description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the scope @@ -248,21 +266,26 @@ spec: description: Reference to a trait created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - traitRef @@ -272,21 +295,26 @@ spec: description: Reference to a workload created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array diff --git a/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml b/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml index 6da33aca7..8f6cb3f10 100644 --- a/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml +++ b/charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml @@ -127,21 +127,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -223,21 +228,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -316,24 +326,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -387,21 +402,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -492,24 +512,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -552,24 +577,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -589,24 +619,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string @@ -1429,21 +1464,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -1525,21 +1565,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -1665,24 +1710,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -1736,21 +1786,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -1841,24 +1896,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -1901,24 +1961,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -1938,24 +2003,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string diff --git a/charts/vela-core/crds/core.oam.dev_applications.yaml b/charts/vela-core/crds/core.oam.dev_applications.yaml index d18f74e52..f88fc7fcb 100644 --- a/charts/vela-core/crds/core.oam.dev_applications.yaml +++ b/charts/vela-core/crds/core.oam.dev_applications.yaml @@ -139,21 +139,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -235,21 +240,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -328,24 +338,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -399,21 +414,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -504,24 +524,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -564,24 +589,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -601,24 +631,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string @@ -766,21 +801,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -862,21 +902,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -1002,24 +1047,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -1073,21 +1123,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -1178,24 +1233,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -1238,24 +1298,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -1275,24 +1340,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string diff --git a/charts/vela-core/crds/core.oam.dev_approllouts.yaml b/charts/vela-core/crds/core.oam.dev_approllouts.yaml index 10c27b315..c3c815e12 100644 --- a/charts/vela-core/crds/core.oam.dev_approllouts.yaml +++ b/charts/vela-core/crds/core.oam.dev_approllouts.yaml @@ -100,21 +100,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -196,21 +201,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -452,21 +462,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -548,21 +563,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name diff --git a/charts/vela-core/crds/core.oam.dev_containerizedworkloads.yaml b/charts/vela-core/crds/core.oam.dev_containerizedworkloads.yaml index cf3f78e14..e1177584c 100644 --- a/charts/vela-core/crds/core.oam.dev_containerizedworkloads.yaml +++ b/charts/vela-core/crds/core.oam.dev_containerizedworkloads.yaml @@ -437,24 +437,29 @@ spec: resources: description: Resources managed by this containerised workload. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/charts/vela-core/crds/core.oam.dev_healthscopes.yaml b/charts/vela-core/crds/core.oam.dev_healthscopes.yaml index 65e6007dd..55525f7fc 100644 --- a/charts/vela-core/crds/core.oam.dev_healthscopes.yaml +++ b/charts/vela-core/crds/core.oam.dev_healthscopes.yaml @@ -48,24 +48,29 @@ spec: workloadRefs: description: WorkloadReferences to the workloads that are in this scope. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array required: @@ -116,24 +121,29 @@ spec: description: HealthStatus represents health status strings. type: string targetWorkload: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object workloadStatus: description: WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN. diff --git a/charts/vela-core/crds/core.oam.dev_initializers.yaml b/charts/vela-core/crds/core.oam.dev_initializers.yaml index 41b38283a..a601a8c17 100644 --- a/charts/vela-core/crds/core.oam.dev_initializers.yaml +++ b/charts/vela-core/crds/core.oam.dev_initializers.yaml @@ -148,21 +148,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -244,21 +249,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -384,24 +394,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -455,21 +470,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -560,24 +580,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -620,24 +645,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -657,24 +687,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string diff --git a/charts/vela-core/crds/core.oam.dev_manualscalertraits.yaml b/charts/vela-core/crds/core.oam.dev_manualscalertraits.yaml index 6ab29c76d..477c8ec66 100644 --- a/charts/vela-core/crds/core.oam.dev_manualscalertraits.yaml +++ b/charts/vela-core/crds/core.oam.dev_manualscalertraits.yaml @@ -41,21 +41,26 @@ spec: description: WorkloadReference to the workload this trait applies to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - replicaCount diff --git a/charts/vela-core/crds/core.oam.dev_resourcetrackers.yaml b/charts/vela-core/crds/core.oam.dev_resourcetrackers.yaml index 79a42d74f..b8feeca0b 100644 --- a/charts/vela-core/crds/core.oam.dev_resourcetrackers.yaml +++ b/charts/vela-core/crds/core.oam.dev_resourcetrackers.yaml @@ -37,27 +37,29 @@ spec: properties: trackedResources: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference across-namespace objects + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string namespace: - description: Namespace of the objects outside the application namespace. + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml b/charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml index f60bc7f7f..4288bd31f 100644 --- a/charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml +++ b/charts/vela-core/crds/standard.oam.dev_podspecworkloads.yaml @@ -3592,24 +3592,29 @@ spec: resources: description: Resources managed by this workload. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/charts/vela-core/crds/standard.oam.dev_rollouts.yaml b/charts/vela-core/crds/standard.oam.dev_rollouts.yaml index 8bc5b3325..cfccbf747 100644 --- a/charts/vela-core/crds/standard.oam.dev_rollouts.yaml +++ b/charts/vela-core/crds/standard.oam.dev_rollouts.yaml @@ -95,21 +95,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -191,21 +196,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name diff --git a/charts/vela-core/crds/standard.oam.dev_rollouttraits.yaml b/charts/vela-core/crds/standard.oam.dev_rollouttraits.yaml index ae2bff692..ac82f71d3 100644 --- a/charts/vela-core/crds/standard.oam.dev_rollouttraits.yaml +++ b/charts/vela-core/crds/standard.oam.dev_rollouttraits.yaml @@ -71,21 +71,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -167,21 +172,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -254,45 +264,55 @@ spec: sourceRef: description: SourceRef references the list of resources that contains the older version of the software. We assume that it's the first time to deploy when we cannot find any source. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array targetRef: description: TargetRef references a target resource that contains the newer version of the software. We assumed that new resource already exists. This is the only resource we work on if the resource is a stateful resource (cloneset/statefulset) properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - rolloutPlan diff --git a/design/vela-core/rollout-design.md b/design/vela-core/rollout-design.md index 52d29eb9a..a35a8f3dc 100644 --- a/design/vela-core/rollout-design.md +++ b/design/vela-core/rollout-design.md @@ -68,12 +68,12 @@ type RolloutTraitSpec struct { // TargetRef references a target resource that contains the newer version // of the software. We assumed that new resource already exists. // This is the only resource we work on if the resource is a stateful resource (cloneset/statefulset) - TargetRef runtimev1alpha1.TypedReference `json:"targetRef"` + TargetRef corev1.ObjectReference `json:"targetRef"` // SourceRef references the list of resources that contains the older version // of the software. We assume that it's the first time to deploy when we cannot find any source. // +optional - SourceRef []runtimev1alpha1.TypedReference `json:"sourceRef,omitempty"` + SourceRef []corev1.ObjectReference `json:"sourceRef,omitempty"` // RolloutPlan is the details on how to rollout the resources RolloutPlan RolloutPlan `json:"rolloutPlan"` diff --git a/design/vela-core/route.md b/design/vela-core/route.md index e0c39e63e..906bcd301 100644 --- a/design/vela-core/route.md +++ b/design/vela-core/route.md @@ -15,7 +15,7 @@ The schema is also clean and easy to understand. // RouteSpec defines the desired state of Route type RouteSpec struct { // WorkloadReference to the workload whose metrics needs to be exposed - WorkloadReference runtimev1alpha1.TypedReference `json:"workloadRef,omitempty"` + WorkloadReference corev1.ObjectReference `json:"workloadRef,omitempty"` // Host is the host of the route Host string `json:"host"` @@ -47,7 +47,7 @@ type Rule struct { CustomHeaders map[string]string `json:"customHeaders,omitempty"` // DefaultBackend will become the ingress default backend if the backend is not available - DefaultBackend runtimev1alpha1.TypedReference `json:"defaultBackend,omitempty"` + DefaultBackend corev1.ObjectReference `json:"defaultBackend,omitempty"` // Backend indicate how to connect backend service // If it's nil, will auto discovery diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationconfigurations.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationconfigurations.yaml index 0dd7af4da..398f9338d 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationconfigurations.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationconfigurations.yaml @@ -78,13 +78,19 @@ spec: description: InputStore specifies the object used to read intermediate data genereted by DataOutput properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -145,13 +151,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object strategyMergeKeys: description: StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array. The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append. If StrategyMergeKeys specified, we will check the key in the target array. If any key exist, do update; if no key exist, append. @@ -215,13 +220,19 @@ spec: description: OutputStore specifies the object used to store intermediate data generated by Operations properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -282,13 +293,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -323,21 +333,26 @@ spec: description: A ScopeReference must refer to an OAM scope resource. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - scopeRef @@ -383,13 +398,19 @@ spec: description: InputStore specifies the object used to read intermediate data genereted by DataOutput properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -450,13 +471,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object strategyMergeKeys: description: StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array. The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append. If StrategyMergeKeys specified, we will check the key in the target array. If any key exist, do update; if no key exist, append. @@ -520,13 +540,19 @@ spec: description: OutputStore specifies the object used to store intermediate data generated by Operations properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string operations: description: Operations specify the data processing operations @@ -587,13 +613,12 @@ spec: - type type: object type: array - uid: - description: UID of the referenced object. + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -653,23 +678,26 @@ spec: description: DependencyFromObject represents the object that dependency data comes from. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. type: string fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object reason: type: string @@ -677,25 +705,30 @@ spec: description: DependencyToObject represents the object that dependency data goes to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string fieldPaths: items: type: string type: array kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - from @@ -716,21 +749,26 @@ spec: description: Reference to running workload. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -770,21 +808,26 @@ spec: description: Reference to a scope created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object status: description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the scope @@ -818,21 +861,26 @@ spec: description: Reference to a trait created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - traitRef @@ -842,21 +890,26 @@ spec: description: Reference to a workload created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationcontexts.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationcontexts.yaml index ff4e1bd95..2a014bd5d 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationcontexts.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationcontexts.yaml @@ -83,23 +83,26 @@ spec: description: DependencyFromObject represents the object that dependency data comes from. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. type: string fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object reason: type: string @@ -107,25 +110,30 @@ spec: description: DependencyToObject represents the object that dependency data goes to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string fieldPaths: items: type: string type: array kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - from @@ -146,21 +154,26 @@ spec: description: Reference to running workload. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array @@ -200,21 +213,26 @@ spec: description: Reference to a scope created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object status: description: Status is a place holder for a customized controller to fill if it needs a single place to summarize the status of the scope @@ -248,21 +266,26 @@ spec: description: Reference to a trait created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - traitRef @@ -272,21 +295,26 @@ spec: description: Reference to a workload created by an ApplicationConfiguration. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: object type: array diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml index 55e7959ee..a8765b066 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applicationrevisions.yaml @@ -129,21 +129,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -225,21 +230,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -318,24 +328,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -389,21 +404,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -494,24 +514,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -554,24 +579,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -591,24 +621,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string @@ -1426,21 +1461,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -1522,21 +1562,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -1662,24 +1707,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -1733,21 +1783,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -1838,24 +1893,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -1898,24 +1958,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -1935,24 +2000,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml index a30523f02..4db1983b0 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_applications.yaml @@ -131,21 +131,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -227,21 +232,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -320,24 +330,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -391,21 +406,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -496,24 +516,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -556,24 +581,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -593,24 +623,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string @@ -737,21 +772,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -833,21 +873,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -973,24 +1018,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -1044,21 +1094,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -1149,24 +1204,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -1209,24 +1269,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -1246,24 +1311,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_approllouts.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_approllouts.yaml index e74cd56d7..91c7891d1 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_approllouts.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_approllouts.yaml @@ -103,21 +103,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -199,21 +204,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -453,21 +463,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -549,21 +564,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_containerizedworkloads.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_containerizedworkloads.yaml index 85a3c2767..900baef63 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_containerizedworkloads.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_containerizedworkloads.yaml @@ -437,24 +437,29 @@ spec: resources: description: Resources managed by this containerised workload. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_healthscopes.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_healthscopes.yaml index 19bafb090..31e4fba95 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_healthscopes.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_healthscopes.yaml @@ -48,24 +48,29 @@ spec: workloadRefs: description: WorkloadReferences to the workloads that are in this scope. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array required: @@ -116,24 +121,29 @@ spec: description: HealthStatus represents health status strings. type: string targetWorkload: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object workloadStatus: description: WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN. diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml index 3d55142b1..a5eb2b1bd 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_initializers.yaml @@ -148,21 +148,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -244,21 +249,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -384,24 +394,29 @@ spec: components: description: Components record the related Components created by Application Controller items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array conditions: @@ -455,21 +470,26 @@ spec: description: ResourceTracker record the status of the ResourceTracker properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object rollout: description: AppRolloutStatus defines the observed state of AppRollout @@ -560,24 +580,29 @@ spec: type: string scopes: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array traits: @@ -620,24 +645,29 @@ spec: appRevision: type: string contextBackend: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object stepIndex: type: integer @@ -657,24 +687,29 @@ spec: description: A brief CamelCase message indicating details about why the workflowStep is in this state. type: string resourceRef: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: type: string diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_manualscalertraits.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_manualscalertraits.yaml index c96efdbf9..70032c246 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_manualscalertraits.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_manualscalertraits.yaml @@ -41,21 +41,26 @@ spec: description: WorkloadReference to the workload this trait applies to. properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - replicaCount diff --git a/legacy/charts/vela-core-legacy/crds/core.oam.dev_resourcetrackers.yaml b/legacy/charts/vela-core-legacy/crds/core.oam.dev_resourcetrackers.yaml index 797f8c6bd..dbbe708cb 100644 --- a/legacy/charts/vela-core-legacy/crds/core.oam.dev_resourcetrackers.yaml +++ b/legacy/charts/vela-core-legacy/crds/core.oam.dev_resourcetrackers.yaml @@ -37,27 +37,29 @@ spec: properties: trackedResources: items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference across-namespace objects + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string namespace: - description: Namespace of the objects outside the application namespace. + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml b/legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml index e57365d12..288b46877 100644 --- a/legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml +++ b/legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml @@ -3589,24 +3589,29 @@ spec: resources: description: Resources managed by this workload. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array type: object diff --git a/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouts.yaml b/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouts.yaml index 1ae441945..02643d308 100644 --- a/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouts.yaml +++ b/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouts.yaml @@ -95,21 +95,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -191,21 +196,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name diff --git a/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouttraits.yaml b/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouttraits.yaml index ca585ed1c..80dcb96df 100644 --- a/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouttraits.yaml +++ b/legacy/charts/vela-core-legacy/crds/standard.oam.dev_rollouttraits.yaml @@ -71,21 +71,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -167,21 +172,26 @@ spec: description: TemplateRef references a metric template object properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - name @@ -254,45 +264,55 @@ spec: sourceRef: description: SourceRef references the list of resources that contains the older version of the software. We assume that it's the first time to deploy when we cannot find any source. items: - description: A TypedReference refers to an object by Name, Kind, and APIVersion. It is commonly used to reference cluster-scoped objects or objects where the namespace is already known. + description: 'ObjectReference contains enough information to let you inspect or modify the referred object. --- New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". Those cannot be well described when embedded. 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple and the version of the actual struct is irrelevant. 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type will affect numerous schemas. Don''t make new APIs embed an underspecified API type they do not control. Instead of using this type, create a locally provided and used type that is well-focused on your reference. For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 .' properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object type: array targetRef: description: TargetRef references a target resource that contains the newer version of the software. We assumed that new resource already exists. This is the only resource we work on if the resource is a stateful resource (cloneset/statefulset) properties: apiVersion: - description: APIVersion of the referenced object. + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' type: string kind: - description: Kind of the referenced object. + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string name: - description: Name of the referenced object. + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: UID of the referenced object. + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - apiVersion - - kind - - name type: object required: - rolloutPlan diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/application_controller.go b/pkg/controller/core.oam.dev/v1alpha2/application/application_controller.go index 1fb17cc7c..20e0fd0a4 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/application_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/application_controller.go @@ -21,7 +21,8 @@ import ( "fmt" "time" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/pkg/errors" @@ -38,7 +39,6 @@ import ( velatypes "github.com/oam-dev/kubevela/apis/types" "github.com/oam-dev/kubevela/pkg/appfile" core "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" - "github.com/oam-dev/kubevela/pkg/controller/utils" "github.com/oam-dev/kubevela/pkg/cue/packages" "github.com/oam-dev/kubevela/pkg/oam" "github.com/oam-dev/kubevela/pkg/oam/discoverymapper" @@ -102,7 +102,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { } endReconcile, err := r.handleFinalizers(ctx, app) if err != nil { - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } if endReconcile { return ctrl.Result{}, nil @@ -115,15 +115,15 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.ErrorS(err, "Failed to parse application", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedParse, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Parsed", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Parsed", err)) } - app.Status.SetConditions(utils.ReadyCondition("Parsed")) + app.Status.SetConditions(condition.ReadyCondition("Parsed")) r.Recorder.Event(app, event.Normal(velatypes.ReasonParsed, velatypes.MessageParsed)) if err := handler.PrepareCurrentAppRevision(ctx, appFile); err != nil { klog.ErrorS(err, "Failed to prepare app revision", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedRevision, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Revision", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Revision", err)) } klog.Info("Successfully prepare current app revision", "revisionName", handler.currentAppRev.Name, "revisionHash", handler.currentRevHash, "isNewRevision", handler.isNewRevision) @@ -133,20 +133,20 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.ErrorS(err, "Failed to render components", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedRender, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Render", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Render", err)) } if err := handler.HandleComponentsRevision(ctx, comps); err != nil { klog.ErrorS(err, "Failed to handle compoents revision", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedRevision, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Render", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Render", err)) } if err := handler.FinalizeAndApplyAppRevision(ctx, comps); err != nil { klog.ErrorS(err, "Failed to apply app revision", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedRevision, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Revision", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Revision", err)) } - app.Status.SetConditions(utils.ReadyCondition("Revision")) + app.Status.SetConditions(condition.ReadyCondition("Revision")) r.Recorder.Event(app, event.Normal(velatypes.ReasonRevisoned, velatypes.MessageRevisioned)) klog.Info("Successfully apply application revision", "application", klog.KObj(app)) @@ -154,9 +154,9 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.Error(err, "[Handle GenerateWorkflowAndPolicy]") r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedRender, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Render", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Render", err)) } - app.Status.SetConditions(utils.ReadyCondition("Render")) + app.Status.SetConditions(condition.ReadyCondition("Render")) r.Recorder.Event(app, event.Normal(velatypes.ReasonRendered, velatypes.MessageRendered)) klog.InfoS("Successfully render application resources", "application", klog.KObj(app)) @@ -164,13 +164,13 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Failed to apply application manifests", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedApply, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Applied", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Applied", err)) } if err := handler.UpdateAppLatestRevisionStatus(ctx); err != nil { klog.ErrorS(err, "Failed to update application status", "application", klog.KObj(app)) - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } - app.Status.SetConditions(utils.ReadyCondition("Applied")) + app.Status.SetConditions(condition.ReadyCondition("Applied")) r.Recorder.Event(app, event.Normal(velatypes.ReasonApplied, velatypes.MessageApplied)) klog.Info("Successfully apply application manifests", "application", klog.KObj(app)) @@ -178,12 +178,12 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.Error(err, "[handle workflow]") r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedWorkflow, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Workflow", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Workflow", err)) } if pause { if err := r.patchStatus(ctx, app); err != nil { - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } return ctrl.Result{}, nil } @@ -198,11 +198,11 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Failed to gc after workflow", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedGC, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("GCAfterWorkflow", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("GCAfterWorkflow", err)) } wfStatus.Terminated = true app.Status.ResourceTracker = ref - return r.endWithNegativeCondition(ctx, app, utils.ReadyCondition("GCAfterWorkflow")) + return r.endWithNegativeCondition(ctx, app, condition.ReadyCondition("GCAfterWorkflow")) } // if inplace is false and rolloutPlan is nil, it means the user will use an outer AppRollout object to rollout the application @@ -211,21 +211,21 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.ErrorS(err, "Failed to handle rollout", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedRollout, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("Rollout", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("Rollout", err)) } // skip health check and garbage collection if rollout have not finished // start next reconcile immediately if res.Requeue || res.RequeueAfter > 0 { app.Status.Phase = common.ApplicationRollingOut if err := r.patchStatus(ctx, app); err != nil { - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } return res, nil } // there is no need reconcile immediately, that means the rollout operation have finished r.Recorder.Event(app, event.Normal(velatypes.ReasonRollout, velatypes.MessageRollout)) - app.Status.SetConditions(utils.ReadyCondition("Rollout")) + app.Status.SetConditions(condition.ReadyCondition("Rollout")) klog.Info("Finished rollout ") } @@ -236,29 +236,29 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.ErrorS(err, "Failed to aggregate status", "application", klog.KObj(app)) r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedHealthCheck, err)) - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("HealthCheck", err)) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("HealthCheck", err)) } app.Status.Services = appCompStatus if !healthy { if err := r.patchStatus(ctx, app); err != nil { - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } - return r.endWithNegativeCondition(ctx, app, utils.ErrorCondition("HealthCheck", errors.New("not healthy"))) + return r.endWithNegativeCondition(ctx, app, condition.ErrorCondition("HealthCheck", errors.New("not healthy"))) } - app.Status.SetConditions(utils.ReadyCondition("HealthCheck")) + app.Status.SetConditions(condition.ReadyCondition("HealthCheck")) r.Recorder.Event(app, event.Normal(velatypes.ReasonHealthCheck, velatypes.MessageHealthCheck)) app.Status.Phase = common.ApplicationRunning if err := garbageCollection(ctx, handler); err != nil { klog.ErrorS(err, "Failed to run garbage collection") r.Recorder.Event(app, event.Warning(velatypes.ReasonFailedGC, err)) - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } klog.Info("Successfully garbage collect", "application", klog.KObj(app)) r.Recorder.Event(app, event.Normal(velatypes.ReasonDeployed, velatypes.MessageDeployed)) if err := r.patchStatus(ctx, app); err != nil { - return r.endWithNegativeCondition(ctx, app, v1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, app, condition.ReconcileError(err)) } return ctrl.Result{}, nil } @@ -313,7 +313,7 @@ func (r *Reconciler) handleFinalizers(ctx context.Context, app *v1beta1.Applicat return false, nil } -func (r *Reconciler) endWithNegativeCondition(ctx context.Context, app *v1beta1.Application, condition v1alpha1.Condition) (ctrl.Result, error) { +func (r *Reconciler) endWithNegativeCondition(ctx context.Context, app *v1beta1.Application, condition condition.Condition) (ctrl.Result, error) { app.SetConditions(condition) if err := r.patchStatus(ctx, app); err != nil { return ctrl.Result{}, errors.WithMessage(err, "cannot update application status") diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go b/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go index b5c72c18f..9136b08bd 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/application_controller_test.go @@ -29,7 +29,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/ghodss/yaml" "github.com/google/go-cmp/cmp" v1 "k8s.io/api/apps/v1" @@ -44,6 +43,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" stdv1alpha1 "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" @@ -1043,8 +1043,8 @@ spec: Namespace: app.Namespace, Name: app.Name, }, got)).Should(BeNil()) - expTrait.Object["status"] = v1alpha1.ConditionedStatus{ - Conditions: []v1alpha1.Condition{{ + expTrait.Object["status"] = condition.ConditionedStatus{ + Conditions: []condition.Condition{{ Status: corev1.ConditionTrue, LastTransitionTime: metav1.Now(), }}, diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/apply.go b/pkg/controller/core.oam.dev/v1alpha2/application/apply.go index 2e363a8bc..603b0cb84 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/apply.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/apply.go @@ -19,8 +19,8 @@ package application import ( "context" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/controller-runtime/pkg/client" @@ -62,13 +62,13 @@ func (h *AppHandler) Dispatch(ctx context.Context, manifests ...*unstructured.Un } // DispatchAndGC apply manifests and do GC. -func (h *AppHandler) DispatchAndGC(ctx context.Context, manifests ...*unstructured.Unstructured) (*runtimev1alpha1.TypedReference, error) { +func (h *AppHandler) DispatchAndGC(ctx context.Context, manifests ...*unstructured.Unstructured) (*corev1.ObjectReference, error) { h.initDispatcher() tracker, err := h.dispatcher.EndAndGC(h.latestTracker).Dispatch(ctx, manifests) if err != nil { return nil, errors.WithMessage(err, "cannot dispatch application manifests") } - return &runtimev1alpha1.TypedReference{ + return &corev1.ObjectReference{ APIVersion: tracker.APIVersion, Kind: tracker.Kind, Name: tracker.Name, @@ -237,10 +237,10 @@ func (h *AppHandler) aggregateHealthStatus(appFile *appfile.Appfile) ([]common.A return appStatus, healthy, nil } -func generateScopeReference(scopes []appfile.Scope) []runtimev1alpha1.TypedReference { - var references []runtimev1alpha1.TypedReference +func generateScopeReference(scopes []appfile.Scope) []corev1.ObjectReference { + var references []corev1.ObjectReference for _, scope := range scopes { - references = append(references, runtimev1alpha1.TypedReference{ + references = append(references, corev1.ObjectReference{ APIVersion: scope.GVK.GroupVersion().String(), Kind: scope.GVK.Kind, Name: scope.Name, diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/assemble/assemble.go b/pkg/controller/core.oam.dev/v1alpha2/application/assemble/assemble.go index 60da34483..c1af7515e 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/assemble/assemble.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/assemble/assemble.go @@ -20,7 +20,6 @@ import ( "reflect" "strings" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -404,7 +403,7 @@ func (am *AppManifests) setWorkloadRefToTrait(wlRef corev1.ObjectReference, trai // only add workload reference to the trait if it asks for it if len(workloadRefPath) != 0 { // TODO(roywang) this is for backward compatibility, remove crossplane/runtime/v1alpha1 in the future - tmpWLRef := runtimev1alpha1.TypedReference{ + tmpWLRef := corev1.ObjectReference{ APIVersion: wlRef.APIVersion, Kind: wlRef.Kind, Name: wlRef.Name, diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/dispatch/dispatch.go b/pkg/controller/core.oam.dev/v1alpha2/application/dispatch/dispatch.go index 9e4e8bde0..530985726 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/dispatch/dispatch.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/dispatch/dispatch.go @@ -117,13 +117,13 @@ func (a *AppManifestsDispatcher) Dispatch(ctx context.Context, manifests []*unst } // ReferenceScopes add workload reference to scopes' workloadRefPath -func (a *AppManifestsDispatcher) ReferenceScopes(ctx context.Context, wlRef *v1beta1.TypedReference, scopes []*v1beta1.TypedReference) error { +func (a *AppManifestsDispatcher) ReferenceScopes(ctx context.Context, wlRef *v1.ObjectReference, scopes []*v1.ObjectReference) error { // TODO handle scopes return nil } // DereferenceScopes remove workload reference from scopes' workloadRefPath -func (a *AppManifestsDispatcher) DereferenceScopes(ctx context.Context, wlRef *v1beta1.TypedReference, scopes []*v1beta1.TypedReference) error { +func (a *AppManifestsDispatcher) DereferenceScopes(ctx context.Context, wlRef *v1.ObjectReference, scopes []*v1.ObjectReference) error { // TODO handle scopes return nil } @@ -281,10 +281,10 @@ func (a *AppManifestsDispatcher) ImmutableResourcesUpdate(ctx context.Context, r func (a *AppManifestsDispatcher) updateResourceTrackerStatus(ctx context.Context, appliedManifests []*unstructured.Unstructured) error { // merge applied resources and already tracked ones if a.currentRT.Status.TrackedResources == nil { - a.currentRT.Status.TrackedResources = make([]v1beta1.TypedReference, 0) + a.currentRT.Status.TrackedResources = make([]v1.ObjectReference, 0) } for _, rsc := range appliedManifests { - appliedRef := v1beta1.TypedReference{ + appliedRef := v1.ObjectReference{ APIVersion: rsc.GetAPIVersion(), Kind: rsc.GetKind(), Name: rsc.GetName(), diff --git a/pkg/controller/core.oam.dev/v1alpha2/application/revision.go b/pkg/controller/core.oam.dev/v1alpha2/application/revision.go index f2b78d887..78a892f45 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/application/revision.go +++ b/pkg/controller/core.oam.dev/v1alpha2/application/revision.go @@ -25,7 +25,6 @@ import ( "github.com/oam-dev/kubevela/pkg/cue/process" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/pkg/errors" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -543,7 +542,7 @@ func componentManifests2AppConfig(cms []*types.ComponentManifest) (runtime.RawEx acc.Scopes = make([]v1alpha2.ComponentScope, len(cm.Scopes)) for x, s := range cm.Scopes { acc.Scopes[x] = v1alpha2.ComponentScope{ - ScopeReference: runtimev1alpha1.TypedReference{ + ScopeReference: corev1.ObjectReference{ APIVersion: s.APIVersion, Kind: s.Kind, Name: s.Name, diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go index 260f6a3ac..caf1fad68 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration.go @@ -25,12 +25,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/source" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -42,6 +42,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/reconcile" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" oamtype "github.com/oam-dev/kubevela/apis/types" "github.com/oam-dev/kubevela/pkg/controller/common" @@ -242,7 +243,7 @@ func (r *OAMApplicationReconciler) Reconcile(req reconcile.Request) (reconcile.R klog.InfoS("Failed to finalize workloads", "workloads status", ac.Status.Workloads, "err", err) r.record.Event(ac, event.Warning(reasonCannotFinalizeWorkloads, err)) - ac.SetConditions(v1alpha1.ReconcileError(errors.Wrap(err, errFinalizeWorkloads))) + ac.SetConditions(condition.ReconcileError(errors.Wrap(err, errFinalizeWorkloads))) return reconcile.Result{}, errors.Wrap(r.UpdateStatus(ctx, ac), errUpdateAppConfigStatus) } return reconcile.Result{}, errors.Wrap(r.client.Update(ctx, ac), errUpdateAppConfigStatus) @@ -250,11 +251,11 @@ func (r *OAMApplicationReconciler) Reconcile(req reconcile.Request) (reconcile.R reconResult, err := r.ACReconcile(ctx, ac) if err != nil { - return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r.client, ac, v1alpha1.ReconcileError(err)) + return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r.client, ac, condition.ReconcileError(err)) } // always update ac status and set the error if err := r.UpdateStatus(ctx, ac); err != nil { - return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r.client, ac, v1alpha1.ReconcileError(err)) + return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r.client, ac, condition.ReconcileError(err)) } return reconResult, nil } @@ -300,7 +301,7 @@ func (r *OAMApplicationReconciler) ACReconcile(ctx context.Context, ac *v1alpha2 msg := "Encounter an application revision, no need to reconcile" klog.Info(msg) r.record.Event(ac, event.Normal(reasonRevision, msg)) - ac.SetConditions(v1alpha1.Unavailable()) + ac.SetConditions(condition.Unavailable()) ac.Status.RollingStatus = oamtype.InactiveAfterRollingCompleted // TODO: GC the traits/workloads return reconcile.Result{}, nil @@ -443,7 +444,7 @@ func (r *OAMApplicationReconciler) updateStatus(ctx context.Context, ac, acPatch // Trait will not work for these remaining workload historyWorkloads = append(historyWorkloads, v1alpha2.HistoryWorkload{ Revision: v.GetName(), - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: v.GetAPIVersion(), Kind: v.GetKind(), Name: v.GetName(), @@ -455,7 +456,7 @@ func (r *OAMApplicationReconciler) updateStatus(ctx context.Context, ac, acPatch ac.Status.HistoryWorkloads = historyWorkloads // patch the extra fields in the status that is wiped by the Status() function patchExtraStatusField(&ac.Status, acPatch.Status) - ac.SetConditions(v1alpha1.ReconcileSuccess()) + ac.SetConditions(condition.ReconcileSuccess()) } func updateObservedGeneration(ac *v1alpha2.ApplicationConfiguration) { @@ -576,7 +577,7 @@ func (w Workload) Status() v1alpha2.WorkloadStatus { ComponentName: w.ComponentName, ComponentRevisionName: w.ComponentRevisionName, DependencyUnsatisfied: w.HasDep, - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: w.Workload.GetAPIVersion(), Kind: w.Workload.GetKind(), Name: w.Workload.GetName(), @@ -588,7 +589,7 @@ func (w Workload) Status() v1alpha2.WorkloadStatus { if tr.Definition.Name == util.Dummy && tr.Definition.Spec.Reference.Name == util.Dummy { acw.Traits[i].Message = util.DummyTraitMessage } - acw.Traits[i].Reference = v1alpha1.TypedReference{ + acw.Traits[i].Reference = corev1.ObjectReference{ APIVersion: w.Traits[i].Object.GetAPIVersion(), Kind: w.Traits[i].Object.GetKind(), Name: w.Traits[i].Object.GetName(), @@ -596,7 +597,7 @@ func (w Workload) Status() v1alpha2.WorkloadStatus { acw.Traits[i].DependencyUnsatisfied = tr.HasDep } for i, s := range w.Scopes { - acw.Scopes[i].Reference = v1alpha1.TypedReference{ + acw.Scopes[i].Reference = corev1.ObjectReference{ APIVersion: s.GetAPIVersion(), Kind: s.GetKind(), Name: s.GetName(), @@ -638,16 +639,16 @@ func IsRevisionWorkload(status v1alpha2.WorkloadStatus, w []Workload) bool { } func eligible(namespace string, ws []v1alpha2.WorkloadStatus, w []Workload) []unstructured.Unstructured { - applied := make(map[v1alpha1.TypedReference]bool) + applied := make(map[corev1.ObjectReference]bool) for _, wl := range w { - r := v1alpha1.TypedReference{ + r := corev1.ObjectReference{ APIVersion: wl.Workload.GetAPIVersion(), Kind: wl.Workload.GetKind(), Name: wl.Workload.GetName(), } applied[r] = true for _, t := range wl.Traits { - r := v1alpha1.TypedReference{ + r := corev1.ObjectReference{ APIVersion: t.Object.GetAPIVersion(), Kind: t.Object.GetKind(), Name: t.Object.GetName(), diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_test.go index edcee5784..9c9f60eb6 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_test.go @@ -23,7 +23,8 @@ import ( "testing" "time" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -49,7 +50,7 @@ var _ reconcile.Reconciler = &OAMApplicationReconciler{} type acParam func(*v1alpha2.ApplicationConfiguration) -func withConditions(c ...runtimev1alpha1.Condition) acParam { +func withConditions(c ...condition.Condition) acParam { return func(ac *v1alpha2.ApplicationConfiguration) { ac.SetConditions(c...) } @@ -103,7 +104,7 @@ func TestReconciler(t *testing.T) { depStatus := v1alpha2.DependencyStatus{ Unsatisfied: []v1alpha2.UnstaifiedDependency{{ From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), @@ -111,7 +112,7 @@ func TestReconciler(t *testing.T) { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), @@ -167,7 +168,7 @@ func TestReconciler(t *testing.T) { Client: &test.MockClient{ MockGet: mockGetAppConfigFn, MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { - want := ac(withConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errRenderComponents)))) + want := ac(withConditions(condition.ReconcileError(errors.Wrap(errBoom, errRenderComponents)))) if diff := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration)); diff != "" { t.Errorf("\nclient.Status().Update(): -want, +got:\n%s", diff) return errUnexpectedStatus @@ -198,7 +199,7 @@ func TestReconciler(t *testing.T) { Client: &test.MockClient{ MockGet: mockGetAppConfigFn, MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { - want := ac(withConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errApplyComponents)))) + want := ac(withConditions(condition.ReconcileError(errors.Wrap(errBoom, errApplyComponents)))) if diff := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration)); diff != "" { t.Errorf("\nclient.Status().Update(): -want, +got:\n%s", diff) return errUnexpectedStatus @@ -233,7 +234,7 @@ func TestReconciler(t *testing.T) { MockGet: mockGetAppConfigFn, MockDelete: test.NewMockDeleteFn(errBoom), MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { - want := ac(withConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errGCComponent)))) + want := ac(withConditions(condition.ReconcileError(errors.Wrap(errBoom, errGCComponent)))) if diff := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration)); diff != "" { t.Errorf("\nclient.Status().Update(): -want, +got:\n%s", diff) return errUnexpectedStatus @@ -272,10 +273,10 @@ func TestReconciler(t *testing.T) { MockDelete: test.NewMockDeleteFn(nil), MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { want := ac( - withConditions(runtimev1alpha1.ReconcileSuccess()), + withConditions(condition.ReconcileSuccess()), withWorkloadStatuses(v1alpha2.WorkloadStatus{ ComponentName: componentName, - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), @@ -291,10 +292,10 @@ func TestReconciler(t *testing.T) { }), MockStatusPatch: test.NewMockStatusPatchFn(nil, func(o runtime.Object) error { want := ac( - withConditions(runtimev1alpha1.ReconcileSuccess()), + withConditions(condition.ReconcileSuccess()), withWorkloadStatuses(v1alpha2.WorkloadStatus{ ComponentName: componentName, - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), @@ -337,7 +338,7 @@ func TestReconciler(t *testing.T) { MockDelete: test.NewMockDeleteFn(nil), MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { want := ac( - withConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errExecutePrehooks))), + withConditions(condition.ReconcileError(errors.Wrap(errBoom, errExecutePrehooks))), ) if diff := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration), cmpopts.EquateEmpty()); diff != "" { t.Errorf("\nclient.Status().Update(): -want, +got:\n%s", diff) @@ -388,16 +389,16 @@ func TestReconciler(t *testing.T) { want := ac( withWorkloadStatuses(v1alpha2.WorkloadStatus{ ComponentName: componentName, - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, }), ) - want.SetConditions(runtimev1alpha1.ReconcileSuccess()) + want.SetConditions(condition.ReconcileSuccess()) diff := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration), cmpopts.EquateEmpty()) - want.SetConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errExecutePosthooks))) + want.SetConditions(condition.ReconcileError(errors.Wrap(errBoom, errExecutePosthooks))) diffPost := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration), cmpopts.EquateEmpty()) if diff != "" && diffPost != "" { t.Errorf("\nclient.Status().Update(): -want, +got:\n%s, \n%s", diff, diffPost) @@ -443,10 +444,10 @@ func TestReconciler(t *testing.T) { MockDelete: test.NewMockDeleteFn(nil), MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { want := ac( - withConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errExecutePrehooks))), + withConditions(condition.ReconcileError(errors.Wrap(errBoom, errExecutePrehooks))), ) diff := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration), cmpopts.EquateEmpty()) - want.SetConditions(runtimev1alpha1.ReconcileError(errors.Wrap(errBoom, errExecutePosthooks))) + want.SetConditions(condition.ReconcileError(errors.Wrap(errBoom, errExecutePosthooks))) diffPost := cmp.Diff(want, o.(*v1alpha2.ApplicationConfiguration), cmpopts.EquateEmpty()) if diff != "" && diffPost != "" { t.Errorf("\nclient.Status().Update(): -want, +got:\n%s, \n%s", diff, diffPost) @@ -498,10 +499,10 @@ func TestReconciler(t *testing.T) { MockDelete: test.NewMockDeleteFn(nil), MockStatusUpdate: test.NewMockStatusUpdateFn(nil, func(o runtime.Object) error { want := ac( - withConditions(runtimev1alpha1.ReconcileSuccess()), + withConditions(condition.ReconcileSuccess()), withWorkloadStatuses(v1alpha2.WorkloadStatus{ ComponentName: componentName, - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), @@ -516,10 +517,10 @@ func TestReconciler(t *testing.T) { }), MockStatusPatch: test.NewMockStatusPatchFn(nil, func(o runtime.Object) error { want := ac( - withConditions(runtimev1alpha1.ReconcileSuccess()), + withConditions(condition.ReconcileSuccess()), withWorkloadStatuses(v1alpha2.WorkloadStatus{ ComponentName: componentName, - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), @@ -570,7 +571,7 @@ func TestReconciler(t *testing.T) { ComponentName: componentName, Scopes: []v1alpha2.ComponentScope{ { - ScopeReference: runtimev1alpha1.TypedReference{ + ScopeReference: corev1.ObjectReference{ APIVersion: "core.oam.dev/v1alpha2", Kind: "HealthScope", Name: "example-healthscope", @@ -742,14 +743,14 @@ func TestWorkloadStatus(t *testing.T) { }, want: v1alpha2.WorkloadStatus{ ComponentName: componentName, - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: trait.GetAPIVersion(), Kind: trait.GetKind(), Name: trait.GetName(), @@ -803,14 +804,14 @@ func TestEligible(t *testing.T) { namespace: namespace, ws: []v1alpha2.WorkloadStatus{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: trait.GetAPIVersion(), Kind: trait.GetKind(), Name: trait.GetName(), @@ -829,14 +830,14 @@ func TestEligible(t *testing.T) { namespace: namespace, ws: []v1alpha2.WorkloadStatus{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: trait.GetAPIVersion(), Kind: trait.GetKind(), Name: trait.GetName(), @@ -854,14 +855,14 @@ func TestEligible(t *testing.T) { namespace: namespace, ws: []v1alpha2.WorkloadStatus{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: trait.GetAPIVersion(), Kind: trait.GetKind(), Name: trait.GetName(), @@ -886,16 +887,16 @@ func TestEligible(t *testing.T) { } func TestIsRevisionWorkload(t *testing.T) { - if true != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: runtimev1alpha1.TypedReference{Name: "compName-rev1"}}, nil) { + if true != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: corev1.ObjectReference{Name: "compName-rev1"}}, nil) { t.Error("workloadName has componentName as prefix is revisionWorkload") } - if true != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: runtimev1alpha1.TypedReference{Name: "speciedName"}}, []Workload{{ComponentName: "compName", RevisionEnabled: true}}) { + if true != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: corev1.ObjectReference{Name: "speciedName"}}, []Workload{{ComponentName: "compName", RevisionEnabled: true}}) { t.Error("workloadName has componentName same and revisionEnabled is revisionWorkload") } - if false != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: runtimev1alpha1.TypedReference{Name: "speciedName"}}, []Workload{{ComponentName: "compName", RevisionEnabled: false}}) { + if false != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: corev1.ObjectReference{Name: "speciedName"}}, []Workload{{ComponentName: "compName", RevisionEnabled: false}}) { t.Error("workloadName has componentName same and revisionEnabled is false") } - if false != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: runtimev1alpha1.TypedReference{Name: "speciedName"}}, []Workload{{ComponentName: "compName-notmatch", RevisionEnabled: true}}) { + if false != IsRevisionWorkload(v1alpha2.WorkloadStatus{ComponentName: "compName", Reference: corev1.ObjectReference{Name: "speciedName"}}, []Workload{{ComponentName: "compName-notmatch", RevisionEnabled: true}}) { t.Error("workload with no prefix and no componentName match is not revisionEnabled ") } } @@ -951,7 +952,7 @@ func TestDependency(t *testing.T) { readyDataPassingOutput := v1alpha2.DataOutput{ Name: "test-ready-dataoutput", OutputStore: v1alpha2.StoreReference{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -968,7 +969,7 @@ func TestDependency(t *testing.T) { unreadyDataPassingOutput := v1alpha2.DataOutput{ Name: "test-unready-dataoutput", OutputStore: v1alpha2.StoreReference{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -985,7 +986,7 @@ func TestDependency(t *testing.T) { readyDataPassingInput := v1alpha2.DataInput{ InputStore: v1alpha2.StoreReference{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -1001,7 +1002,7 @@ func TestDependency(t *testing.T) { } unreadyDataPassingInput := v1alpha2.DataInput{ InputStore: v1alpha2.StoreReference{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -1061,7 +1062,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "status.key not found in object", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyWorkload.GetAPIVersion(), Kind: unreadyWorkload.GetKind(), Name: unreadyWorkload.GetName(), @@ -1069,7 +1070,7 @@ func TestDependency(t *testing.T) { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyWorkload.GetAPIVersion(), Kind: unreadyWorkload.GetKind(), Name: unreadyWorkload.GetName(), @@ -1144,7 +1145,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "status.key not found in object", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyTrait.GetAPIVersion(), Kind: unreadyTrait.GetKind(), Name: unreadyTrait.GetName(), @@ -1152,7 +1153,7 @@ func TestDependency(t *testing.T) { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyWorkload.GetAPIVersion(), Kind: unreadyWorkload.GetKind(), Name: unreadyWorkload.GetName(), @@ -1230,7 +1231,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "status.key not found in object", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyWorkload.GetAPIVersion(), Kind: unreadyWorkload.GetKind(), Name: unreadyWorkload.GetName(), @@ -1238,7 +1239,7 @@ func TestDependency(t *testing.T) { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyTrait.GetAPIVersion(), Kind: unreadyTrait.GetKind(), Name: unreadyTrait.GetName(), @@ -1318,7 +1319,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "status.key not found in object", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyTrait.GetAPIVersion(), Kind: unreadyTrait.GetKind(), Name: unreadyTrait.GetName(), @@ -1326,7 +1327,7 @@ func TestDependency(t *testing.T) { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: unreadyTrait.GetAPIVersion(), Kind: unreadyTrait.GetKind(), Name: unreadyTrait.GetName(), @@ -1456,7 +1457,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "got(test) expected to be ", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: readyWorkload.GetAPIVersion(), Kind: readyWorkload.GetKind(), Name: readyWorkload.GetName(), @@ -1464,7 +1465,7 @@ func TestDependency(t *testing.T) { FieldPath: "", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -1504,7 +1505,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "got(test) expected to be ", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: readyWorkload.GetAPIVersion(), Kind: readyWorkload.GetKind(), Name: readyWorkload.GetName(), @@ -1512,7 +1513,7 @@ func TestDependency(t *testing.T) { FieldPath: "", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -1552,7 +1553,7 @@ func TestDependency(t *testing.T) { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "got(test) expected to be ", From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -1560,7 +1561,7 @@ func TestDependency(t *testing.T) { FieldPath: "", }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: readyWorkload.GetAPIVersion(), Kind: readyWorkload.GetKind(), Name: readyWorkload.GetName(), @@ -1706,7 +1707,7 @@ func TestPatchExtraField(t *testing.T) { ComponentRevisionName: "test-v1", Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1724,7 +1725,7 @@ func TestPatchExtraField(t *testing.T) { Traits: []v1alpha2.WorkloadTrait{ { Status: "add this too", - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1743,7 +1744,7 @@ func TestPatchExtraField(t *testing.T) { Traits: []v1alpha2.WorkloadTrait{ { Status: "add this too", - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1762,7 +1763,7 @@ func TestPatchExtraField(t *testing.T) { ComponentRevisionName: "test-v1", Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1780,7 +1781,7 @@ func TestPatchExtraField(t *testing.T) { Traits: []v1alpha2.WorkloadTrait{ { Status: "add this too", - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait2", @@ -1798,7 +1799,7 @@ func TestPatchExtraField(t *testing.T) { ComponentRevisionName: "test-v1", Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1817,7 +1818,7 @@ func TestPatchExtraField(t *testing.T) { ComponentRevisionName: "test-v1", Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1835,7 +1836,7 @@ func TestPatchExtraField(t *testing.T) { Traits: []v1alpha2.WorkloadTrait{ { Status: "add this too", - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", @@ -1852,7 +1853,7 @@ func TestPatchExtraField(t *testing.T) { ComponentRevisionName: "test-v1", Traits: []v1alpha2.WorkloadTrait{ { - Reference: runtimev1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: "apiVersion1", Kind: "kind1", Name: "trait1", diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_without_traitdefinition_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_without_traitdefinition_test.go index 706b2f028..2b11c6322 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_without_traitdefinition_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/applicationconfiguration_without_traitdefinition_test.go @@ -23,8 +23,6 @@ import ( "strings" "time" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" - "k8s.io/apimachinery/pkg/runtime" "github.com/ghodss/yaml" @@ -192,7 +190,7 @@ spec: }, Spec: v1alpha2.ManualScalerTraitSpec{ ReplicaCount: 3, - WorkloadReference: v1alpha1.TypedReference{ + WorkloadReference: corev1.ObjectReference{ APIVersion: "core.oam.dev/v1alpha2", Kind: "ContainerizedWorkload", Name: componentName, diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go index 0c1664d33..e97d21197 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply.go @@ -23,13 +23,13 @@ import ( "reflect" "strings" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" jsonpatch "github.com/evanphx/json-patch" "github.com/pkg/errors" "github.com/tidwall/gjson" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" @@ -149,7 +149,7 @@ func (a *workloads) Apply(ctx context.Context, status []v1alpha2.WorkloadStatus, return err } } - workloadRef := runtimev1alpha1.TypedReference{ + workloadRef := corev1.ObjectReference{ APIVersion: wl.Workload.GetAPIVersion(), Kind: wl.Workload.GetKind(), Name: wl.Workload.GetName(), @@ -347,7 +347,7 @@ func findDereferencedScopes(statusScopes []v1alpha2.WorkloadScope, scopes []unst return toBeDeferenced } -func (a *workloads) applyScope(ctx context.Context, wl Workload, s unstructured.Unstructured, workloadRef runtimev1alpha1.TypedReference) error { +func (a *workloads) applyScope(ctx context.Context, wl Workload, s unstructured.Unstructured, workloadRef corev1.ObjectReference) error { // get ScopeDefinition scopeDefinition, err := util.FetchScopeDefinition(ctx, a.rawClient, a.dm, &s) if err != nil { @@ -391,7 +391,7 @@ func (a *workloads) applyScope(ctx context.Context, wl Workload, s unstructured. // applyScopeRemoval remove the workload reference from the scope's reference list. // If the scope or scope definition is not found(deleted), it's still regarded as remove successfully. -func (a *workloads) applyScopeRemoval(ctx context.Context, namespace string, wr runtimev1alpha1.TypedReference, s v1alpha2.WorkloadScope) error { +func (a *workloads) applyScopeRemoval(ctx context.Context, namespace string, wr corev1.ObjectReference, s v1alpha2.WorkloadScope) error { scopeObject := unstructured.Unstructured{} scopeObject.SetAPIVersion(s.Reference.APIVersion) scopeObject.SetKind(s.Reference.Kind) diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply_test.go index cd38da0bb..889f0d895 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/apply_test.go @@ -22,11 +22,11 @@ import ( "fmt" "testing" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -79,7 +79,7 @@ func TestApplyWorkloads(t *testing.T) { }, Spec: v1alpha2.HealthScopeSpec{ // set an empty ref to enable wrokloadRefs field - WorkloadReferences: []v1alpha1.TypedReference{ + WorkloadReferences: []corev1.ObjectReference{ { APIVersion: "", Kind: "", @@ -101,7 +101,7 @@ func TestApplyWorkloads(t *testing.T) { Kind: "scopeKind", }, Spec: v1alpha2.HealthScopeSpec{ - WorkloadReferences: []v1alpha1.TypedReference{ + WorkloadReferences: []corev1.ObjectReference{ { APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), @@ -209,14 +209,14 @@ func TestApplyWorkloads(t *testing.T) { }}, ws: []v1alpha2.WorkloadStatus{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Scopes: []v1alpha2.WorkloadScope{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: scope.GetAPIVersion(), Kind: scope.GetKind(), Name: scope.GetName(), @@ -250,14 +250,14 @@ func TestApplyWorkloads(t *testing.T) { }}, ws: []v1alpha2.WorkloadStatus{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Scopes: []v1alpha2.WorkloadScope{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: scope.GetAPIVersion(), Kind: scope.GetKind(), Name: scope.GetName(), @@ -308,14 +308,14 @@ func TestApplyWorkloads(t *testing.T) { }}, ws: []v1alpha2.WorkloadStatus{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Scopes: []v1alpha2.WorkloadScope{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: scope.GetAPIVersion(), Kind: scope.GetKind(), Name: scope.GetName(), @@ -362,14 +362,14 @@ func TestApplyWorkloads(t *testing.T) { }}, ws: []v1alpha2.WorkloadStatus{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Scopes: []v1alpha2.WorkloadScope{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: scope.GetAPIVersion(), Kind: scope.GetKind(), Name: scope.GetName(), @@ -417,7 +417,7 @@ func TestFinalizeWorkloadScopes(t *testing.T) { Kind: "scopeKind", }, Spec: v1alpha2.HealthScopeSpec{ - WorkloadReferences: []v1alpha1.TypedReference{ + WorkloadReferences: []corev1.ObjectReference{ { APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), @@ -450,14 +450,14 @@ func TestFinalizeWorkloadScopes(t *testing.T) { Status: v1alpha2.ApplicationConfigurationStatus{ Workloads: []v1alpha2.WorkloadStatus{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: workload.GetAPIVersion(), Kind: workload.GetKind(), Name: workload.GetName(), }, Scopes: []v1alpha2.WorkloadScope{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: scope.GetAPIVersion(), Kind: scope.GetKind(), Name: scope.GetName(), @@ -585,7 +585,7 @@ func TestApplyOutputRef(t *testing.T) { outputs: map[string]v1alpha2.DataOutput{ "test": { OutputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), @@ -712,7 +712,7 @@ func TestApplyInputRef(t *testing.T) { workload: workload.DeepCopy(), inputs: []v1alpha2.DataInput{{ InputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: refConfigMap.GetAPIVersion(), Kind: refConfigMap.GetKind(), Name: refConfigMap.GetName(), diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/component_custom_revision_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/component_custom_revision_test.go index 4de11ec1b..4b05eb15e 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/component_custom_revision_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/component_custom_revision_test.go @@ -64,8 +64,7 @@ var RevisionHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Reque req.Comp.Annotations["app-namespace"] = req.RelatedApps[0].Namespace } a := &unstructured.Unstructured{} - err = json.Unmarshal(req.Comp.Spec.Workload.Raw, a) - fmt.Println("XX:", err) + _ = json.Unmarshal(req.Comp.Spec.Workload.Raw, a) a.SetAnnotations(map[string]string{"time": time.Now().Format(time.RFC3339Nano)}) data, _ = json.Marshal(a) req.Comp.Spec.Workload.Raw = data diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/dependency_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/dependency_test.go index ecbfca894..ad0780b82 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/dependency_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/dependency_test.go @@ -24,7 +24,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -178,7 +177,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: reason, From: v1alpha2.DependencyFromObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: outName, Kind: tempFoo.GetKind(), @@ -186,7 +185,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: inName, Kind: tempFoo.GetKind(), @@ -520,7 +519,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "got(hash-v1) expected to be hash-v2", From: v1alpha2.DependencyFromObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: outName, Kind: tempFoo.GetKind(), @@ -528,7 +527,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: inName, Kind: tempFoo.GetKind(), @@ -794,7 +793,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { }, ToFieldPaths: []string{"spec.key"}, InputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -821,7 +820,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Name: "trait-comp", FieldPath: "status.key", OutputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -975,7 +974,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "got(hash-v1) expected to be hash-v2", From: v1alpha2.DependencyFromObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: outName, Kind: tempFoo.GetKind(), @@ -983,7 +982,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: inName, Kind: tempFoo.GetKind(), @@ -994,7 +993,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { }}, { Reason: "got(hash-v1) expected to be hash-v2", From: v1alpha2.DependencyFromObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: outName, Kind: tempFoo.GetKind(), @@ -1002,7 +1001,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1073,7 +1072,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { ComponentName: componentInName, DataInputs: []v1alpha2.DataInput{{ InputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1103,7 +1102,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { }, DataOutputs: []v1alpha2.DataOutput{{ OutputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1260,7 +1259,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "got(hash-v1) expected to be hash-v2", From: v1alpha2.DependencyFromObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: outName, Kind: tempFoo.GetKind(), @@ -1268,7 +1267,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1343,7 +1342,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { }, ToFieldPaths: []string{"spec.key"}, InputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1376,7 +1375,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Name: "trait-comp", FieldPath: "status.key", OutputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1503,7 +1502,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { Unsatisfied: []v1alpha2.UnstaifiedDependency{{ Reason: "DataInputs Conditions: got(test) expected to be ", From: v1alpha2.DependencyFromObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: outName, Kind: tempFoo.GetKind(), @@ -1511,7 +1510,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { FieldPath: "status.key", }, To: v1alpha2.DependencyToObject{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: tempFoo.GetAPIVersion(), Name: inName, Kind: tempFoo.GetKind(), @@ -1553,7 +1552,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { ComponentName: componentInName, DataInputs: []v1alpha2.DataInput{{ InputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), @@ -1573,7 +1572,7 @@ var _ = Describe("Resource Dependency in an ApplicationConfiguration", func() { }, DataOutputs: []v1alpha2.DataOutput{{ OutputStore: v1alpha2.StoreReference{ - TypedReference: v1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: store.GetAPIVersion(), Name: store.GetName(), Kind: store.GetKind(), diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render.go index 597b3b37c..e5d87aaee 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render.go @@ -24,7 +24,6 @@ import ( "strconv" "strings" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" @@ -274,7 +273,7 @@ func (r *components) renderComponent(ctx context.Context, acc v1alpha2.Applicati } // create the ref after the workload name is set - workloadRef := runtimev1alpha1.TypedReference{ + workloadRef := corev1.ObjectReference{ APIVersion: w.GetAPIVersion(), Kind: w.GetKind(), Name: w.GetName(), @@ -585,7 +584,7 @@ func makeUnsatisfiedDependency(obj *unstructured.Unstructured, s *dagSource, toP return v1alpha2.UnstaifiedDependency{ Reason: reason, From: v1alpha2.DependencyFromObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: s.ObjectRef.APIVersion, Kind: s.ObjectRef.Kind, Name: s.ObjectRef.Name, @@ -593,7 +592,7 @@ func makeUnsatisfiedDependency(obj *unstructured.Unstructured, s *dagSource, toP FieldPath: s.ObjectRef.FieldPath, }, To: v1alpha2.DependencyToObject{ - TypedReference: runtimev1alpha1.TypedReference{ + ObjectReference: corev1.ObjectReference{ APIVersion: obj.GetAPIVersion(), Kind: obj.GetKind(), Name: obj.GetName(), @@ -631,8 +630,8 @@ func (r *components) handleDataOutput(ctx context.Context, outputs []v1alpha2.Da if err != nil || !ready { if err == nil { outObj := &unstructured.Unstructured{} - outObj.SetGroupVersionKind(out.OutputStore.TypedReference.GroupVersionKind()) - outObj.SetName(out.OutputStore.TypedReference.Name) + outObj.SetGroupVersionKind(out.OutputStore.GroupVersionKind()) + outObj.SetName(out.OutputStore.Name) toPath := oper.ToFieldPath if len(oper.ToDataPath) != 0 { toPath = toPath + "(" + oper.ToDataPath + ")" diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render_test.go index 2a67979bb..3c0f05094 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationconfiguration/render_test.go @@ -23,7 +23,6 @@ import ( "strconv" "testing" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" @@ -31,6 +30,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" v1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -535,7 +535,7 @@ func TestRender(t *testing.T) { oam.LabelAppComponentRevision: revisionName, oam.LabelOAMResourceType: oam.ResourceTypeTrait, }) - workloadRef := v1alpha1.TypedReference{ + workloadRef := corev1.ObjectReference{ APIVersion: "traitApiVersion", Kind: "traitKind", Name: componentName, @@ -1829,7 +1829,7 @@ func TestRenderTraitName(t *testing.T) { ComponentName: componentName, Traits: []v1alpha2.WorkloadTrait{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: gvk.GroupVersion().String(), Kind: gvk.Kind, Name: "component3-trait-11111111", @@ -1900,7 +1900,7 @@ func TestRenderTraitNameWithoutReferenceName(t *testing.T) { ComponentName: componentName, Traits: []v1alpha2.WorkloadTrait{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: gvk.GroupVersion().String(), Kind: gvk.Kind, }, @@ -1983,7 +1983,7 @@ func TestRenderTraitNameWithShortNameTraitDefinition(t *testing.T) { ComponentName: componentName, Traits: []v1alpha2.WorkloadTrait{ { - Reference: v1alpha1.TypedReference{ + Reference: corev1.ObjectReference{ APIVersion: gvk.GroupVersion().String(), Kind: gvk.Kind, }, diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller.go b/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller.go index 06f2b43f4..afda85597 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller.go @@ -21,6 +21,8 @@ import ( "fmt" "time" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/pkg/errors" @@ -38,7 +40,6 @@ import ( "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" "github.com/oam-dev/kubevela/pkg/controller/common/rollout" oamctrl "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" - "github.com/oam-dev/kubevela/pkg/controller/utils" "github.com/oam-dev/kubevela/pkg/oam/discoverymapper" oamutil "github.com/oam-dev/kubevela/pkg/oam/util" ) @@ -185,10 +186,10 @@ func (r *Reconciler) DoReconcile(ctx context.Context, appRollout *v1beta1.AppRol // target manifest haven't template yet, call dispatch template target manifest firstly err = h.templateTargetManifest(ctx) if err != nil { - h.appRollout.Status.SetConditions(utils.ErrorCondition("template", err)) + h.appRollout.Status.SetConditions(condition.ErrorCondition("template", err)) return reconcile.Result{}, err } - h.appRollout.Status.SetConditions(utils.ReadyCondition("template")) + h.appRollout.Status.SetConditions(condition.ReadyCondition("template")) // this ensures that we template workload only once h.appRollout.Status.StateTransition(v1alpha1.AppLocatedEvent) klog.InfoS("AppRollout have complete templateTarget", "name", h.appRollout.Name, "namespace", diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller_test.go index cc75a54ab..cb781cd04 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/applicationrollout_controller_test.go @@ -19,9 +19,10 @@ package applicationrollout import ( "testing" + "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "k8s.io/utils/pointer" - "github.com/oam-dev/kubevela/apis/core.oam.dev/common" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" ) diff --git a/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/helper_test.go b/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/helper_test.go index c861d630a..6d3cc8623 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/helper_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/applicationrollout/helper_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" oamstandard "github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1" diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition/componentdefinition_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition/componentdefinition_controller.go index cd9988e02..74cfa7632 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition/componentdefinition_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/components/componentdefinition/componentdefinition_controller.go @@ -22,7 +22,6 @@ import ( "context" "fmt" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,6 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" "github.com/oam-dev/kubevela/apis/types" oamctrl "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" @@ -82,7 +82,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not discover the open api of the CRD", "err", err) r.record.Event(&componentDefinition, event.Warning("Could not discover the open api of the CRD", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &componentDefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) + condition.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) } } @@ -92,7 +92,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not generate DefinitionRevision", "componentDefinition", klog.KObj(&componentDefinition), "err", err) r.record.Event(&componentDefinition, event.Warning("Could not generate DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &componentDefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, componentDefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, componentDefinition.Name, err))) } if !isNewRevision { @@ -100,7 +100,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not update DefinitionRevision", "err", err) r.record.Event(&(componentDefinition), event.Warning("Could not update DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(componentDefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully update definitionRevision", "definitionRevision", klog.KObj(defRev)) @@ -119,7 +119,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not capability in ConfigMap", "err", err) r.record.Event(&(componentDefinition), event.Warning("Could not store capability in ConfigMap", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(componentDefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrStoreCapabilityInConfigMap, def.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrStoreCapabilityInConfigMap, def.Name, err))) } componentDefinition.Status.ConfigMapRef = cmName klog.Info("Successfully stored Capability Schema in ConfigMap") @@ -128,7 +128,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not create DefinitionRevision", "err", err) r.record.Event(&(componentDefinition), event.Warning("cannot create DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(componentDefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully create definitionRevision", "definitionRevision", klog.KObj(defRev)) @@ -142,7 +142,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not update componentDefinition Status", "err", err) r.record.Event(&(componentDefinition), event.Warning("cannot update ComponentDefinition Status", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(componentDefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrUpdateComponentDefinition, componentDefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrUpdateComponentDefinition, componentDefinition.Name, err))) } if err := coredef.CleanUpDefinitionRevision(ctx, r.Client, &componentDefinition, r.defRevLimit); err != nil { diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition/policydefinition_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition/policydefinition_controller.go index 8335b83c9..f4395b9c0 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition/policydefinition_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/policies/policydefinition/policydefinition_controller.go @@ -22,7 +22,6 @@ import ( "context" "fmt" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,6 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" oamctrl "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" coredef "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev/v1alpha2/core" @@ -82,7 +82,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot refresh packageDiscover") r.record.Event(&policydefinition, event.Warning("cannot refresh packageDiscover", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &policydefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) + condition.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) } } @@ -92,14 +92,14 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot generate DefinitionRevision", "PolicyDefinitionName", policydefinition.Name) r.record.Event(&policydefinition, event.Warning("cannot generate DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &policydefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, policydefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, policydefinition.Name, err))) } if !isNewRevision { if err = r.createOrUpdatePolicyDefRevision(ctx, req.Namespace, &policydefinition, defRev); err != nil { klog.ErrorS(err, "cannot update DefinitionRevision") r.record.Event(&(policydefinition), event.Warning("cannot update DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(policydefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully update DefinitionRevision", "name", defRev.Name) @@ -114,7 +114,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot create DefinitionRevision") r.record.Event(&(policydefinition), event.Warning("cannot create DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(policydefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully createOrUpdatePolicyDefRevision", "name", defRev.Name) @@ -128,7 +128,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot update PolicyDefinition Status") r.record.Event(&(policydefinition), event.Warning("cannot update PolicyDefinition Status", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(policydefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrUpdatePolicyDefinition, policydefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrUpdatePolicyDefinition, policydefinition.Name, err))) } if err := coredef.CleanUpDefinitionRevision(ctx, r.Client, &policydefinition, r.defRevLimit); err != nil { diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope.go b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope.go index 7141991b4..b4d532379 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope.go @@ -35,10 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" - "github.com/oam-dev/kubevela/pkg/oam" - - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" ) const ( @@ -80,15 +77,15 @@ type ScopeHealthCondition = v1alpha2.ScopeHealthCondition // A WorloadHealthChecker checks health status of specified resource // and saves status into an HealthCondition object. type WorloadHealthChecker interface { - Check(context.Context, client.Client, runtimev1alpha1.TypedReference, string) *WorkloadHealthCondition + Check(context.Context, client.Client, core.ObjectReference, string) *WorkloadHealthCondition } // WorkloadHealthCheckFn checks health status of specified resource // and saves status into an HealthCondition object. -type WorkloadHealthCheckFn func(context.Context, client.Client, runtimev1alpha1.TypedReference, string) *WorkloadHealthCondition +type WorkloadHealthCheckFn func(context.Context, client.Client, core.ObjectReference, string) *WorkloadHealthCondition // Check the health status of specified resource -func (fn WorkloadHealthCheckFn) Check(ctx context.Context, c client.Client, tr runtimev1alpha1.TypedReference, ns string) *WorkloadHealthCondition { +func (fn WorkloadHealthCheckFn) Check(ctx context.Context, c client.Client, tr core.ObjectReference, ns string) *WorkloadHealthCondition { r := fn(ctx, c, tr, ns) if r == nil { return r @@ -117,7 +114,7 @@ func (fn WorkloadHealthCheckFn) Check(ctx context.Context, c client.Client, tr r } // CheckContainerziedWorkloadHealth check health condition of ContainerizedWorkload -func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition { +func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref core.ObjectReference, namespace string) *WorkloadHealthCondition { if ref.GroupVersionKind() != v1alpha2.SchemeGroupVersion.WithKind(kindContainerizedWorkload) { return nil } @@ -141,7 +138,7 @@ func CheckContainerziedWorkloadHealth(ctx context.Context, c client.Client, ref return r } -func updateChildResourcesCondition(ctx context.Context, c client.Client, namespace string, r *WorkloadHealthCondition, ref runtimev1alpha1.TypedReference, childRefs []runtimev1alpha1.TypedReference) { +func updateChildResourcesCondition(ctx context.Context, c client.Client, namespace string, r *WorkloadHealthCondition, ref core.ObjectReference, childRefs []core.ObjectReference) { subConditions := []*WorkloadHealthCondition{} if len(childRefs) != 2 { // one deployment and one svc are required by containerizedworkload @@ -180,7 +177,7 @@ func updateChildResourcesCondition(ctx context.Context, c client.Client, namespa } // CheckDeploymentHealth checks health condition of Deployment -func CheckDeploymentHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition { +func CheckDeploymentHealth(ctx context.Context, client client.Client, ref core.ObjectReference, namespace string) *WorkloadHealthCondition { if ref.GroupVersionKind() != apps.SchemeGroupVersion.WithKind(kindDeployment) { return nil } @@ -214,7 +211,7 @@ func CheckDeploymentHealth(ctx context.Context, client client.Client, ref runtim } // CheckStatefulsetHealth checks health condition of StatefulSet -func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition { +func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref core.ObjectReference, namespace string) *WorkloadHealthCondition { if ref.GroupVersionKind() != apps.SchemeGroupVersion.WithKind(kindStatefulSet) { return nil } @@ -247,7 +244,7 @@ func CheckStatefulsetHealth(ctx context.Context, client client.Client, ref runti } // CheckDaemonsetHealth checks health condition of DaemonSet -func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition { +func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref core.ObjectReference, namespace string) *WorkloadHealthCondition { if ref.GroupVersionKind() != apps.SchemeGroupVersion.WithKind(kindDaemonSet) { return nil } @@ -276,13 +273,13 @@ func CheckDaemonsetHealth(ctx context.Context, client client.Client, ref runtime } // CheckByHealthCheckTrait checks health condition through HealthCheckTrait. -func CheckByHealthCheckTrait(ctx context.Context, c client.Client, wlRef runtimev1alpha1.TypedReference, ns string) *WorkloadHealthCondition { +func CheckByHealthCheckTrait(ctx context.Context, c client.Client, wlRef core.ObjectReference, ns string) *WorkloadHealthCondition { // TODO(roywang) implement HealthCheckTrait feature return nil } // CheckUnknownWorkload handles unknown type workloads. -func CheckUnknownWorkload(ctx context.Context, c client.Client, wlRef runtimev1alpha1.TypedReference, ns string) *WorkloadHealthCondition { +func CheckUnknownWorkload(ctx context.Context, c client.Client, wlRef core.ObjectReference, ns string) *WorkloadHealthCondition { healthCondition := &WorkloadHealthCondition{ TargetWorkload: wlRef, HealthStatus: StatusUnknown, @@ -330,7 +327,7 @@ func getAppConfigNameFromLabel(o metav1.Object) string { return appName } -func getVersioningPeerWorkloadRefs(ctx context.Context, c client.Reader, wlRef runtimev1alpha1.TypedReference, ns string) ([]runtimev1alpha1.TypedReference, error) { +func getVersioningPeerWorkloadRefs(ctx context.Context, c client.Reader, wlRef core.ObjectReference, ns string) ([]core.ObjectReference, error) { o := &unstructured.Unstructured{} o.SetGroupVersionKind(wlRef.GroupVersionKind()) if err := c.Get(ctx, client.ObjectKey{Namespace: ns, Name: wlRef.Name}, o); err != nil { @@ -344,7 +341,7 @@ func getVersioningPeerWorkloadRefs(ctx context.Context, c client.Reader, wlRef r return nil, nil } - peerRefs := []runtimev1alpha1.TypedReference{} + peerRefs := []core.ObjectReference{} l := &unstructured.UnstructuredList{} l.SetGroupVersionKind(wlRef.GroupVersionKind()) @@ -362,7 +359,7 @@ func getVersioningPeerWorkloadRefs(ctx context.Context, c client.Reader, wlRef r if obj.GetName() == o.GetName() { continue } - tmpRef := runtimev1alpha1.TypedReference{} + tmpRef := core.ObjectReference{} tmpRef.SetGroupVersionKind(obj.GroupVersionKind()) tmpRef.Name = obj.GetName() peerRefs = append(peerRefs, tmpRef) diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller.go index 35d566bde..39f8caba1 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller.go @@ -22,10 +22,10 @@ import ( "sync" "time" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" "k8s.io/klog/v2" @@ -188,7 +188,7 @@ func (r *Reconciler) GetScopeHealthStatus(ctx context.Context, healthScope *v1al wg.Add(len(scopeWLRefs)) for _, workloadRef := range scopeWLRefs { - go func(resRef runtimev1alpha1.TypedReference) { + go func(resRef corev1.ObjectReference) { defer wg.Done() var wlHealthCondition *WorkloadHealthCondition diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller_test.go b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller_test.go index 72ca2b836..71abd024a 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_controller_test.go @@ -29,12 +29,12 @@ import ( "k8s.io/apimachinery/pkg/types" appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/test" @@ -60,11 +60,11 @@ var _ = Describe("HealthScope Controller Reconcile Test", func() { Client: &test.MockClient{}, } MockHealthyChecker := WorkloadHealthCheckFn( - func(context.Context, client.Client, v1alpha1.TypedReference, string) *WorkloadHealthCondition { + func(context.Context, client.Client, corev1.ObjectReference, string) *WorkloadHealthCondition { return &WorkloadHealthCondition{HealthStatus: StatusHealthy} }) MockUnhealthyChecker := WorkloadHealthCheckFn( - func(context.Context, client.Client, v1alpha1.TypedReference, string) *WorkloadHealthCondition { + func(context.Context, client.Client, corev1.ObjectReference, string) *WorkloadHealthCondition { return &WorkloadHealthCondition{HealthStatus: StatusUnhealthy} }) reconciler := NewReconciler(mockMgr, @@ -72,7 +72,7 @@ var _ = Describe("HealthScope Controller Reconcile Test", func() { WithChecker(MockHealthyChecker), ) - hs := v1alpha2.HealthScope{Spec: v1alpha2.HealthScopeSpec{WorkloadReferences: []v1alpha1.TypedReference{ + hs := v1alpha2.HealthScope{Spec: v1alpha2.HealthScopeSpec{WorkloadReferences: []corev1.ObjectReference{ // add one wlRef to trigger mockChecker { APIVersion: "mock", @@ -166,7 +166,7 @@ var _ = Describe("Test GetScopeHealthStatus", func() { hs := v1alpha2.HealthScope{} - var cwRef, deployRef, svcRef v1alpha1.TypedReference + var cwRef, deployRef, svcRef corev1.ObjectReference cwRef.SetGroupVersionKind(v1alpha2.SchemeGroupVersion.WithKind(kindContainerizedWorkload)) cwRef.Name = "cw" deployRef.SetGroupVersionKind(appsv1.SchemeGroupVersion.WithKind(kindDeployment)) @@ -175,7 +175,7 @@ var _ = Describe("Test GetScopeHealthStatus", func() { cw := v1alpha2.ContainerizedWorkload{} cw.SetGroupVersionKind(v1alpha2.SchemeGroupVersion.WithKind(kindContainerizedWorkload)) - cw.Status.Resources = []v1alpha1.TypedReference{deployRef, svcRef} + cw.Status.Resources = []corev1.ObjectReference{deployRef, svcRef} hDeploy := appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ @@ -188,7 +188,7 @@ var _ = Describe("Test GetScopeHealthStatus", func() { hDeploy.SetName("deploy") hDeploy.SetGroupVersionKind(appsv1.SchemeGroupVersion.WithKind(kindDeployment)) - uhGeneralRef := v1alpha1.TypedReference{ + uhGeneralRef := corev1.ObjectReference{ APIVersion: "unknown", Kind: "unknown", Name: "unhealthyGeneral", @@ -203,7 +203,7 @@ var _ = Describe("Test GetScopeHealthStatus", func() { BeforeEach(func() { logf.Log.Info("Set up resources before an unit test") - hs.Spec.WorkloadReferences = []v1alpha1.TypedReference{} + hs.Spec.WorkloadReferences = []corev1.ObjectReference{} }) AfterEach(func() { @@ -214,13 +214,13 @@ var _ = Describe("Test GetScopeHealthStatus", func() { It("Test healthy scope", func() { tests := []struct { caseName string - hsWorkloadRefs []v1alpha1.TypedReference + hsWorkloadRefs []corev1.ObjectReference mockGetFn test.MockGetFn wantScopeCondition ScopeHealthCondition }{ { caseName: "2 supportted workloads(cw,deploy)", - hsWorkloadRefs: []v1alpha1.TypedReference{cwRef, deployRef}, + hsWorkloadRefs: []corev1.ObjectReference{cwRef, deployRef}, mockGetFn: func(ctx context.Context, key types.NamespacedName, obj runtime.Object) error { if o, ok := obj.(*v1alpha2.ContainerizedWorkload); ok { *o = cw @@ -256,13 +256,13 @@ var _ = Describe("Test GetScopeHealthStatus", func() { It("Test unhealthy scope", func() { tests := []struct { caseName string - hsWorkloadRefs []v1alpha1.TypedReference + hsWorkloadRefs []corev1.ObjectReference mockGetFn test.MockGetFn wantScopeCondition ScopeHealthCondition }{ { caseName: "2 supportted workloads but one is unhealthy", - hsWorkloadRefs: []v1alpha1.TypedReference{cwRef, deployRef}, + hsWorkloadRefs: []corev1.ObjectReference{cwRef, deployRef}, mockGetFn: func(ctx context.Context, key types.NamespacedName, obj runtime.Object) error { switch o := obj.(type) { case *v1alpha2.ContainerizedWorkload: @@ -288,7 +288,7 @@ var _ = Describe("Test GetScopeHealthStatus", func() { }, { caseName: "1 healthy supportted workload and 1 unsupportted workloads", - hsWorkloadRefs: []v1alpha1.TypedReference{cwRef, uhGeneralRef}, + hsWorkloadRefs: []corev1.ObjectReference{cwRef, uhGeneralRef}, mockGetFn: func(ctx context.Context, key types.NamespacedName, obj runtime.Object) error { switch o := obj.(type) { case *v1alpha2.ContainerizedWorkload: diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_test.go b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_test.go index 0146b6ae2..95caf8ef6 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/healthscope_test.go @@ -25,13 +25,13 @@ import ( "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" apps "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/crossplane-runtime/pkg/test" @@ -54,27 +54,27 @@ var ( func TestCheckContainerziedWorkloadHealth(t *testing.T) { mockClient := test.NewMockClient() - cwRef := runtimev1alpha1.TypedReference{} + cwRef := corev1.ObjectReference{} cwRef.SetGroupVersionKind(corev1alpha2.SchemeGroupVersion.WithKind(kindContainerizedWorkload)) - deployRef := runtimev1alpha1.TypedReference{} + deployRef := corev1.ObjectReference{} deployRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindDeployment)) - svcRef := runtimev1alpha1.TypedReference{} + svcRef := corev1.ObjectReference{} svcRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindService)) cw := corev1alpha2.ContainerizedWorkload{ Status: corev1alpha2.ContainerizedWorkloadStatus{ - Resources: []runtimev1alpha1.TypedReference{deployRef, svcRef}, + Resources: []corev1.ObjectReference{deployRef, svcRef}, }, } tests := []struct { caseName string mockGetFn test.MockGetFn - wlRef runtimev1alpha1.TypedReference + wlRef corev1.ObjectReference expect *WorkloadHealthCondition }{ { caseName: "not matched checker", - wlRef: runtimev1alpha1.TypedReference{}, + wlRef: corev1.ObjectReference{}, expect: nil, }, { @@ -192,18 +192,18 @@ func TestCheckContainerziedWorkloadHealth(t *testing.T) { func TestCheckDeploymentHealth(t *testing.T) { mockClient := test.NewMockClient() - deployRef := runtimev1alpha1.TypedReference{} + deployRef := corev1.ObjectReference{} deployRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindDeployment)) tests := []struct { caseName string mockGetFn test.MockGetFn - wlRef runtimev1alpha1.TypedReference + wlRef corev1.ObjectReference expect *WorkloadHealthCondition }{ { caseName: "not matched checker", - wlRef: runtimev1alpha1.TypedReference{}, + wlRef: corev1.ObjectReference{}, expect: nil, }, { @@ -273,18 +273,18 @@ func TestCheckDeploymentHealth(t *testing.T) { func TestCheckStatefulsetHealth(t *testing.T) { mockClient := test.NewMockClient() - stsRef := runtimev1alpha1.TypedReference{} + stsRef := corev1.ObjectReference{} stsRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindStatefulSet)) tests := []struct { caseName string mockGetFn test.MockGetFn - wlRef runtimev1alpha1.TypedReference + wlRef corev1.ObjectReference expect *WorkloadHealthCondition }{ { caseName: "not matched checker", - wlRef: runtimev1alpha1.TypedReference{}, + wlRef: corev1.ObjectReference{}, expect: nil, }, { @@ -354,18 +354,18 @@ func TestCheckStatefulsetHealth(t *testing.T) { func TestCheckDaemonsetHealth(t *testing.T) { mockClient := test.NewMockClient() - dstRef := runtimev1alpha1.TypedReference{} + dstRef := corev1.ObjectReference{} dstRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindDaemonSet)) tests := []struct { caseName string mockGetFn test.MockGetFn - wlRef runtimev1alpha1.TypedReference + wlRef corev1.ObjectReference expect *WorkloadHealthCondition }{ { caseName: "not matched checker", - wlRef: runtimev1alpha1.TypedReference{}, + wlRef: corev1.ObjectReference{}, expect: nil, }, { @@ -430,7 +430,7 @@ func TestCheckDaemonsetHealth(t *testing.T) { func TestCheckUnknownWorkload(t *testing.T) { mockError := errors.New("mock error") mockClient := test.NewMockClient() - unknownWL := runtimev1alpha1.TypedReference{} + unknownWL := corev1.ObjectReference{} tests := []struct { caseName string mockGetFn test.MockGetFn @@ -489,7 +489,7 @@ func TestCheckUnknownWorkload(t *testing.T) { } func TestCheckVersionEnabledComponent(t *testing.T) { - deployRef := runtimev1alpha1.TypedReference{} + deployRef := corev1.ObjectReference{} deployRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindDeployment)) deployRef.Name = "main-workload" deployObj := apps.Deployment{ @@ -651,12 +651,12 @@ func TestPeerHealthConditionsSort(t *testing.T) { want := make(PeerHealthConditions, len(tc.w)) for i, v := range tc.d { data[i] = WorkloadHealthCondition{ - TargetWorkload: runtimev1alpha1.TypedReference{Name: v}, + TargetWorkload: corev1.ObjectReference{Name: v}, } } for i, v := range tc.w { want[i] = WorkloadHealthCondition{ - TargetWorkload: runtimev1alpha1.TypedReference{Name: v}, + TargetWorkload: corev1.ObjectReference{Name: v}, } } sort.Sort(data) diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard.go b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard.go index bb495bfb6..825309026 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard.go @@ -19,8 +19,8 @@ package healthscope import ( "context" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kuberuntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -39,7 +39,7 @@ var ( ) // CheckPodSpecWorkloadHealth check health condition of podspecworkloads.standard.oam.dev -func CheckPodSpecWorkloadHealth(ctx context.Context, c client.Client, ref runtimev1alpha1.TypedReference, namespace string) *WorkloadHealthCondition { +func CheckPodSpecWorkloadHealth(ctx context.Context, c client.Client, ref corev1.ObjectReference, namespace string) *WorkloadHealthCondition { if ref.GroupVersionKind() != podSpecWorkloadGVK { return nil } @@ -58,10 +58,10 @@ func CheckPodSpecWorkloadHealth(ctx context.Context, c client.Client, ref runtim r.TargetWorkload.UID = workloadObj.GetUID() childRefsData, _, _ := unstructured.NestedSlice(workloadObj.Object, "status", "resources") - childRefs := []runtimev1alpha1.TypedReference{} + childRefs := []corev1.ObjectReference{} for _, v := range childRefsData { v := v.(map[string]interface{}) - tmpChildRef := &runtimev1alpha1.TypedReference{} + tmpChildRef := &corev1.ObjectReference{} if err := kuberuntime.DefaultUnstructuredConverter.FromUnstructured(v, tmpChildRef); err != nil { r.HealthStatus = StatusUnhealthy r.Diagnosis = errors.Wrap(err, errHealthCheck).Error() diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard_test.go b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard_test.go index 9b2996440..42a20eebe 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard_test.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/scopes/healthscope/standard_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/stretchr/testify/assert" apps "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" @@ -33,12 +33,12 @@ import ( func TestCheckPodSpecWorkloadHealth(t *testing.T) { mockClient := test.NewMockClient() - scRef := runtimev1alpha1.TypedReference{} + scRef := corev1.ObjectReference{} scRef.SetGroupVersionKind(podSpecWorkloadGVK) - deployRef := runtimev1alpha1.TypedReference{} + deployRef := corev1.ObjectReference{} deployRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindDeployment)) - svcRef := runtimev1alpha1.TypedReference{} + svcRef := corev1.ObjectReference{} svcRef.SetGroupVersionKind(apps.SchemeGroupVersion.WithKind(kindService)) deployRefData, _ := util.Object2Map(deployRef) @@ -51,12 +51,12 @@ func TestCheckPodSpecWorkloadHealth(t *testing.T) { tests := []struct { caseName string mockGetFn test.MockGetFn - wlRef runtimev1alpha1.TypedReference + wlRef corev1.ObjectReference expect *WorkloadHealthCondition }{ { caseName: "not matched checker", - wlRef: runtimev1alpha1.TypedReference{}, + wlRef: corev1.ObjectReference{}, expect: nil, }, { diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go index d347d889d..85c77d442 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go @@ -21,7 +21,6 @@ import ( "fmt" "strings" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" cpmeta "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/pkg/errors" @@ -37,6 +36,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" oamv1alpha2 "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" controller "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" "github.com/oam-dev/kubevela/pkg/oam/discoverymapper" @@ -103,7 +103,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { r.record.Event(eventObj, event.Warning(util.ErrLocateWorkload, err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition( - ctx, r, &manualScalar, cpv1alpha1.ReconcileError(errors.Wrap(err, util.ErrLocateWorkload))) + ctx, r, &manualScalar, condition.ReconcileError(errors.Wrap(err, util.ErrLocateWorkload))) } // Fetch the child resources list from the corresponding workload @@ -112,7 +112,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Error while fetching the workload child resources", "workload", workload.UnstructuredContent()) r.record.Event(eventObj, event.Warning(util.ErrFetchChildResources, err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, - cpv1alpha1.ReconcileError(errors.New(util.ErrFetchChildResources))) + condition.ReconcileError(errors.New(util.ErrFetchChildResources))) } // include the workload itself if there is no child resources if len(resources) == 0 { @@ -131,7 +131,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { r.record.Event(eventObj, event.Normal("Manual scalar applied", fmt.Sprintf("Trait `%s` successfully scaled a resource to %d instances", manualScalar.Name, manualScalar.Spec.ReplicaCount))) - return ctrl.Result{}, util.EndReconcileWithPositiveCondition(ctx, r, &manualScalar, cpv1alpha1.ReconcileSuccess()) + return ctrl.Result{}, util.EndReconcileWithPositiveCondition(ctx, r, &manualScalar, condition.ReconcileSuccess()) } // identify child resources and scale them @@ -153,12 +153,12 @@ func (r *Reconciler) scaleResources(ctx context.Context, manualScalar oamv1alpha schemaDoc, err := r.DiscoveryClient.OpenAPISchema() if err != nil { return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, cpv1alpha1.ReconcileError(errors.Wrap(err, errQueryOpenAPI))) + util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, condition.ReconcileError(errors.Wrap(err, errQueryOpenAPI))) } document, err := openapi.NewOpenAPIData(schemaDoc) if err != nil { return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, cpv1alpha1.ReconcileError(errors.Wrap(err, errQueryOpenAPI))) + util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, condition.ReconcileError(errors.Wrap(err, errQueryOpenAPI))) } for _, res := range resources { if locateReplicaField(document, res) { @@ -171,13 +171,13 @@ func (r *Reconciler) scaleResources(ctx context.Context, manualScalar oamv1alpha if err != nil { klog.ErrorS(err, "Failed to patch a resource for scaling") return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, cpv1alpha1.ReconcileError(errors.Wrap(err, errPatchTobeScaledResource))) + util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, condition.ReconcileError(errors.Wrap(err, errPatchTobeScaledResource))) } // merge patch to scale the resource if err := r.Patch(ctx, res, resPatch, client.FieldOwner(manualScalar.GetUID())); err != nil { klog.ErrorS(err, "Failed to scale a resource") return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, cpv1alpha1.ReconcileError(errors.Wrap(err, errScaleResource))) + util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, condition.ReconcileError(errors.Wrap(err, errScaleResource))) } klog.InfoS("Successfully scaled a resource", "resource GVK", res.GroupVersionKind().String(), "res UID", res.GetUID(), "target replica", manualScalar.Spec.ReplicaCount) @@ -186,7 +186,7 @@ func (r *Reconciler) scaleResources(ctx context.Context, manualScalar oamv1alpha if !found { klog.InfoS("Cannot locate any resource", "total resources", len(resources)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, cpv1alpha1.ReconcileError(errors.New(errScaleResource))) + util.EndReconcileWithNegativeCondition(ctx, r, &manualScalar, condition.ReconcileError(errors.New(errScaleResource))) } return ctrl.Result{}, nil } diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition/traitdefinition_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition/traitdefinition_controller.go index 62a4ec41a..c1419d0c9 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition/traitdefinition_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/traits/traitdefinition/traitdefinition_controller.go @@ -22,7 +22,6 @@ import ( "context" "fmt" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,6 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" oamctrl "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" coredef "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev/v1alpha2/core" @@ -81,7 +81,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not refresh packageDiscover", "err", err) r.record.Event(&traitdefinition, event.Warning("cannot refresh packageDiscover", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &traitdefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) + condition.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) } } @@ -91,14 +91,14 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not generate definitionRevision", "traitDefinition", klog.KObj(&traitdefinition), "err", err) r.record.Event(&traitdefinition, event.Warning("Could not generate DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &traitdefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, traitdefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, traitdefinition.Name, err))) } if !isNewRevision { if err = r.createOrUpdateTraitDefRevision(ctx, req.Namespace, &traitdefinition, defRev); err != nil { klog.InfoS("Could not update DefinitionRevision", "err", err) r.record.Event(&(traitdefinition), event.Warning("cannot update DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(traitdefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully update definitionRevision", "definitionRevision", klog.KObj(defRev)) @@ -118,7 +118,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not store capability in ConfigMap", "err", err) r.record.Event(&(traitdefinition), event.Warning("Could not store capability in ConfigMap", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &traitdefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrStoreCapabilityInConfigMap, traitdefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrStoreCapabilityInConfigMap, traitdefinition.Name, err))) } traitdefinition.Status.ConfigMapRef = cmName klog.Info("Successfully stored Capability Schema in ConfigMap") @@ -127,7 +127,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not create DefinitionRevision", "err", err) r.record.Event(&(traitdefinition), event.Warning("Could not create definitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(traitdefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully create definitionRevision", "definitionRevision", klog.KObj(defRev)) @@ -141,7 +141,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.InfoS("Could not update TraitDefinition Status", "err", err) r.record.Event(&(traitdefinition), event.Warning("Could not update TraitDefinition Status", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(traitdefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrUpdateTraitDefinition, traitdefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrUpdateTraitDefinition, traitdefinition.Name, err))) } if err := coredef.CleanUpDefinitionRevision(ctx, r.Client, &traitdefinition, r.defRevLimit); err != nil { diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition/workflowstepdefinition_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition/workflowstepdefinition_controller.go index b69fcf610..dc2babb25 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition/workflowstepdefinition_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/workflow/workflowstepdefinition/workflowstepdefinition_controller.go @@ -22,7 +22,6 @@ import ( "context" "fmt" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,6 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" oamctrl "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" coredef "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev/v1alpha2/core" @@ -82,7 +82,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot refresh packageDiscover") r.record.Event(&wfstepdefinition, event.Warning("cannot refresh packageDiscover", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &wfstepdefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) + condition.ReconcileError(fmt.Errorf(util.ErrRefreshPackageDiscover, err))) } } // generate DefinitionRevision from WorkflowStepDefinition @@ -91,7 +91,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot generate DefinitionRevision", "WorkflowStepDefinitionName", wfstepdefinition.Name) r.record.Event(&wfstepdefinition, event.Warning("cannot generate DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &wfstepdefinition, - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, wfstepdefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrGenerateDefinitionRevision, wfstepdefinition.Name, err))) } if !isNewRevision { @@ -99,7 +99,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot update DefinitionRevision") r.record.Event(&(wfstepdefinition), event.Warning("cannot update DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(wfstepdefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully update DefinitionRevision", "name", defRev.Name) @@ -114,7 +114,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot create DefinitionRevision") r.record.Event(&(wfstepdefinition), event.Warning("cannot create DefinitionRevision", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(wfstepdefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrCreateOrUpdateDefinitionRevision, defRev.Name, err))) } klog.InfoS("Successfully createOrUpdateWFStepDefRevision", "name", defRev.Name) @@ -128,7 +128,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "cannot update WorkflowStepDefinition Status") r.record.Event(&(wfstepdefinition), event.Warning("cannot update WorkflowStepDefinition Status", err)) return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &(wfstepdefinition), - cpv1alpha1.ReconcileError(fmt.Errorf(util.ErrUpdateWorkflowStepDefinition, wfstepdefinition.Name, err))) + condition.ReconcileError(fmt.Errorf(util.ErrUpdateWorkflowStepDefinition, wfstepdefinition.Name, err))) } if err := coredef.CleanUpDefinitionRevision(ctx, r.Client, &wfstepdefinition, r.defRevLimit); err != nil { diff --git a/pkg/controller/core.oam.dev/v1alpha2/core/workloads/containerizedworkload/containerizedworkload_controller.go b/pkg/controller/core.oam.dev/v1alpha2/core/workloads/containerizedworkload/containerizedworkload_controller.go index 4fb829eb4..de309fc3e 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/core/workloads/containerizedworkload/containerizedworkload_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/core/workloads/containerizedworkload/containerizedworkload_controller.go @@ -21,7 +21,6 @@ import ( "fmt" "strings" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/pkg/errors" appsv1 "k8s.io/api/apps/v1" @@ -36,6 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/predicate" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" controller "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" "github.com/oam-dev/kubevela/pkg/oam/util" @@ -97,7 +97,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Failed to render a deployment") r.record.Event(eventObj, event.Warning(errRenderWorkload, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errRenderWorkload))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errRenderWorkload))) } // server side apply, only the fields we set are touched applyOpts := []client.PatchOption{client.ForceOwnership, client.FieldOwner(workload.GetUID())} @@ -105,7 +105,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Failed to apply to a deployment") r.record.Event(eventObj, event.Warning(errApplyDeployment, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errApplyDeployment))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errApplyDeployment))) } r.record.Event(eventObj, event.Normal("Deployment created", fmt.Sprintf("Workload `%s` successfully server side patched a deployment `%s`", @@ -117,14 +117,14 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Failed to render configmaps") r.record.Event(eventObj, event.Warning(errRenderWorkload, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errRenderWorkload))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errRenderWorkload))) } for _, cm := range configmaps { if err := r.Patch(ctx, cm, client.Apply, configMapApplyOpts...); err != nil { klog.ErrorS(err, "Failed to apply a configmap") r.record.Event(eventObj, event.Warning(errApplyConfigMap, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errApplyConfigMap))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errApplyConfigMap))) } r.record.Event(eventObj, event.Normal("ConfigMap created", fmt.Sprintf("Workload `%s` successfully server side patched a configmap `%s`", @@ -137,14 +137,14 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { klog.ErrorS(err, "Failed to render a service") r.record.Event(eventObj, event.Warning(errRenderService, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errRenderService))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errRenderService))) } // server side apply the service if err := r.Patch(ctx, service, client.Apply, applyOpts...); err != nil { klog.ErrorS(err, "Failed to apply a service") r.record.Event(eventObj, event.Warning(errApplyDeployment, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errApplyService))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errApplyService))) } r.record.Event(eventObj, event.Normal("Service created", fmt.Sprintf("Workload `%s` successfully server side patched a service `%s`", @@ -157,13 +157,13 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { workload.Status.Resources = nil // record the new deployment, new service workload.Status.Resources = append(workload.Status.Resources, - cpv1alpha1.TypedReference{ + corev1.ObjectReference{ APIVersion: deploy.GetObjectKind().GroupVersionKind().GroupVersion().String(), Kind: deploy.GetObjectKind().GroupVersionKind().Kind, Name: deploy.GetName(), UID: deploy.UID, }, - cpv1alpha1.TypedReference{ + corev1.ObjectReference{ APIVersion: service.GetObjectKind().GroupVersionKind().GroupVersion().String(), Kind: service.GetObjectKind().GroupVersionKind().Kind, Name: service.GetName(), @@ -171,9 +171,9 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { }, ) - workload.SetConditions(cpv1alpha1.ReconcileSuccess()) + workload.SetConditions(condition.ReconcileSuccess()) if err := r.UpdateStatus(ctx, &workload); err != nil { - return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(err)) + return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(err)) } return ctrl.Result{}, nil } diff --git a/pkg/controller/core.oam.dev/v1alpha2/initializer/initializer_controller.go b/pkg/controller/core.oam.dev/v1alpha2/initializer/initializer_controller.go index 51fa3b1a4..40066b7ee 100644 --- a/pkg/controller/core.oam.dev/v1alpha2/initializer/initializer_controller.go +++ b/pkg/controller/core.oam.dev/v1alpha2/initializer/initializer_controller.go @@ -20,7 +20,6 @@ import ( "context" "time" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -35,6 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" velatypes "github.com/oam-dev/kubevela/apis/types" oamctrl "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" @@ -76,7 +76,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.ErrorS(err, "Check initializer dependsOn error") r.record.Event(init, event.Warning("Checking Initializer dependsOn error", err)) - return r.endWithNegativeCondition(ctx, init, cpv1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, init, condition.ReconcileError(err)) } if !dependsOnInitReady { klog.Info("Wait for dependent Initializer to be ready") @@ -88,7 +88,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err != nil { klog.ErrorS(err, "Could not create resources via application to initialize the env") r.record.Event(init, event.Warning("Could not create resources via application", err)) - return r.endWithNegativeCondition(ctx, init, cpv1alpha1.ReconcileError(err)) + return r.endWithNegativeCondition(ctx, init, condition.ReconcileError(err)) } if !appReady { klog.Info("Wait for the Application created by Initializer to be ready") @@ -99,7 +99,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { if err = r.patchStatus(ctx, init); err != nil { klog.ErrorS(err, "Could not update status") r.record.Event(init, event.Warning("Could not update status", err)) - return ctrl.Result{}, oamutil.EndReconcileWithNegativeCondition(ctx, r, init, cpv1alpha1.ReconcileError(err)) + return ctrl.Result{}, oamutil.EndReconcileWithNegativeCondition(ctx, r, init, condition.ReconcileError(err)) } return ctrl.Result{}, nil } @@ -137,26 +137,26 @@ func (r *Reconciler) checkOrInstallDependsOn(ctx context.Context, depends []v1be return true, nil } -func (r *Reconciler) endWithNegativeCondition(ctx context.Context, init *v1beta1.Initializer, condition cpv1alpha1.Condition) (ctrl.Result, error) { - init.SetConditions(condition) +func (r *Reconciler) endWithNegativeCondition(ctx context.Context, init *v1beta1.Initializer, cond condition.Condition) (ctrl.Result, error) { + init.SetConditions(cond) if err := r.patchStatus(ctx, init); err != nil { return ctrl.Result{}, errors.WithMessage(err, "cannot update initializer status") } // if any condition is changed, patching status can trigger requeue the resource and we should return nil to // avoid requeue it again - if oamutil.IsConditionChanged([]cpv1alpha1.Condition{condition}, init) { + if oamutil.IsConditionChanged([]condition.Condition{cond}, init) { return ctrl.Result{}, nil } // if no condition is changed, patching status can not trigger requeue, so we must return an error to // requeue the resource - return ctrl.Result{}, errors.Errorf("object level reconcile error, type: %q, msg: %q", string(condition.Type), condition.Message) + return ctrl.Result{}, errors.Errorf("object level reconcile error, type: %q, msg: %q", string(cond.Type), cond.Message) } // endWithTryLater means reconcile successfully but have to wait until initializer phase is success. initializer may be // 1. waiting dependent initializer to be ready // 2. initializing func (r *Reconciler) endWithTryLater(ctx context.Context, init *v1beta1.Initializer) (ctrl.Result, error) { - init.SetConditions(cpv1alpha1.ReconcileSuccess()) + init.SetConditions(condition.ReconcileSuccess()) if err := r.patchStatus(ctx, init); err != nil { return ctrl.Result{}, errors.WithMessage(err, "cannot update initializer status") } diff --git a/pkg/controller/standard.oam.dev/v1alpha1/podspecworkload/podspecworkload_controller.go b/pkg/controller/standard.oam.dev/v1alpha1/podspecworkload/podspecworkload_controller.go index ab0eb1392..4a5e4d34f 100644 --- a/pkg/controller/standard.oam.dev/v1alpha1/podspecworkload/podspecworkload_controller.go +++ b/pkg/controller/standard.oam.dev/v1alpha1/podspecworkload/podspecworkload_controller.go @@ -21,9 +21,10 @@ import ( "fmt" "reflect" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + controller "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/go-logr/logr" "github.com/pkg/errors" @@ -100,7 +101,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { log.Error(err, "Failed to render a deployment") r.record.Event(eventObj, event.Warning(errRenderDeployment, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errRenderDeployment))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errRenderDeployment))) } // server side apply applyOpts := []client.PatchOption{client.ForceOwnership, client.FieldOwner(workload.GetUID())} @@ -108,14 +109,14 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { log.Error(err, "Failed to apply to a deployment") r.record.Event(eventObj, event.Warning(errApplyDeployment, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errApplyDeployment))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errApplyDeployment))) } r.record.Event(eventObj, event.Normal("Deployment created", fmt.Sprintf("Workload `%s` successfully patched a deployment `%s`", workload.Name, deploy.Name))) // record the new deployment - workload.Status.Resources = []cpv1alpha1.TypedReference{ + workload.Status.Resources = []corev1.ObjectReference{ { APIVersion: deploy.GetObjectKind().GroupVersionKind().GroupVersion().String(), Kind: deploy.GetObjectKind().GroupVersionKind().Kind, @@ -133,21 +134,21 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { log.Error(err, "Failed to render a service") r.record.Event(eventObj, event.Warning(errRenderService, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errRenderService))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errRenderService))) } // server side apply the service if err := r.Patch(ctx, service, client.Apply, applyOpts...); err != nil { log.Error(err, "Failed to apply a service") r.record.Event(eventObj, event.Warning(errApplyDeployment, err)) return ctrl.Result{}, - util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(errors.Wrap(err, errApplyService))) + util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(errors.Wrap(err, errApplyService))) } r.record.Event(eventObj, event.Normal("Service created", fmt.Sprintf("Workload `%s` successfully server side patched a service `%s`", workload.Name, service.Name))) // record the new service - workload.Status.Resources = append(workload.Status.Resources, cpv1alpha1.TypedReference{ + workload.Status.Resources = append(workload.Status.Resources, corev1.ObjectReference{ APIVersion: service.GetObjectKind().GroupVersionKind().GroupVersion().String(), Kind: service.GetObjectKind().GroupVersionKind().Kind, Name: service.GetName(), @@ -155,9 +156,9 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { }) } - workload.SetConditions(cpv1alpha1.ReconcileSuccess()) + workload.SetConditions(condition.ReconcileSuccess()) if err := r.UpdateStatus(ctx, &workload); err != nil { - return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &workload, cpv1alpha1.ReconcileError(err)) + return ctrl.Result{}, util.EndReconcileWithNegativeCondition(ctx, r, &workload, condition.ReconcileError(err)) } return ctrl.Result{}, nil } diff --git a/pkg/controller/utils/utils.go b/pkg/controller/utils/utils.go index 70f022ee0..a80e4c493 100644 --- a/pkg/controller/utils/utils.go +++ b/pkg/controller/utils/utils.go @@ -25,7 +25,6 @@ import ( "strings" "time" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/fieldpath" mapset "github.com/deckarep/golang-set" "github.com/ghodss/yaml" @@ -45,6 +44,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" commontypes "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" velatypes "github.com/oam-dev/kubevela/apis/types" @@ -360,7 +360,7 @@ func CheckAppDeploymentUsingAppRevision(ctx context.Context, c client.Reader, ap } // GetUnstructuredObjectStatusCondition returns the status.condition with matching condType from an unstructured object. -func GetUnstructuredObjectStatusCondition(obj *unstructured.Unstructured, condType string) (*runtimev1alpha1.Condition, bool, error) { +func GetUnstructuredObjectStatusCondition(obj *unstructured.Unstructured, condType string) (*condition.Condition, bool, error) { cs, found, err := unstructured.NestedSlice(obj.Object, "status", "conditions") if err != nil { return nil, false, err @@ -373,7 +373,7 @@ func GetUnstructuredObjectStatusCondition(obj *unstructured.Unstructured, condTy if err != nil { return nil, false, err } - condObj := &runtimev1alpha1.Condition{} + condObj := &condition.Condition{} err = json.Unmarshal(b, condObj) if err != nil { return nil, false, err @@ -427,24 +427,3 @@ func GetBuildInInitializer(ctx context.Context, cli client.Client, name string) return init, nil } - -// ReadyCondition generate ready condition for conditionType -func ReadyCondition(tpy string) runtimev1alpha1.Condition { - return runtimev1alpha1.Condition{ - Type: runtimev1alpha1.ConditionType(tpy), - Status: corev1.ConditionTrue, - Reason: runtimev1alpha1.ReasonAvailable, - LastTransitionTime: metav1.NewTime(time.Now()), - } -} - -// ErrorCondition generate error condition for conditionType and error -func ErrorCondition(tpy string, err error) runtimev1alpha1.Condition { - return runtimev1alpha1.Condition{ - Type: runtimev1alpha1.ConditionType(tpy), - Status: corev1.ConditionFalse, - LastTransitionTime: metav1.NewTime(time.Now()), - Reason: runtimev1alpha1.ReasonReconcileError, - Message: err.Error(), - } -} diff --git a/pkg/oam/mock/mocks.go b/pkg/oam/mock/mocks.go index 20e0193ea..76b32848a 100644 --- a/pkg/oam/mock/mocks.go +++ b/pkg/oam/mock/mocks.go @@ -21,27 +21,26 @@ import ( "encoding/json" "reflect" - "k8s.io/client-go/rest" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" ) // Conditioned is a mock that implements Conditioned interface. -type Conditioned struct{ Conditions []v1alpha1.Condition } +type Conditioned struct{ Conditions []condition.Condition } // SetConditions sets the Conditions. -func (m *Conditioned) SetConditions(c ...v1alpha1.Condition) { m.Conditions = c } +func (m *Conditioned) SetConditions(c ...condition.Condition) { m.Conditions = c } // GetCondition get the Condition with the given ConditionType. -func (m *Conditioned) GetCondition(ct v1alpha1.ConditionType) v1alpha1.Condition { - return v1alpha1.Condition{Type: ct, Status: corev1.ConditionUnknown} +func (m *Conditioned) GetCondition(ct condition.ConditionType) condition.Condition { + return condition.Condition{Type: ct, Status: corev1.ConditionUnknown} } // ManagedResourceReferencer is a mock that implements ManagedResourceReferencer interface. @@ -54,15 +53,15 @@ func (m *ManagedResourceReferencer) SetResourceReference(r *corev1.ObjectReferen func (m *ManagedResourceReferencer) GetResourceReference() *corev1.ObjectReference { return m.Ref } // A WorkloadReferencer references an OAM Workload type. -type WorkloadReferencer struct{ Ref v1alpha1.TypedReference } +type WorkloadReferencer struct{ Ref corev1.ObjectReference } // GetWorkloadReference gets the WorkloadReference. -func (w *WorkloadReferencer) GetWorkloadReference() v1alpha1.TypedReference { +func (w *WorkloadReferencer) GetWorkloadReference() corev1.ObjectReference { return w.Ref } // SetWorkloadReference sets the WorkloadReference. -func (w *WorkloadReferencer) SetWorkloadReference(r v1alpha1.TypedReference) { +func (w *WorkloadReferencer) SetWorkloadReference(r corev1.ObjectReference) { w.Ref = r } @@ -92,7 +91,7 @@ func (o *Object) DeepCopyObject() runtime.Object { type Trait struct { metav1.ObjectMeta runtime.Object - v1alpha1.ConditionedStatus + condition.ConditionedStatus WorkloadReferencer } @@ -116,7 +115,7 @@ func (t *Trait) DeepCopyObject() runtime.Object { type Workload struct { metav1.ObjectMeta runtime.Object - v1alpha1.ConditionedStatus + condition.ConditionedStatus } // GetObjectKind returns schema.ObjectKind. @@ -192,3 +191,49 @@ func (mock NotFoundErr) Status() metav1.Status { func (mock NotFoundErr) Error() string { return "Not Found Resource" } + +// A LocalSecretReference is a reference to a secret in the same namespace as +// the referencer. +type LocalSecretReference struct { + // Name of the secret. + Name string `json:"name"` +} + +// LocalConnectionSecretWriterTo is a mock that implements LocalConnectionSecretWriterTo interface. +type LocalConnectionSecretWriterTo struct { + Ref *LocalSecretReference +} + +// SetWriteConnectionSecretToReference sets the WriteConnectionSecretToReference. +func (m *LocalConnectionSecretWriterTo) SetWriteConnectionSecretToReference(r *LocalSecretReference) { + m.Ref = r +} + +// GetWriteConnectionSecretToReference gets the WriteConnectionSecretToReference. +func (m *LocalConnectionSecretWriterTo) GetWriteConnectionSecretToReference() *LocalSecretReference { + return m.Ref +} + +// Target is a mock that implements Target interface. +type Target struct { + metav1.ObjectMeta + ManagedResourceReferencer + LocalConnectionSecretWriterTo + condition.ConditionedStatus +} + +// GetObjectKind returns schema.ObjectKind. +func (m *Target) GetObjectKind() schema.ObjectKind { + return schema.EmptyObjectKind +} + +// DeepCopyObject returns a deep copy of Target as runtime.Object. +func (m *Target) DeepCopyObject() runtime.Object { + out := &Target{} + j, err := json.Marshal(m) + if err != nil { + panic(err) + } + _ = json.Unmarshal(j, out) + return out +} diff --git a/pkg/oam/types.go b/pkg/oam/types.go index 456c96c2f..f8933aa2d 100644 --- a/pkg/oam/types.go +++ b/pkg/oam/types.go @@ -20,11 +20,12 @@ package oam import ( "context" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" ) // ScopeKind contains the type metadata for a kind of an OAM scope resource. @@ -39,20 +40,20 @@ type WorkloadKind schema.GroupVersionKind // A Conditioned may have conditions set or retrieved. Conditions are typically // indicate the status of both a resource and its reconciliation process. type Conditioned interface { - SetConditions(c ...runtimev1alpha1.Condition) - GetCondition(runtimev1alpha1.ConditionType) runtimev1alpha1.Condition + SetConditions(c ...condition.Condition) + GetCondition(condition.ConditionType) condition.Condition } // A WorkloadReferencer may reference an OAM workload. type WorkloadReferencer interface { - GetWorkloadReference() runtimev1alpha1.TypedReference - SetWorkloadReference(runtimev1alpha1.TypedReference) + GetWorkloadReference() corev1.ObjectReference + SetWorkloadReference(corev1.ObjectReference) } // A WorkloadsReferencer may reference an OAM workload. type WorkloadsReferencer interface { - GetWorkloadReferences() []runtimev1alpha1.TypedReference - AddWorkloadReference(runtimev1alpha1.TypedReference) + GetWorkloadReferences() []corev1.ObjectReference + AddWorkloadReference(corev1.ObjectReference) } // A Finalizer manages the finalizers on the resource. diff --git a/pkg/oam/util/helper.go b/pkg/oam/util/helper.go index 398aff68f..abaf301c8 100644 --- a/pkg/oam/util/helper.go +++ b/pkg/oam/util/helper.go @@ -27,7 +27,8 @@ import ( "strconv" "strings" - cpv1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" + "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" appsv1 "k8s.io/api/apps/v1" @@ -453,7 +454,7 @@ func fetchChildResources(ctx context.Context, r client.Reader, workload *unstruc // It should not handle reconcile success with positive conditions, otherwise it will trigger // infinite requeue. func EndReconcileWithNegativeCondition(ctx context.Context, r client.StatusClient, workload ConditionedObject, - condition ...cpv1alpha1.Condition) error { + condition ...condition.Condition) error { if len(condition) == 0 { return nil } @@ -474,7 +475,7 @@ func EndReconcileWithNegativeCondition(ctx context.Context, r client.StatusClien } // IsConditionChanged will check if conditions in workload is changed compare to newCondition -func IsConditionChanged(newCondition []cpv1alpha1.Condition, workload ConditionedObject) bool { +func IsConditionChanged(newCondition []condition.Condition, workload ConditionedObject) bool { var conditionIsChanged bool for _, newCond := range newCondition { // NOTE(roywang) an implicit rule here: condition type is unique in an object's conditions @@ -492,7 +493,7 @@ func IsConditionChanged(newCondition []cpv1alpha1.Condition, workload Conditione // EndReconcileWithPositiveCondition is used to handle reconcile success for a conditioned resource. // It should only accept positive condition which means no need to requeue the resource. func EndReconcileWithPositiveCondition(ctx context.Context, r client.StatusClient, workload ConditionedObject, - condition ...cpv1alpha1.Condition) error { + condition ...condition.Condition) error { workloadPatch := client.MergeFrom(workload.DeepCopyObject()) workload.SetConditions(condition...) return errors.Wrap( @@ -975,3 +976,22 @@ func Abs(a int) int { } return a } + +// AsOwner converts the supplied object reference to an owner reference. +func AsOwner(r *corev1.ObjectReference) metav1.OwnerReference { + return metav1.OwnerReference{ + APIVersion: r.APIVersion, + Kind: r.Kind, + Name: r.Name, + UID: r.UID, + } +} + +// AsController converts the supplied object reference to a controller +// reference. You may also consider using metav1.NewControllerRef. +func AsController(r *corev1.ObjectReference) metav1.OwnerReference { + c := true + ref := AsOwner(r) + ref.Controller = &c + return ref +} diff --git a/pkg/oam/util/helper_test.go b/pkg/oam/util/helper_test.go index 7e207da16..77c9e53ce 100644 --- a/pkg/oam/util/helper_test.go +++ b/pkg/oam/util/helper_test.go @@ -26,12 +26,11 @@ import ( "testing" "time" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" - "github.com/crossplane/crossplane-runtime/pkg/resource/fake" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/pkg/errors" "github.com/stretchr/testify/assert" appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -42,6 +41,7 @@ import ( "sigs.k8s.io/yaml" "github.com/oam-dev/kubevela/apis/core.oam.dev/common" + "github.com/oam-dev/kubevela/apis/core.oam.dev/condition" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" "github.com/oam-dev/kubevela/pkg/oam" @@ -186,7 +186,7 @@ func TestFetchWorkloadTraitReference(t *testing.T) { }, Spec: v1alpha2.ManualScalerTraitSpec{ ReplicaCount: 3, - WorkloadReference: v1alpha1.TypedReference{ + WorkloadReference: corev1.ObjectReference{ APIVersion: "apiversion", Kind: "Kind", }, @@ -910,7 +910,7 @@ func TestGenTraitName(t *testing.T) { }, }, definitionName: "", - exp: "simple-trait-5ddc8b7556", + exp: "simple-trait-69dbc6b96", }, { name: "simple-definition", @@ -954,7 +954,7 @@ func TestComputeHash(t *testing.T) { Object: &mts, }, }, - exp: "5ddc8b7556", + exp: "69dbc6b96", }, } for _, test := range test { @@ -993,7 +993,7 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { ctx context.Context r client.StatusClient workload util.ConditionedObject - condition []v1alpha1.Condition + condition []condition.Condition } patchErr := fmt.Errorf("eww") tests := []struct { @@ -1008,8 +1008,8 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { r: &test.MockClient{ MockStatusPatch: test.NewMockStatusPatchFn(nil), }, - workload: &fake.Target{}, - condition: []v1alpha1.Condition{}, + workload: &mock.Target{}, + condition: []condition.Condition{}, }, expected: nil, }, @@ -1020,9 +1020,9 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { r: &test.MockClient{ MockStatusPatch: test.NewMockStatusPatchFn(nil), }, - workload: &fake.Target{ - ConditionedStatus: v1alpha1.ConditionedStatus{ - Conditions: []v1alpha1.Condition{ + workload: &mock.Target{ + ConditionedStatus: condition.ConditionedStatus{ + Conditions: []condition.Condition{ { Type: "test", LastTransitionTime: metav1.NewTime(time1), @@ -1032,7 +1032,7 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { }, }, }, - condition: []v1alpha1.Condition{ + condition: []condition.Condition{ { Type: "test", LastTransitionTime: metav1.NewTime(time2), @@ -1050,9 +1050,9 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { r: &test.MockClient{ MockStatusPatch: test.NewMockStatusPatchFn(nil), }, - workload: &fake.Target{ - ConditionedStatus: v1alpha1.ConditionedStatus{ - Conditions: []v1alpha1.Condition{ + workload: &mock.Target{ + ConditionedStatus: condition.ConditionedStatus{ + Conditions: []condition.Condition{ { Type: "test", LastTransitionTime: metav1.NewTime(time1), @@ -1062,7 +1062,7 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { }, }, }, - condition: []v1alpha1.Condition{ + condition: []condition.Condition{ { Type: "test", LastTransitionTime: metav1.NewTime(time2), @@ -1080,8 +1080,8 @@ func TestEndReconcileWithNegativeCondition(t *testing.T) { r: &test.MockClient{ MockStatusPatch: test.NewMockStatusPatchFn(patchErr), }, - workload: &fake.Target{}, - condition: []v1alpha1.Condition{ + workload: &mock.Target{}, + condition: []condition.Condition{ {}, }, }, @@ -1103,7 +1103,7 @@ func TestEndReconcileWithPositiveCondition(t *testing.T) { ctx context.Context r client.StatusClient workload util.ConditionedObject - condition []v1alpha1.Condition + condition []condition.Condition } patchErr := fmt.Errorf("eww") tests := []struct { @@ -1118,8 +1118,8 @@ func TestEndReconcileWithPositiveCondition(t *testing.T) { r: &test.MockClient{ MockStatusPatch: test.NewMockStatusPatchFn(nil), }, - workload: &fake.Target{}, - condition: []v1alpha1.Condition{ + workload: &mock.Target{}, + condition: []condition.Condition{ {}, }, }, @@ -1132,8 +1132,8 @@ func TestEndReconcileWithPositiveCondition(t *testing.T) { r: &test.MockClient{ MockStatusPatch: test.NewMockStatusPatchFn(patchErr), }, - workload: &fake.Target{}, - condition: []v1alpha1.Condition{ + workload: &mock.Target{}, + condition: []condition.Condition{ {}, }, }, diff --git a/pkg/workflow/context/context.go b/pkg/workflow/context/context.go index d7a29fbd6..dca211e0f 100644 --- a/pkg/workflow/context/context.go +++ b/pkg/workflow/context/context.go @@ -22,7 +22,6 @@ import ( "time" "cuelang.org/go/cue" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" @@ -160,8 +159,8 @@ func (wf *WorkflowContext) LoadFromConfigMap(cm corev1.ConfigMap) error { } // StoreRef return the store reference of workflow context. -func (wf *WorkflowContext) StoreRef() *runtimev1alpha1.TypedReference { - return &runtimev1alpha1.TypedReference{ +func (wf *WorkflowContext) StoreRef() *corev1.ObjectReference { + return &corev1.ObjectReference{ APIVersion: wf.store.APIVersion, Kind: wf.store.Kind, Name: wf.store.Name, diff --git a/pkg/workflow/context/context_test.go b/pkg/workflow/context/context_test.go index 937117aa7..1a12b4982 100644 --- a/pkg/workflow/context/context_test.go +++ b/pkg/workflow/context/context_test.go @@ -21,7 +21,6 @@ import ( "encoding/json" "testing" - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/crossplane/crossplane-runtime/pkg/test" yamlUtil "github.com/ghodss/yaml" "gopkg.in/yaml.v3" @@ -204,7 +203,7 @@ func TestRefObj(t *testing.T) { wfCtx.store.Name = "app-v1" ref := wfCtx.StoreRef() - assert.Equal(t, *ref, runtimev1alpha1.TypedReference{ + assert.Equal(t, *ref, corev1.ObjectReference{ APIVersion: "v1", Kind: "ConfigMap", Name: "app-v1", diff --git a/pkg/workflow/context/interface.go b/pkg/workflow/context/interface.go index ebbc0f3e2..2319a96a6 100644 --- a/pkg/workflow/context/interface.go +++ b/pkg/workflow/context/interface.go @@ -17,7 +17,7 @@ limitations under the License. package context import ( - runtimev1alpha1 "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" + corev1 "k8s.io/api/core/v1" "github.com/oam-dev/kubevela/pkg/cue/model/value" ) @@ -30,5 +30,5 @@ type Context interface { SetVar(v *value.Value, paths ...string) error Commit() error MakeParameter(parameter map[string]interface{}) (*value.Value, error) - StoreRef() *runtimev1alpha1.TypedReference + StoreRef() *corev1.ObjectReference } diff --git a/references/apiserver/traitHandler.go b/references/apiserver/traitHandler.go index 260818805..eede0db1f 100644 --- a/references/apiserver/traitHandler.go +++ b/references/apiserver/traitHandler.go @@ -20,6 +20,7 @@ import ( "github.com/gin-gonic/gin" "github.com/oam-dev/kubevela/apis/types" + "github.com/oam-dev/kubevela/references/apiserver/apis" "github.com/oam-dev/kubevela/references/apiserver/util" "github.com/oam-dev/kubevela/references/common" diff --git a/references/appfile/api/appfile.go b/references/appfile/api/appfile.go index 3eaa53434..3d09ccbe4 100644 --- a/references/appfile/api/appfile.go +++ b/references/appfile/api/appfile.go @@ -25,8 +25,8 @@ import ( "strings" "time" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/ghodss/yaml" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" @@ -198,7 +198,7 @@ func addDefaultHealthScopeToApplication(app *v1beta1.Application) *v1alpha2.Heal } health.Name = FormatDefaultHealthScopeName(app.Name) health.Namespace = app.Namespace - health.Spec.WorkloadReferences = make([]v1alpha1.TypedReference, 0) + health.Spec.WorkloadReferences = make([]corev1.ObjectReference, 0) for i := range app.Spec.Components { // FIXME(wonderflow): the hardcode health scope should be fixed. app.Spec.Components[i].Scopes = map[string]string{DefaultHealthScopeKey: health.Name} diff --git a/references/appfile/api/appfile_test.go b/references/appfile/api/appfile_test.go index 59b6742a0..dc11e47fc 100644 --- a/references/appfile/api/appfile_test.go +++ b/references/appfile/api/appfile_test.go @@ -20,10 +20,9 @@ import ( "os" "testing" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" - v12 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -329,7 +328,7 @@ outputs: ingress: { "value": "test-value", }} - ac3cm := &v12.ConfigMap{ + ac3cm := &corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "ConfigMap", @@ -348,7 +347,7 @@ outputs: ingress: { } health.Name = FormatDefaultHealthScopeName("myapp") health.Namespace = "default" - health.Spec.WorkloadReferences = make([]v1alpha1.TypedReference, 0) + health.Spec.WorkloadReferences = make([]corev1.ObjectReference, 0) type args struct { appfileData string workloadTemplates map[string]string diff --git a/references/cli/traits_test.go b/references/cli/traits_test.go index fb92d720f..503afbf2d 100644 --- a/references/cli/traits_test.go +++ b/references/cli/traits_test.go @@ -20,10 +20,11 @@ import ( "os" "testing" + "github.com/oam-dev/kubevela/apis/types" + "github.com/spf13/cobra" "github.com/stretchr/testify/assert" - "github.com/oam-dev/kubevela/apis/types" common2 "github.com/oam-dev/kubevela/pkg/utils/common" cmdutil "github.com/oam-dev/kubevela/pkg/utils/util" "github.com/oam-dev/kubevela/references/common" diff --git a/references/plugins/registry.go b/references/plugins/registry.go index 2f0ffb752..cb3956742 100644 --- a/references/plugins/registry.go +++ b/references/plugins/registry.go @@ -27,11 +27,12 @@ import ( "path" "path/filepath" + "github.com/oam-dev/kubevela/apis/types" + "github.com/google/go-github/v32/github" "github.com/pkg/errors" "golang.org/x/oauth2" - "github.com/oam-dev/kubevela/apis/types" "github.com/oam-dev/kubevela/pkg/utils/common" ) diff --git a/test/e2e-test/appconfig_finalizer_test.go b/test/e2e-test/appconfig_finalizer_test.go index 47c4fe455..6c72ba635 100644 --- a/test/e2e-test/appconfig_finalizer_test.go +++ b/test/e2e-test/appconfig_finalizer_test.go @@ -23,7 +23,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -192,7 +191,7 @@ var _ = Describe("Finalizer for HealthScope in ApplicationConfiguration", func() Namespace: namespace, }, Spec: v1alpha2.HealthScopeSpec{ - WorkloadReferences: []v1alpha1.TypedReference{}, + WorkloadReferences: []corev1.ObjectReference{}, }, } By("Creat health scope") @@ -203,7 +202,7 @@ var _ = Describe("Finalizer for HealthScope in ApplicationConfiguration", func() ComponentName: componentName, Scopes: []v1alpha2.ComponentScope{ { - ScopeReference: v1alpha1.TypedReference{ + ScopeReference: corev1.ObjectReference{ APIVersion: "core.oam.dev/v1alpha2", Kind: "HealthScope", Name: healthScopeName, diff --git a/test/e2e-test/appctx_compatibility_test.go b/test/e2e-test/appctx_compatibility_test.go index 1c1c66a87..b2635a0ca 100644 --- a/test/e2e-test/appctx_compatibility_test.go +++ b/test/e2e-test/appctx_compatibility_test.go @@ -21,20 +21,17 @@ import ( "fmt" "time" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" - "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/ghodss/yaml" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/kind/pkg/errors" - appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/kind/pkg/errors" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2" "github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1" @@ -78,7 +75,7 @@ var _ = Describe("Test compatibility for deprecation of appContext", func() { By("Mock owner references: appCtx owns Deployment and Service") appCtx := &v1alpha2.ApplicationContext{} Expect(k8sClient.Get(ctx, *appCtxKey, appCtx)).Should(Succeed()) - appCtxOwnRef := meta.AsController(&v1alpha1.TypedReference{ + appCtxOwnRef := util.AsController(&corev1.ObjectReference{ APIVersion: "core.oam.dev/v1alpha2", Kind: "ApplicationContext", Name: appCtx.GetName(), @@ -88,7 +85,7 @@ var _ = Describe("Test compatibility for deprecation of appContext", func() { By("Mock owner references: rscTracker owns PersistentVolume") rt := &v1beta1.ResourceTracker{} Expect(k8sClient.Get(ctx, *rtKey, rt)).Should(Succeed()) - rtOwnerRef := meta.AsController(&v1alpha1.TypedReference{ + rtOwnerRef := util.AsController(&corev1.ObjectReference{ APIVersion: "core.oam.dev/v1beta1", Kind: "ResourceTracker", Name: rt.GetName(), diff --git a/test/e2e-test/health_scope_test.go b/test/e2e-test/health_scope_test.go index 45716ab2c..1ba3d235d 100644 --- a/test/e2e-test/health_scope_test.go +++ b/test/e2e-test/health_scope_test.go @@ -23,7 +23,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/crossplane/crossplane-runtime/apis/core/v1alpha1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -108,7 +107,7 @@ var _ = Describe("HealthScope", func() { }, Spec: v1alpha2.HealthScopeSpec{ ProbeTimeout: &varInt32_60, - WorkloadReferences: []v1alpha1.TypedReference{}, + WorkloadReferences: []corev1.ObjectReference{}, }, } logf.Log.Info("Creating health scope") @@ -233,7 +232,7 @@ var _ = Describe("HealthScope", func() { }, Scopes: []v1alpha2.ComponentScope{ { - ScopeReference: v1alpha1.TypedReference{ + ScopeReference: corev1.ObjectReference{ APIVersion: gvks[0].GroupVersion().String(), Kind: v1alpha2.HealthScopeGroupVersionKind.Kind, Name: healthScopeName, @@ -255,7 +254,7 @@ var _ = Describe("HealthScope", func() { }, Scopes: []v1alpha2.ComponentScope{ { - ScopeReference: v1alpha1.TypedReference{ + ScopeReference: corev1.ObjectReference{ APIVersion: gvks[0].GroupVersion().String(), Kind: v1alpha2.HealthScopeGroupVersionKind.Kind, Name: healthScopeName,