diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index aeb396611..5eecd42ca 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -57,6 +57,18 @@ rules: - tuneds verbs: - '*' +- apiGroups: + - operators.coreos.com + resources: + - clusterserviceversions + - operatorgroups + - subscriptions + verbs: + - get + - list + - update + - watch + - delete --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/controllers/performanceprofile_controller.go b/controllers/performanceprofile_controller.go index 2a6a173e6..6b900f3ca 100644 --- a/controllers/performanceprofile_controller.go +++ b/controllers/performanceprofile_controller.go @@ -30,9 +30,13 @@ import ( tunedv1 "github.com/openshift/cluster-node-tuning-operator/pkg/apis/tuned/v1" mcov1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" + olmv1 "github.com/operator-framework/api/pkg/operators/v1" + olmv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + corev1 "k8s.io/api/core/v1" nodev1beta1 "k8s.io/api/node/v1beta1" apiequality "k8s.io/apimachinery/pkg/api/equality" + "k8s.io/apimachinery/pkg/api/errors" k8serros "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -57,14 +61,14 @@ const finalizer = "foreground-deletion" // PerformanceProfileReconciler reconciles a PerformanceProfile object type PerformanceProfileReconciler struct { client.Client - Scheme *runtime.Scheme - Recorder record.EventRecorder + Scheme *runtime.Scheme + Recorder record.EventRecorder + olmRemoved bool } // SetupWithManager creates a new PerformanceProfile Controller and adds it to the Manager. // The Manager will set fields on the Controller and Start it when the Manager is Started. func (r *PerformanceProfileReconciler) SetupWithManager(mgr ctrl.Manager) error { - // we want to initate reconcile loop only on change under labels or spec of the object p := predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { @@ -135,6 +139,72 @@ func (r *PerformanceProfileReconciler) SetupWithManager(mgr ctrl.Manager) error Complete(r) } +// uninstall PAO OLM operator and all of its artifacts +// this should apply only from version 4.11 +func (r *PerformanceProfileReconciler) removeOLMOperator() error { + paoCSV := "performance-addon-operator.v4.10.0" + subscription := &olmv1alpha1.Subscription{} + key := types.NamespacedName{ + Name: "performance-addon-operator", + Namespace: "openshift-performance-addon-operator", + } + + if err := r.Get(context.TODO(), key, subscription); err != nil { + if !errors.IsNotFound(err) { + return err + } + } else { + klog.Infof("Removing performance-addon-operator subscription %s", subscription.Name) + if subscription.Status.CurrentCSV != paoCSV { + return fmt.Errorf("Subscription to be removed contains a current CSV version %s which is different from %s", subscription.Status.CurrentCSV, paoCSV) + } + if err := r.Delete(context.TODO(), subscription); err != nil { + return err + } + } + + csv, err := r.getCSV(paoCSV, "openshift-performance-addon-operator") + if err != nil { + if !errors.IsNotFound(err) { + return err + } + } else { + klog.Infof("Removing performance-addon-operator CSV %s", paoCSV) + if err := r.Delete(context.TODO(), csv); err != nil { + return err + } + } + + operatorGroup := &olmv1.OperatorGroup{} + key = types.NamespacedName{ + Name: "performance-addon-operator", + Namespace: "openshift-performance-addon-operator", + } + + if err := r.Get(context.TODO(), key, operatorGroup); err != nil { + if !errors.IsNotFound(err) { + return err + } + } else { + klog.Infof("Removing performance-addon-operator operator group %s", operatorGroup.Name) + if err := r.Delete(context.TODO(), operatorGroup); err != nil { + return err + } + } + + return nil +} + +func (r *PerformanceProfileReconciler) getCSV(name, namespace string) (*olmv1alpha1.ClusterServiceVersion, error) { + csv := &olmv1alpha1.ClusterServiceVersion{} + key := types.NamespacedName{ + Name: name, + Namespace: namespace, + } + err := r.Get(context.TODO(), key, csv) + return csv, err +} + func (r *PerformanceProfileReconciler) mcpToPerformanceProfile(mcpObj client.Object) []reconcile.Request { mcp := &mcov1.MachineConfigPool{} @@ -233,6 +303,15 @@ func validateUpdateEvent(e *event.UpdateEvent) bool { func (r *PerformanceProfileReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { klog.Info("Reconciling PerformanceProfile") + // This should be deprecated in openshift 4.12 + if !r.olmRemoved { + if err := r.removeOLMOperator(); err != nil { + return reconcile.Result{}, err + } else { + r.olmRemoved = true + } + } + // Fetch the PerformanceProfile instance instance := &performancev2.PerformanceProfile{} err := r.Get(ctx, req.NamespacedName, instance) diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1/doc.go b/vendor/github.com/operator-framework/api/pkg/operators/v1/doc.go new file mode 100644 index 000000000..dec83277b --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/v1/doc.go @@ -0,0 +1,4 @@ +// +groupName=operators.coreos.com + +// Package v1 contains resources types for version v1 of the operators.coreos.com API group. +package v1 diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1/groupversion_info.go b/vendor/github.com/operator-framework/api/pkg/operators/v1/groupversion_info.go new file mode 100644 index 000000000..089ec8783 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/v1/groupversion_info.go @@ -0,0 +1,28 @@ +// +kubebuilder:object:generate=true + +// Package v1 contains API Schema definitions for the operator v1 API group. +package v1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "operators.coreos.com", Version: "v1"} + + // SchemeGroupVersion is required for compatibility with client generation. + SchemeGroupVersion = GroupVersion + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return GroupVersion.WithResource(resource).GroupResource() +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1/operator_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1/operator_types.go new file mode 100644 index 000000000..af735950f --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/v1/operator_types.go @@ -0,0 +1,88 @@ +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// OperatorSpec defines the desired state of Operator +type OperatorSpec struct{} + +// OperatorStatus defines the observed state of an Operator and its components +type OperatorStatus struct { + // Components describes resources that compose the operator. + // +optional + Components *Components `json:"components,omitempty"` +} + +// ConditionType codifies a condition's type. +type ConditionType string + +// Condition represent the latest available observations of an component's state. +type Condition struct { + // Type of condition. + Type ConditionType `json:"type"` + // Status of the condition, one of True, False, Unknown. + Status corev1.ConditionStatus `json:"status"` + // The reason for the condition's last transition. + // +optional + Reason string `json:"reason,omitempty"` + // A human readable message indicating details about the transition. + // +optional + Message string `json:"message,omitempty"` + // Last time the condition was probed + // +optional + LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` + // Last time the condition transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` +} + +// Components tracks the resources that compose an operator. +type Components struct { + // LabelSelector is a label query over a set of resources used to select the operator's components + LabelSelector *metav1.LabelSelector `json:"labelSelector"` + // Refs are a set of references to the operator's component resources, selected with LabelSelector. + // +optional + Refs []RichReference `json:"refs,omitempty"` +} + +// RichReference is a reference to a resource, enriched with its status conditions. +type RichReference struct { + *corev1.ObjectReference `json:",inline"` + // Conditions represents the latest state of the component. + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` +} + +// +genclient +// +genclient:nonNamespaced +// +kubebuilder:object:root=true +// +kubebuilder:storageversion +// +kubebuilder:resource:categories=olm,scope=Cluster +// +kubebuilder:subresource:status + +// Operator represents a cluster operator. +type Operator struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OperatorSpec `json:"spec,omitempty"` + Status OperatorStatus `json:"status,omitempty"` +} + +// +genclient:nonNamespaced +// +kubebuilder:object:root=true + +// OperatorList contains a list of Operators. +type OperatorList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Operator `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Operator{}, &OperatorList{}) +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1/operatorcondition_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1/operatorcondition_types.go new file mode 100644 index 000000000..8647b227e --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/v1/operatorcondition_types.go @@ -0,0 +1,49 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // Upgradeable indicates that the operator is upgradeable + Upgradeable string = "Upgradeable" +) + +// OperatorConditionSpec allows a cluster admin to convey information about the state of an operator to OLM, potentially overriding state reported by the operator. +type OperatorConditionSpec struct { + ServiceAccounts []string `json:"serviceAccounts,omitempty"` + Deployments []string `json:"deployments,omitempty"` + Overrides []metav1.Condition `json:"overrides,omitempty"` +} + +// OperatorConditionStatus allows an operator to convey information its state to OLM. The status may trail the actual +// state of a system. +type OperatorConditionStatus struct { + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient +// +kubebuilder:resource:shortName=condition,categories=olm +// +kubebuilder:subresource:status +// OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator. +type OperatorCondition struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec OperatorConditionSpec `json:"spec,omitempty"` + Status OperatorConditionStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// OperatorConditionList represents a list of Conditions. +type OperatorConditionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []OperatorCondition `json:"items"` +} + +func init() { + SchemeBuilder.Register(&OperatorCondition{}, &OperatorConditionList{}) +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1/operatorgroup_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1/operatorgroup_types.go new file mode 100644 index 000000000..1706eb17e --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/v1/operatorgroup_types.go @@ -0,0 +1,158 @@ +package v1 + +import ( + "fmt" + "sort" + "strings" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + OperatorGroupAnnotationKey = "olm.operatorGroup" + OperatorGroupNamespaceAnnotationKey = "olm.operatorNamespace" + OperatorGroupTargetsAnnotationKey = "olm.targetNamespaces" + OperatorGroupProvidedAPIsAnnotationKey = "olm.providedAPIs" + + OperatorGroupKind = "OperatorGroup" + + OperatorGroupLabelPrefix = "olm.operatorgroup.uid/" + OperatorGroupLabelTemplate = OperatorGroupLabelPrefix + "%s" + + OperatorGroupServiceAccountCondition = "OperatorGroupServiceAccount" + MutlipleOperatorGroupCondition = "MultipleOperatorGroup" + MultipleOperatorGroupsReason = "MultipleOperatorGroupsFound" + OperatorGroupServiceAccountReason = "ServiceAccountNotFound" +) + +// OperatorGroupSpec is the spec for an OperatorGroup resource. +type OperatorGroupSpec struct { + // Selector selects the OperatorGroup's target namespaces. + // +optional + Selector *metav1.LabelSelector `json:"selector,omitempty"` + + // TargetNamespaces is an explicit set of namespaces to target. + // If it is set, Selector is ignored. + // +optional + // +listType=set + TargetNamespaces []string `json:"targetNamespaces,omitempty"` + + // ServiceAccountName is the admin specified service account which will be + // used to deploy operator(s) in this operator group. + ServiceAccountName string `json:"serviceAccountName,omitempty"` + + // Static tells OLM not to update the OperatorGroup's providedAPIs annotation + // +optional + StaticProvidedAPIs bool `json:"staticProvidedAPIs,omitempty"` +} + +// OperatorGroupStatus is the status for an OperatorGroupResource. +type OperatorGroupStatus struct { + // Namespaces is the set of target namespaces for the OperatorGroup. + // +listType=set + Namespaces []string `json:"namespaces,omitempty"` + + // ServiceAccountRef references the service account object specified. + ServiceAccountRef *corev1.ObjectReference `json:"serviceAccountRef,omitempty"` + + // LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. + LastUpdated *metav1.Time `json:"lastUpdated"` + + // Conditions is an array of the OperatorGroup's conditions. + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient +// +kubebuilder:storageversion +// +kubebuilder:resource:shortName=og,categories=olm +// +kubebuilder:subresource:status + +// OperatorGroup is the unit of multitenancy for OLM managed operators. +// It constrains the installation of operators in its namespace to a specified set of target namespaces. +type OperatorGroup struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + // +optional + Spec OperatorGroupSpec `json:"spec"` + Status OperatorGroupStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OperatorGroupList is a list of OperatorGroup resources. +type OperatorGroupList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + // +listType=set + Items []OperatorGroup `json:"items"` +} + +// BuildTargetNamespaces returns the set of target namespaces as a sorted, comma-delimited string +func (o *OperatorGroup) BuildTargetNamespaces() string { + ns := make([]string, len(o.Status.Namespaces)) + copy(ns, o.Status.Namespaces) + sort.Strings(ns) + return strings.Join(ns, ",") +} + +// IsServiceAccountSpecified returns true if the spec has a service account name specified. +func (o *OperatorGroup) IsServiceAccountSpecified() bool { + if o.Spec.ServiceAccountName == "" { + return false + } + + return true +} + +// HasServiceAccountSynced returns true if the service account specified has been synced. +func (o *OperatorGroup) HasServiceAccountSynced() bool { + if o.IsServiceAccountSpecified() && o.Status.ServiceAccountRef != nil { + return true + } + + return false +} + +// OGLabelKeyAndValue returns a key and value that should be applied to namespaces listed in the OperatorGroup. +// If the UID is not set an error is returned. +func (o *OperatorGroup) OGLabelKeyAndValue() (string, string, error) { + if string(o.GetUID()) == "" { + return "", "", fmt.Errorf("Missing UID") + } + return fmt.Sprintf(OperatorGroupLabelTemplate, o.GetUID()), "", nil +} + +// NamespaceLabelSelector provides a selector that can be used to filter namespaces that belong to the OperatorGroup. +func (o *OperatorGroup) NamespaceLabelSelector() (*metav1.LabelSelector, error) { + if len(o.Spec.TargetNamespaces) == 0 { + // If no target namespaces are set, check if a selector exists. + if o.Spec.Selector != nil { + return o.Spec.Selector, nil + } + // No selector exists, return nil which should be used to select EVERYTHING. + return nil, nil + } + // Return a label that should be present on all namespaces defined in the OperatorGroup.Spec.TargetNamespaces field. + ogKey, ogValue, err := o.OGLabelKeyAndValue() + if err != nil { + return nil, err + } + + return &metav1.LabelSelector{ + MatchLabels: map[string]string{ + ogKey: ogValue, + }, + }, nil +} + +// IsOperatorGroupLabel returns true if the label is an OperatorGroup label. +func IsOperatorGroupLabel(label string) bool { + return strings.HasPrefix(label, OperatorGroupLabelPrefix) +} + +func init() { + SchemeBuilder.Register(&OperatorGroup{}, &OperatorGroupList{}) +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1/zz_generated.deepcopy.go b/vendor/github.com/operator-framework/api/pkg/operators/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000..f872afca9 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/v1/zz_generated.deepcopy.go @@ -0,0 +1,430 @@ +// +build !ignore_autogenerated + +/* + +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 v1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Components) DeepCopyInto(out *Components) { + *out = *in + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.Refs != nil { + in, out := &in.Refs, &out.Refs + *out = make([]RichReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Components. +func (in *Components) DeepCopy() *Components { + if in == nil { + return nil + } + out := new(Components) + in.DeepCopyInto(out) + return out +} + +// 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 + if in.LastUpdateTime != nil { + in, out := &in.LastUpdateTime, &out.LastUpdateTime + *out = (*in).DeepCopy() + } + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } +} + +// 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 *Operator) DeepCopyInto(out *Operator) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Operator. +func (in *Operator) DeepCopy() *Operator { + if in == nil { + return nil + } + out := new(Operator) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Operator) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorCondition) DeepCopyInto(out *OperatorCondition) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorCondition. +func (in *OperatorCondition) DeepCopy() *OperatorCondition { + if in == nil { + return nil + } + out := new(OperatorCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorCondition) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorConditionList) DeepCopyInto(out *OperatorConditionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OperatorCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConditionList. +func (in *OperatorConditionList) DeepCopy() *OperatorConditionList { + if in == nil { + return nil + } + out := new(OperatorConditionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorConditionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorConditionSpec) DeepCopyInto(out *OperatorConditionSpec) { + *out = *in + if in.ServiceAccounts != nil { + in, out := &in.ServiceAccounts, &out.ServiceAccounts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Deployments != nil { + in, out := &in.Deployments, &out.Deployments + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConditionSpec. +func (in *OperatorConditionSpec) DeepCopy() *OperatorConditionSpec { + if in == nil { + return nil + } + out := new(OperatorConditionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorConditionStatus) DeepCopyInto(out *OperatorConditionStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorConditionStatus. +func (in *OperatorConditionStatus) DeepCopy() *OperatorConditionStatus { + if in == nil { + return nil + } + out := new(OperatorConditionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroup) DeepCopyInto(out *OperatorGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroup. +func (in *OperatorGroup) DeepCopy() *OperatorGroup { + if in == nil { + return nil + } + out := new(OperatorGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroupList) DeepCopyInto(out *OperatorGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OperatorGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroupList. +func (in *OperatorGroupList) DeepCopy() *OperatorGroupList { + if in == nil { + return nil + } + out := new(OperatorGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroupSpec) DeepCopyInto(out *OperatorGroupSpec) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.TargetNamespaces != nil { + in, out := &in.TargetNamespaces, &out.TargetNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroupSpec. +func (in *OperatorGroupSpec) DeepCopy() *OperatorGroupSpec { + if in == nil { + return nil + } + out := new(OperatorGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroupStatus) DeepCopyInto(out *OperatorGroupStatus) { + *out = *in + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceAccountRef != nil { + in, out := &in.ServiceAccountRef, &out.ServiceAccountRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroupStatus. +func (in *OperatorGroupStatus) DeepCopy() *OperatorGroupStatus { + if in == nil { + return nil + } + out := new(OperatorGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorList) DeepCopyInto(out *OperatorList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Operator, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorList. +func (in *OperatorList) DeepCopy() *OperatorList { + if in == nil { + return nil + } + out := new(OperatorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorSpec) DeepCopyInto(out *OperatorSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorSpec. +func (in *OperatorSpec) DeepCopy() *OperatorSpec { + if in == nil { + return nil + } + out := new(OperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorStatus) DeepCopyInto(out *OperatorStatus) { + *out = *in + if in.Components != nil { + in, out := &in.Components, &out.Components + *out = new(Components) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorStatus. +func (in *OperatorStatus) DeepCopy() *OperatorStatus { + if in == nil { + return nil + } + out := new(OperatorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RichReference) DeepCopyInto(out *RichReference) { + *out = *in + if in.ObjectReference != nil { + in, out := &in.ObjectReference, &out.ObjectReference + *out = new(corev1.ObjectReference) + **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 RichReference. +func (in *RichReference) DeepCopy() *RichReference { + if in == nil { + return nil + } + out := new(RichReference) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b74474d12..30d8b3d3e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -340,6 +340,7 @@ github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.opens ## explicit; go 1.16 github.com/operator-framework/api/pkg/lib/version github.com/operator-framework/api/pkg/operators +github.com/operator-framework/api/pkg/operators/v1 github.com/operator-framework/api/pkg/operators/v1alpha1 # github.com/operator-framework/operator-lifecycle-manager v3.11.0+incompatible ## explicit