diff --git a/crds/zz_defs.go b/crds/zz_defs.go index a936ed279..3d69af7c4 100644 --- a/crds/zz_defs.go +++ b/crds/zz_defs.go @@ -98,7 +98,7 @@ func operatorsCoreosCom_catalogsourcesYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operators.coreos.com_catalogsources.yaml", size: 7987, mode: os.FileMode(436), modTime: time.Unix(1596017036, 0)} + info := bindataFileInfo{name: "operators.coreos.com_catalogsources.yaml", size: 7987, mode: os.FileMode(420), modTime: time.Unix(1596160005, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -118,7 +118,7 @@ func operatorsCoreosCom_clusterserviceversionsYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operators.coreos.com_clusterserviceversions.yaml", size: 666332, mode: os.FileMode(436), modTime: time.Unix(1596017036, 0)} + info := bindataFileInfo{name: "operators.coreos.com_clusterserviceversions.yaml", size: 666332, mode: os.FileMode(420), modTime: time.Unix(1596160005, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -138,7 +138,7 @@ func operatorsCoreosCom_installplansYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operators.coreos.com_installplans.yaml", size: 13953, mode: os.FileMode(436), modTime: time.Unix(1596017036, 0)} + info := bindataFileInfo{name: "operators.coreos.com_installplans.yaml", size: 13953, mode: os.FileMode(420), modTime: time.Unix(1596160006, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -158,7 +158,7 @@ func operatorsCoreosCom_operatorgroupsYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operators.coreos.com_operatorgroups.yaml", size: 15412, mode: os.FileMode(436), modTime: time.Unix(1596017037, 0)} + info := bindataFileInfo{name: "operators.coreos.com_operatorgroups.yaml", size: 15412, mode: os.FileMode(420), modTime: time.Unix(1596160006, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -178,7 +178,7 @@ func operatorsCoreosCom_operatorsYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operators.coreos.com_operators.yaml", size: 9269, mode: os.FileMode(436), modTime: time.Unix(1596017037, 0)} + info := bindataFileInfo{name: "operators.coreos.com_operators.yaml", size: 9269, mode: os.FileMode(420), modTime: time.Unix(1596160007, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -198,7 +198,7 @@ func operatorsCoreosCom_subscriptionsYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operators.coreos.com_subscriptions.yaml", size: 111704, mode: os.FileMode(436), modTime: time.Unix(1596017037, 0)} + info := bindataFileInfo{name: "operators.coreos.com_subscriptions.yaml", size: 111704, mode: os.FileMode(420), modTime: time.Unix(1596160007, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/pkg/operators/catalogsource_types.go b/pkg/operators/catalogsource_types.go deleted file mode 100644 index ff810f550..000000000 --- a/pkg/operators/catalogsource_types.go +++ /dev/null @@ -1,142 +0,0 @@ -package operators - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// CatalogSourceKind is the PascalCase name of a CatalogSource's kind. -const CatalogSourceKind = "CatalogSource" - -// SourceType indicates the type of backing store for a CatalogSource -type SourceType string - -const ( - // SourceTypeInternal (deprecated) specifies a CatalogSource of type SourceTypeConfigmap - SourceTypeInternal SourceType = "internal" - - // SourceTypeConfigmap specifies a CatalogSource that generates a configmap-server registry - SourceTypeConfigmap SourceType = "configmap" - - // SourceTypeGrpc specifies a CatalogSource that can use an operator registry image to generate a - // registry-server or connect to a pre-existing registry at an address. - SourceTypeGrpc SourceType = "grpc" -) - -type CatalogSourceSpec struct { - // SourceType is the type of source - SourceType SourceType - - // ConfigMap is the name of the ConfigMap to be used to back a configmap-server registry. - // Only used when SourceType = SourceTypeConfigmap or SourceTypeInternal. - // +Optional - ConfigMap string - - // Address is a host that OLM can use to connect to a pre-existing registry. - // Format: : - // Only used when SourceType = SourceTypeGrpc. - // Ignored when the Image field is set. - // +Optional - Address string - - // Image is an operator-registry container image to instantiate a registry-server with. - // Only used when SourceType = SourceTypeGrpc. - // If present, the address field is ignored. - // +Optional - Image string - - // UpdateStrategy defines how updated catalog source images can be discovered - // Consists of an interval that defines polling duration and an embedded strategy type - // +Optional - UpdateStrategy *UpdateStrategy - - // Secrets represent set of secrets that can be used to access the contents of the catalog. - // It is best to keep this list small, since each will need to be tried for every catalog entry. - // +Optional - Secrets []string - - // Metadata - DisplayName string - Description string - Publisher string - Icon Icon -} - -// UpdateStrategy holds all the different types of catalog source update strategies -// Currently only registry polling strategy is implemented -type UpdateStrategy struct { - *RegistryPoll -} - -type RegistryPoll struct { - // Interval is used to determine the time interval between checks of the latest catalog source version. - // The catalog operator polls to see if a new version of the catalog source is available. - // If available, the latest image is pulled and gRPC traffic is directed to the latest catalog source. - Interval *metav1.Duration -} - -type RegistryServiceStatus struct { - Protocol string - ServiceName string - ServiceNamespace string - Port string - CreatedAt metav1.Time -} - -type GRPCConnectionState struct { - Address string - LastObservedState string - LastConnectTime metav1.Time -} - -func (s *RegistryServiceStatus) Address() string { - return fmt.Sprintf("%s.%s.svc:%s", s.ServiceName, s.ServiceNamespace, s.Port) -} - -type CatalogSourceStatus struct { - Message string `json:"message,omitempty"` - Reason ConditionReason `json:"reason,omitempty"` - ConfigMapResource *ConfigMapResourceReference - RegistryServiceStatus *RegistryServiceStatus - GRPCConnectionState *GRPCConnectionState - LatestImageRegistryPoll *metav1.Time -} - -type ConfigMapResourceReference struct { - Name string - Namespace string - UID types.UID - ResourceVersion string - LastUpdateTime metav1.Time -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient - -// CatalogSource is a repository of CSVs, CRDs, and operator packages. -type CatalogSource struct { - metav1.TypeMeta - metav1.ObjectMeta - - Spec CatalogSourceSpec - Status CatalogSourceStatus -} - -func (c *CatalogSource) Address() string { - if c.Spec.Address != "" { - return c.Spec.Address - } - return c.Status.RegistryServiceStatus.Address() -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CatalogSourceList is a list of CatalogSource resources. -type CatalogSourceList struct { - metav1.TypeMeta - metav1.ListMeta - - Items []CatalogSource -} diff --git a/pkg/operators/clusterserviceversion_types.go b/pkg/operators/clusterserviceversion_types.go deleted file mode 100644 index fded5c3cb..000000000 --- a/pkg/operators/clusterserviceversion_types.go +++ /dev/null @@ -1,516 +0,0 @@ -package operators - -import ( - "encoding/json" - "fmt" - "sort" - - appsv1 "k8s.io/api/apps/v1" - rbac "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/operator-framework/api/pkg/lib/version" -) - -// ClusterServiceVersionKind is the PascalCase name of a CSV's kind. -const ClusterServiceVersionKind = "ClusterServiceVersion" - -// InstallModeType is a supported type of install mode for CSV installation -type InstallModeType string - -const ( - // InstallModeTypeOwnNamespace indicates that the operator can be a member of an `OperatorGroup` that selects its own namespace. - InstallModeTypeOwnNamespace InstallModeType = "OwnNamespace" - // InstallModeTypeSingleNamespace indicates that the operator can be a member of an `OperatorGroup` that selects one namespace. - InstallModeTypeSingleNamespace InstallModeType = "SingleNamespace" - // InstallModeTypeMultiNamespace indicates that the operator can be a member of an `OperatorGroup` that selects more than one namespace. - InstallModeTypeMultiNamespace InstallModeType = "MultiNamespace" - // InstallModeTypeAllNamespaces indicates that the operator can be a member of an `OperatorGroup` that selects all namespaces (target namespace set is the empty string ""). - InstallModeTypeAllNamespaces InstallModeType = "AllNamespaces" - - InstallStrategyNameDeployment = "deployment" -) - -// InstallMode associates an InstallModeType with a flag representing if the CSV supports it -type InstallMode struct { - Type InstallModeType - Supported bool -} - -// InstallModeSet is a mapping of unique InstallModeTypes to whether they are supported. -type InstallModeSet map[InstallModeType]bool - -// NamedInstallStrategy represents the block of an ClusterServiceVersion resource -// where the install strategy is specified. -type NamedInstallStrategy struct { - StrategyName string - StrategySpec StrategyDetailsDeployment -} - -// StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy -type StrategyDeploymentPermissions struct { - ServiceAccountName string - Rules []rbac.PolicyRule -} - -// StrategyDeploymentSpec contains the name and spec for the deployment ALM should create -type StrategyDeploymentSpec struct { - Name string - Spec appsv1.DeploymentSpec -} - -// StrategyDetailsDeployment represents the parsed details of a Deployment -// InstallStrategy. -type StrategyDetailsDeployment struct { - DeploymentSpecs []StrategyDeploymentSpec - Permissions []StrategyDeploymentPermissions - ClusterPermissions []StrategyDeploymentPermissions -} - -func (d *StrategyDetailsDeployment) GetStrategyName() string { - return InstallStrategyNameDeployment -} - -// StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it -type StatusDescriptor struct { - Path string - DisplayName string - Description string - XDescriptors []string - Value json.RawMessage -} - -// SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it -type SpecDescriptor struct { - Path string - DisplayName string - Description string - XDescriptors []string - Value json.RawMessage -} - -// ActionDescriptor describes a declarative action that can be performed on a custom resource instance -type ActionDescriptor struct { - Path string - DisplayName string - Description string - XDescriptors []string - Value json.RawMessage -} - -// CRDDescription provides details to OLM about the CRDs -type CRDDescription struct { - Name string - Version string - Kind string - DisplayName string - Description string - Resources []APIResourceReference - StatusDescriptors []StatusDescriptor - SpecDescriptors []SpecDescriptor - ActionDescriptor []ActionDescriptor -} - -// APIServiceDescription provides details to OLM about apis provided via aggregation -type APIServiceDescription struct { - Name string - Group string - Version string - Kind string - DeploymentName string - ContainerPort int32 - DisplayName string - Description string - Resources []APIResourceReference - StatusDescriptors []StatusDescriptor - SpecDescriptors []SpecDescriptor - ActionDescriptor []ActionDescriptor -} - -// APIResourceReference is a Kubernetes resource type used by a custom resource -type APIResourceReference struct { - Name string - Kind string - Version string -} - -// GetName returns the name of an APIService as derived from its group and version. -func (d APIServiceDescription) GetName() string { - return fmt.Sprintf("%s.%s", d.Version, d.Group) -} - -// CustomResourceDefinitions declares all of the CRDs managed or required by -// an operator being ran by ClusterServiceVersion. -// -// If the CRD is present in the Owned list, it is implicitly required. -type CustomResourceDefinitions struct { - Owned []CRDDescription - Required []CRDDescription -} - -// APIServiceDefinitions declares all of the extension apis managed or required by -// an operator being ran by ClusterServiceVersion. -type APIServiceDefinitions struct { - Owned []APIServiceDescription - Required []APIServiceDescription -} - -// ClusterServiceVersionSpec declarations tell OLM how to install an operator -// that can manage apps for a given version. -type ClusterServiceVersionSpec struct { - InstallStrategy NamedInstallStrategy - Version version.OperatorVersion - Maturity string - CustomResourceDefinitions CustomResourceDefinitions - APIServiceDefinitions APIServiceDefinitions - NativeAPIs []metav1.GroupVersionKind - MinKubeVersion string - DisplayName string - Description string - Keywords []string - Maintainers []Maintainer - Provider AppLink - Links []AppLink - Icon []Icon - - // InstallModes specify supported installation types - // +optional - InstallModes []InstallMode - - // The name of a CSV this one replaces. Should match the `metadata.Name` field of the old CSV. - // +optional - Replaces string - - // Map of string keys and values that can be used to organize and categorize - // (scope and select) objects. - // +optional - Labels map[string]string - - // Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. - // +optional - Annotations map[string]string - - // Label selector for related resources. - // +optional - Selector *metav1.LabelSelector -} - -type Maintainer struct { - Name string - Email string -} - -type AppLink struct { - Name string - URL string -} - -type Icon struct { - Data string - MediaType string -} - -// ClusterServiceVersionPhase is a label for the condition of a ClusterServiceVersion at the current time. -type ClusterServiceVersionPhase string - -// These are the valid phases of ClusterServiceVersion -const ( - CSVPhaseNone = "" - // CSVPhasePending means the csv has been accepted by the system, but the install strategy has not been attempted. - // This is likely because there are unmet requirements. - CSVPhasePending ClusterServiceVersionPhase = "Pending" - // CSVPhaseInstallReady means that the requirements are met but the install strategy has not been run. - CSVPhaseInstallReady ClusterServiceVersionPhase = "InstallReady" - // CSVPhaseInstalling means that the install strategy has been initiated but not completed. - CSVPhaseInstalling ClusterServiceVersionPhase = "Installing" - // CSVPhaseSucceeded means that the resources in the CSV were created successfully. - CSVPhaseSucceeded ClusterServiceVersionPhase = "Succeeded" - // CSVPhaseFailed means that the install strategy could not be successfully completed. - CSVPhaseFailed ClusterServiceVersionPhase = "Failed" - // CSVPhaseUnknown means that for some reason the state of the csv could not be obtained. - CSVPhaseUnknown ClusterServiceVersionPhase = "Unknown" - // CSVPhaseReplacing means that a newer CSV has been created and the csv's resources will be transitioned to a new owner. - CSVPhaseReplacing ClusterServiceVersionPhase = "Replacing" - // CSVPhaseDeleting means that a CSV has been replaced by a new one and will be checked for safety before being deleted - CSVPhaseDeleting ClusterServiceVersionPhase = "Deleting" - // CSVPhaseAny matches all other phases in CSV queries - CSVPhaseAny ClusterServiceVersionPhase = "" -) - -// ConditionReason is a camelcased reason for the state transition -type ConditionReason string - -const ( - CSVReasonRequirementsUnknown ConditionReason = "RequirementsUnknown" - CSVReasonRequirementsNotMet ConditionReason = "RequirementsNotMet" - CSVReasonRequirementsMet ConditionReason = "AllRequirementsMet" - CSVReasonOwnerConflict ConditionReason = "OwnerConflict" - CSVReasonComponentFailed ConditionReason = "InstallComponentFailed" - CSVReasonInvalidStrategy ConditionReason = "InvalidInstallStrategy" - CSVReasonWaiting ConditionReason = "InstallWaiting" - CSVReasonInstallSuccessful ConditionReason = "InstallSucceeded" - CSVReasonInstallCheckFailed ConditionReason = "InstallCheckFailed" - CSVReasonComponentUnhealthy ConditionReason = "ComponentUnhealthy" - CSVReasonBeingReplaced ConditionReason = "BeingReplaced" - CSVReasonReplaced ConditionReason = "Replaced" - CSVReasonNeedsReinstall ConditionReason = "NeedsReinstall" - CSVReasonNeedsCertRotation ConditionReason = "NeedsCertRotation" - CSVReasonAPIServiceResourceIssue ConditionReason = "APIServiceResourceIssue" - CSVReasonAPIServiceResourcesNeedReinstall ConditionReason = "APIServiceResourcesNeedReinstall" - CSVReasonAPIServiceInstallFailed ConditionReason = "APIServiceInstallFailed" - CSVReasonCopied ConditionReason = "Copied" - CSVReasonInvalidInstallModes ConditionReason = "InvalidInstallModes" - CSVReasonNoTargetNamespaces ConditionReason = "NoTargetNamespaces" - CSVReasonUnsupportedOperatorGroup ConditionReason = "UnsupportedOperatorGroup" - CSVReasonNoOperatorGroup ConditionReason = "NoOperatorGroup" - CSVReasonTooManyOperatorGroups ConditionReason = "TooManyOperatorGroups" - CSVReasonInterOperatorGroupOwnerConflict ConditionReason = "InterOperatorGroupOwnerConflict" - CSVReasonCannotModifyStaticOperatorGroupProvidedAPIs ConditionReason = "CannotModifyStaticOperatorGroupProvidedAPIs" -) - -// Conditions appear in the status as a record of state transitions on the ClusterServiceVersion -type ClusterServiceVersionCondition struct { - // Condition of the ClusterServiceVersion - Phase ClusterServiceVersionPhase - // A human readable message indicating details about why the ClusterServiceVersion is in this condition. - // +optional - Message string - // A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. - // e.g. 'RequirementsNotMet' - // +optional - Reason ConditionReason - // Last time we updated the status - // +optional - LastUpdateTime *metav1.Time - // Last time the status transitioned from one status to another. - // +optional - LastTransitionTime *metav1.Time -} - -// OwnsCRD determines whether the current CSV owns a paritcular CRD. -func (csv ClusterServiceVersion) OwnsCRD(name string) bool { - for _, desc := range csv.Spec.CustomResourceDefinitions.Owned { - if desc.Name == name { - return true - } - } - - return false -} - -// OwnsAPIService determines whether the current CSV owns a paritcular APIService. -func (csv ClusterServiceVersion) OwnsAPIService(name string) bool { - for _, desc := range csv.Spec.APIServiceDefinitions.Owned { - apiServiceName := fmt.Sprintf("%s.%s", desc.Version, desc.Group) - if apiServiceName == name { - return true - } - } - - return false -} - -// StatusReason is a camelcased reason for the status of a RequirementStatus or DependentStatus -type StatusReason string - -const ( - RequirementStatusReasonPresent StatusReason = "Present" - RequirementStatusReasonNotPresent StatusReason = "NotPresent" - RequirementStatusReasonPresentNotSatisfied StatusReason = "PresentNotSatisfied" - // The CRD is present but the Established condition is False (not available) - RequirementStatusReasonNotAvailable StatusReason = "PresentNotAvailable" - DependentStatusReasonSatisfied StatusReason = "Satisfied" - DependentStatusReasonNotSatisfied StatusReason = "NotSatisfied" -) - -// DependentStatus is the status for a dependent requirement (to prevent infinite nesting) -type DependentStatus struct { - Group string - Version string - Kind string - Status StatusReason - UUID string - Message string -} - -type RequirementStatus struct { - Group string - Version string - Kind string - Name string - Status StatusReason - Message string - UUID string - Dependents []DependentStatus -} - -// ClusterServiceVersionStatus represents information about the status of a pod. Status may trail the actual -// state of a system. -type ClusterServiceVersionStatus struct { - // Current condition of the ClusterServiceVersion - Phase ClusterServiceVersionPhase - // A human readable message indicating details about why the ClusterServiceVersion is in this condition. - // +optional - Message string - // A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. - // e.g. 'RequirementsNotMet' - // +optional - Reason ConditionReason - // Last time we updated the status - // +optional - LastUpdateTime *metav1.Time - // Last time the status transitioned from one status to another. - // +optional - LastTransitionTime *metav1.Time - // List of conditions, a history of state transitions - Conditions []ClusterServiceVersionCondition - // The status of each requirement for this CSV - RequirementStatus []RequirementStatus - // Last time the owned APIService certs were updated - // +optional - CertsLastUpdated *metav1.Time - // Time the owned APIService certs will rotate next - // +optional - CertsRotateAt *metav1.Time -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient - -// ClusterServiceVersion is a Custom Resource of type `ClusterServiceVersionSpec`. -type ClusterServiceVersion struct { - metav1.TypeMeta - metav1.ObjectMeta - - Spec ClusterServiceVersionSpec - Status ClusterServiceVersionStatus -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterServiceVersionList represents a list of ClusterServiceVersions. -type ClusterServiceVersionList struct { - metav1.TypeMeta - metav1.ListMeta - - Items []ClusterServiceVersion -} - -// GetAllCRDDescriptions returns a deduplicated set of CRDDescriptions that is -// the union of the owned and required CRDDescriptions. -// -// Descriptions with the same name prefer the value in Owned. -// Descriptions are returned in alphabetical order. -func (csv ClusterServiceVersion) GetAllCRDDescriptions() []CRDDescription { - set := make(map[string]CRDDescription) - for _, required := range csv.Spec.CustomResourceDefinitions.Required { - set[required.Name] = required - } - - for _, owned := range csv.Spec.CustomResourceDefinitions.Owned { - set[owned.Name] = owned - } - - keys := make([]string, 0) - for key := range set { - keys = append(keys, key) - } - sort.StringSlice(keys).Sort() - - descs := make([]CRDDescription, 0) - for _, key := range keys { - descs = append(descs, set[key]) - } - - return descs -} - -// GetAllAPIServiceDescriptions returns a deduplicated set of APIServiceDescriptions that is -// the union of the owned and required APIServiceDescriptions. -// -// Descriptions with the same name prefer the value in Owned. -// Descriptions are returned in alphabetical order. -func (csv ClusterServiceVersion) GetAllAPIServiceDescriptions() []APIServiceDescription { - set := make(map[string]APIServiceDescription) - for _, required := range csv.Spec.APIServiceDefinitions.Required { - name := fmt.Sprintf("%s.%s", required.Version, required.Group) - set[name] = required - } - - for _, owned := range csv.Spec.APIServiceDefinitions.Owned { - name := fmt.Sprintf("%s.%s", owned.Version, owned.Group) - set[name] = owned - } - - keys := make([]string, 0) - for key := range set { - keys = append(keys, key) - } - sort.StringSlice(keys).Sort() - - descs := make([]APIServiceDescription, 0) - for _, key := range keys { - descs = append(descs, set[key]) - } - - return descs -} - -// GetRequiredAPIServiceDescriptions returns a deduplicated set of required APIServiceDescriptions -// with the intersection of required and owned removed -// Equivalent to the set subtraction required - owned -// -// Descriptions are returned in alphabetical order. -func (csv ClusterServiceVersion) GetRequiredAPIServiceDescriptions() []APIServiceDescription { - set := make(map[string]APIServiceDescription) - for _, required := range csv.Spec.APIServiceDefinitions.Required { - name := fmt.Sprintf("%s.%s", required.Version, required.Group) - set[name] = required - } - - // Remove any shared owned from the set - for _, owned := range csv.Spec.APIServiceDefinitions.Owned { - name := fmt.Sprintf("%s.%s", owned.Version, owned.Group) - if _, ok := set[name]; ok { - delete(set, name) - } - } - - keys := make([]string, 0) - for key := range set { - keys = append(keys, key) - } - sort.StringSlice(keys).Sort() - - descs := make([]APIServiceDescription, 0) - for _, key := range keys { - descs = append(descs, set[key]) - } - - return descs -} - -// GetOwnedAPIServiceDescriptions returns a deduplicated set of owned APIServiceDescriptions -// -// Descriptions are returned in alphabetical order. -func (csv ClusterServiceVersion) GetOwnedAPIServiceDescriptions() []APIServiceDescription { - set := make(map[string]APIServiceDescription) - for _, owned := range csv.Spec.APIServiceDefinitions.Owned { - name := owned.GetName() - set[name] = owned - } - - keys := make([]string, 0) - for key := range set { - keys = append(keys, key) - } - sort.StringSlice(keys).Sort() - - descs := make([]APIServiceDescription, 0) - for _, key := range keys { - descs = append(descs, set[key]) - } - - return descs -} diff --git a/pkg/operators/doc.go b/pkg/operators/doc.go index ee6b62a7d..7eba79448 100644 --- a/pkg/operators/doc.go +++ b/pkg/operators/doc.go @@ -1,5 +1,4 @@ -// +k8s:deepcopy-gen=package -// +groupName=operators.coreos.com // +kubebuilder:skip + // Package operators contains all resource types of the operators.coreos.com API group. package operators diff --git a/pkg/operators/install/install.go b/pkg/operators/install/install.go index d4bc598ea..eda6c5d16 100644 --- a/pkg/operators/install/install.go +++ b/pkg/operators/install/install.go @@ -4,7 +4,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "github.com/operator-framework/api/pkg/operators" operatorsv1 "github.com/operator-framework/api/pkg/operators/v1" operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" operatorsv1alpha2 "github.com/operator-framework/api/pkg/operators/v1alpha2" @@ -12,7 +11,6 @@ import ( // Install registers the API group and adds all of its types to the given scheme. func Install(scheme *runtime.Scheme) { - utilruntime.Must(operators.AddToScheme(scheme)) utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme)) utilruntime.Must(operatorsv1alpha2.AddToScheme(scheme)) utilruntime.Must(operatorsv1.AddToScheme(scheme)) diff --git a/pkg/operators/installplan_types.go b/pkg/operators/installplan_types.go deleted file mode 100644 index fcd7764e8..000000000 --- a/pkg/operators/installplan_types.go +++ /dev/null @@ -1,392 +0,0 @@ -package operators - -import ( - "errors" - "fmt" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// InstallPlanKind is the PascalCase name of an InstallPlan's kind. -const InstallPlanKind = "InstallPlan" - -// Approval is the user approval policy for an InstallPlan. -type Approval string - -const ( - ApprovalAutomatic Approval = "Automatic" - ApprovalManual Approval = "Manual" -) - -// InstallPlanSpec defines a set of Application resources to be installed -type InstallPlanSpec struct { - CatalogSource string - CatalogSourceNamespace string - ClusterServiceVersionNames []string - Approval Approval - Approved bool -} - -// InstallPlanPhase is the current status of a InstallPlan as a whole. -type InstallPlanPhase string - -const ( - InstallPlanPhaseNone InstallPlanPhase = "" - InstallPlanPhasePlanning InstallPlanPhase = "Planning" - InstallPlanPhaseRequiresApproval InstallPlanPhase = "RequiresApproval" - InstallPlanPhaseInstalling InstallPlanPhase = "Installing" - InstallPlanPhaseComplete InstallPlanPhase = "Complete" - InstallPlanPhaseFailed InstallPlanPhase = "Failed" -) - -// InstallPlanConditionType describes the state of an InstallPlan at a certain point as a whole. -type InstallPlanConditionType string - -const ( - InstallPlanResolved InstallPlanConditionType = "Resolved" - InstallPlanInstalled InstallPlanConditionType = "Installed" -) - -// ConditionReason is a camelcased reason for the state transition. -type InstallPlanConditionReason string - -const ( - InstallPlanReasonPlanUnknown InstallPlanConditionReason = "PlanUnknown" - InstallPlanReasonInstallCheckFailed InstallPlanConditionReason = "InstallCheckFailed" - InstallPlanReasonDependencyConflict InstallPlanConditionReason = "DependenciesConflict" - InstallPlanReasonComponentFailed InstallPlanConditionReason = "InstallComponentFailed" -) - -// StepStatus is the current status of a particular resource an in -// InstallPlan -type StepStatus string - -const ( - StepStatusUnknown StepStatus = "Unknown" - StepStatusNotPresent StepStatus = "NotPresent" - StepStatusPresent StepStatus = "Present" - StepStatusCreated StepStatus = "Created" - StepStatusWaitingForAPI StepStatus = "WaitingForApi" - StepStatusUnsupportedResource StepStatus = "UnsupportedResource" -) - -// ErrInvalidInstallPlan is the error returned by functions that operate on -// InstallPlans when the InstallPlan does not contain totally valid data. -var ErrInvalidInstallPlan = errors.New("the InstallPlan contains invalid data") - -// InstallPlanStatus represents the information about the status of -// steps required to complete installation. -// -// Status may trail the actual state of a system. -type InstallPlanStatus struct { - Phase InstallPlanPhase - Conditions []InstallPlanCondition - CatalogSources []string - Plan []*Step - // BundleLookups is the set of in-progress requests to pull and unpackage bundle content to the cluster. - // +optional - BundleLookups []BundleLookup - // AttenuatedServiceAccountRef references the service account that is used - // to do scoped operator install. - AttenuatedServiceAccountRef *corev1.ObjectReference -} - -// InstallPlanCondition represents the overall status of the execution of -// an InstallPlan. -type InstallPlanCondition struct { - Type InstallPlanConditionType - Status corev1.ConditionStatus // True, False, or Unknown - LastUpdateTime *metav1.Time - LastTransitionTime *metav1.Time - Reason InstallPlanConditionReason - Message string -} - -// allow overwriting `now` function for deterministic tests -var now = metav1.Now - -// GetCondition returns the InstallPlanCondition of the given type if it exists in the InstallPlanStatus' Conditions. -// Returns a condition of the given type with a ConditionStatus of "Unknown" if not found. -func (s InstallPlanStatus) GetCondition(conditionType InstallPlanConditionType) InstallPlanCondition { - for _, cond := range s.Conditions { - if cond.Type == conditionType { - return cond - } - } - - return InstallPlanCondition{ - Type: conditionType, - Status: corev1.ConditionUnknown, - } -} - -// SetCondition adds or updates a condition, using `Type` as merge key. -func (s *InstallPlanStatus) SetCondition(cond InstallPlanCondition) InstallPlanCondition { - for i, existing := range s.Conditions { - if existing.Type != cond.Type { - continue - } - if existing.Status == cond.Status { - cond.LastTransitionTime = existing.LastTransitionTime - } - s.Conditions[i] = cond - return cond - } - s.Conditions = append(s.Conditions, cond) - return cond -} - -func ConditionFailed(cond InstallPlanConditionType, reason InstallPlanConditionReason, message string, now *metav1.Time) InstallPlanCondition { - return InstallPlanCondition{ - Type: cond, - Status: corev1.ConditionFalse, - Reason: reason, - Message: message, - LastUpdateTime: now, - LastTransitionTime: now, - } -} - -func ConditionMet(cond InstallPlanConditionType, now *metav1.Time) InstallPlanCondition { - return InstallPlanCondition{ - Type: cond, - Status: corev1.ConditionTrue, - LastUpdateTime: now, - LastTransitionTime: now, - } -} - -// Step represents the status of an individual step in an InstallPlan. -type Step struct { - Resolving string - Resource StepResource - Status StepStatus -} - -// BundleLookupConditionType is a category of the overall state of a BundleLookup. -type BundleLookupConditionType string - -const ( - // BundleLookupPending describes BundleLookups that are not complete. - BundleLookupPending BundleLookupConditionType = "BundleLookupPending" - - crdKind = "CustomResourceDefinition" -) - -type BundleLookupCondition struct { - // Type of condition. - Type BundleLookupConditionType - // Status of the condition, one of True, False, Unknown. - Status corev1.ConditionStatus - // The reason for the condition's last transition. - // +optional - Reason string - // A human readable message indicating details about the transition. - // +optional - Message string - // Last time the condition was probed - // +optional - LastUpdateTime *metav1.Time - // Last time the condition transitioned from one status to another. - // +optional - LastTransitionTime *metav1.Time -} - -// BundleLookup is a request to pull and unpackage the content of a bundle to the cluster. -type BundleLookup struct { - // Path refers to the location of a bundle to pull. - // It's typically an image reference. - Path string - // Replaces is the name of the bundle to replace with the one found at Path. - Replaces string - // CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from. - CatalogSourceRef *corev1.ObjectReference - // Conditions represents the overall state of a BundleLookup. - // +optional - Conditions []BundleLookupCondition -} - -// GetCondition returns the BundleLookupCondition of the given type if it exists in the BundleLookup's Conditions. -// Returns a condition of the given type with a ConditionStatus of "Unknown" if not found. -func (b BundleLookup) GetCondition(conditionType BundleLookupConditionType) BundleLookupCondition { - for _, cond := range b.Conditions { - if cond.Type == conditionType { - return cond - } - } - - return BundleLookupCondition{ - Type: conditionType, - Status: corev1.ConditionUnknown, - } -} - -// RemoveCondition removes the BundleLookupCondition of the given type from the BundleLookup's Conditions if it exists. -func (b *BundleLookup) RemoveCondition(conditionType BundleLookupConditionType) { - for i, cond := range b.Conditions { - if cond.Type == conditionType { - b.Conditions = append(b.Conditions[:i], b.Conditions[i+1:]...) - if len(b.Conditions) == 0 { - b.Conditions = nil - } - return - } - } -} - -// SetCondition replaces the existing BundleLookupCondition of the same type, or adds it if it was not found. -func (b *BundleLookup) SetCondition(cond BundleLookupCondition) BundleLookupCondition { - for i, existing := range b.Conditions { - if existing.Type != cond.Type { - continue - } - if existing.Status == cond.Status { - cond.LastTransitionTime = existing.LastTransitionTime - } - b.Conditions[i] = cond - return cond - } - b.Conditions = append(b.Conditions, cond) - - return cond -} - -func OrderSteps(steps []*Step) []*Step { - // CSVs must be applied first - csvList := []*Step{} - - // CRDs must be applied second - crdList := []*Step{} - - // Other resources may be applied in any order - remainingResources := []*Step{} - for _, step := range steps { - switch step.Resource.Kind { - case crdKind: - crdList = append(crdList, step) - case ClusterServiceVersionKind: - csvList = append(csvList, step) - default: - remainingResources = append(remainingResources, step) - } - } - - result := make([]*Step, len(steps)) - i := 0 - - for j := range csvList { - result[i] = csvList[j] - i++ - } - - for j := range crdList { - result[i] = crdList[j] - i++ - } - - for j := range remainingResources { - result[i] = remainingResources[j] - i++ - } - - return result -} - -func (s InstallPlanStatus) NeedsRequeue() bool { - for _, step := range s.Plan { - switch step.Status { - case StepStatusWaitingForAPI: - return true - } - } - - return false -} - -// ManifestsMatch returns true if the CSV manifests in the StepResources of the given list of steps -// matches those in the InstallPlanStatus. -func (s *InstallPlanStatus) CSVManifestsMatch(steps []*Step) bool { - if s.Plan == nil && steps == nil { - return true - } - if s.Plan == nil || steps == nil { - return false - } - - manifests := make(map[string]struct{}) - for _, step := range s.Plan { - resource := step.Resource - if resource.Kind != ClusterServiceVersionKind { - continue - } - manifests[resource.Manifest] = struct{}{} - } - - for _, step := range steps { - resource := step.Resource - if resource.Kind != ClusterServiceVersionKind { - continue - } - if _, ok := manifests[resource.Manifest]; !ok { - return false - } - delete(manifests, resource.Manifest) - } - - return len(manifests) == 0 -} - -func (s *Step) String() string { - return fmt.Sprintf("%s: %s (%s)", s.Resolving, s.Resource, s.Status) -} - -// StepResource represents the status of a resource to be tracked by an -// InstallPlan. -type StepResource struct { - CatalogSource string - CatalogSourceNamespace string - Group string - Version string - Kind string - Name string - Manifest string -} - -func (r StepResource) String() string { - return fmt.Sprintf("%s[%s/%s/%s (%s/%s)]", r.Name, r.Group, r.Version, r.Kind, r.CatalogSource, r.CatalogSourceNamespace) -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient - -// InstallPlan defines the installation of a set of operators. -type InstallPlan struct { - metav1.TypeMeta - metav1.ObjectMeta - - Spec InstallPlanSpec - Status InstallPlanStatus -} - -// EnsureCatalogSource ensures that a CatalogSource is present in the Status -// block of an InstallPlan. -func (p *InstallPlan) EnsureCatalogSource(sourceName string) { - for _, srcName := range p.Status.CatalogSources { - if srcName == sourceName { - return - } - } - - p.Status.CatalogSources = append(p.Status.CatalogSources, sourceName) -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// InstallPlanList is a list of InstallPlan resources. -type InstallPlanList struct { - metav1.TypeMeta - metav1.ListMeta - - Items []InstallPlan -} diff --git a/pkg/operators/operatorgroup_types.go b/pkg/operators/operatorgroup_types.go deleted file mode 100644 index e94386c77..000000000 --- a/pkg/operators/operatorgroup_types.go +++ /dev/null @@ -1,79 +0,0 @@ -package operators - -import ( - "sort" - "strings" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// OperatorGroupKind is the PascalCase name of an OperatorGroup's kind. -const OperatorGroupKind = "OperatorGroup" - -const ( - OperatorGroupAnnotationKey = "olm.operatorGroup" - OperatorGroupNamespaceAnnotationKey = "olm.operatorNamespace" - OperatorGroupTargetsAnnotationKey = "olm.targetNamespaces" - OperatorGroupProvidedAPIsAnnotationKey = "olm.providedAPIs" -) - -// OperatorGroupSpec is the spec for an OperatorGroup resource. -type OperatorGroupSpec struct { - // Selector selects the OperatorGroup's target namespaces. - // +optional - Selector *metav1.LabelSelector - - // TargetNamespaces is an explicit set of namespaces to target. - // If it is set, Selector is ignored. - // +optional - TargetNamespaces []string - - // ServiceAccountName is the admin specified service account which will be - // used to deploy operator(s) in this operator group. - ServiceAccountName string - - // Static tells OLM not to update the OperatorGroup's providedAPIs annotation - // +optional - StaticProvidedAPIs bool -} - -// OperatorGroupStatus is the status for an OperatorGroupResource. -type OperatorGroupStatus struct { - // Namespaces is the set of target namespaces for the OperatorGroup. - Namespaces []string - - // ServiceAccountRef references the service account object specified. - ServiceAccountRef *corev1.ObjectReference - - // LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. - LastUpdated *metav1.Time -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient - -// 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 - metav1.ObjectMeta - - Spec OperatorGroupSpec - Status OperatorGroupStatus -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OperatorGroupList is a list of OperatorGroup resources. -type OperatorGroupList struct { - metav1.TypeMeta - metav1.ListMeta - - Items []OperatorGroup -} - -func (o *OperatorGroup) BuildTargetNamespaces() string { - sort.Strings(o.Status.Namespaces) - return strings.Join(o.Status.Namespaces, ",") -} diff --git a/pkg/operators/reference/reference_test.go b/pkg/operators/reference/reference_test.go index c9fac72cf..a68a33890 100644 --- a/pkg/operators/reference/reference_test.go +++ b/pkg/operators/reference/reference_test.go @@ -10,7 +10,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" - "github.com/operator-framework/api/pkg/operators" v1 "github.com/operator-framework/api/pkg/operators/v1" "github.com/operator-framework/api/pkg/operators/v1alpha1" ) @@ -151,121 +150,6 @@ func TestGetReference(t *testing.T) { err: nil, }, }, - { - name: "internalversion/ClusterServiceVersion", - args: args{ - &operators.ClusterServiceVersion{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns", - Name: "csv", - UID: types.UID("uid"), - SelfLink: buildSelfLink(operators.SchemeGroupVersion.String(), "clusterserviceversions", "ns", "csv"), - }, - }, - }, - want: want{ - ref: &corev1.ObjectReference{ - Namespace: "ns", - Name: "csv", - UID: types.UID("uid"), - Kind: operators.ClusterServiceVersionKind, - APIVersion: operators.SchemeGroupVersion.String(), - }, - err: nil, - }, - }, - { - name: "internalversion/InstallPlan", - args: args{ - &v1alpha1.InstallPlan{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns", - Name: "ip", - UID: types.UID("uid"), - SelfLink: buildSelfLink(operators.SchemeGroupVersion.String(), "installplans", "ns", "ip"), - }, - }, - }, - want: want{ - ref: &corev1.ObjectReference{ - Namespace: "ns", - Name: "ip", - UID: types.UID("uid"), - Kind: operators.InstallPlanKind, - APIVersion: v1alpha1.SchemeGroupVersion.String(), - }, - err: nil, - }, - }, - { - name: "internalversion/Subscription", - args: args{ - &v1alpha1.Subscription{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns", - Name: "sub", - UID: types.UID("uid"), - SelfLink: buildSelfLink(operators.SchemeGroupVersion.String(), "subscriptions", "ns", "sub"), - }, - }, - }, - want: want{ - ref: &corev1.ObjectReference{ - Namespace: "ns", - Name: "sub", - UID: types.UID("uid"), - Kind: operators.SubscriptionKind, - APIVersion: v1alpha1.SchemeGroupVersion.String(), - }, - err: nil, - }, - }, - { - name: "internalversion/CatalogSource", - args: args{ - &v1alpha1.CatalogSource{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns", - Name: "catsrc", - UID: types.UID("uid"), - SelfLink: buildSelfLink(operators.SchemeGroupVersion.String(), "catalogsources", "ns", "catsrc"), - }, - }, - }, - want: want{ - ref: &corev1.ObjectReference{ - Namespace: "ns", - Name: "catsrc", - UID: types.UID("uid"), - Kind: operators.CatalogSourceKind, - APIVersion: v1alpha1.SchemeGroupVersion.String(), - }, - err: nil, - }, - }, - { - name: "internalversion/OperatorGroup", - args: args{ - &v1.OperatorGroup{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns", - Name: "og", - UID: types.UID("uid"), - SelfLink: buildSelfLink(operators.SchemeGroupVersion.String(), "operatorgroups", "ns", "og"), - }, - }, - }, - want: want{ - ref: &corev1.ObjectReference{ - Namespace: "ns", - Name: "og", - UID: types.UID("uid"), - Kind: operators.OperatorGroupKind, - APIVersion: v1.SchemeGroupVersion.String(), - }, - err: nil, - }, - }, } for _, tt := range tests { diff --git a/pkg/operators/register.go b/pkg/operators/register.go index 784b04026..e3c31d51a 100644 --- a/pkg/operators/register.go +++ b/pkg/operators/register.go @@ -10,41 +10,22 @@ const ( GroupName = "operators.coreos.com" // GroupVersion is the group version used in this package. GroupVersion = runtime.APIVersionInternal -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} + // LEGACY: Exported kind names, remove after major version bump -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder initializes a scheme builder - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme is a global function that registers this API group & version to a scheme - AddToScheme = SchemeBuilder.AddToScheme + // ClusterServiceVersionKind is the kind name for ClusterServiceVersion resources. + ClusterServiceVersionKind = "ClusterServiceVersion" + // CatalogSourceKind is the kind name for CatalogSource resources. + CatalogSourceKind = "CatalogSource" + // InstallPlanKind is the kind name for InstallPlan resources. + InstallPlanKind = "InstallPlan" + // SubscriptionKind is the kind name for Subscription resources. + SubscriptionKind = "Subscription" + // OperatorKind is the kind name for Operator resources. + OperatorKind = "Operator" + // OperatorGroupKind is the kind name for OperatorGroup resources. + OperatorGroupKind = "OperatorGroup" ) -// addKnownTypes adds the list of known types to Scheme -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &CatalogSource{}, - &CatalogSourceList{}, - &InstallPlan{}, - &InstallPlanList{}, - &Subscription{}, - &SubscriptionList{}, - &ClusterServiceVersion{}, - &ClusterServiceVersionList{}, - &OperatorGroup{}, - &OperatorGroupList{}, - ) - return nil -} +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} diff --git a/pkg/operators/subscription_types.go b/pkg/operators/subscription_types.go deleted file mode 100644 index 931207681..000000000 --- a/pkg/operators/subscription_types.go +++ /dev/null @@ -1,312 +0,0 @@ -package operators - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// SubscriptionKind is the PascalCase name of a Subscription's kind. -const SubscriptionKind = "Subscription" - -// SubscriptionState tracks when updates are available, installing, or service is up to date -type SubscriptionState string - -const ( - SubscriptionStateNone = "" - SubscriptionStateFailed = "UpgradeFailed" - SubscriptionStateUpgradeAvailable = "UpgradeAvailable" - SubscriptionStateUpgradePending = "UpgradePending" - SubscriptionStateAtLatest = "AtLatestKnown" -) - -const ( - SubscriptionReasonInvalidCatalog ConditionReason = "InvalidCatalog" - SubscriptionReasonUpgradeSucceeded ConditionReason = "UpgradeSucceeded" -) - -// SubscriptionSpec defines an Application that can be installed -type SubscriptionSpec struct { - CatalogSource string - CatalogSourceNamespace string - Package string - Channel string - StartingCSV string - InstallPlanApproval Approval - Config SubscriptionConfig -} - -// SubscriptionConfig contains configuration specified for a subscription. -type SubscriptionConfig struct { - // Label selector for pods. Existing ReplicaSets whose pods are - // selected by this will be the ones affected by this deployment. - // It must match the pod template's labels. - Selector *metav1.LabelSelector `json:"selector,omitempty"` - - // NodeSelector is a selector which must be true for the pod to fit on a node. - // Selector which must match a node's labels for the pod to be scheduled on that node. - // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - // If specified, the pod's tolerations. - // +optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` - - // Compute Resources required by this container. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - Resources corev1.ResourceRequirements `json:"resources,omitempty"` - - // List of sources to populate environment variables in the container. - // The keys defined within a source must be a C_IDENTIFIER. All invalid keys - // will be reported as an event when the container is starting. When a key exists in multiple - // sources, the value associated with the last source will take precedence. - // Values defined by an Env with a duplicate key will take precedence. - // Cannot be updated. - // +optional - EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"` - // List of environment variables to set in the container. - // Cannot be updated. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - Env []corev1.EnvVar `json:"env,omitempty"` - - // List of Volumes to set in the podSpec. - // +optional - Volumes []corev1.Volume `json:"volumes,omitempty"` - - // List of VolumeMounts to set in the container. - // +optional - VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` -} - -// SubscriptionConditionType indicates an explicit state condition about a Subscription in "abnormal-true" -// polarity form (see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties). -type SubscriptionConditionType string - -const ( - // SubscriptionCatalogSourcesUnhealthy indicates that some or all of the CatalogSources to be used in resolution are unhealthy. - SubscriptionCatalogSourcesUnhealthy SubscriptionConditionType = "CatalogSourcesUnhealthy" - - // SubscriptionInstallPlanMissing indicates that a Subscription's InstallPlan is missing. - SubscriptionInstallPlanMissing SubscriptionConditionType = "InstallPlanMissing" - - // SubscriptionInstallPlanPending indicates that a Subscription's InstallPlan is pending installation. - SubscriptionInstallPlanPending SubscriptionConditionType = "InstallPlanPending" - - // SubscriptionInstallPlanFailed indicates that the installation of a Subscription's InstallPlan has failed. - SubscriptionInstallPlanFailed SubscriptionConditionType = "InstallPlanFailed" -) - -const ( - // NoCatalogSourcesFound is a reason string for Subscriptions with unhealthy CatalogSources due to none being available. - NoCatalogSourcesFound = "NoCatalogSourcesFound" - - // AllCatalogSourcesHealthy is a reason string for Subscriptions that transitioned due to all CatalogSources being healthy. - AllCatalogSourcesHealthy = "AllCatalogSourcesHealthy" - - // CatalogSourcesAdded is a reason string for Subscriptions that transitioned due to CatalogSources being added. - CatalogSourcesAdded = "CatalogSourcesAdded" - - // CatalogSourcesUpdated is a reason string for Subscriptions that transitioned due to CatalogSource being updated. - CatalogSourcesUpdated = "CatalogSourcesUpdated" - - // CatalogSourcesDeleted is a reason string for Subscriptions that transitioned due to CatalogSources being removed. - CatalogSourcesDeleted = "CatalogSourcesDeleted" - - // UnhealthyCatalogSourceFound is a reason string for Subscriptions that transitioned because an unhealthy CatalogSource was found. - UnhealthyCatalogSourceFound = "UnhealthyCatalogSourceFound" - - // ReferencedInstallPlanNotFound is a reason string for Subscriptions that transitioned due to a referenced InstallPlan not being found. - ReferencedInstallPlanNotFound = "ReferencedInstallPlanNotFound" - - // InstallPlanNotYetReconciled is a reason string for Subscriptions that transitioned due to a referenced InstallPlan not being reconciled yet. - InstallPlanNotYetReconciled = "InstallPlanNotYetReconciled" - - // InstallPlanFailed is a reason string for Subscriptions that transitioned due to a referenced InstallPlan failing without setting an explicit failure condition. - InstallPlanFailed = "InstallPlanFailed" -) - -// SubscriptionCondition represents the latest available observations of a Subscription's state. -type SubscriptionCondition struct { - // Type is the type of Subscription condition. - Type SubscriptionConditionType - - // Status is the status of the condition, one of True, False, Unknown. - Status corev1.ConditionStatus - - // Reason is a one-word CamelCase reason for the condition's last transition. - // +optional - Reason string - - // Message is a human-readable message indicating details about last transition. - // +optional - Message string - - // LastHeartbeatTime is the last time we got an update on a given condition - // +optional - LastHeartbeatTime *metav1.Time - - // LastTransitionTime is the last time the condition transit from one status to another - // +optional - LastTransitionTime *metav1.Time -} - -// Equals returns true if a SubscriptionCondition equals the one given, false otherwise. -// Equality is determined by the equality of the type, status, reason, and message fields ONLY. -func (s SubscriptionCondition) Equals(condition SubscriptionCondition) bool { - return s.Type == condition.Type && s.Status == condition.Status && s.Reason == condition.Reason && s.Message == condition.Message -} - -type SubscriptionStatus struct { - // CurrentCSV is the CSV the Subscription is progressing to. - // +optional - CurrentCSV string - - // InstalledCSV is the CSV currently installed by the Subscription. - // +optional - InstalledCSV string - - // Install is a reference to the latest InstallPlan generated for the Subscription. - // DEPRECATED: InstallPlanRef - // +optional - Install *InstallPlanReference - - // State represents the current state of the Subscription - // +optional - State SubscriptionState - - // Reason is the reason the Subscription was transitioned to its current state. - // +optional - Reason ConditionReason - - // InstallPlanRef is a reference to the latest InstallPlan that contains the Subscription's current CSV. - // +optional - InstallPlanRef *corev1.ObjectReference - - // CatalogHealth contains the Subscription's view of its relevant CatalogSources' status. - // It is used to determine SubscriptionStatusConditions related to CatalogSources. - // +optional - CatalogHealth []SubscriptionCatalogHealth - - // Conditions is a list of the latest available observations about a Subscription's current state. - // +optional - Conditions []SubscriptionCondition `hash:"set"` - - // LastUpdated represents the last time that the Subscription status was updated. - LastUpdated metav1.Time -} - -// GetCondition returns the SubscriptionCondition of the given type if it exists in the SubscriptionStatus' Conditions. -// Returns a condition of the given type with a ConditionStatus of "Unknown" if not found. -func (s SubscriptionStatus) GetCondition(conditionType SubscriptionConditionType) SubscriptionCondition { - for _, cond := range s.Conditions { - if cond.Type == conditionType { - return cond - } - } - - return SubscriptionCondition{ - Type: conditionType, - Status: corev1.ConditionUnknown, - } -} - -// SetCondition sets the given SubscriptionCondition in the SubscriptionStatus' Conditions. -func (s *SubscriptionStatus) SetCondition(condition SubscriptionCondition) { - for i, cond := range s.Conditions { - if cond.Type == condition.Type { - s.Conditions[i] = condition - return - } - } - - s.Conditions = append(s.Conditions, condition) -} - -// RemoveConditions removes any conditions of the given types from the SubscriptionStatus' Conditions. -func (s *SubscriptionStatus) RemoveConditions(remove ...SubscriptionConditionType) { - exclusions := map[SubscriptionConditionType]struct{}{} - for _, r := range remove { - exclusions[r] = struct{}{} - } - - var filtered []SubscriptionCondition - for _, cond := range s.Conditions { - if _, ok := exclusions[cond.Type]; ok { - // Skip excluded condition types - continue - } - filtered = append(filtered, cond) - } - - s.Conditions = filtered -} - -type InstallPlanReference struct { - APIVersion string - Kind string - Name string - UID types.UID -} - -// SubscriptionCatalogHealth describes the health of a CatalogSource the Subscription knows about. -type SubscriptionCatalogHealth struct { - // CatalogSourceRef is a reference to a CatalogSource. - CatalogSourceRef *corev1.ObjectReference - - // LastUpdated represents the last time that the CatalogSourceHealth changed - LastUpdated *metav1.Time - - // Healthy is true if the CatalogSource is healthy; false otherwise. - Healthy bool -} - -// Equals returns true if a SubscriptionCatalogHealth equals the one given, false otherwise. -// Equality is based SOLEY on health and UID. -func (s SubscriptionCatalogHealth) Equals(health SubscriptionCatalogHealth) bool { - return s.Healthy == health.Healthy && s.CatalogSourceRef.UID == health.CatalogSourceRef.UID -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient - -// Subscription keeps operators up to date by tracking changes to Catalogs. -type Subscription struct { - metav1.TypeMeta - metav1.ObjectMeta - - Spec *SubscriptionSpec - Status SubscriptionStatus -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// SubscriptionList is a list of Subscription resources. -type SubscriptionList struct { - metav1.TypeMeta - metav1.ListMeta - - Items []Subscription -} - -// GetInstallPlanApproval gets the configured install plan approval or the default -func (s *Subscription) GetInstallPlanApproval() Approval { - if s.Spec.InstallPlanApproval == ApprovalManual { - return ApprovalManual - } - return ApprovalAutomatic -} - -// NewInstallPlanReference returns an InstallPlanReference for the given ObjectReference. -func NewInstallPlanReference(ref *corev1.ObjectReference) *InstallPlanReference { - return &InstallPlanReference{ - APIVersion: ref.APIVersion, - Kind: ref.Kind, - Name: ref.Name, - UID: ref.UID, - } -} diff --git a/pkg/operators/v1/doc.go b/pkg/operators/v1/doc.go new file mode 100644 index 000000000..dec83277b --- /dev/null +++ b/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/pkg/operators/v1/groupversion_info.go b/pkg/operators/v1/groupversion_info.go index e3c213e51..089ec8783 100644 --- a/pkg/operators/v1/groupversion_info.go +++ b/pkg/operators/v1/groupversion_info.go @@ -1,6 +1,6 @@ -// Package v1 contains API Schema definitions for the operator v1 API group. // +kubebuilder:object:generate=true -// +groupName=operators.coreos.com + +// Package v1 contains API Schema definitions for the operator v1 API group. package v1 import ( @@ -21,3 +21,8 @@ var ( // 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/pkg/operators/v1alpha1/doc.go b/pkg/operators/v1alpha1/doc.go index 3938a475e..74bc9b819 100644 --- a/pkg/operators/v1alpha1/doc.go +++ b/pkg/operators/v1alpha1/doc.go @@ -1,6 +1,6 @@ +// +groupName=operators.coreos.com // +k8s:deepcopy-gen=package // +k8s:conversion-gen=github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators -// +groupName=operators.coreos.com // Package v1alpha1 contains resources types for version v1alpha1 of the operators.coreos.com API group. package v1alpha1 diff --git a/pkg/operators/v1alpha2/doc.go b/pkg/operators/v1alpha2/doc.go index 29ac1b147..b881240ad 100644 --- a/pkg/operators/v1alpha2/doc.go +++ b/pkg/operators/v1alpha2/doc.go @@ -1,6 +1,6 @@ +// +groupName=operators.coreos.com // +k8s:deepcopy-gen=package // +k8s:conversion-gen=github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators -// +groupName=operators.coreos.com // Package v1alpha2 contains resources types for version v1alpha2 of the operators.coreos.com API group. package v1alpha2 diff --git a/pkg/operators/v1alpha2/groupversion_info.go b/pkg/operators/v1alpha2/groupversion_info.go index aa04199a0..637dc4dfc 100644 --- a/pkg/operators/v1alpha2/groupversion_info.go +++ b/pkg/operators/v1alpha2/groupversion_info.go @@ -12,9 +12,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha2 contains API Schema definitions for the discovery v1alpha2 API group. // +kubebuilder:object:generate=true -// +groupName=operators.coreos.com + +// Package v1alpha2 contains API Schema definitions for the discovery v1alpha2 API group. package v1alpha2 import ( @@ -35,3 +35,8 @@ var ( // 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/pkg/operators/zz_generated.deepcopy.go b/pkg/operators/zz_generated.deepcopy.go deleted file mode 100644 index 8b8760842..000000000 --- a/pkg/operators/zz_generated.deepcopy.go +++ /dev/null @@ -1,1457 +0,0 @@ -// +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 operators - -import ( - "encoding/json" - corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIResourceReference) DeepCopyInto(out *APIResourceReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceReference. -func (in *APIResourceReference) DeepCopy() *APIResourceReference { - if in == nil { - return nil - } - out := new(APIResourceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServiceDefinitions) DeepCopyInto(out *APIServiceDefinitions) { - *out = *in - if in.Owned != nil { - in, out := &in.Owned, &out.Owned - *out = make([]APIServiceDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Required != nil { - in, out := &in.Required, &out.Required - *out = make([]APIServiceDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServiceDefinitions. -func (in *APIServiceDefinitions) DeepCopy() *APIServiceDefinitions { - if in == nil { - return nil - } - out := new(APIServiceDefinitions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServiceDescription) DeepCopyInto(out *APIServiceDescription) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]APIResourceReference, len(*in)) - copy(*out, *in) - } - if in.StatusDescriptors != nil { - in, out := &in.StatusDescriptors, &out.StatusDescriptors - *out = make([]StatusDescriptor, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SpecDescriptors != nil { - in, out := &in.SpecDescriptors, &out.SpecDescriptors - *out = make([]SpecDescriptor, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ActionDescriptor != nil { - in, out := &in.ActionDescriptor, &out.ActionDescriptor - *out = make([]ActionDescriptor, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServiceDescription. -func (in *APIServiceDescription) DeepCopy() *APIServiceDescription { - if in == nil { - return nil - } - out := new(APIServiceDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ActionDescriptor) DeepCopyInto(out *ActionDescriptor) { - *out = *in - if in.XDescriptors != nil { - in, out := &in.XDescriptors, &out.XDescriptors - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = make(json.RawMessage, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionDescriptor. -func (in *ActionDescriptor) DeepCopy() *ActionDescriptor { - if in == nil { - return nil - } - out := new(ActionDescriptor) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AppLink) DeepCopyInto(out *AppLink) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppLink. -func (in *AppLink) DeepCopy() *AppLink { - if in == nil { - return nil - } - out := new(AppLink) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BundleLookup) DeepCopyInto(out *BundleLookup) { - *out = *in - if in.CatalogSourceRef != nil { - in, out := &in.CatalogSourceRef, &out.CatalogSourceRef - *out = new(corev1.ObjectReference) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]BundleLookupCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleLookup. -func (in *BundleLookup) DeepCopy() *BundleLookup { - if in == nil { - return nil - } - out := new(BundleLookup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BundleLookupCondition) DeepCopyInto(out *BundleLookupCondition) { - *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 BundleLookupCondition. -func (in *BundleLookupCondition) DeepCopy() *BundleLookupCondition { - if in == nil { - return nil - } - out := new(BundleLookupCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CRDDescription) DeepCopyInto(out *CRDDescription) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]APIResourceReference, len(*in)) - copy(*out, *in) - } - if in.StatusDescriptors != nil { - in, out := &in.StatusDescriptors, &out.StatusDescriptors - *out = make([]StatusDescriptor, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SpecDescriptors != nil { - in, out := &in.SpecDescriptors, &out.SpecDescriptors - *out = make([]SpecDescriptor, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ActionDescriptor != nil { - in, out := &in.ActionDescriptor, &out.ActionDescriptor - *out = make([]ActionDescriptor, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRDDescription. -func (in *CRDDescription) DeepCopy() *CRDDescription { - if in == nil { - return nil - } - out := new(CRDDescription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CatalogSource) DeepCopyInto(out *CatalogSource) { - *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 CatalogSource. -func (in *CatalogSource) DeepCopy() *CatalogSource { - if in == nil { - return nil - } - out := new(CatalogSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogSource) 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 *CatalogSourceList) DeepCopyInto(out *CatalogSourceList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CatalogSource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSourceList. -func (in *CatalogSourceList) DeepCopy() *CatalogSourceList { - if in == nil { - return nil - } - out := new(CatalogSourceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CatalogSourceList) 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 *CatalogSourceSpec) DeepCopyInto(out *CatalogSourceSpec) { - *out = *in - if in.UpdateStrategy != nil { - in, out := &in.UpdateStrategy, &out.UpdateStrategy - *out = new(UpdateStrategy) - (*in).DeepCopyInto(*out) - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.Icon = in.Icon -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSourceSpec. -func (in *CatalogSourceSpec) DeepCopy() *CatalogSourceSpec { - if in == nil { - return nil - } - out := new(CatalogSourceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CatalogSourceStatus) DeepCopyInto(out *CatalogSourceStatus) { - *out = *in - if in.ConfigMapResource != nil { - in, out := &in.ConfigMapResource, &out.ConfigMapResource - *out = new(ConfigMapResourceReference) - (*in).DeepCopyInto(*out) - } - if in.RegistryServiceStatus != nil { - in, out := &in.RegistryServiceStatus, &out.RegistryServiceStatus - *out = new(RegistryServiceStatus) - (*in).DeepCopyInto(*out) - } - if in.GRPCConnectionState != nil { - in, out := &in.GRPCConnectionState, &out.GRPCConnectionState - *out = new(GRPCConnectionState) - (*in).DeepCopyInto(*out) - } - if in.LatestImageRegistryPoll != nil { - in, out := &in.LatestImageRegistryPoll, &out.LatestImageRegistryPoll - *out = (*in).DeepCopy() - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSourceStatus. -func (in *CatalogSourceStatus) DeepCopy() *CatalogSourceStatus { - if in == nil { - return nil - } - out := new(CatalogSourceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterServiceVersion) DeepCopyInto(out *ClusterServiceVersion) { - *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 ClusterServiceVersion. -func (in *ClusterServiceVersion) DeepCopy() *ClusterServiceVersion { - if in == nil { - return nil - } - out := new(ClusterServiceVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterServiceVersion) 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 *ClusterServiceVersionCondition) DeepCopyInto(out *ClusterServiceVersionCondition) { - *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 ClusterServiceVersionCondition. -func (in *ClusterServiceVersionCondition) DeepCopy() *ClusterServiceVersionCondition { - if in == nil { - return nil - } - out := new(ClusterServiceVersionCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterServiceVersionList) DeepCopyInto(out *ClusterServiceVersionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterServiceVersion, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionList. -func (in *ClusterServiceVersionList) DeepCopy() *ClusterServiceVersionList { - if in == nil { - return nil - } - out := new(ClusterServiceVersionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterServiceVersionList) 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 *ClusterServiceVersionSpec) DeepCopyInto(out *ClusterServiceVersionSpec) { - *out = *in - in.InstallStrategy.DeepCopyInto(&out.InstallStrategy) - in.Version.DeepCopyInto(&out.Version) - in.CustomResourceDefinitions.DeepCopyInto(&out.CustomResourceDefinitions) - in.APIServiceDefinitions.DeepCopyInto(&out.APIServiceDefinitions) - if in.NativeAPIs != nil { - in, out := &in.NativeAPIs, &out.NativeAPIs - *out = make([]v1.GroupVersionKind, len(*in)) - copy(*out, *in) - } - if in.Keywords != nil { - in, out := &in.Keywords, &out.Keywords - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Maintainers != nil { - in, out := &in.Maintainers, &out.Maintainers - *out = make([]Maintainer, len(*in)) - copy(*out, *in) - } - out.Provider = in.Provider - if in.Links != nil { - in, out := &in.Links, &out.Links - *out = make([]AppLink, len(*in)) - copy(*out, *in) - } - if in.Icon != nil { - in, out := &in.Icon, &out.Icon - *out = make([]Icon, len(*in)) - copy(*out, *in) - } - if in.InstallModes != nil { - in, out := &in.InstallModes, &out.InstallModes - *out = make([]InstallMode, len(*in)) - copy(*out, *in) - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionSpec. -func (in *ClusterServiceVersionSpec) DeepCopy() *ClusterServiceVersionSpec { - if in == nil { - return nil - } - out := new(ClusterServiceVersionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterServiceVersionStatus) DeepCopyInto(out *ClusterServiceVersionStatus) { - *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() - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterServiceVersionCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RequirementStatus != nil { - in, out := &in.RequirementStatus, &out.RequirementStatus - *out = make([]RequirementStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.CertsLastUpdated != nil { - in, out := &in.CertsLastUpdated, &out.CertsLastUpdated - *out = (*in).DeepCopy() - } - if in.CertsRotateAt != nil { - in, out := &in.CertsRotateAt, &out.CertsRotateAt - *out = (*in).DeepCopy() - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionStatus. -func (in *ClusterServiceVersionStatus) DeepCopy() *ClusterServiceVersionStatus { - if in == nil { - return nil - } - out := new(ClusterServiceVersionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigMapResourceReference) DeepCopyInto(out *ConfigMapResourceReference) { - *out = *in - in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapResourceReference. -func (in *ConfigMapResourceReference) DeepCopy() *ConfigMapResourceReference { - if in == nil { - return nil - } - out := new(ConfigMapResourceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomResourceDefinitions) DeepCopyInto(out *CustomResourceDefinitions) { - *out = *in - if in.Owned != nil { - in, out := &in.Owned, &out.Owned - *out = make([]CRDDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Required != nil { - in, out := &in.Required, &out.Required - *out = make([]CRDDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitions. -func (in *CustomResourceDefinitions) DeepCopy() *CustomResourceDefinitions { - if in == nil { - return nil - } - out := new(CustomResourceDefinitions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DependentStatus) DeepCopyInto(out *DependentStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependentStatus. -func (in *DependentStatus) DeepCopy() *DependentStatus { - if in == nil { - return nil - } - out := new(DependentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCConnectionState) DeepCopyInto(out *GRPCConnectionState) { - *out = *in - in.LastConnectTime.DeepCopyInto(&out.LastConnectTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCConnectionState. -func (in *GRPCConnectionState) DeepCopy() *GRPCConnectionState { - if in == nil { - return nil - } - out := new(GRPCConnectionState) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Icon) DeepCopyInto(out *Icon) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Icon. -func (in *Icon) DeepCopy() *Icon { - if in == nil { - return nil - } - out := new(Icon) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstallMode) DeepCopyInto(out *InstallMode) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallMode. -func (in *InstallMode) DeepCopy() *InstallMode { - if in == nil { - return nil - } - out := new(InstallMode) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in InstallModeSet) DeepCopyInto(out *InstallModeSet) { - { - in := &in - *out = make(InstallModeSet, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallModeSet. -func (in InstallModeSet) DeepCopy() InstallModeSet { - if in == nil { - return nil - } - out := new(InstallModeSet) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstallPlan) DeepCopyInto(out *InstallPlan) { - *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 InstallPlan. -func (in *InstallPlan) DeepCopy() *InstallPlan { - if in == nil { - return nil - } - out := new(InstallPlan) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InstallPlan) 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 *InstallPlanCondition) DeepCopyInto(out *InstallPlanCondition) { - *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 InstallPlanCondition. -func (in *InstallPlanCondition) DeepCopy() *InstallPlanCondition { - if in == nil { - return nil - } - out := new(InstallPlanCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstallPlanList) DeepCopyInto(out *InstallPlanList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]InstallPlan, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanList. -func (in *InstallPlanList) DeepCopy() *InstallPlanList { - if in == nil { - return nil - } - out := new(InstallPlanList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InstallPlanList) 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 *InstallPlanReference) DeepCopyInto(out *InstallPlanReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanReference. -func (in *InstallPlanReference) DeepCopy() *InstallPlanReference { - if in == nil { - return nil - } - out := new(InstallPlanReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstallPlanSpec) DeepCopyInto(out *InstallPlanSpec) { - *out = *in - if in.ClusterServiceVersionNames != nil { - in, out := &in.ClusterServiceVersionNames, &out.ClusterServiceVersionNames - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanSpec. -func (in *InstallPlanSpec) DeepCopy() *InstallPlanSpec { - if in == nil { - return nil - } - out := new(InstallPlanSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstallPlanStatus) DeepCopyInto(out *InstallPlanStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]InstallPlanCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.CatalogSources != nil { - in, out := &in.CatalogSources, &out.CatalogSources - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = make([]*Step, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Step) - **out = **in - } - } - } - if in.BundleLookups != nil { - in, out := &in.BundleLookups, &out.BundleLookups - *out = make([]BundleLookup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AttenuatedServiceAccountRef != nil { - in, out := &in.AttenuatedServiceAccountRef, &out.AttenuatedServiceAccountRef - *out = new(corev1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanStatus. -func (in *InstallPlanStatus) DeepCopy() *InstallPlanStatus { - if in == nil { - return nil - } - out := new(InstallPlanStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Maintainer) DeepCopyInto(out *Maintainer) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Maintainer. -func (in *Maintainer) DeepCopy() *Maintainer { - if in == nil { - return nil - } - out := new(Maintainer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamedInstallStrategy) DeepCopyInto(out *NamedInstallStrategy) { - *out = *in - in.StrategySpec.DeepCopyInto(&out.StrategySpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedInstallStrategy. -func (in *NamedInstallStrategy) DeepCopy() *NamedInstallStrategy { - if in == nil { - return nil - } - out := new(NamedInstallStrategy) - 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(v1.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() - } -} - -// 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 *RegistryPoll) DeepCopyInto(out *RegistryPoll) { - *out = *in - if in.Interval != nil { - in, out := &in.Interval, &out.Interval - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryPoll. -func (in *RegistryPoll) DeepCopy() *RegistryPoll { - if in == nil { - return nil - } - out := new(RegistryPoll) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegistryServiceStatus) DeepCopyInto(out *RegistryServiceStatus) { - *out = *in - in.CreatedAt.DeepCopyInto(&out.CreatedAt) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryServiceStatus. -func (in *RegistryServiceStatus) DeepCopy() *RegistryServiceStatus { - if in == nil { - return nil - } - out := new(RegistryServiceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RequirementStatus) DeepCopyInto(out *RequirementStatus) { - *out = *in - if in.Dependents != nil { - in, out := &in.Dependents, &out.Dependents - *out = make([]DependentStatus, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequirementStatus. -func (in *RequirementStatus) DeepCopy() *RequirementStatus { - if in == nil { - return nil - } - out := new(RequirementStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SpecDescriptor) DeepCopyInto(out *SpecDescriptor) { - *out = *in - if in.XDescriptors != nil { - in, out := &in.XDescriptors, &out.XDescriptors - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = make(json.RawMessage, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpecDescriptor. -func (in *SpecDescriptor) DeepCopy() *SpecDescriptor { - if in == nil { - return nil - } - out := new(SpecDescriptor) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StatusDescriptor) DeepCopyInto(out *StatusDescriptor) { - *out = *in - if in.XDescriptors != nil { - in, out := &in.XDescriptors, &out.XDescriptors - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = make(json.RawMessage, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusDescriptor. -func (in *StatusDescriptor) DeepCopy() *StatusDescriptor { - if in == nil { - return nil - } - out := new(StatusDescriptor) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Step) DeepCopyInto(out *Step) { - *out = *in - out.Resource = in.Resource -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step. -func (in *Step) DeepCopy() *Step { - if in == nil { - return nil - } - out := new(Step) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StepResource) DeepCopyInto(out *StepResource) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepResource. -func (in *StepResource) DeepCopy() *StepResource { - if in == nil { - return nil - } - out := new(StepResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StrategyDeploymentPermissions) DeepCopyInto(out *StrategyDeploymentPermissions) { - *out = *in - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]rbacv1.PolicyRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyDeploymentPermissions. -func (in *StrategyDeploymentPermissions) DeepCopy() *StrategyDeploymentPermissions { - if in == nil { - return nil - } - out := new(StrategyDeploymentPermissions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StrategyDeploymentSpec) DeepCopyInto(out *StrategyDeploymentSpec) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyDeploymentSpec. -func (in *StrategyDeploymentSpec) DeepCopy() *StrategyDeploymentSpec { - if in == nil { - return nil - } - out := new(StrategyDeploymentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StrategyDetailsDeployment) DeepCopyInto(out *StrategyDetailsDeployment) { - *out = *in - if in.DeploymentSpecs != nil { - in, out := &in.DeploymentSpecs, &out.DeploymentSpecs - *out = make([]StrategyDeploymentSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Permissions != nil { - in, out := &in.Permissions, &out.Permissions - *out = make([]StrategyDeploymentPermissions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ClusterPermissions != nil { - in, out := &in.ClusterPermissions, &out.ClusterPermissions - *out = make([]StrategyDeploymentPermissions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyDetailsDeployment. -func (in *StrategyDetailsDeployment) DeepCopy() *StrategyDetailsDeployment { - if in == nil { - return nil - } - out := new(StrategyDetailsDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Subscription) DeepCopyInto(out *Subscription) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Spec != nil { - in, out := &in.Spec, &out.Spec - *out = new(SubscriptionSpec) - (*in).DeepCopyInto(*out) - } - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subscription. -func (in *Subscription) DeepCopy() *Subscription { - if in == nil { - return nil - } - out := new(Subscription) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Subscription) 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 *SubscriptionCatalogHealth) DeepCopyInto(out *SubscriptionCatalogHealth) { - *out = *in - if in.CatalogSourceRef != nil { - in, out := &in.CatalogSourceRef, &out.CatalogSourceRef - *out = new(corev1.ObjectReference) - **out = **in - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionCatalogHealth. -func (in *SubscriptionCatalogHealth) DeepCopy() *SubscriptionCatalogHealth { - if in == nil { - return nil - } - out := new(SubscriptionCatalogHealth) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionCondition) DeepCopyInto(out *SubscriptionCondition) { - *out = *in - if in.LastHeartbeatTime != nil { - in, out := &in.LastHeartbeatTime, &out.LastHeartbeatTime - *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 SubscriptionCondition. -func (in *SubscriptionCondition) DeepCopy() *SubscriptionCondition { - if in == nil { - return nil - } - out := new(SubscriptionCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionConfig) DeepCopyInto(out *SubscriptionConfig) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]corev1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.Resources.DeepCopyInto(&out.Resources) - if in.EnvFrom != nil { - in, out := &in.EnvFrom, &out.EnvFrom - *out = make([]corev1.EnvFromSource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]corev1.EnvVar, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]corev1.Volume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]corev1.VolumeMount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionConfig. -func (in *SubscriptionConfig) DeepCopy() *SubscriptionConfig { - if in == nil { - return nil - } - out := new(SubscriptionConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Subscription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionList. -func (in *SubscriptionList) DeepCopy() *SubscriptionList { - if in == nil { - return nil - } - out := new(SubscriptionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SubscriptionList) 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 *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec) { - *out = *in - in.Config.DeepCopyInto(&out.Config) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionSpec. -func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec { - if in == nil { - return nil - } - out := new(SubscriptionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubscriptionStatus) DeepCopyInto(out *SubscriptionStatus) { - *out = *in - if in.Install != nil { - in, out := &in.Install, &out.Install - *out = new(InstallPlanReference) - **out = **in - } - if in.InstallPlanRef != nil { - in, out := &in.InstallPlanRef, &out.InstallPlanRef - *out = new(corev1.ObjectReference) - **out = **in - } - if in.CatalogHealth != nil { - in, out := &in.CatalogHealth, &out.CatalogHealth - *out = make([]SubscriptionCatalogHealth, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]SubscriptionCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.LastUpdated.DeepCopyInto(&out.LastUpdated) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionStatus. -func (in *SubscriptionStatus) DeepCopy() *SubscriptionStatus { - if in == nil { - return nil - } - out := new(SubscriptionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy) { - *out = *in - if in.RegistryPoll != nil { - in, out := &in.RegistryPoll, &out.RegistryPoll - *out = new(RegistryPoll) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStrategy. -func (in *UpdateStrategy) DeepCopy() *UpdateStrategy { - if in == nil { - return nil - } - out := new(UpdateStrategy) - in.DeepCopyInto(out) - return out -}