diff --git a/go.mod b/go.mod index b6f04b9af1c1..0c967e9edd82 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,6 @@ require ( github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235 github.com/openshift/library-go v0.0.0-20251015151611-6fc7a74b67c5 - github.com/operator-framework/api v0.36.0 github.com/ovn-org/ovn-kubernetes/go-controller v0.0.0-20250118001652-a8b9c3c31417 github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index fd0f94e7bf83..8b0639f4ddfe 100644 --- a/go.sum +++ b/go.sum @@ -892,8 +892,6 @@ github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1 h1:PMTg github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20251001123353-fd5b1fb35db1/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/operator-framework/api v0.36.0 h1:6+duRhamCvB540JbvNp/1+Pot7luff7HqdAOm9bAntg= -github.com/operator-framework/api v0.36.0/go.mod h1:QSmHMx8XpGsNWvjU5CUelVZC916VLp/TZhfYvGKpghM= github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/ovn-org/ovn-kubernetes/go-controller v0.0.0-20250118001652-a8b9c3c31417 h1:7k+dokKFfpICbkpX5TvvpFbKTFsl/6YQd46EpY2JNhc= github.com/ovn-org/ovn-kubernetes/go-controller v0.0.0-20250118001652-a8b9c3c31417/go.mod h1:9LxDV3rAHlGHAYtVrT62y/fqfIxc5RrDiYi9RVeD0gg= diff --git a/test/extended/storage/storage_networkpolicy.go b/test/extended/storage/storage_networkpolicy.go index b84324023b29..9568ba116afe 100644 --- a/test/extended/storage/storage_networkpolicy.go +++ b/test/extended/storage/storage_networkpolicy.go @@ -5,15 +5,12 @@ import ( "fmt" "strings" - "github.com/blang/semver/v4" g "github.com/onsi/ginkgo/v2" o "github.com/onsi/gomega" exutil "github.com/openshift/origin/test/extended/util" - operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" e2e "k8s.io/kubernetes/test/e2e/framework" - "sigs.k8s.io/controller-runtime/pkg/client" ) // storage_networkpolicy.go contains tests for verifying network policy configurations @@ -28,14 +25,8 @@ import ( // 2. CSI driver resources - verifies network policy labels on platform-specific CSI // drivers (AWS EBS/EFS, Azure Disk/File, GCP PD/Filestore, vSphere, IBM Cloud, // OpenStack Cinder/Manila, SMB) -// 3. LSO (Local Storage Operator) resources - verifies network policy labels on -// related deployment and diskmaker daemonsets -// 4. NetworkPolicy resources - ensures required NetworkPolicies exist with correct -// PodSelector labels for CSO, CSI, and LSO namespaces -// -// LSO-specific Design Considerations: -// - LSONamespace is defined as a variable (not constant) because LSO can be installed -// in a user-specified namespace, allowing for customization based on actual deployment +// 3. NetworkPolicy resources - ensures required NetworkPolicies exist with correct +// PodSelector labels for CSO, CSI // ResourceType defines the type of Openshift workload resource type ResourceType string @@ -45,13 +36,6 @@ const ( ResourceTypeDaemonSet ResourceType = "DaemonSet" ) -// lsoInfo contains information about the Local Storage Operator installation -type lsoInfo struct { - Installed bool - Namespace string - Version string -} - // resourceCheck defines a check for a workload resource (Deployment, DaemonSet, etc.) type resourceCheck struct { ResourceType ResourceType @@ -68,11 +52,6 @@ var ( npLabelOperatorMetricsRange = map[string]string{"openshift.storage.network-policy.operator-metrics-range": "allow"} npLabelMetricsRange = map[string]string{"openshift.storage.network-policy.metrics-range": "allow"} npLabelAllEgress = map[string]string{"openshift.storage.network-policy.all-egress": "allow"} - // LSO specific network policy labels - npLabelLSOAPIServer = map[string]string{"openshift.storage.network-policy.lso.api-server": "allow"} - npLabelLSODNS = map[string]string{"openshift.storage.network-policy.lso.dns": "allow"} - npLabelLSOOperatorMetrics = map[string]string{"openshift.storage.network-policy.lso.operator-metrics": "allow"} - npLabelLSODiskmakerMetrics = map[string]string{"openshift.storage.network-policy.lso.diskmaker-metrics": "allow"} ) func mergeLabels(maps ...map[string]string) map[string]string { @@ -94,9 +73,6 @@ var ( csiOperatorWithAllEgressRequiredLabels = mergeLabels(npLabelAPI, npLabelDNS, npLabelOperatorMetricsRange, npLabelAllEgress) csiControllerRequiredLabels = mergeLabels(npLabelAPI, npLabelDNS, npLabelMetricsRange) csiControllerWithAllEgressRequiredLabels = mergeLabels(npLabelAPI, npLabelDNS, npLabelMetricsRange, npLabelAllEgress) - // LSO specific required labels - lsoOperatorRequiredLabels = mergeLabels(npLabelLSOAPIServer, npLabelLSODNS, npLabelLSOOperatorMetrics) - lsoDiskmakerRequiredLabels = mergeLabels(npLabelLSOAPIServer, npLabelLSODNS, npLabelLSODiskmakerMetrics) ) type npCheck struct { @@ -140,26 +116,11 @@ var networkPolicyChecks = []npCheck{ // }, } -// getLSONetworkPolicyCheck returns the LSO network policy check configuration -// based on the detected LSO installation information -func getLSONetworkPolicyCheck(lso *lsoInfo) npCheck { - return npCheck{ - Namespace: lso.Namespace, - RequiredPodSelectors: []map[string]string{ - npLabelLSOAPIServer, - npLabelLSODNS, - npLabelLSOOperatorMetrics, - npLabelLSODiskmakerMetrics, - }, - } -} - var _ = g.Describe("[sig-storage][OCPFeature:StorageNetworkPolicy] Storage Network Policy", func() { defer g.GinkgoRecover() var ( oc = exutil.NewCLI("storage-network-policy") currentPlatform = e2e.TestContext.Provider - lsoInstallInfo *lsoInfo // LSO installation information detected once per suite ) g.BeforeEach(func() { @@ -168,20 +129,6 @@ var _ = g.Describe("[sig-storage][OCPFeature:StorageNetworkPolicy] Storage Netwo if isMicroShift { g.Skip("Storage Network Policy tests are not supported on MicroShift") } - - // Detect LSO installation only once (cache the result) - if lsoInstallInfo == nil { - lsoInstallInfo, err = getLSOInfo(oc) - o.Expect(err).NotTo(o.HaveOccurred(), "Failed to detect LSO installation") - - if lsoInstallInfo.Installed { - supported := isLSOVersionSupported(lsoInstallInfo.Version) - g.By(fmt.Sprintf("Detected LSO installed in namespace: %s, version: %s (network policy support: %v)", - lsoInstallInfo.Namespace, lsoInstallInfo.Version, supported)) - } else { - g.By("LSO is not installed on this cluster") - } - } }) g.It("should verify required labels for CSO related Operators", func() { @@ -364,59 +311,6 @@ var _ = g.Describe("[sig-storage][OCPFeature:StorageNetworkPolicy] Storage Netwo runResourceChecks(oc, CSIResourcesToCheck, currentPlatform) }) - g.It("should verify required labels for LSO related resources", func() { - // Skip if LSO is not installed or version is lower than 4.21.0 - if !lsoInstallInfo.Installed { - g.Skip("LSO is not installed on this cluster") - } - - if !isLSOVersionSupported(lsoInstallInfo.Version) { - g.Skip(fmt.Sprintf("LSO network policy support requires version >= 4.21.0, current version: %s", lsoInstallInfo.Version)) - } - - LSOResourcesToCheck := []resourceCheck{ - { - ResourceType: ResourceTypeDeployment, - Namespace: lsoInstallInfo.Namespace, - Name: "local-storage-operator", - Platform: "all", - RequiredLabels: lsoOperatorRequiredLabels, - }, - { - ResourceType: ResourceTypeDaemonSet, - Namespace: lsoInstallInfo.Namespace, - Name: "diskmaker-manager", - Platform: "all", - RequiredLabels: lsoDiskmakerRequiredLabels, - }, - { - ResourceType: ResourceTypeDaemonSet, - Namespace: lsoInstallInfo.Namespace, - Name: "diskmaker-discovery", - Platform: "all", - RequiredLabels: lsoDiskmakerRequiredLabels, - }, - } - - runResourceChecks(oc, LSOResourcesToCheck, currentPlatform) - }) - - g.It("should ensure required NetworkPolicies exist with correct labels for LSO", func() { - // Skip if LSO is not installed or version is lower than 4.21.0 - if !lsoInstallInfo.Installed { - g.Skip("LSO is not installed on this cluster") - } - - if !isLSOVersionSupported(lsoInstallInfo.Version) { - g.Skip(fmt.Sprintf("LSO network policy support requires version >= 4.21.0, current version: %s", lsoInstallInfo.Version)) - } - - // Get LSO network policy check configuration - lsoCheck := getLSONetworkPolicyCheck(lsoInstallInfo) - - verifyNetworkPolicyPodSelectors(oc, lsoCheck.Namespace, lsoCheck.RequiredPodSelectors) - }) - g.It("should ensure required NetworkPolicies exist with correct labels", func() { for _, c := range networkPolicyChecks { _, err := oc.AdminKubeClient().CoreV1().Namespaces().Get(context.TODO(), c.Namespace, metav1.GetOptions{}) @@ -496,70 +390,6 @@ func runResourceChecks(oc *exutil.CLI, resources []resourceCheck, currentPlatfor } } -// isLSOVersionSupported checks if the LSO version is 4.21.0 or higher -// Supported version formats: "4.21.0", "4.21.0-202511252120" -func isLSOVersionSupported(versionStr string) bool { - // Minimum required version for LSO network policy support - minVersion := semver.MustParse("4.21.0") - - // Parse the LSO version - // The version string may contain build metadata (e.g., "4.21.0-202511252120") - // semver.Parse handles this correctly - version, err := semver.Parse(versionStr) - if err != nil { - e2e.Logf("Failed to parse LSO version %q: %v", versionStr, err) - return false - } - - // Compare versions: returns true if version >= minVersion - return version.GTE(minVersion) -} - -// getLSOInfo detects if LSO is installed by searching for local-storage-operator CSV -// across all namespaces and returns its namespace and version information -func getLSOInfo(oc *exutil.CLI) (*lsoInfo, error) { - info := &lsoInfo{ - Installed: false, - } - - // Create controller-runtime client - clusterConfig := oc.AdminConfig() - clusterClient, err := client.New(clusterConfig, client.Options{}) - if err != nil { - return info, fmt.Errorf("failed to create controller-runtime client: %v", err) - } - - // Add operatorsv1alpha1 to scheme - err = operatorsv1alpha1.AddToScheme(clusterClient.Scheme()) - if err != nil { - return info, fmt.Errorf("failed to add operators.coreos.com/v1alpha1 to scheme: %v", err) - } - - // List all ClusterServiceVersions across all namespaces - csvList := &operatorsv1alpha1.ClusterServiceVersionList{} - err = clusterClient.List(context.TODO(), csvList) - if err != nil { - return info, fmt.Errorf("failed to list ClusterServiceVersions: %v", err) - } - - // Search for local-storage-operator CSV - for _, csv := range csvList.Items { - // Match CSV name pattern: local-storage-operator.* - if strings.HasPrefix(csv.Name, "local-storage-operator") { - // Only consider CSVs in Succeeded phase - if csv.Status.Phase == operatorsv1alpha1.CSVPhaseSucceeded { - info.Installed = true - info.Namespace = csv.Namespace - info.Version = csv.Spec.Version.String() - return info, nil - } - } - } - - // LSO not found or not in Succeeded phase - return info, nil -} - // podSelectorContainsLabels checks if actualLabels contains all key-value pairs from requiredLabels func podSelectorContainsLabels(actualLabels map[string]string, requiredLabels map[string]string) bool { for key, value := range requiredLabels { diff --git a/vendor/github.com/operator-framework/api/LICENSE b/vendor/github.com/operator-framework/api/LICENSE deleted file mode 100644 index 261eeb9e9f8b..000000000000 --- a/vendor/github.com/operator-framework/api/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/vendor/github.com/operator-framework/api/pkg/lib/version/version.go b/vendor/github.com/operator-framework/api/pkg/lib/version/version.go deleted file mode 100644 index a0ffb9fcbe0a..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/lib/version/version.go +++ /dev/null @@ -1,67 +0,0 @@ -package version - -import ( - "encoding/json" - - semver "github.com/blang/semver/v4" -) - -// +k8s:openapi-gen=true -// OperatorVersion is a wrapper around semver.Version which supports correct -// marshaling to YAML and JSON. -// +kubebuilder:validation:Type=string -type OperatorVersion struct { - semver.Version `json:"-"` -} - -// DeepCopyInto creates a deep-copy of the Version value. -func (v *OperatorVersion) DeepCopyInto(out *OperatorVersion) { - out.Major = v.Major - out.Minor = v.Minor - out.Patch = v.Patch - - if v.Pre != nil { - pre := make([]semver.PRVersion, len(v.Pre)) - copy(pre, v.Pre) - out.Pre = pre - } - - if v.Build != nil { - build := make([]string, len(v.Build)) - copy(build, v.Build) - out.Build = build - } -} - -// MarshalJSON implements the encoding/json.Marshaler interface. -func (v OperatorVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.String()) -} - -// UnmarshalJSON implements the encoding/json.Unmarshaler interface. -func (v *OperatorVersion) UnmarshalJSON(data []byte) (err error) { - var versionString string - - if err = json.Unmarshal(data, &versionString); err != nil { - return - } - - version := semver.Version{} - version, err = semver.ParseTolerant(versionString) - if err != nil { - return err - } - v.Version = version - return -} - -// OpenAPISchemaType is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -// -// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators -func (_ OperatorVersion) OpenAPISchemaType() []string { return []string{"string"} } - -// OpenAPISchemaFormat is used by the kube-openapi generator when constructing -// the OpenAPI spec of this type. -// "semver" is not a standard openapi format but tooling may use the value regardless -func (_ OperatorVersion) OpenAPISchemaFormat() string { return "semver" } diff --git a/vendor/github.com/operator-framework/api/pkg/operators/doc.go b/vendor/github.com/operator-framework/api/pkg/operators/doc.go deleted file mode 100644 index 7eba794488ba..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// +kubebuilder:skip - -// Package operators contains all resource types of the operators.coreos.com API group. -package operators diff --git a/vendor/github.com/operator-framework/api/pkg/operators/register.go b/vendor/github.com/operator-framework/api/pkg/operators/register.go deleted file mode 100644 index e3c31d51ac22..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/register.go +++ /dev/null @@ -1,31 +0,0 @@ -package operators - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ( - // GroupName is the group name used in this package. - GroupName = "operators.coreos.com" - // GroupVersion is the group version used in this package. - GroupVersion = runtime.APIVersionInternal - - // LEGACY: Exported kind names, remove after major version bump - - // 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" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/catalogsource_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/catalogsource_types.go deleted file mode 100644 index 8386b2032041..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/catalogsource_types.go +++ /dev/null @@ -1,364 +0,0 @@ -package v1alpha1 - -import ( - "encoding/json" - "fmt" - "time" - - "github.com/sirupsen/logrus" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -const ( - CatalogSourceCRDAPIVersion = GroupName + "/" + GroupVersion - CatalogSourceKind = "CatalogSource" - DefaultRegistryPollDuration = 15 * time.Minute -) - -// 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" -) - -const ( - // CatalogSourceSpecInvalidError denotes when fields on the spec of the CatalogSource are not valid. - CatalogSourceSpecInvalidError ConditionReason = "SpecInvalidError" - // CatalogSourceConfigMapError denotes when there is an issue extracting manifests from the specified ConfigMap. - CatalogSourceConfigMapError ConditionReason = "ConfigMapError" - // CatalogSourceRegistryServerError denotes when there is an issue querying the specified registry server. - CatalogSourceRegistryServerError ConditionReason = "RegistryServerError" - // CatalogSourceIntervalInvalidError denotes if the registry polling interval is invalid. - CatalogSourceIntervalInvalidError ConditionReason = "InvalidIntervalError" -) - -type CatalogSourceSpec struct { - // SourceType is the type of source - SourceType SourceType `json:"sourceType"` - - // Priority field assigns a weight to the catalog source to prioritize them so that it can be consumed by the dependency resolver. - // Usage: - // Higher weight indicates that this catalog source is preferred over lower weighted catalog sources during dependency resolution. - // The range of the priority value can go from positive to negative in the range of int32. - // The default value to a catalog source with unassigned priority would be 0. - // The catalog source with the same priority values will be ranked lexicographically based on its name. - // +optional - Priority int `json:"priority,omitempty"` - - // 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 `json:"configMap,omitempty"` - - // 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 `json:"address,omitempty"` - - // 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 `json:"image,omitempty"` - - // GrpcPodConfig exposes different overrides for the pod spec of the CatalogSource Pod. - // Only used when SourceType = SourceTypeGrpc and Image is set. - // +optional - GrpcPodConfig *GrpcPodConfig `json:"grpcPodConfig,omitempty"` - - // 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 `json:"updateStrategy,omitempty"` - - // 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 `json:"secrets,omitempty"` - - // Metadata - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - Publisher string `json:"publisher,omitempty"` - Icon Icon `json:"icon,omitempty"` -} - -type SecurityConfig string - -const ( - Legacy SecurityConfig = "legacy" - Restricted SecurityConfig = "restricted" -) - -// GrpcPodConfig contains configuration specified for a catalog source -type GrpcPodConfig struct { - // 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. - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - // Tolerations are the catalog source's pod's tolerations. - // +optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` - - // Affinity is the catalog source's pod's affinity. - // +optional - Affinity *corev1.Affinity `json:"affinity,omitempty"` - - // If specified, indicates the pod's priority. - // If not specified, the pod priority will be default or zero if there is no - // default. - // +optional - PriorityClassName *string `json:"priorityClassName,omitempty"` - - // SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource's pod is either injected with the - // right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod - // Security Admission (PSA) `restricted` mode, or doesn't set these values at all, in which case the pod can only be - // run in PSA `baseline` or `privileged` namespaces. If the SecurityContextConfig is unspecified, the mode will be - // determined by the namespace's PSA configuration. If the namespace is enforcing `restricted` mode, then the pod - // will be configured as if `restricted` was specified. Otherwise, it will be configured as if `legacy` was - // specified. Specifying a value other than `legacy` or `restricted` result in a validation error. When using older - // catalog images, which can not run in `restricted` mode, the SecurityContextConfig should be set to `legacy`. - // - // More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/ - // +optional - // +kubebuilder:validation:Enum=legacy;restricted - SecurityContextConfig SecurityConfig `json:"securityContextConfig,omitempty"` - - // MemoryTarget configures the $GOMEMLIMIT value for the gRPC catalog Pod. This is a soft memory limit for the server, - // which the runtime will attempt to meet but makes no guarantees that it will do so. If this value is set, the Pod - // will have the following modifications made to the container running the server: - // - the $GOMEMLIMIT environment variable will be set to this value in bytes - // - the memory request will be set to this value - // - // This field should be set if it's desired to reduce the footprint of a catalog server as much as possible, or if - // a catalog being served is very large and needs more than the default allocation. If your index image has a file- - // system cache, determine a good approximation for this value by doubling the size of the package cache at - // /tmp/cache/cache/packages.json in the index image. - // - // This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set. - // +optional - MemoryTarget *resource.Quantity `json:"memoryTarget,omitempty"` - - // ExtractContent configures the gRPC catalog Pod to extract catalog metadata from the provided index image and - // use a well-known version of the `opm` server to expose it. The catalog index image that this CatalogSource is - // configured to use *must* be using the file-based catalogs in order to utilize this feature. - // +optional - ExtractContent *ExtractContentConfig `json:"extractContent,omitempty"` -} - -// ExtractContentConfig configures context extraction from a file-based catalog index image. -type ExtractContentConfig struct { - // CacheDir is the (optional) directory storing the pre-calculated API cache. - CacheDir string `json:"cacheDir,omitempty"` - // CatalogDir is the directory storing the file-based catalog contents. - CatalogDir string `json:"catalogDir"` -} - -// UpdateStrategy holds all the different types of catalog source update strategies -// Currently only registry polling strategy is implemented -type UpdateStrategy struct { - *RegistryPoll `json:"registryPoll,omitempty"` -} - -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. - RawInterval string `json:"interval,omitempty"` - Interval *metav1.Duration `json:"-"` - ParsingError string `json:"-"` -} - -// UnmarshalJSON implements the encoding/json.Unmarshaler interface. -func (u *UpdateStrategy) UnmarshalJSON(data []byte) (err error) { - type alias struct { - *RegistryPoll `json:"registryPoll,omitempty"` - } - us := alias{} - if err = json.Unmarshal(data, &us); err != nil { - return err - } - registryPoll := &RegistryPoll{ - RawInterval: us.RegistryPoll.RawInterval, - } - duration, err := time.ParseDuration(registryPoll.RawInterval) - if err != nil { - registryPoll.ParsingError = fmt.Sprintf("error parsing spec.updateStrategy.registryPoll.interval. Using the default value of %s instead. Error: %s", DefaultRegistryPollDuration, err) - registryPoll.Interval = &metav1.Duration{Duration: DefaultRegistryPollDuration} - } else { - registryPoll.Interval = &metav1.Duration{Duration: duration} - } - u.RegistryPoll = registryPoll - return nil -} - -type RegistryServiceStatus struct { - Protocol string `json:"protocol,omitempty"` - ServiceName string `json:"serviceName,omitempty"` - ServiceNamespace string `json:"serviceNamespace,omitempty"` - Port string `json:"port,omitempty"` - CreatedAt metav1.Time `json:"createdAt,omitempty"` -} - -func (s *RegistryServiceStatus) Address() string { - return fmt.Sprintf("%s.%s.svc:%s", s.ServiceName, s.ServiceNamespace, s.Port) -} - -type GRPCConnectionState struct { - Address string `json:"address,omitempty"` - LastObservedState string `json:"lastObservedState"` - LastConnectTime metav1.Time `json:"lastConnect,omitempty"` -} - -type CatalogSourceStatus struct { - // A human readable message indicating details about why the CatalogSource is in this condition. - // +optional - Message string `json:"message,omitempty"` - // Reason is the reason the CatalogSource was transitioned to its current state. - // +optional - Reason ConditionReason `json:"reason,omitempty"` - - // The last time the CatalogSource image registry has been polled to ensure the image is up-to-date - LatestImageRegistryPoll *metav1.Time `json:"latestImageRegistryPoll,omitempty"` - - // ConfigMapReference (deprecated) is the reference to the ConfigMap containing the catalog source's configuration, when the catalog source is a ConfigMap - ConfigMapResource *ConfigMapResourceReference `json:"configMapReference,omitempty"` - // RegistryService represents the current state of the GRPC service used to serve the catalog - RegistryServiceStatus *RegistryServiceStatus `json:"registryService,omitempty"` - // ConnectionState represents the current state of the CatalogSource's connection to the registry - GRPCConnectionState *GRPCConnectionState `json:"connectionState,omitempty"` - - // Represents the state of a CatalogSource. Note that Message and Reason represent the original - // status information, which may be migrated to be conditions based in the future. Any new features - // introduced will use conditions. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` -} - -type ConfigMapResourceReference struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - UID types.UID `json:"uid,omitempty"` - ResourceVersion string `json:"resourceVersion,omitempty"` - LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` -} - -func (r *ConfigMapResourceReference) IsAMatch(object *metav1.ObjectMeta) bool { - return r.UID == object.GetUID() && r.ResourceVersion == object.GetResourceVersion() -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient -// +kubebuilder:resource:shortName=catsrc,categories=olm -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Display",type=string,JSONPath=`.spec.displayName`,description="The pretty name of the catalog" -// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.sourceType`,description="The type of the catalog" -// +kubebuilder:printcolumn:name="Publisher",type=string,JSONPath=`.spec.publisher`,description="The publisher of the catalog" -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` - -// CatalogSource is a repository of CSVs, CRDs, and operator packages. -type CatalogSource struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec CatalogSourceSpec `json:"spec"` - // +optional - Status CatalogSourceStatus `json:"status"` -} - -func (c *CatalogSource) Address() string { - if c.Spec.Address != "" { - return c.Spec.Address - } - return c.Status.RegistryServiceStatus.Address() -} - -func (c *CatalogSource) SetError(reason ConditionReason, err error) { - c.Status.Reason = reason - c.Status.Message = "" - if err != nil { - c.Status.Message = err.Error() - } -} - -func (c *CatalogSource) SetLastUpdateTime() { - now := metav1.Now() - c.Status.LatestImageRegistryPoll = &now -} - -// Check if it is time to update based on polling setting -func (c *CatalogSource) Update() bool { - if !c.Poll() { - return false - } - interval := c.Spec.UpdateStrategy.Interval.Duration - latest := c.Status.LatestImageRegistryPoll - if latest == nil { - logrus.WithField("CatalogSource", c.Name).Debugf("latest poll %v", latest) - } else { - logrus.WithField("CatalogSource", c.Name).Debugf("latest poll %v", *c.Status.LatestImageRegistryPoll) - } - - if c.Status.LatestImageRegistryPoll.IsZero() { - logrus.WithField("CatalogSource", c.Name).Debugf("creation timestamp plus interval before now %t", c.CreationTimestamp.Add(interval).Before(time.Now())) - if c.CreationTimestamp.Add(interval).Before(time.Now()) { - return true - } - } else { - logrus.WithField("CatalogSource", c.Name).Debugf("latest poll plus interval before now %t", c.Status.LatestImageRegistryPoll.Add(interval).Before(time.Now())) - if c.Status.LatestImageRegistryPoll.Add(interval).Before(time.Now()) { - return true - } - } - - return false -} - -// Poll determines whether the polling feature is enabled on the particular catalog source -func (c *CatalogSource) Poll() bool { - if c.Spec.UpdateStrategy == nil { - return false - } - // if polling interval is zero polling will not be done - if c.Spec.UpdateStrategy.RegistryPoll == nil { - return false - } - // if catalog source is not backed by an image polling will not be done - if c.Spec.Image == "" { - return false - } - // if image is not type gRPC polling will not be done - if c.Spec.SourceType != SourceTypeGrpc { - return false - } - return true -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CatalogSourceList is a repository of CSVs, CRDs, and operator packages. -type CatalogSourceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []CatalogSource `json:"items"` -} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/clusterserviceversion.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/clusterserviceversion.go deleted file mode 100644 index a4c8d1746960..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/clusterserviceversion.go +++ /dev/null @@ -1,215 +0,0 @@ -package v1alpha1 - -import ( - "fmt" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/record" -) - -const ( - CopiedLabelKey = "olm.copiedFrom" - - // ConditionsLengthLimit is the maximum length of Status.Conditions of a - // given ClusterServiceVersion object. The oldest condition(s) are removed - // from the list as it grows over time to keep it at limit. - ConditionsLengthLimit = 20 -) - -// obsoleteReasons are the set of reasons that mean a CSV should no longer be processed as active -var obsoleteReasons = map[ConditionReason]struct{}{ - CSVReasonReplaced: {}, - CSVReasonBeingReplaced: {}, -} - -// uncopiableReasons are the set of reasons that should prevent a CSV from being copied to target namespaces -var uncopiableReasons = map[ConditionReason]struct{}{ - CSVReasonCopied: {}, - CSVReasonInvalidInstallModes: {}, - CSVReasonNoTargetNamespaces: {}, - CSVReasonUnsupportedOperatorGroup: {}, - CSVReasonNoOperatorGroup: {}, - CSVReasonTooManyOperatorGroups: {}, - CSVReasonInterOperatorGroupOwnerConflict: {}, - CSVReasonCannotModifyStaticOperatorGroupProvidedAPIs: {}, -} - -// safeToAnnotateOperatorGroupReasons are the set of reasons that it's safe to attempt to update the operatorgroup -// annotations -var safeToAnnotateOperatorGroupReasons = map[ConditionReason]struct{}{ - CSVReasonOwnerConflict: {}, - CSVReasonInstallSuccessful: {}, - CSVReasonInvalidInstallModes: {}, - CSVReasonNoTargetNamespaces: {}, - CSVReasonUnsupportedOperatorGroup: {}, - CSVReasonNoOperatorGroup: {}, - CSVReasonTooManyOperatorGroups: {}, - CSVReasonInterOperatorGroupOwnerConflict: {}, - CSVReasonCannotModifyStaticOperatorGroupProvidedAPIs: {}, -} - -// SetPhaseWithEventIfChanged emits a Kubernetes event with details of a phase change and sets the current phase if phase, reason, or message would changed -func (c *ClusterServiceVersion) SetPhaseWithEventIfChanged(phase ClusterServiceVersionPhase, reason ConditionReason, message string, now *metav1.Time, recorder record.EventRecorder) { - if c.Status.Phase == phase && c.Status.Reason == reason && c.Status.Message == message { - return - } - - c.SetPhaseWithEvent(phase, reason, message, now, recorder) -} - -// SetPhaseWithEvent generates a Kubernetes event with details about the phase change and sets the current phase -func (c *ClusterServiceVersion) SetPhaseWithEvent(phase ClusterServiceVersionPhase, reason ConditionReason, message string, now *metav1.Time, recorder record.EventRecorder) { - var eventtype string - if phase == CSVPhaseFailed { - eventtype = v1.EventTypeWarning - } else { - eventtype = v1.EventTypeNormal - } - go recorder.Event(c, eventtype, string(reason), message) - c.SetPhase(phase, reason, message, now) -} - -// SetPhase sets the current phase and adds a condition if necessary -func (c *ClusterServiceVersion) SetPhase(phase ClusterServiceVersionPhase, reason ConditionReason, message string, now *metav1.Time) { - newCondition := func() ClusterServiceVersionCondition { - return ClusterServiceVersionCondition{ - Phase: c.Status.Phase, - LastTransitionTime: c.Status.LastTransitionTime, - LastUpdateTime: c.Status.LastUpdateTime, - Message: message, - Reason: reason, - } - } - - defer c.TrimConditionsIfLimitExceeded() - - c.Status.LastUpdateTime = now - if c.Status.Phase != phase { - c.Status.Phase = phase - c.Status.LastTransitionTime = now - } - c.Status.Message = message - c.Status.Reason = reason - if len(c.Status.Conditions) == 0 { - c.Status.Conditions = append(c.Status.Conditions, newCondition()) - return - } - - previousCondition := c.Status.Conditions[len(c.Status.Conditions)-1] - if previousCondition.Phase != c.Status.Phase || previousCondition.Reason != c.Status.Reason { - c.Status.Conditions = append(c.Status.Conditions, newCondition()) - } -} - -// SetRequirementStatus adds the status of all requirements to the CSV status -func (c *ClusterServiceVersion) SetRequirementStatus(statuses []RequirementStatus) { - c.Status.RequirementStatus = statuses -} - -// IsObsolete returns if this CSV is being replaced or is marked for deletion -func (c *ClusterServiceVersion) IsObsolete() bool { - for _, condition := range c.Status.Conditions { - _, ok := obsoleteReasons[condition.Reason] - if ok { - return true - } - } - return false -} - -// IsCopied returns true if the CSV has been copied and false otherwise. -func (c *ClusterServiceVersion) IsCopied() bool { - return c.Status.Reason == CSVReasonCopied || IsCopied(c) -} - -func IsCopied(o metav1.Object) bool { - annotations := o.GetAnnotations() - if annotations != nil { - operatorNamespace, ok := annotations[OperatorGroupNamespaceAnnotationKey] - if ok && o.GetNamespace() != operatorNamespace { - return true - } - } - - if labels := o.GetLabels(); labels != nil { - if _, ok := labels[CopiedLabelKey]; ok { - return true - } - } - return false -} - -func (c *ClusterServiceVersion) IsUncopiable() bool { - if c.Status.Phase == CSVPhaseNone { - return true - } - _, ok := uncopiableReasons[c.Status.Reason] - return ok -} - -func (c *ClusterServiceVersion) IsSafeToUpdateOperatorGroupAnnotations() bool { - _, ok := safeToAnnotateOperatorGroupReasons[c.Status.Reason] - return ok -} - -// NewInstallModeSet returns an InstallModeSet instantiated from the given list of InstallModes. -// If the given list is not a set, an error is returned. -func NewInstallModeSet(modes []InstallMode) (InstallModeSet, error) { - set := InstallModeSet{} - for _, mode := range modes { - if _, exists := set[mode.Type]; exists { - return nil, fmt.Errorf("InstallMode list contains duplicates, cannot make set: %v", modes) - } - set[mode.Type] = mode.Supported - } - - return set, nil -} - -// Supports returns an error if the InstallModeSet does not support configuration for -// the given operatorNamespace and list of target namespaces. -func (set InstallModeSet) Supports(operatorNamespace string, namespaces []string) error { - numNamespaces := len(namespaces) - switch { - case numNamespaces == 0: - return fmt.Errorf("operatorgroup has invalid selected namespaces, cannot configure to watch zero namespaces") - case numNamespaces == 1: - switch namespaces[0] { - case operatorNamespace: - if !set[InstallModeTypeOwnNamespace] { - return fmt.Errorf("%s InstallModeType not supported, cannot configure to watch own namespace", InstallModeTypeOwnNamespace) - } - case v1.NamespaceAll: - if !set[InstallModeTypeAllNamespaces] { - return fmt.Errorf("%s InstallModeType not supported, cannot configure to watch all namespaces", InstallModeTypeAllNamespaces) - } - default: - if !set[InstallModeTypeSingleNamespace] { - return fmt.Errorf("%s InstallModeType not supported, cannot configure to watch one namespace", InstallModeTypeSingleNamespace) - } - } - case numNamespaces > 1 && !set[InstallModeTypeMultiNamespace]: - return fmt.Errorf("%s InstallModeType not supported, cannot configure to watch %d namespaces", InstallModeTypeMultiNamespace, numNamespaces) - case numNamespaces > 1: - for _, namespace := range namespaces { - if namespace == operatorNamespace && !set[InstallModeTypeOwnNamespace] { - return fmt.Errorf("%s InstallModeType not supported, cannot configure to watch own namespace", InstallModeTypeOwnNamespace) - } - if namespace == v1.NamespaceAll { - return fmt.Errorf("operatorgroup has invalid selected namespaces, NamespaceAll found when |selected namespaces| > 1") - } - } - } - - return nil -} - -func (c *ClusterServiceVersion) TrimConditionsIfLimitExceeded() { - if len(c.Status.Conditions) <= ConditionsLengthLimit { - return - } - - firstIndex := len(c.Status.Conditions) - ConditionsLengthLimit - c.Status.Conditions = c.Status.Conditions[firstIndex:len(c.Status.Conditions)] -} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/clusterserviceversion_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/clusterserviceversion_types.go deleted file mode 100644 index 3e6d3248037e..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/clusterserviceversion_types.go +++ /dev/null @@ -1,737 +0,0 @@ -package v1alpha1 - -import ( - "encoding/json" - "fmt" - "sort" - "strings" - - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - appsv1 "k8s.io/api/apps/v1" - rbac "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/intstr" - - "github.com/operator-framework/api/pkg/lib/version" -) - -const ( - ClusterServiceVersionAPIVersion = GroupName + "/" + GroupVersion - ClusterServiceVersionKind = "ClusterServiceVersion" - OperatorGroupNamespaceAnnotationKey = "olm.operatorNamespace" - InstallStrategyNameDeployment = "deployment" - SkipRangeAnnotationKey = "olm.skipRange" -) - -// 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" -) - -// InstallMode associates an InstallModeType with a flag representing if the CSV supports it -// +k8s:openapi-gen=true -type InstallMode struct { - Type InstallModeType `json:"type"` - Supported bool `json:"supported"` -} - -// 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. -// +k8s:openapi-gen=true -type NamedInstallStrategy struct { - StrategyName string `json:"strategy"` - StrategySpec StrategyDetailsDeployment `json:"spec,omitempty"` -} - -// StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy -// +k8s:openapi-gen=true -type StrategyDeploymentPermissions struct { - ServiceAccountName string `json:"serviceAccountName"` - Rules []rbac.PolicyRule `json:"rules"` -} - -// StrategyDeploymentSpec contains the name, spec and labels for the deployment ALM should create -// +k8s:openapi-gen=true -type StrategyDeploymentSpec struct { - Name string `json:"name"` - Spec appsv1.DeploymentSpec `json:"spec"` - Label labels.Set `json:"label,omitempty"` -} - -// StrategyDetailsDeployment represents the parsed details of a Deployment -// InstallStrategy. -// +k8s:openapi-gen=true -type StrategyDetailsDeployment struct { - DeploymentSpecs []StrategyDeploymentSpec `json:"deployments"` - Permissions []StrategyDeploymentPermissions `json:"permissions,omitempty"` - ClusterPermissions []StrategyDeploymentPermissions `json:"clusterPermissions,omitempty"` -} - -func (d *StrategyDetailsDeployment) GetStrategyName() string { - return InstallStrategyNameDeployment -} - -// StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it -// +k8s:openapi-gen=true -type StatusDescriptor struct { - Path string `json:"path"` - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - XDescriptors []string `json:"x-descriptors,omitempty"` - Value json.RawMessage `json:"value,omitempty"` -} - -// SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it -// +k8s:openapi-gen=true -type SpecDescriptor struct { - Path string `json:"path"` - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - XDescriptors []string `json:"x-descriptors,omitempty"` - Value json.RawMessage `json:"value,omitempty"` -} - -// ActionDescriptor describes a declarative action that can be performed on a custom resource instance -// +k8s:openapi-gen=true -type ActionDescriptor struct { - Path string `json:"path"` - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - XDescriptors []string `json:"x-descriptors,omitempty"` - Value json.RawMessage `json:"value,omitempty"` -} - -// CRDDescription provides details to OLM about the CRDs -// +k8s:openapi-gen=true -type CRDDescription struct { - Name string `json:"name"` - Version string `json:"version"` - Kind string `json:"kind"` - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - Resources []APIResourceReference `json:"resources,omitempty"` - StatusDescriptors []StatusDescriptor `json:"statusDescriptors,omitempty"` - SpecDescriptors []SpecDescriptor `json:"specDescriptors,omitempty"` - ActionDescriptor []ActionDescriptor `json:"actionDescriptors,omitempty"` -} - -// APIServiceDescription provides details to OLM about apis provided via aggregation -// +k8s:openapi-gen=true -type APIServiceDescription struct { - Name string `json:"name"` - Group string `json:"group"` - Version string `json:"version"` - Kind string `json:"kind"` - DeploymentName string `json:"deploymentName,omitempty"` - ContainerPort int32 `json:"containerPort,omitempty"` - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - Resources []APIResourceReference `json:"resources,omitempty"` - StatusDescriptors []StatusDescriptor `json:"statusDescriptors,omitempty"` - SpecDescriptors []SpecDescriptor `json:"specDescriptors,omitempty"` - ActionDescriptor []ActionDescriptor `json:"actionDescriptors,omitempty"` -} - -// APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes. -// +k8s:openapi-gen=true -type APIResourceReference struct { - // Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource. - Name string `json:"name"` - // Kind of the referenced resource type. - Kind string `json:"kind"` - // API Version of the referenced resource type. - Version string `json:"version"` -} - -// 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) -} - -// WebhookAdmissionType is the type of admission webhooks supported by OLM -type WebhookAdmissionType string - -const ( - // ValidatingAdmissionWebhook is for validating admission webhooks - ValidatingAdmissionWebhook WebhookAdmissionType = "ValidatingAdmissionWebhook" - // MutatingAdmissionWebhook is for mutating admission webhooks - MutatingAdmissionWebhook WebhookAdmissionType = "MutatingAdmissionWebhook" - // ConversionWebhook is for conversion webhooks - ConversionWebhook WebhookAdmissionType = "ConversionWebhook" -) - -// WebhookDescription provides details to OLM about required webhooks -// +k8s:openapi-gen=true -type WebhookDescription struct { - GenerateName string `json:"generateName"` - // +kubebuilder:validation:Enum=ValidatingAdmissionWebhook;MutatingAdmissionWebhook;ConversionWebhook - Type WebhookAdmissionType `json:"type"` - DeploymentName string `json:"deploymentName,omitempty"` - // +kubebuilder:validation:Maximum=65535 - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:default=443 - ContainerPort int32 `json:"containerPort,omitempty"` - TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` - Rules []admissionregistrationv1.RuleWithOperations `json:"rules,omitempty"` - FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"` - MatchPolicy *admissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"` - ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty"` - SideEffects *admissionregistrationv1.SideEffectClass `json:"sideEffects"` - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` - AdmissionReviewVersions []string `json:"admissionReviewVersions"` - ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"` - WebhookPath *string `json:"webhookPath,omitempty"` - ConversionCRDs []string `json:"conversionCRDs,omitempty"` -} - -// GetValidatingWebhook returns a ValidatingWebhook generated from the WebhookDescription -func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.ValidatingWebhook { - return admissionregistrationv1.ValidatingWebhook{ - Name: w.GenerateName, - Rules: w.Rules, - FailurePolicy: w.FailurePolicy, - MatchPolicy: w.MatchPolicy, - NamespaceSelector: namespaceSelector, - ObjectSelector: w.ObjectSelector, - SideEffects: w.SideEffects, - TimeoutSeconds: w.TimeoutSeconds, - AdmissionReviewVersions: w.AdmissionReviewVersions, - ClientConfig: admissionregistrationv1.WebhookClientConfig{ - Service: &admissionregistrationv1.ServiceReference{ - Name: w.DomainName() + "-service", - Namespace: namespace, - Path: w.WebhookPath, - Port: &w.ContainerPort, - }, - CABundle: caBundle, - }, - } -} - -// GetMutatingWebhook returns a MutatingWebhook generated from the WebhookDescription -func (w *WebhookDescription) GetMutatingWebhook(namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.MutatingWebhook { - return admissionregistrationv1.MutatingWebhook{ - Name: w.GenerateName, - Rules: w.Rules, - FailurePolicy: w.FailurePolicy, - MatchPolicy: w.MatchPolicy, - NamespaceSelector: namespaceSelector, - ObjectSelector: w.ObjectSelector, - SideEffects: w.SideEffects, - TimeoutSeconds: w.TimeoutSeconds, - AdmissionReviewVersions: w.AdmissionReviewVersions, - ClientConfig: admissionregistrationv1.WebhookClientConfig{ - Service: &admissionregistrationv1.ServiceReference{ - Name: w.DomainName() + "-service", - Namespace: namespace, - Path: w.WebhookPath, - Port: &w.ContainerPort, - }, - CABundle: caBundle, - }, - ReinvocationPolicy: w.ReinvocationPolicy, - } -} - -// DomainName returns the result of replacing all periods in the given Webhook name with hyphens -func (w *WebhookDescription) DomainName() string { - // Replace all '.'s with "-"s to convert to a DNS-1035 label - return strings.Replace(w.DeploymentName, ".", "-", -1) -} - -// 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. -// +k8s:openapi-gen=true -type CustomResourceDefinitions struct { - Owned []CRDDescription `json:"owned,omitempty"` - Required []CRDDescription `json:"required,omitempty"` -} - -// APIServiceDefinitions declares all of the extension apis managed or required by -// an operator being ran by ClusterServiceVersion. -// +k8s:openapi-gen=true -type APIServiceDefinitions struct { - Owned []APIServiceDescription `json:"owned,omitempty"` - Required []APIServiceDescription `json:"required,omitempty"` -} - -// ClusterServiceVersionSpec declarations tell OLM how to install an operator -// that can manage apps for a given version. -// +k8s:openapi-gen=true -type ClusterServiceVersionSpec struct { - InstallStrategy NamedInstallStrategy `json:"install"` - Version version.OperatorVersion `json:"version,omitempty"` - Maturity string `json:"maturity,omitempty"` - CustomResourceDefinitions CustomResourceDefinitions `json:"customresourcedefinitions,omitempty"` - APIServiceDefinitions APIServiceDefinitions `json:"apiservicedefinitions,omitempty"` - WebhookDefinitions []WebhookDescription `json:"webhookdefinitions,omitempty"` - NativeAPIs []metav1.GroupVersionKind `json:"nativeAPIs,omitempty"` - MinKubeVersion string `json:"minKubeVersion,omitempty"` - - // The name of the operator in display format. - DisplayName string `json:"displayName"` - - // Description of the operator. Can include the features, limitations or use-cases of the - // operator. - // +optional - Description string `json:"description,omitempty"` - - // A list of keywords describing the operator. - // +optional - Keywords []string `json:"keywords,omitempty"` - - // A list of organizational entities maintaining the operator. - // +optional - Maintainers []Maintainer `json:"maintainers,omitempty"` - - // The publishing entity behind the operator. - // +optional - Provider AppLink `json:"provider,omitempty"` - - // A list of links related to the operator. - // +optional - Links []AppLink `json:"links,omitempty"` - - // The icon for this operator. - // +optional - Icon []Icon `json:"icon,omitempty"` - - // InstallModes specify supported installation types - // +optional - InstallModes []InstallMode `json:"installModes,omitempty"` - - // The name of a CSV this one replaces. Should match the `metadata.Name` field of the old CSV. - // +optional - Replaces string `json:"replaces,omitempty"` - - // Map of string keys and values that can be used to organize and categorize - // (scope and select) objects. - // +optional - Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` - - // 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 `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` - - // Label selector for related resources. - // +optional - Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` - - // Cleanup specifies the cleanup behaviour when the CSV gets deleted - // +optional - Cleanup CleanupSpec `json:"cleanup,omitempty"` - - // The name(s) of one or more CSV(s) that should be skipped in the upgrade graph. - // Should match the `metadata.Name` field of the CSV that should be skipped. - // This field is only used during catalog creation and plays no part in cluster runtime. - // +optional - Skips []string `json:"skips,omitempty"` - - // List any related images, or other container images that your Operator might require to perform their functions. - // This list should also include operand images as well. All image references should be specified by - // digest (SHA) and not by tag. This field is only used during catalog creation and plays no part in cluster runtime. - // +optional - RelatedImages []RelatedImage `json:"relatedImages,omitempty"` -} - -// +k8s:openapi-gen=true -type CleanupSpec struct { - Enabled bool `json:"enabled"` -} - -// +k8s:openapi-gen=true -type Maintainer struct { - Name string `json:"name,omitempty"` - Email string `json:"email,omitempty"` -} - -// +k8s:openapi-gen=true -type AppLink struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` -} - -// +k8s:openapi-gen=true -type Icon struct { - Data string `json:"base64data"` - MediaType string `json:"mediatype"` -} - -// +k8s:openapi-gen=true -type RelatedImage struct { - Name string `json:"name"` - Image string `json:"image"` -} - -// 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" - CSVReasonComponentFailedNoRetry ConditionReason = "InstallComponentFailedNoRetry" - 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" - CSVReasonDetectedClusterChange ConditionReason = "DetectedClusterChange" - CSVReasonInvalidWebhookDescription ConditionReason = "InvalidWebhookDescription" - CSVReasonOperatorConditionNotUpgradeable ConditionReason = "OperatorConditionNotUpgradeable" - CSVReasonWaitingForCleanupToComplete ConditionReason = "WaitingOnCleanup" -) - -// HasCaResources returns true if the CSV has owned APIServices or Webhooks. -func (c *ClusterServiceVersion) HasCAResources() bool { - // Return early if there are no owned APIServices - if len(c.Spec.APIServiceDefinitions.Owned)+len(c.Spec.WebhookDefinitions) == 0 { - return false - } - return true -} - -// Conditions appear in the status as a record of state transitions on the ClusterServiceVersion -// +k8s:openapi-gen=true -type ClusterServiceVersionCondition struct { - // Condition of the ClusterServiceVersion - Phase ClusterServiceVersionPhase `json:"phase,omitempty"` - // A human readable message indicating details about why the ClusterServiceVersion is in this condition. - // +optional - Message string `json:"message,omitempty"` - // A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. - // e.g. 'RequirementsNotMet' - // +optional - Reason ConditionReason `json:"reason,omitempty"` - // Last time we updated the status - // +optional - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - // Last time the status transitioned from one status to another. - // +optional - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` -} - -// OwnsCRD determines whether the current CSV owns a particular 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 particular 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) -// +k8s:openapi-gen=true -type DependentStatus struct { - Group string `json:"group"` - Version string `json:"version"` - Kind string `json:"kind"` - Status StatusReason `json:"status"` - UUID string `json:"uuid,omitempty"` - Message string `json:"message,omitempty"` -} - -// +k8s:openapi-gen=true -type RequirementStatus struct { - Group string `json:"group"` - Version string `json:"version"` - Kind string `json:"kind"` - Name string `json:"name"` - Status StatusReason `json:"status"` - Message string `json:"message"` - UUID string `json:"uuid,omitempty"` - Dependents []DependentStatus `json:"dependents,omitempty"` -} - -// ClusterServiceVersionStatus represents information about the status of a CSV. Status may trail the actual -// state of a system. -// +k8s:openapi-gen=true -type ClusterServiceVersionStatus struct { - // Current condition of the ClusterServiceVersion - Phase ClusterServiceVersionPhase `json:"phase,omitempty"` - // A human readable message indicating details about why the ClusterServiceVersion is in this condition. - // +optional - Message string `json:"message,omitempty"` - // A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. - // e.g. 'RequirementsNotMet' - // +optional - Reason ConditionReason `json:"reason,omitempty"` - // Last time we updated the status - // +optional - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - // Last time the status transitioned from one status to another. - // +optional - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` - // List of conditions, a history of state transitions - Conditions []ClusterServiceVersionCondition `json:"conditions,omitempty"` - // The status of each requirement for this CSV - RequirementStatus []RequirementStatus `json:"requirementStatus,omitempty"` - // Last time the owned APIService certs were updated - // +optional - CertsLastUpdated *metav1.Time `json:"certsLastUpdated,omitempty"` - // Time the owned APIService certs will rotate next - // +optional - CertsRotateAt *metav1.Time `json:"certsRotateAt,omitempty"` - // CleanupStatus represents information about the status of cleanup while a CSV is pending deletion - // +optional - Cleanup CleanupStatus `json:"cleanup,omitempty"` -} - -// CleanupStatus represents information about the status of cleanup while a CSV is pending deletion -// +k8s:openapi-gen=true -type CleanupStatus struct { - // PendingDeletion is the list of custom resource objects that are pending deletion and blocked on finalizers. - // This indicates the progress of cleanup that is blocking CSV deletion or operator uninstall. - // +optional - PendingDeletion []ResourceList `json:"pendingDeletion,omitempty"` -} - -// ResourceList represents a list of resources which are of the same Group/Kind -// +k8s:openapi-gen=true -type ResourceList struct { - Group string `json:"group"` - Kind string `json:"kind"` - Instances []ResourceInstance `json:"instances"` -} - -// +k8s:openapi-gen=true -type ResourceInstance struct { - Name string `json:"name"` - // Namespace can be empty for cluster-scoped resources - Namespace string `json:"namespace,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient -// +kubebuilder:storageversion -// +kubebuilder:resource:shortName={csv, csvs},categories=olm -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Display",type=string,JSONPath=`.spec.displayName`,description="The name of the CSV" -// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`,description="The version of the CSV" -// +kubebuilder:printcolumn:name="Replaces",type=string,JSONPath=`.spec.replaces`,description="The name of a CSV that this one replaces" -// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` - -// ClusterServiceVersion is a Custom Resource of type `ClusterServiceVersionSpec`. -type ClusterServiceVersion struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec ClusterServiceVersionSpec `json:"spec"` - // +optional - Status ClusterServiceVersionStatus `json:"status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterServiceVersionList represents a list of ClusterServiceVersions. -type ClusterServiceVersionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []ClusterServiceVersion `json:"items"` -} - -// 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/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/doc.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/doc.go deleted file mode 100644 index 74bc9b819a40..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// +groupName=operators.coreos.com -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators - -// Package v1alpha1 contains resources types for version v1alpha1 of the operators.coreos.com API group. -package v1alpha1 diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/installplan_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/installplan_types.go deleted file mode 100644 index 3b1b0feedf6e..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/installplan_types.go +++ /dev/null @@ -1,391 +0,0 @@ -package v1alpha1 - -import ( - "errors" - "fmt" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - InstallPlanKind = "InstallPlan" - InstallPlanAPIVersion = GroupName + "/" + GroupVersion -) - -// Approval is the user approval policy for an InstallPlan. -// It must be one of "Automatic" or "Manual". -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 `json:"source,omitempty"` - CatalogSourceNamespace string `json:"sourceNamespace,omitempty"` - ClusterServiceVersionNames []string `json:"clusterServiceVersionNames"` - Approval Approval `json:"approval"` - Approved bool `json:"approved"` - Generation int `json:"generation,omitempty"` -} - -// 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" - StepStatusNotCreated StepStatus = "NotCreated" - 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 `json:"phase"` - Conditions []InstallPlanCondition `json:"conditions,omitempty"` - CatalogSources []string `json:"catalogSources"` - Plan []*Step `json:"plan,omitempty"` - // BundleLookups is the set of in-progress requests to pull and unpackage bundle content to the cluster. - // +optional - BundleLookups []BundleLookup `json:"bundleLookups,omitempty"` - // AttenuatedServiceAccountRef references the service account that is used - // to do scoped operator install. - AttenuatedServiceAccountRef *corev1.ObjectReference `json:"attenuatedServiceAccountRef,omitempty"` - - // StartTime is the time when the controller began applying - // the resources listed in the plan to the cluster. - // +optional - StartTime *metav1.Time `json:"startTime,omitempty"` - - // Message is a human-readable message containing detailed - // information that may be important to understanding why the - // plan has its current status. - // +optional - Message string `json:"message,omitempty"` -} - -// InstallPlanCondition represents the overall status of the execution of -// an InstallPlan. -type InstallPlanCondition struct { - Type InstallPlanConditionType `json:"type,omitempty"` - Status corev1.ConditionStatus `json:"status,omitempty"` // True, False, or Unknown - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` - Reason InstallPlanConditionReason `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// 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 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 -} -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 `json:"resolving"` - Resource StepResource `json:"resource"` - Optional bool `json:"optional,omitempty"` - Status StepStatus `json:"status"` -} - -// 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" - - // BundleLookupFailed describes conditions types for when BundleLookups fail - BundleLookupFailed BundleLookupConditionType = "BundleLookupFailed" - - crdKind = "CustomResourceDefinition" -) - -type BundleLookupCondition struct { - // Type of condition. - Type BundleLookupConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status corev1.ConditionStatus `json:"status"` - // The reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty"` - // A human readable message indicating details about the transition. - // +optional - Message string `json:"message,omitempty"` - // Last time the condition was probed. - // +optional - LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"` - // Last time the condition transitioned from one status to another. - // +optional - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` -} - -// 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 `json:"path"` - // Identifier is the catalog-unique name of the operator (the name of the CSV for bundles that contain CSVs) - Identifier string `json:"identifier"` - // Replaces is the name of the bundle to replace with the one found at Path. - Replaces string `json:"replaces"` - // CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from. - CatalogSourceRef *corev1.ObjectReference `json:"catalogSourceRef"` - // Conditions represents the overall state of a BundleLookup. - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - Conditions []BundleLookupCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` - // The effective properties of the unpacked bundle. - // +optional - Properties string `json:"properties,omitempty"` -} - -// 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 (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 `json:"sourceName"` - CatalogSourceNamespace string `json:"sourceNamespace"` - Group string `json:"group"` - Version string `json:"version"` - Kind string `json:"kind"` - Name string `json:"name"` - Manifest string `json:"manifest,omitempty"` -} - -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 -// +kubebuilder:resource:shortName=ip,categories=olm -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="CSV",type=string,JSONPath=`.spec.clusterServiceVersionNames[0]`,description="The first CSV in the list of clusterServiceVersionNames" -// +kubebuilder:printcolumn:name="Approval",type=string,JSONPath=`.spec.approval`,description="The approval mode" -// +kubebuilder:printcolumn:name="Approved",type=boolean,JSONPath=`.spec.approved` - -// InstallPlan defines the installation of a set of operators. -type InstallPlan struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec InstallPlanSpec `json:"spec"` - // +optional - Status InstallPlanStatus `json:"status"` -} - -// 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 `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []InstallPlan `json:"items"` -} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/register.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/register.go deleted file mode 100644 index f1cd86f1a372..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/register.go +++ /dev/null @@ -1,55 +0,0 @@ -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - - "github.com/operator-framework/api/pkg/operators" -) - -const ( - // GroupName is the group name used in this package. - GroupName = operators.GroupName - // GroupVersion is the group version used in this package. - GroupVersion = "v1alpha1" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// 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 - - // localSchemeBuilder is expected by generated conversion functions - localSchemeBuilder = &SchemeBuilder -) - -// 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{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/subscription_types.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/subscription_types.go deleted file mode 100644 index 7aa854f596e5..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/subscription_types.go +++ /dev/null @@ -1,362 +0,0 @@ -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -const ( - SubscriptionKind = "Subscription" - SubscriptionCRDAPIVersion = GroupName + "/" + GroupVersion -) - -// 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 `json:"source"` - CatalogSourceNamespace string `json:"sourceNamespace"` - Package string `json:"name"` - Channel string `json:"channel,omitempty"` - StartingCSV string `json:"startingCSV,omitempty"` - InstallPlanApproval Approval `json:"installPlanApproval,omitempty"` - Config *SubscriptionConfig `json:"config,omitempty"` -} - -// SubscriptionConfig contains configuration specified for a subscription. -type SubscriptionConfig struct { - // Selector is the label selector for pods to be configured. - // 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"` - - // Tolerations are the pod's tolerations. - // +optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` - - // Resources represents compute resources required by this container. - // Immutable. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - Resources *corev1.ResourceRequirements `json:"resources,omitempty"` - - // EnvFrom is a 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. - // Immutable. - // +optional - EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"` - // Env is a list of environment variables to set in the container. - // Cannot be updated. - // +patchMergeKey=name - // +patchStrategy=merge - // +optional - Env []corev1.EnvVar `json:"env,omitempty" patchMergeKey:"name" patchStrategy:"merge"` - - // 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"` - - // If specified, overrides the pod's scheduling constraints. - // nil sub-attributes will *not* override the original values in the pod.spec for those sub-attributes. - // Use empty object ({}) to erase original sub-attribute values. - // +optional - Affinity *corev1.Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"` - - // Annotations is an unstructured key value map stored with each Deployment, Pod, APIService in the Operator. - // Typically, annotations may be set by external tools to store and retrieve arbitrary metadata. - // Use this field to pre-define annotations that OLM should add to each of the Subscription's - // deployments, pods, and apiservices. - // +optional - Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` -} - -// 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" - - // SubscriptionResolutionFailed indicates that the dependency resolution in the namespace in which the subscription is created has failed - SubscriptionResolutionFailed SubscriptionConditionType = "ResolutionFailed" - - // SubscriptionBundleUnpacking indicates that the unpack job is currently running - SubscriptionBundleUnpacking SubscriptionConditionType = "BundleUnpacking" - - // SubscriptionBundleUnpackFailed indicates that the unpack job failed - SubscriptionBundleUnpackFailed SubscriptionConditionType = "BundleUnpackFailed" - - // SubscriptionDeprecated is a roll-up condition which indicates that the Operator currently installed with this Subscription - //has been deprecated. It will be present when any of the three deprecation types (Package, Channel, Bundle) are present. - SubscriptionDeprecated SubscriptionConditionType = "Deprecated" - - // SubscriptionOperatorDeprecated indicates that the Package currently installed with this Subscription has been deprecated. - SubscriptionPackageDeprecated SubscriptionConditionType = "PackageDeprecated" - - // SubscriptionOperatorDeprecated indicates that the Channel used with this Subscription has been deprecated. - SubscriptionChannelDeprecated SubscriptionConditionType = "ChannelDeprecated" - - // SubscriptionOperatorDeprecated indicates that the Bundle currently installed with this Subscription has been deprecated. - SubscriptionBundleDeprecated SubscriptionConditionType = "BundleDeprecated" -) - -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 `json:"type" description:"type of Subscription condition"` - - // Status is the status of the condition, one of True, False, Unknown. - Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` - - // Reason is a one-word CamelCase reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"` - - // Message is a human-readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"` - - // LastHeartbeatTime is the last time we got an update on a given condition - // +optional - LastHeartbeatTime *metav1.Time `json:"lastHeartbeatTime,omitempty" description:"last time we got an update on a given condition"` - - // LastTransitionTime is the last time the condition transit from one status to another - // +optional - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another" hash:"ignore"` -} - -// 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 `json:"currentCSV,omitempty"` - - // InstalledCSV is the CSV currently installed by the Subscription. - // +optional - InstalledCSV string `json:"installedCSV,omitempty"` - - // Install is a reference to the latest InstallPlan generated for the Subscription. - // DEPRECATED: InstallPlanRef - // +optional - Install *InstallPlanReference `json:"installplan,omitempty"` - - // State represents the current state of the Subscription - // +optional - State SubscriptionState `json:"state,omitempty"` - - // Reason is the reason the Subscription was transitioned to its current state. - // +optional - Reason ConditionReason `json:"reason,omitempty"` - - // InstallPlanGeneration is the current generation of the installplan - // +optional - InstallPlanGeneration int `json:"installPlanGeneration,omitempty"` - - // InstallPlanRef is a reference to the latest InstallPlan that contains the Subscription's current CSV. - // +optional - InstallPlanRef *corev1.ObjectReference `json:"installPlanRef,omitempty"` - - // CatalogHealth contains the Subscription's view of its relevant CatalogSources' status. - // It is used to determine SubscriptionStatusConditions related to CatalogSources. - // +optional - // +patchMergeKey= - // +patchStrategy=merge - CatalogHealth []SubscriptionCatalogHealth `json:"catalogHealth,omitempty"` - - // Conditions is a list of the latest available observations about a Subscription's current state. - // +optional - Conditions []SubscriptionCondition `json:"conditions,omitempty" hash:"set"` - - // LastUpdated represents the last time that the Subscription status was updated. - LastUpdated metav1.Time `json:"lastUpdated"` -} - -// 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 `json:"apiVersion"` - Kind string `json:"kind"` - Name string `json:"name"` - UID types.UID `json:"uuid"` -} - -// SubscriptionCatalogHealth describes the health of a CatalogSource the Subscription knows about. -type SubscriptionCatalogHealth struct { - // CatalogSourceRef is a reference to a CatalogSource. - CatalogSourceRef *corev1.ObjectReference `json:"catalogSourceRef"` - - // LastUpdated represents the last time that the CatalogSourceHealth changed - LastUpdated *metav1.Time `json:"lastUpdated"` - - // Healthy is true if the CatalogSource is healthy; false otherwise. - Healthy bool `json:"healthy"` -} - -// 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 -// +kubebuilder:resource:shortName={sub, subs},categories=olm -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Package",type=string,JSONPath=`.spec.name`,description="The package subscribed to" -// +kubebuilder:printcolumn:name="Source",type=string,JSONPath=`.spec.source`,description="The catalog source for the specified package" -// +kubebuilder:printcolumn:name="Channel",type=string,JSONPath=`.spec.channel`,description="The channel of updates to subscribe to" - -// Subscription keeps operators up to date by tracking changes to Catalogs. -type Subscription struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - Spec *SubscriptionSpec `json:"spec"` - // +optional - Status SubscriptionStatus `json:"status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// SubscriptionList is a list of Subscription resources. -type SubscriptionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Subscription `json:"items"` -} - -// 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/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 684a7432a6e5..000000000000 --- a/vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,1632 +0,0 @@ -//go: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 v1alpha1 - -import ( - "encoding/json" - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *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(v1.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.GrpcPodConfig != nil { - in, out := &in.GrpcPodConfig, &out.GrpcPodConfig - *out = new(GrpcPodConfig) - (*in).DeepCopyInto(*out) - } - 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.LatestImageRegistryPoll != nil { - in, out := &in.LatestImageRegistryPoll, &out.LatestImageRegistryPoll - *out = (*in).DeepCopy() - } - 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.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new 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 *CleanupSpec) DeepCopyInto(out *CleanupSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupSpec. -func (in *CleanupSpec) DeepCopy() *CleanupSpec { - if in == nil { - return nil - } - out := new(CleanupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CleanupStatus) DeepCopyInto(out *CleanupStatus) { - *out = *in - if in.PendingDeletion != nil { - in, out := &in.PendingDeletion, &out.PendingDeletion - *out = make([]ResourceList, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CleanupStatus. -func (in *CleanupStatus) DeepCopy() *CleanupStatus { - if in == nil { - return nil - } - out := new(CleanupStatus) - 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.WebhookDefinitions != nil { - in, out := &in.WebhookDefinitions, &out.WebhookDefinitions - *out = make([]WebhookDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.NativeAPIs != nil { - in, out := &in.NativeAPIs, &out.NativeAPIs - *out = make([]metav1.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(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - out.Cleanup = in.Cleanup - if in.Skips != nil { - in, out := &in.Skips, &out.Skips - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.RelatedImages != nil { - in, out := &in.RelatedImages, &out.RelatedImages - *out = make([]RelatedImage, len(*in)) - copy(*out, *in) - } -} - -// 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() - } - in.Cleanup.DeepCopyInto(&out.Cleanup) -} - -// 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 *ExtractContentConfig) DeepCopyInto(out *ExtractContentConfig) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtractContentConfig. -func (in *ExtractContentConfig) DeepCopy() *ExtractContentConfig { - if in == nil { - return nil - } - out := new(ExtractContentConfig) - 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 *GrpcPodConfig) DeepCopyInto(out *GrpcPodConfig) { - *out = *in - 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([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - *out = new(v1.Affinity) - (*in).DeepCopyInto(*out) - } - if in.PriorityClassName != nil { - in, out := &in.PriorityClassName, &out.PriorityClassName - *out = new(string) - **out = **in - } - if in.MemoryTarget != nil { - in, out := &in.MemoryTarget, &out.MemoryTarget - x := (*in).DeepCopy() - *out = &x - } - if in.ExtractContent != nil { - in, out := &in.ExtractContent, &out.ExtractContent - *out = new(ExtractContentConfig) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcPodConfig. -func (in *GrpcPodConfig) DeepCopy() *GrpcPodConfig { - if in == nil { - return nil - } - out := new(GrpcPodConfig) - 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(v1.ObjectReference) - **out = **in - } - if in.StartTime != nil { - in, out := &in.StartTime, &out.StartTime - *out = (*in).DeepCopy() - } -} - -// 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 *RegistryPoll) DeepCopyInto(out *RegistryPoll) { - *out = *in - if in.Interval != nil { - in, out := &in.Interval, &out.Interval - *out = new(metav1.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 *RelatedImage) DeepCopyInto(out *RelatedImage) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RelatedImage. -func (in *RelatedImage) DeepCopy() *RelatedImage { - if in == nil { - return nil - } - out := new(RelatedImage) - 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 *ResourceInstance) DeepCopyInto(out *ResourceInstance) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceInstance. -func (in *ResourceInstance) DeepCopy() *ResourceInstance { - if in == nil { - return nil - } - out := new(ResourceInstance) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceList) DeepCopyInto(out *ResourceList) { - *out = *in - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]ResourceInstance, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceList. -func (in *ResourceList) DeepCopy() *ResourceList { - if in == nil { - return nil - } - out := new(ResourceList) - 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) - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = make(labels.Set, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// 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(v1.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(metav1.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([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = new(v1.ResourceRequirements) - (*in).DeepCopyInto(*out) - } - if in.EnvFrom != nil { - in, out := &in.EnvFrom, &out.EnvFrom - *out = make([]v1.EnvFromSource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]v1.EnvVar, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]v1.Volume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]v1.VolumeMount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - *out = new(v1.Affinity) - (*in).DeepCopyInto(*out) - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new 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 - if in.Config != nil { - in, out := &in.Config, &out.Config - *out = new(SubscriptionConfig) - (*in).DeepCopyInto(*out) - } -} - -// 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(v1.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 -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookDescription) DeepCopyInto(out *WebhookDescription) { - *out = *in - if in.TargetPort != nil { - in, out := &in.TargetPort, &out.TargetPort - *out = new(intstr.IntOrString) - **out = **in - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]admissionregistrationv1.RuleWithOperations, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.FailurePolicy != nil { - in, out := &in.FailurePolicy, &out.FailurePolicy - *out = new(admissionregistrationv1.FailurePolicyType) - **out = **in - } - if in.MatchPolicy != nil { - in, out := &in.MatchPolicy, &out.MatchPolicy - *out = new(admissionregistrationv1.MatchPolicyType) - **out = **in - } - if in.ObjectSelector != nil { - in, out := &in.ObjectSelector, &out.ObjectSelector - *out = new(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.SideEffects != nil { - in, out := &in.SideEffects, &out.SideEffects - *out = new(admissionregistrationv1.SideEffectClass) - **out = **in - } - if in.TimeoutSeconds != nil { - in, out := &in.TimeoutSeconds, &out.TimeoutSeconds - *out = new(int32) - **out = **in - } - if in.AdmissionReviewVersions != nil { - in, out := &in.AdmissionReviewVersions, &out.AdmissionReviewVersions - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ReinvocationPolicy != nil { - in, out := &in.ReinvocationPolicy, &out.ReinvocationPolicy - *out = new(admissionregistrationv1.ReinvocationPolicyType) - **out = **in - } - if in.WebhookPath != nil { - in, out := &in.WebhookPath, &out.WebhookPath - *out = new(string) - **out = **in - } - if in.ConversionCRDs != nil { - in, out := &in.ConversionCRDs, &out.ConversionCRDs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookDescription. -func (in *WebhookDescription) DeepCopy() *WebhookDescription { - if in == nil { - return nil - } - out := new(WebhookDescription) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/modules.txt b/vendor/modules.txt index bf211d78397b..4c6683785f1b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1765,11 +1765,6 @@ github.com/openshift/library-go/test/library/metrics github.com/opentracing/opentracing-go github.com/opentracing/opentracing-go/ext github.com/opentracing/opentracing-go/log -# github.com/operator-framework/api v0.36.0 -## explicit; go 1.24.6 -github.com/operator-framework/api/pkg/lib/version -github.com/operator-framework/api/pkg/operators -github.com/operator-framework/api/pkg/operators/v1alpha1 # github.com/ovn-org/ovn-kubernetes/go-controller v0.0.0-20250118001652-a8b9c3c31417 ## explicit; go 1.22.0 github.com/ovn-org/ovn-kubernetes/go-controller/pkg/crd/routeadvertisements/v1