From 47ab2f722eafef6a292bce499cde130d303f11dc Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Tue, 1 Oct 2024 16:38:37 +0200 Subject: [PATCH] First stab at doc hierarchy Signed-off-by: Per Goncalves da Silva --- README.md | 4 +- api/v1alpha1/clusterextension_types.go | 22 ++++----- ...peratorframework.io_clusterextensions.yaml | 4 +- config/samples/catalogd_operatorcatalog.yaml | 2 +- .../catalogd-api-reference.md | 0 .../crd-ref-docs-gen-config.yaml | 0 .../operator-controller-api-reference.md | 0 docs/contribute/contributing.md | 1 + docs/{general => contribute}/developer.md | 0 docs/index.md | 7 +++ .../olmv1_architecture.md} | 3 +- .../olmv1_design_decisions.md | 0 .../olmv1_getting_started.md | 2 +- docs/{general => overview}/olmv1_overview.md | 30 ++++++------ docs/{general => overview}/olmv1_roadmap.md | 0 docs/refs/controlling-catalog-selection.md | 14 +++--- .../derive-service-account.md} | 3 +- .../how-to-channel-based-upgrades.md | 2 +- .../upgrade => refs}/how-to-pin-version.md | 4 +- .../how-to-version-range-upgrades.md | 4 +- .../how-to-z-stream-upgrades.md | 4 +- docs/refs/single-owner-objects.md | 2 +- docs/refs/supported-extensions.md | 2 +- .../upgrade => refs}/upgrade-support.md | 0 .../adding-a-catalog.md => add-a-catalog.md} | 2 +- ...an-extension.md => downgrade-extension.md} | 1 - .../explore-available-content.md} | 6 +-- ...g-an-extension.md => install-extension.md} | 17 ++++++- .../installation/provided-serviceaccount.md | 31 ------------- ...an-extension.md => uninstall-extension.md} | 2 +- ...g-an-extension.md => upgrade-extension.md} | 12 ++--- hack/test/build-push-e2e-catalog.sh | 4 +- hack/tools/catalogs/download-catalog | 4 +- hack/tools/catalogs/lib/rbac.sh | 2 +- internal/catalogmetadata/cache/cache.go | 24 +++++----- internal/catalogmetadata/cache/cache_test.go | 36 +++++++-------- internal/catalogmetadata/client/client.go | 14 +++--- .../catalogmetadata/client/client_test.go | 6 +-- .../catalogmetadata/filter/successors_test.go | 6 +-- .../clustercatalog_controller_test.go | 8 ++-- .../clusterextension_admission_test.go | 14 +++--- .../clusterextension_controller.go | 10 ++-- internal/resolve/catalog.go | 6 +-- internal/resolve/catalog_test.go | 18 ++++---- internal/resolve/validation_test.go | 22 ++++----- mkdocs.yml | 46 +++++++++++++------ test/e2e/cluster_extension_install_test.go | 40 ++++++++-------- test/e2e/e2e_suite_test.go | 12 ++--- .../extension_developer_test.go | 2 +- test/extension-developer-e2e/setup.sh | 10 ++-- 50 files changed, 236 insertions(+), 229 deletions(-) rename docs/{refs/api => api-reference}/catalogd-api-reference.md (100%) rename docs/{refs/api => api-reference}/crd-ref-docs-gen-config.yaml (100%) rename docs/{refs/api => api-reference}/operator-controller-api-reference.md (100%) create mode 120000 docs/contribute/contributing.md rename docs/{general => contribute}/developer.md (100%) create mode 100644 docs/index.md rename docs/{general/architecture.md => overview/olmv1_architecture.md} (99%) rename docs/{general => overview}/olmv1_design_decisions.md (100%) rename docs/{general => overview}/olmv1_getting_started.md (98%) rename docs/{general => overview}/olmv1_overview.md (79%) rename docs/{general => overview}/olmv1_roadmap.md (100%) rename docs/{drafts/derive-serviceaccount.md => refs/derive-service-account.md} (99%) rename docs/{tasks/upgrade => refs}/how-to-channel-based-upgrades.md (96%) rename docs/{tasks/upgrade => refs}/how-to-pin-version.md (86%) rename docs/{tasks/upgrade => refs}/how-to-version-range-upgrades.md (90%) rename docs/{tasks/upgrade => refs}/how-to-z-stream-upgrades.md (89%) rename docs/{tasks/upgrade => refs}/upgrade-support.md (100%) rename docs/tasks/{catalog/adding-a-catalog.md => add-a-catalog.md} (99%) rename docs/tasks/{downgrade/downgrading-an-extension.md => downgrade-extension.md} (99%) rename docs/{refs/exploring-available-packages.md => tasks/explore-available-content.md} (96%) rename docs/tasks/{installation/installing-an-extension.md => install-extension.md} (82%) delete mode 100644 docs/tasks/installation/provided-serviceaccount.md rename docs/tasks/{uninstallation/uninstalling-an-extension.md => uninstall-extension.md} (97%) rename docs/tasks/{upgrade/upgrading-an-extension.md => upgrade-extension.md} (94%) diff --git a/README.md b/README.md index 83aed5f0b..2324e3bd2 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ OLM v1 consists of two different components: * operator-controller (this repository) * [catalogd](https://github.com/operator-framework/catalogd) -For a more complete overview of OLM v1 and how it differs from OLM v0, see our [overview](docs/general/olmv1_design_decisions.md). +For a more complete overview of OLM v1 and how it differs from OLM v0, see our [overview](docs/overview/olmv1_design_decisions.md). ## Getting Started -To get started with OLM v1, please see our [Getting Started](docs/general/olmv1_getting_started.md) documentation. +To get started with OLM v1, please see our [Getting Started](docs/overview/olmv1_getting_started.md) documentation. ## License diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index b68f7f2a7..8d7463878 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -49,13 +49,13 @@ type ClusterExtensionSpec struct { // for this ClusterExtension. Selection is performed by setting the sourceType. // // Catalog is currently the only implemented sourceType, and setting the - // sourcetype to "Catalog" requires the catalog field to also be defined. + // sourcetype to "Catalog" requires the content-management field to also be defined. // // Below is a minimal example of a source definition (in yaml): // // source: // sourceType: Catalog - // catalog: + // content-management: // packageName: example-package // Source SourceConfig `json:"source"` @@ -76,7 +76,7 @@ const SourceTypeCatalog = "Catalog" // SourceConfig is a discriminated union which selects the installation source. // +union -// +kubebuilder:validation:XValidation:rule="self.sourceType == 'Catalog' && has(self.catalog)",message="sourceType Catalog requires catalog field" +// +kubebuilder:validation:XValidation:rule="self.sourceType == 'Catalog' && has(self.content-management)",message="sourceType Catalog requires content-management field" type SourceConfig struct { // sourceType is a required reference to the type of install source. // @@ -84,17 +84,17 @@ type SourceConfig struct { // // When this field is set to "Catalog", information for determining the appropriate // bundle of content to install will be fetched from ClusterCatalog resources existing - // on the cluster. When using the Catalog sourceType, the catalog field must also be set. + // on the cluster. When using the Catalog sourceType, the content-management field must also be set. // // +unionDiscriminator // +kubebuilder:validation:Enum:="Catalog" SourceType string `json:"sourceType"` - // catalog is used to configure how information is sourced from a catalog. This field must be defined when sourceType is set to "Catalog", + // content-management is used to configure how information is sourced from a content-management. This field must be defined when sourceType is set to "Catalog", // and must be the only field defined for this sourceType. // // +optional. - Catalog *CatalogSource `json:"catalog,omitempty"` + Catalog *CatalogSource `json:"content-management,omitempty"` } // ClusterExtensionInstallConfig is a union which selects the clusterExtension installation config. @@ -152,7 +152,7 @@ type ClusterExtensionInstallConfig struct { Preflight *PreflightConfig `json:"preflight,omitempty"` } -// CatalogSource defines the required fields for catalog source. +// CatalogSource defines the required fields for content-management source. type CatalogSource struct { // packageName is a reference to the name of the package to be installed // and is used to filter the content from catalogs. @@ -319,7 +319,7 @@ type CatalogSource struct { Selector metav1.LabelSelector `json:"selector,omitempty"` // upgradeConstraintPolicy is an optional field that controls whether - // the upgrade path(s) defined in the catalog are enforced for the package + // the upgrade path(s) defined in the content-management are enforced for the package // referenced in the packageName field. // // Allowed values are: ["CatalogProvided", "SelfCertified"]. @@ -484,10 +484,10 @@ type ClusterExtensionStatus struct { // - "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec // - "Unpacked", represents whether or not the bundle contents have been successfully unpacked // - // When the ClusterExtension is sourced from a catalog, the following conditions are also possible: + // When the ClusterExtension is sourced from a content-management, the following conditions are also possible: // - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types - // - "PackageDeprecated", represents whether or not the package specified in the spec.source.catalog.packageName field has been deprecated - // - "ChannelDeprecated", represents whether or not any channel specified in spec.source.catalog.channels has been deprecated + // - "PackageDeprecated", represents whether or not the package specified in the spec.source.content-management.packageName field has been deprecated + // - "ChannelDeprecated", represents whether or not any channel specified in spec.source.content-management.channels has been deprecated // - "BundleDeprecated", represents whether or not the installed bundle is deprecated // // The current set of reasons are: diff --git a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml index f24871f00..3f95f95c5 100644 --- a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml +++ b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml @@ -454,8 +454,8 @@ spec: - sourceType type: object x-kubernetes-validations: - - message: sourceType Catalog requires catalog field - rule: self.sourceType == 'Catalog' && has(self.catalog) + - message: sourceType Catalog requires content-management field + rule: self.sourceType == 'Catalog' && has(self.content-management) required: - install - source diff --git a/config/samples/catalogd_operatorcatalog.yaml b/config/samples/catalogd_operatorcatalog.yaml index 5965edeb1..56c7d400c 100644 --- a/config/samples/catalogd_operatorcatalog.yaml +++ b/config/samples/catalogd_operatorcatalog.yaml @@ -6,5 +6,5 @@ spec: source: type: image image: - ref: quay.io/operatorhubio/catalog:latest + ref: quay.io/operatorhubio/content-management:latest pollInterval: 10m diff --git a/docs/refs/api/catalogd-api-reference.md b/docs/api-reference/catalogd-api-reference.md similarity index 100% rename from docs/refs/api/catalogd-api-reference.md rename to docs/api-reference/catalogd-api-reference.md diff --git a/docs/refs/api/crd-ref-docs-gen-config.yaml b/docs/api-reference/crd-ref-docs-gen-config.yaml similarity index 100% rename from docs/refs/api/crd-ref-docs-gen-config.yaml rename to docs/api-reference/crd-ref-docs-gen-config.yaml diff --git a/docs/refs/api/operator-controller-api-reference.md b/docs/api-reference/operator-controller-api-reference.md similarity index 100% rename from docs/refs/api/operator-controller-api-reference.md rename to docs/api-reference/operator-controller-api-reference.md diff --git a/docs/contribute/contributing.md b/docs/contribute/contributing.md new file mode 120000 index 000000000..f939e75f2 --- /dev/null +++ b/docs/contribute/contributing.md @@ -0,0 +1 @@ +../../CONTRIBUTING.md \ No newline at end of file diff --git a/docs/general/developer.md b/docs/contribute/developer.md similarity index 100% rename from docs/general/developer.md rename to docs/contribute/developer.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..87fbe9474 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,7 @@ +--- +hide: + - navigation + - toc +--- + +Something nice diff --git a/docs/general/architecture.md b/docs/overview/olmv1_architecture.md similarity index 99% rename from docs/general/architecture.md rename to docs/overview/olmv1_architecture.md index 5be36f9af..bc52dee15 100644 --- a/docs/general/architecture.md +++ b/docs/overview/olmv1_architecture.md @@ -1,5 +1,4 @@ - -## OLM V1 Architecture +# OLM V1 Architecture This document describes the OLM v1 architecture. OLM v1 consists of two main components: diff --git a/docs/general/olmv1_design_decisions.md b/docs/overview/olmv1_design_decisions.md similarity index 100% rename from docs/general/olmv1_design_decisions.md rename to docs/overview/olmv1_design_decisions.md diff --git a/docs/general/olmv1_getting_started.md b/docs/overview/olmv1_getting_started.md similarity index 98% rename from docs/general/olmv1_getting_started.md rename to docs/overview/olmv1_getting_started.md index 3f05620b6..2c1fa5242 100644 --- a/docs/general/olmv1_getting_started.md +++ b/docs/overview/olmv1_getting_started.md @@ -80,7 +80,7 @@ and on the extension upgrade process [here](./docs/drafts/Tasks/upgrading-an-ext ```bash # Update to v0.11.0 -kubectl patch clusterextension argocd --type='merge' -p '{"spec": {"source": {"catalog": {"version": "0.11.0"}}}}' +kubectl patch clusterextension argocd --type='merge' -p '{"spec": {"source": {"content-management": {"version": "0.11.0"}}}}' ``` diff --git a/docs/general/olmv1_overview.md b/docs/overview/olmv1_overview.md similarity index 79% rename from docs/general/olmv1_overview.md rename to docs/overview/olmv1_overview.md index ca3928973..54d5441da 100644 --- a/docs/general/olmv1_overview.md +++ b/docs/overview/olmv1_overview.md @@ -1,15 +1,13 @@ -# Overview +# What is Operator Lifecycle Manager (OLM)? -## What is Operator Lifecycle Manager (OLM)? - -Operator Lifecycle Manager (OLM) is an open-source [CNCF](https://www.cncf.io/) project with the mission to manage the -lifecycle of cluster extensions centrally and declaratively on Kubernetes clusters. Its purpose is to make installing, +Operator Lifecycle Manager (OLM) is an open-source [CNCF](https://www.cncf.io/) project with the mission to manage the +lifecycle of cluster extensions centrally and declaratively on Kubernetes clusters. Its purpose is to make installing, running, and updating functional extensions to the cluster easy, safe, and reproducible for cluster administrators and PaaS administrators. -Previously, OLM was focused on a particular type of cluster extension: [Operators](https://operatorhub.io/what-is-an-operator#:~:text=is%20an%20Operator-,What%20is%20an%20Operator%20after%20all%3F,or%20automation%20software%20like%20Ansible.). +Previously, OLM was focused on a particular type of cluster extension: [Operators](https://operatorhub.io/what-is-an-operator#:~:text=is%20an%20Operator-,What%20is%20an%20Operator%20after%20all%3F,or%20automation%20software%20like%20Ansible.). Operators are a method of packaging, deploying, and managing a Kubernetes application. An Operator is composed of one or more controllers paired with one or both of the following objects: -* One or more API extensions +* One or more API extensions * One or more [CustomResourceDefinitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) (CRDs). OLM helped define lifecycles for these extensions: from packaging and distribution to installation, configuration, upgrade, and removal. @@ -27,7 +25,7 @@ is a popular destination for discovering Operators, and boasts over 300 packages ## Why are we building OLM v1? OLM v0 has been in production for over 5 years, and the community to leverage this experience and question the initial -goals and assumptions of the project. OLM v1 is a complete redesign and rewrite of OLM taking into account this accumulated experience. +goals and assumptions of the project. OLM v1 is a complete redesign and rewrite of OLM taking into account this accumulated experience. Compared to its predecessor, amongst other things, OLM v1 aims to provide: * A simpler API surface and mental model @@ -37,19 +35,19 @@ Compared to its predecessor, amongst other things, OLM v1 aims to provide: * Helm Chart support * GitOps support -To learn more about where v1 one came from, and where it's going, please see [The Road to v1: Multi-Tenancy Challenges, Lessons Learned, and Design Shifts](olmv1_design_decisions.md) -and our feature [Roadmap](olmv1_roadmap.md). +To learn more about where v1 one came from, and where it's going, please see [The Road to v1: Multi-Tenancy Challenges, Lessons Learned, and Design Shifts](overview/olmv1_design_decisions.md) +and our feature [Roadmap](overview/olmv1_roadmap.md). ## The OLM community -In this next iteration of OLM, the community has also taken care to make it as contributor-friendly as possible, and welcomes new contributors. -The project is tracked in a [GitHub project](https://github.com/orgs/operator-framework/projects/8/), +In this next iteration of OLM, the community has also taken care to make it as contributor-friendly as possible, and welcomes new contributors. +The project is tracked in a [GitHub project](https://github.com/orgs/operator-framework/projects/8/), which provides a great entry point to quickly find something interesting to work on and contribute. You can reach out to the OLM community for feedbacks/discussions/contributions in the following channels: - * Kubernetes Slack channel: [#olm-dev](https://kubernetes.slack.com/messages/olm-dev) - * [Operator Framework on Google Groups](https://groups.google.com/forum/#!forum/operator-framework) - * Weekly in-person Working Group meeting: [olm-wg](https://github.com/operator-framework/community#operator-lifecycle-manager-working-group) +* Kubernetes Slack channel: [#olm-dev](https://kubernetes.slack.com/messages/olm-dev) +* [Operator Framework on Google Groups](https://groups.google.com/forum/#!forum/operator-framework) +* Weekly in-person Working Group meeting: [olm-wg](https://github.com/operator-framework/community#operator-lifecycle-manager-working-group) -For further information on contributing, please consult the [Contribution Guide](../../CONTRIBUTING.md) +For further information on contributing, please consult the [Contribution Guide](../CONTRIBUTING.md) \ No newline at end of file diff --git a/docs/general/olmv1_roadmap.md b/docs/overview/olmv1_roadmap.md similarity index 100% rename from docs/general/olmv1_roadmap.md rename to docs/overview/olmv1_roadmap.md diff --git a/docs/refs/controlling-catalog-selection.md b/docs/refs/controlling-catalog-selection.md index e91a1eb0f..544f36be5 100644 --- a/docs/refs/controlling-catalog-selection.md +++ b/docs/refs/controlling-catalog-selection.md @@ -27,7 +27,7 @@ spec: catalog: selector: matchLabels: - olm.operatorframework.io/metadata.name: my-catalog + olm.operatorframework.io/metadata.name: my-content-management ``` In this example, only the catalog named `my-catalog` will be considered when resolving `my-package`. @@ -93,7 +93,7 @@ spec: - key: olm.operatorframework.io/metadata.name operator: NotIn values: - - unwanted-catalog + - unwanted-content-management ``` This excludes the catalog named `unwanted-catalog` from consideration. @@ -134,7 +134,7 @@ spec: source: type: image image: - ref: quay.io/example/high-priority-catalog:latest + ref: quay.io/example/high-priority-content-management:latest ``` Catalogs have a default priority of `0`. The priority can be any 32-bit integer. Catalogs with higher priority values are preferred during bundle resolution. @@ -171,7 +171,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera source: type: image image: - ref: quay.io/example/catalog-a:latest + ref: quay.io/example/content-management-a:latest ``` ```yaml @@ -186,7 +186,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera source: type: image image: - ref: quay.io/example/catalog-b:latest + ref: quay.io/example/content-management-b:latest ``` NB: an `olm.operatorframework.io/metadata.name` label will be added automatically to ClusterCatalogs when applied @@ -209,8 +209,8 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera 3. **Apply the Resources** ```shell - kubectl apply -f catalog-a.yaml - kubectl apply -f catalog-b.yaml + kubectl apply -f content-management-a.yaml + kubectl apply -f content-management-b.yaml kubectl apply -f install-my-operator.yaml ``` diff --git a/docs/drafts/derive-serviceaccount.md b/docs/refs/derive-service-account.md similarity index 99% rename from docs/drafts/derive-serviceaccount.md rename to docs/refs/derive-service-account.md index fec1649df..621e439d6 100644 --- a/docs/drafts/derive-serviceaccount.md +++ b/docs/refs/derive-service-account.md @@ -1,6 +1,6 @@ # Derive minimal ServiceAccount required for ClusterExtension Installation and Management -OLM v1 does not have permission to install extensions on a cluster by default. In order to install a [supported bundle](../refs/supported-extensions.md), +OLM v1 does not have permission to install extensions on a cluster by default. In order to install a [supported bundle](supported-extensions.md), OLM must be provided a ServiceAccount configured with the appropriate permissions. For more information, see the [provided ServiceAccount](./provided-serviceaccount.md) documentation. This document serves as a guide for how to derive the RBAC necessary to install a bundle. @@ -12,6 +12,7 @@ This bundle image contains all the manifests that make up the extension (e.g. `C as well as a [`ClusterServiceVersion`](https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion/) (CSV) that describes the extension and its service account's permission requirements. The service account must have permissions to: + - create and manage the extension's `CustomResourceDefinition`s - create and manage the resources packaged in the bundle - grant the extension controller's service account the permissions it requires for its operation diff --git a/docs/tasks/upgrade/how-to-channel-based-upgrades.md b/docs/refs/how-to-channel-based-upgrades.md similarity index 96% rename from docs/tasks/upgrade/how-to-channel-based-upgrades.md rename to docs/refs/how-to-channel-based-upgrades.md index f1692422f..501a7f951 100644 --- a/docs/tasks/upgrade/how-to-channel-based-upgrades.md +++ b/docs/refs/how-to-channel-based-upgrades.md @@ -1,4 +1,4 @@ -## How-to: Channel-Based Automatic Upgrades +# Channel-Based Automatic Upgrades A "channel" is a package author defined stream of updates for an extension. A set of channels can be set in the Catalog source to restrict automatic updates to the set of versions defined in those channels. diff --git a/docs/tasks/upgrade/how-to-pin-version.md b/docs/refs/how-to-pin-version.md similarity index 86% rename from docs/tasks/upgrade/how-to-pin-version.md rename to docs/refs/how-to-pin-version.md index 5ba1c39db..3b35f1468 100644 --- a/docs/tasks/upgrade/how-to-pin-version.md +++ b/docs/refs/how-to-pin-version.md @@ -1,4 +1,4 @@ -## How-to: Version Pin and Disable Automatic Updates +# Pin Version and Disable Automatic Updates To disable automatic updates, and pin the version of an extension, set `version` in the Catalog source to a specific version (e.g. 1.2.3). @@ -21,4 +21,4 @@ spec: name: argocd-installer ``` -For more information on SemVer version ranges see [version ranges](../../refs/version-ranges.md) +For more information on SemVer version ranges see [version ranges](version-ranges.md) diff --git a/docs/tasks/upgrade/how-to-version-range-upgrades.md b/docs/refs/how-to-version-range-upgrades.md similarity index 90% rename from docs/tasks/upgrade/how-to-version-range-upgrades.md rename to docs/refs/how-to-version-range-upgrades.md index 15bef4a9c..13be7a804 100644 --- a/docs/tasks/upgrade/how-to-version-range-upgrades.md +++ b/docs/refs/how-to-version-range-upgrades.md @@ -1,4 +1,4 @@ -## How-to: Version Range Automatic Updates +# Version Range Automatic Updates Set the version for the desired package in the Catalog source to a comparison string, like `">=3.0, <3.6"`, to restrict the automatic updates to the version range. Any new version of the extension released in the catalog within this range will be automatically applied. @@ -21,4 +21,4 @@ spec: name: argocd-installer ``` -For more information on SemVer version ranges see [version-rages](../../refs/version-ranges.md) \ No newline at end of file +For more information on SemVer version ranges see [version-rages](version-ranges.md) \ No newline at end of file diff --git a/docs/tasks/upgrade/how-to-z-stream-upgrades.md b/docs/refs/how-to-z-stream-upgrades.md similarity index 89% rename from docs/tasks/upgrade/how-to-z-stream-upgrades.md rename to docs/refs/how-to-z-stream-upgrades.md index deeef2fc9..d6e82018c 100644 --- a/docs/tasks/upgrade/how-to-z-stream-upgrades.md +++ b/docs/refs/how-to-z-stream-upgrades.md @@ -1,4 +1,4 @@ -## How-to: Z-Stream Automatic Updates +# Z-Stream Automatic Updates To restrict automatic updates to only z-stream patches and avoid breaking changes, use the `"~"` version range operator when setting the version for the desired package in Catalog source. @@ -21,4 +21,4 @@ spec: name: argocd-installer ``` -For more information on SemVer version ranges see [version ranges](../../refs/version-ranges.md) +For more information on SemVer version ranges see [version ranges](version-ranges.md) diff --git a/docs/refs/single-owner-objects.md b/docs/refs/single-owner-objects.md index 0ed7dfcac..0553f70a8 100644 --- a/docs/refs/single-owner-objects.md +++ b/docs/refs/single-owner-objects.md @@ -1,4 +1,3 @@ - # OLM Ownership Enforcement for `ClusterExtensions` In OLM, **a Kubernetes resource can only be owned by a single `ClusterExtension` at a time**. This ensures that resources within a Kubernetes cluster are managed consistently and prevents conflicts between multiple `ClusterExtensions` attempting to control the same resource. @@ -15,6 +14,7 @@ Operator bundles provide `CustomResourceDefinitions` (CRDs), which are part of a ### 2. `ClusterExtensions` Cannot Share Objects + OLM's single-owner policy means that **`ClusterExtensions` cannot share ownership of any resources**. If one `ClusterExtension` manages a specific resource (e.g., a `Deployment`, `CustomResourceDefinition`, or `Service`), another `ClusterExtension` cannot claim ownership of the same resource. Any attempt to do so will be blocked by the system. ## Error Messages diff --git a/docs/refs/supported-extensions.md b/docs/refs/supported-extensions.md index 8a1e97c02..4100ca658 100644 --- a/docs/refs/supported-extensions.md +++ b/docs/refs/supported-extensions.md @@ -2,7 +2,7 @@ Currently, OLM v1 supports installing cluster extensions that meet the following * The extension must support installation via the `AllNamespaces` install mode. * The extension must not use webhooks. -* The extension must not declare dependencies using the any of following file-based catalog properties: +* The extension must not declare dependencies using any of the following file-based catalog properties: * `olm.gvk.required` * `olm.package.required` diff --git a/docs/tasks/upgrade/upgrade-support.md b/docs/refs/upgrade-support.md similarity index 100% rename from docs/tasks/upgrade/upgrade-support.md rename to docs/refs/upgrade-support.md diff --git a/docs/tasks/catalog/adding-a-catalog.md b/docs/tasks/add-a-catalog.md similarity index 99% rename from docs/tasks/catalog/adding-a-catalog.md rename to docs/tasks/add-a-catalog.md index 8158f0d4a..0e5e60da4 100644 --- a/docs/tasks/catalog/adding-a-catalog.md +++ b/docs/tasks/add-a-catalog.md @@ -1,4 +1,4 @@ -# Adding a catalog of extensions to a cluster +# Add a Catalog of Extensions to a Cluster Extension authors can publish their products in catalogs. ClusterCatalogs are curated collections of Kubernetes extensions, such as Operators. diff --git a/docs/tasks/downgrade/downgrading-an-extension.md b/docs/tasks/downgrade-extension.md similarity index 99% rename from docs/tasks/downgrade/downgrading-an-extension.md rename to docs/tasks/downgrade-extension.md index c372ce8e2..bcbf6b119 100644 --- a/docs/tasks/downgrade/downgrading-an-extension.md +++ b/docs/tasks/downgrade-extension.md @@ -1,4 +1,3 @@ - # Downgrade a ClusterExtension ## Introduction diff --git a/docs/refs/exploring-available-packages.md b/docs/tasks/explore-available-content.md similarity index 96% rename from docs/refs/exploring-available-packages.md rename to docs/tasks/explore-available-content.md index 6b3071001..76c7c8574 100644 --- a/docs/refs/exploring-available-packages.md +++ b/docs/tasks/explore-available-content.md @@ -1,6 +1,6 @@ -# Exploring Available Packages +# Explore Available Content -After you add a catalog of extensions to your cluster, you must port forward your catalog as a service. +After you [add a catalog of extensions](add-a-catalog.md) to your cluster, you must port forward your catalog as a service. Then you can query the catalog by using `curl` commands and the `jq` CLI tool to find extensions to install. ## Prerequisites @@ -143,4 +143,4 @@ The following examples will show this default behavior, but for simplicity's sak ### Additional resources -* [Catalog queries](catalog-queries.md) +* [Catalog queries](../refs/catalog-queries.md) diff --git a/docs/tasks/installation/installing-an-extension.md b/docs/tasks/install-extension.md similarity index 82% rename from docs/tasks/installation/installing-an-extension.md rename to docs/tasks/install-extension.md index 1a0e956cf..e27e23dfa 100644 --- a/docs/tasks/installation/installing-an-extension.md +++ b/docs/tasks/install-extension.md @@ -1,4 +1,4 @@ -# Installing an extension from a catalog +# Install an Extension from a Catalog In Operator Lifecycle Manager (OLM) 1.0, Kubernetes extensions are scoped to the cluster. After you add a catalog to your cluster, you can install an extension by creating a custom resource (CR) and applying it. @@ -8,7 +8,20 @@ After you add a catalog to your cluster, you can install an extension by creatin * A deployed and unpacked catalog * The name, and optionally version, or channel, of the [supported extension](../concepts/supported-extensions.md) to be installed * An existing namespace in which to install the extension -* A suitable service account for installation (more information can be found [here](../../drafts/create-installer-service-account.md)) + +### ServiceAccount for ClusterExtension Installation and Management + +Adhering to OLM v1's "Secure by Default" tenet, OLM v1 does not have the permissions +necessary to install content. This follows the least privilege principle and reduces +the chance of a [confused deputy attack](https://en.wikipedia.org/wiki/Confused_deputy_problem). +Instead, users must explicitly specify a ServiceAccount that will be used to perform the +installation and management of a specific ClusterExtension. + +The ServiceAccount must be configured with the RBAC permissions required by the ClusterExtension. +If the permissions do not meet the minimum requirements, installation will fail. If no ServiceAccount +is provided in the ClusterExtension manifest, then the manifest will be rejected. + +For information on determining the ServiceAccount's permission, please see [Derive minimal ServiceAccount required for ClusterExtension Installation and Management](../../refs/derive-service-account). ## Procedure diff --git a/docs/tasks/installation/provided-serviceaccount.md b/docs/tasks/installation/provided-serviceaccount.md deleted file mode 100644 index 33f4501e9..000000000 --- a/docs/tasks/installation/provided-serviceaccount.md +++ /dev/null @@ -1,31 +0,0 @@ -# Provided ServiceAccount for ClusterExtension Installation and Management - -Adhering to OLM v1's "Secure by Default" tenet, OLM v1 does not have the permissions -necessary to install content. This follows the least privilege principle and reduces -the chance of a [confused deputy attack](https://en.wikipedia.org/wiki/Confused_deputy_problem). -Instead, users must explicitly specify a ServiceAccount that will be used to perform the -installation and management of a specific ClusterExtension. The ServiceAccount is specified -in the ClusterExtension manifest as follows: - -```yaml -apiVersion: olm.operatorframework.io/v1alpha1 -kind: ClusterExtension -metadata: - name: argocd -spec: - source: - sourceType: Catalog - catalog: - packageName: argocd-operator - version: 0.6.0 - install: - namespace: argocd - serviceAccount: - name: argocd-installer -``` - -The ServiceAccount must be configured with the RBAC permissions required by the ClusterExtension. -If the permissions do not meet the minimum requirements, installation will fail. If no ServiceAccount -is provided in the ClusterExtension manifest, then the manifest will be rejected. - -//TODO: Add link to documentation on determining least privileges required for the ServiceAccount \ No newline at end of file diff --git a/docs/tasks/uninstallation/uninstalling-an-extension.md b/docs/tasks/uninstall-extension.md similarity index 97% rename from docs/tasks/uninstallation/uninstalling-an-extension.md rename to docs/tasks/uninstall-extension.md index 575a7602a..32ee950de 100644 --- a/docs/tasks/uninstallation/uninstalling-an-extension.md +++ b/docs/tasks/uninstall-extension.md @@ -1,4 +1,4 @@ -# Deleting an extension +# Uninstall an extension You can uninstall a Kubernetes extension and its associated custom resource definitions (CRD) by deleting the extension's custom resource (CR). diff --git a/docs/tasks/upgrade/upgrading-an-extension.md b/docs/tasks/upgrade-extension.md similarity index 94% rename from docs/tasks/upgrade/upgrading-an-extension.md rename to docs/tasks/upgrade-extension.md index 481a083d4..cec3c830c 100644 --- a/docs/tasks/upgrade/upgrading-an-extension.md +++ b/docs/tasks/upgrade-extension.md @@ -1,17 +1,17 @@ -# Upgrading an Extension +# Upgrade an Extension Existing extensions can be upgraded by updating the version field in the ClusterExtension resource. -For information on downgrading an extension, see [Downgrade an Extension](../downgrade/downgrading-an-extension.md). +For information on downgrading an extension, see [Downgrade an Extension](downgrade-extension.md). ## Prerequisites * You have an extension installed -* The target version is compatible with OLM v1 (see [OLM v1 limitations](../../drafts/olmv1-limitations.md)) -* CRD compatibility between the versions being upgraded or downgraded (see [CRD upgrade safety](../../refs/crd-upgrade-safety.md)) -* The installer service account's RBAC permissions are adequate for the target version (see [Minimal RBAC for Installer Service Account](../../drafts/create-installer-service-account.md)) +* The target version is compatible with OLM v1 (see [OLM v1 limitations](../drafts/olmv1-limitations.md)) +* CRD compatibility between the versions being upgraded or downgraded (see [CRD upgrade safety](../refs/crd-upgrade-safety.md)) +* The installer service account's RBAC permissions are adequate for the target version (see [Minimal RBAC for Installer Service Account](../drafts/create-installer-service-account.md)) -For more detailed information see [Upgrade Support](upgrade-support.md). +For more detailed information see [Upgrade Support](../refs/upgrade-support.md). ## Procedure diff --git a/hack/test/build-push-e2e-catalog.sh b/hack/test/build-push-e2e-catalog.sh index 9fd1a9d6b..cef67692d 100755 --- a/hack/test/build-push-e2e-catalog.sh +++ b/hack/test/build-push-e2e-catalog.sh @@ -26,8 +26,8 @@ tag=${image##*:} echo "${namespace}" "${image}" "${tag}" -kubectl create configmap -n "${namespace}" --from-file=testdata/catalogs/test-catalog-${tag}.Dockerfile operator-controller-e2e-${tag}.dockerfile -kubectl create configmap -n "${namespace}" --from-file=testdata/catalogs/test-catalog-${tag} operator-controller-e2e-${tag}.build-contents +kubectl create configmap -n "${namespace}" --from-file=testdata/catalogs/test-content-management-${tag}.Dockerfile operator-controller-e2e-${tag}.dockerfile +kubectl create configmap -n "${namespace}" --from-file=testdata/catalogs/test-content-management-${tag} operator-controller-e2e-${tag}.build-contents kubectl apply -f - << EOF apiVersion: batch/v1 diff --git a/hack/tools/catalogs/download-catalog b/hack/tools/catalogs/download-catalog index 8e997215f..e9710cea9 100755 --- a/hack/tools/catalogs/download-catalog +++ b/hack/tools/catalogs/download-catalog @@ -30,7 +30,7 @@ usage() { echo " $0 operatorhubio" } -# Check if catalog name is provided +# Check if content-management name is provided if [ -z "$1" ]; then usage exit 1 @@ -84,7 +84,7 @@ echo "Using local port: $CATALOGD_LOCAL_SERVICE_PORT" echo "Using local content URL: $LOCAL_CONTENT_URL" # shellcheck disable=SC2001 -# Download the catalog using wget +# Download the content-management using wget echo "Downloading catalog from $LOCAL_CONTENT_URL..." wget --no-check-certificate "$LOCAL_CONTENT_URL" -O "${CATALOG_NAME}-catalog.json" diff --git a/hack/tools/catalogs/lib/rbac.sh b/hack/tools/catalogs/lib/rbac.sh index 03df135e8..052eecf46 100644 --- a/hack/tools/catalogs/lib/rbac.sh +++ b/hack/tools/catalogs/lib/rbac.sh @@ -79,7 +79,7 @@ aggregate_rules() { # It creates two RBAC rules: # 1. Valid for all resources on the cluster/namespace # 2. Only valid for named resources on the cluster/namespace -# This is done to follow the general pattern of giving the installer service account +# This is done to follow the overview pattern of giving the installer service account # permissions to "create" any resource of that type, but only allow CRUD on specific resources. # # For instance: diff --git a/internal/catalogmetadata/cache/cache.go b/internal/catalogmetadata/cache/cache.go index e986c9714..1b46cd63e 100644 --- a/internal/catalogmetadata/cache/cache.go +++ b/internal/catalogmetadata/cache/cache.go @@ -34,7 +34,7 @@ func NewFilesystemCache(cachePath string, clientFunc func() (*http.Client, error } } -// cacheData holds information about a catalog +// cacheData holds information about a content-management // other than it's contents that is used for // making decisions on when to attempt to refresh // the cache. @@ -44,8 +44,8 @@ type cacheData struct { // FilesystemCache is a cache that // uses the local filesystem for caching -// catalog contents. It will fetch catalog -// contents if the catalog does not already +// content-management contents. It will fetch content-management +// contents if the content-management does not already // exist in the cache. type filesystemCache struct { mutex sync.RWMutex @@ -63,21 +63,21 @@ type filesystemCache struct { // The Catalog provided to this function is expected to: // - Be non-nil // - Have a non-nil Catalog.Status.ResolvedSource.Image -// This ensures that we are only attempting to fetch catalog contents for Catalog +// This ensures that we are only attempting to fetch content-management contents for Catalog // resources that have been successfully reconciled, unpacked, and are being served. // These requirements help ensure that we can rely on status conditions to determine // when to issue a request to update the cached Catalog contents. func (fsc *filesystemCache) FetchCatalogContents(ctx context.Context, catalog *catalogd.ClusterCatalog) (fs.FS, error) { if catalog == nil { - return nil, fmt.Errorf("error: provided catalog must be non-nil") + return nil, fmt.Errorf("error: provided content-management must be non-nil") } if catalog.Status.ResolvedSource == nil { - return nil, fmt.Errorf("error: catalog %q has a nil status.resolvedSource value", catalog.Name) + return nil, fmt.Errorf("error: content-management %q has a nil status.resolvedSource value", catalog.Name) } if catalog.Status.ResolvedSource.Image == nil { - return nil, fmt.Errorf("error: catalog %q has a nil status.resolvedSource.image value", catalog.Name) + return nil, fmt.Errorf("error: content-management %q has a nil status.resolvedSource.image value", catalog.Name) } cacheDir := fsc.cacheDir(catalog.Name) @@ -126,12 +126,12 @@ func (fsc *filesystemCache) FetchCatalogContents(ctx context.Context, catalog *c tmpDir, err := os.MkdirTemp(fsc.cachePath, fmt.Sprintf(".%s-", catalog.Name)) if err != nil { - return nil, fmt.Errorf("error creating temporary directory to unpack catalog metadata: %v", err) + return nil, fmt.Errorf("error creating temporary directory to unpack content-management metadata: %v", err) } if err := declcfg.WalkMetasReader(resp.Body, func(meta *declcfg.Meta, err error) error { if err != nil { - return fmt.Errorf("error parsing catalog contents: %v", err) + return fmt.Errorf("error parsing content-management contents: %v", err) } pkgName := meta.Package if meta.Schema == declcfg.SchemaPackage { @@ -143,10 +143,10 @@ func (fsc *filesystemCache) FetchCatalogContents(ctx context.Context, catalog *c } metaPath := filepath.Join(tmpDir, pkgName, meta.Schema, metaName+".json") if err := os.MkdirAll(filepath.Dir(metaPath), os.ModePerm); err != nil { - return fmt.Errorf("error creating directory for catalog metadata: %v", err) + return fmt.Errorf("error creating directory for content-management metadata: %v", err) } if err := os.WriteFile(metaPath, meta.Blob, 0600); err != nil { - return fmt.Errorf("error writing catalog metadata to file: %v", err) + return fmt.Errorf("error writing content-management metadata to file: %v", err) } return nil }); err != nil { @@ -167,7 +167,7 @@ func (fsc *filesystemCache) FetchCatalogContents(ctx context.Context, catalog *c return os.DirFS(cacheDir), nil } -// Remove deletes cache directory for a given catalog from the filesystem +// Remove deletes cache directory for a given content-management from the filesystem func (fsc *filesystemCache) Remove(catalogName string) error { cacheDir := fsc.cacheDir(catalogName) diff --git a/internal/catalogmetadata/cache/cache_test.go b/internal/catalogmetadata/cache/cache_test.go index 74f7d79c0..dc9f63a4f 100644 --- a/internal/catalogmetadata/cache/cache_test.go +++ b/internal/catalogmetadata/cache/cache_test.go @@ -79,13 +79,13 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { name: "valid non-cached fetch", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ Type: catalogd.SourceTypeImage, Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + ResolvedRef: "fake/content-management@sha256:fakesha", }, }, }, @@ -97,13 +97,13 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { name: "valid cached fetch", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ Type: catalogd.SourceTypeImage, Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + ResolvedRef: "fake/content-management@sha256:fakesha", }, }, }, @@ -117,13 +117,13 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { name: "cached update fetch with changes", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ Type: catalogd.SourceTypeImage, Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + ResolvedRef: "fake/content-management@sha256:fakesha", }, }, }, @@ -137,13 +137,13 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { name: "fetch error", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ Type: catalogd.SourceTypeImage, Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + ResolvedRef: "fake/content-management@sha256:fakesha", }, }, }, @@ -156,13 +156,13 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { name: "fetch internal server error response", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ Type: catalogd.SourceTypeImage, Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + ResolvedRef: "fake/content-management@sha256:fakesha", }, }, }, @@ -172,17 +172,17 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { wantErr: true, }, { - name: "nil catalog", + name: "nil content-management", catalog: nil, contents: defaultFS, tripper: &mockTripper{serverError: true}, wantErr: true, }, { - name: "nil catalog.status.resolvedSource", + name: "nil content-management.status.resolvedSource", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: nil, @@ -193,10 +193,10 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { wantErr: true, }, { - name: "nil catalog.status.resolvedSource.image", + name: "nil content-management.status.resolvedSource.image", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ @@ -231,7 +231,7 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { if tt.testCaching { if !tt.shouldHitCache { - tt.catalog.Status.ResolvedSource.Image.ResolvedRef = "fake/catalog@sha256:shafake" + tt.catalog.Status.ResolvedSource.Image.ResolvedRef = "fake/content-management@sha256:shafake" } tt.tripper.content["foobar/olm.package/foobar.json"] = &fstest.MapFile{Data: []byte(`{"schema": "olm.package", "name": "foobar"}`)} actualFS, err := c.FetchCatalogContents(ctx, tt.catalog) @@ -250,13 +250,13 @@ func TestFilesystemCacheFetchCatalogContents(t *testing.T) { func TestFilesystemCacheRemove(t *testing.T) { testCatalog := &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - Name: "test-catalog", + Name: "test-content-management", }, Status: catalogd.ClusterCatalogStatus{ ResolvedSource: &catalogd.ResolvedCatalogSource{ Type: catalogd.SourceTypeImage, Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + ResolvedRef: "fake/content-management@sha256:fakesha", }, }, }, diff --git a/internal/catalogmetadata/client/client.go b/internal/catalogmetadata/client/client.go index 6a9efe285..97cda06ad 100644 --- a/internal/catalogmetadata/client/client.go +++ b/internal/catalogmetadata/client/client.go @@ -14,10 +14,10 @@ import ( ) // Fetcher is an interface to facilitate fetching -// catalog contents from catalogd. +// content-management contents from catalogd. type Fetcher interface { // FetchCatalogContents fetches contents from the catalogd HTTP - // server for the catalog provided. It returns a fs.FS containing the FBC contents. + // server for the content-management provided. It returns a fs.FS containing the FBC contents. // Each sub directory contains FBC for a single package // and the directory name is package name. // Returns an error if any occur. @@ -30,22 +30,22 @@ func New(fetcher Fetcher) *Client { } } -// Client is reading catalog metadata +// Client is reading content-management metadata type Client struct { - // fetcher is the Fetcher to use for fetching catalog contents + // fetcher is the Fetcher to use for fetching content-management contents fetcher Fetcher } func (c *Client) GetPackage(ctx context.Context, catalog *catalogd.ClusterCatalog, pkgName string) (*declcfg.DeclarativeConfig, error) { - // if the catalog has not been successfully unpacked, report an error. This ensures that our + // if the content-management has not been successfully unpacked, report an error. This ensures that our // reconciles are deterministic and wait for all desired catalogs to be ready. if !meta.IsStatusConditionPresentAndEqual(catalog.Status.Conditions, catalogd.TypeServing, metav1.ConditionTrue) { - return nil, fmt.Errorf("catalog %q is not being served", catalog.Name) + return nil, fmt.Errorf("content-management %q is not being served", catalog.Name) } catalogFsys, err := c.fetcher.FetchCatalogContents(ctx, catalog) if err != nil { - return nil, fmt.Errorf("error fetching catalog contents: %v", err) + return nil, fmt.Errorf("error fetching content-management contents: %v", err) } pkgFsys, err := fs.Sub(catalogFsys, pkgName) diff --git a/internal/catalogmetadata/client/client_test.go b/internal/catalogmetadata/client/client_test.go index 989b66acc..1234d1772 100644 --- a/internal/catalogmetadata/client/client_test.go +++ b/internal/catalogmetadata/client/client_test.go @@ -31,10 +31,10 @@ func TestClientNew(t *testing.T) { for _, tc := range []testCase{ { name: "not unpacked", - catalog: &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}}, + catalog: &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "content-management-1"}}, fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }), assert: func(t *testing.T, dc *declcfg.DeclarativeConfig, err error) { - assert.ErrorContains(t, err, `catalog "catalog-1" is not being served`) + assert.ErrorContains(t, err, `content-management "content-management-1" is not being served`) }, }, { @@ -44,7 +44,7 @@ func TestClientNew(t *testing.T) { }, fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return nil, errors.New("fetch error") }), assert: func(t *testing.T, dc *declcfg.DeclarativeConfig, err error) { - assert.ErrorContains(t, err, `error fetching catalog contents: fetch error`) + assert.ErrorContains(t, err, `error fetching content-management contents: fetch error`) }, }, { diff --git a/internal/catalogmetadata/filter/successors_test.go b/internal/catalogmetadata/filter/successors_test.go index 1d7cc72c3..f13dda35c 100644 --- a/internal/catalogmetadata/filter/successors_test.go +++ b/internal/catalogmetadata/filter/successors_test.go @@ -285,7 +285,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsDisabled(t *testing expectedResult []declcfg.Bundle }{ { - name: "respect replaces directive from catalog", + name: "respect replaces directive from content-management", installedBundle: bundleutil.MetadataFor("test-package.v2.0.0", bsemver.MustParse("2.0.0")), expectedResult: []declcfg.Bundle{ // Must only have two bundle: @@ -296,7 +296,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsDisabled(t *testing }, }, { - name: "respect skips directive from catalog", + name: "respect skips directive from content-management", installedBundle: bundleutil.MetadataFor("test-package.v2.2.1", bsemver.MustParse("2.2.1")), expectedResult: []declcfg.Bundle{ // Must only have two bundle: @@ -307,7 +307,7 @@ func TestSuccessorsPredicateWithForceSemverUpgradeConstraintsDisabled(t *testing }, }, { - name: "respect skipRange directive from catalog", + name: "respect skipRange directive from content-management", installedBundle: bundleutil.MetadataFor("test-package.v2.3.0", bsemver.MustParse("2.3.0")), expectedResult: []declcfg.Bundle{ // Must only have two bundle: diff --git a/internal/controllers/clustercatalog_controller_test.go b/internal/controllers/clustercatalog_controller_test.go index 762fa15ec..5993efed4 100644 --- a/internal/controllers/clustercatalog_controller_test.go +++ b/internal/controllers/clustercatalog_controller_test.go @@ -19,7 +19,7 @@ import ( ) func TestClusterCatalogReconcilerFinalizers(t *testing.T) { - catalogKey := types.NamespacedName{Name: "test-catalog"} + catalogKey := types.NamespacedName{Name: "test-content-management"} for _, tt := range []struct { name string @@ -29,7 +29,7 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) { wantErr string }{ { - name: "catalog exists", + name: "content-management exists", catalog: &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ Name: catalogKey.Name, @@ -37,7 +37,7 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) { }, }, { - name: "catalog does not exist", + name: "content-management does not exist", cacheRemoveFunc: func(catalogName string) error { assert.Equal(t, catalogKey.Name, catalogName) return nil @@ -45,7 +45,7 @@ func TestClusterCatalogReconcilerFinalizers(t *testing.T) { wantCacheRemoveCalled: true, }, { - name: "catalog does not exist - error on removal", + name: "content-management does not exist - error on removal", cacheRemoveFunc: func(catalogName string) error { return errors.New("fake error from remove") }, diff --git a/internal/controllers/clusterextension_admission_test.go b/internal/controllers/clusterextension_admission_test.go index c7bc3ae1a..355d7c9bb 100644 --- a/internal/controllers/clusterextension_admission_test.go +++ b/internal/controllers/clusterextension_admission_test.go @@ -24,7 +24,7 @@ func TestClusterExtensionSourceConfig(t *testing.T) { }{ {"sourceType is null", "", "Catalog", sourceTypeEmptyError}, {"sourceType is invalid", "Invalid", "Catalog", sourceTypeMismatchError}, - {"catalog field does not exist", "Catalog", "", sourceConfigInvalidError}, + {"content-management field does not exist", "Catalog", "", sourceConfigInvalidError}, {"sourceConfig has required fields", "Catalog", "Catalog", ""}, } @@ -76,8 +76,8 @@ func TestClusterExtensionSourceConfig(t *testing.T) { } func TestClusterExtensionAdmissionPackageName(t *testing.T) { - tooLongError := "spec.source.catalog.packageName: Too long: may not be longer than 253" - regexMismatchError := "spec.source.catalog.packageName in body should match" + tooLongError := "spec.source.content-management.packageName: Too long: may not be longer than 253" + regexMismatchError := "spec.source.content-management.packageName in body should match" testCases := []struct { name string @@ -135,8 +135,8 @@ func TestClusterExtensionAdmissionPackageName(t *testing.T) { } func TestClusterExtensionAdmissionVersion(t *testing.T) { - tooLongError := "spec.source.catalog.version: Too long: may not be longer than 64" - regexMismatchError := "spec.source.catalog.version in body should match" + tooLongError := "spec.source.content-management.version: Too long: may not be longer than 64" + regexMismatchError := "spec.source.content-management.version in body should match" testCases := []struct { name string @@ -235,8 +235,8 @@ func TestClusterExtensionAdmissionVersion(t *testing.T) { } func TestClusterExtensionAdmissionChannel(t *testing.T) { - tooLongError := "spec.source.catalog.channels[0]: Too long: may not be longer than 253" - regexMismatchError := "spec.source.catalog.channels[0] in body should match" + tooLongError := "spec.source.content-management.channels[0]: Too long: may not be longer than 253" + regexMismatchError := "spec.source.content-management.channels[0] in body should match" testCases := []struct { name string diff --git a/internal/controllers/clusterextension_controller.go b/internal/controllers/clusterextension_controller.go index 65cb2eaf6..9b174b8eb 100644 --- a/internal/controllers/clusterextension_controller.go +++ b/internal/controllers/clusterextension_controller.go @@ -177,7 +177,7 @@ func checkForUnexpectedFieldChange(a, b ocv1alpha1.ClusterExtension) bool { // to return different results (e.g. requeue). // /* The reconcile functions performs the following major tasks: -1. Resolution: Run the resolution to find the bundle from the catalog which needs to be installed. +1. Resolution: Run the resolution to find the bundle from the content-management which needs to be installed. 2. Validate: Ensure that the bundle returned from the resolution for install meets our requirements. 3. Unpack: Unpack the contents from the bundle and store in a localdir in the pod. 4. Install: The process of installing involves: @@ -232,7 +232,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp // resolvedDeprecation even if resolution returns an error. If present, we can still update some of // our deprecation status. // - Open question though: what if different catalogs have different opinions of what's deprecated. - // If we can't resolve a bundle, how do we know which catalog to trust for deprecation information? + // If we can't resolve a bundle, how do we know which content-management to trust for deprecation information? // Perhaps if the package shows up in multiple catalogs and deprecations don't match, we can set // the deprecation status to unknown? Or perhaps we somehow combine the deprecation information from // all catalogs? @@ -436,15 +436,15 @@ func wrapErrorWithResolutionInfo(resolved ocv1alpha1.BundleMetadata, err error) return fmt.Errorf("%w for resolved bundle %q with version %q", err, resolved.Name, resolved.Version) } -// Generate reconcile requests for all cluster extensions affected by a catalog change +// Generate reconcile requests for all cluster extensions affected by a content-management change func clusterExtensionRequestsForCatalog(c client.Reader, logger logr.Logger) crhandler.MapFunc { return func(ctx context.Context, _ client.Object) []reconcile.Request { - // no way of associating an extension to a catalog so create reconcile requests for everything + // no way of associating an extension to a content-management so create reconcile requests for everything clusterExtensions := metav1.PartialObjectMetadataList{} clusterExtensions.SetGroupVersionKind(ocv1alpha1.GroupVersion.WithKind("ClusterExtensionList")) err := c.List(ctx, &clusterExtensions) if err != nil { - logger.Error(err, "unable to enqueue cluster extensions for catalog reconcile") + logger.Error(err, "unable to enqueue cluster extensions for content-management reconcile") return nil } var requests []reconcile.Request diff --git a/internal/resolve/catalog.go b/internal/resolve/catalog.go index 0c9dac762..1cdbe992b 100644 --- a/internal/resolve/catalog.go +++ b/internal/resolve/catalog.go @@ -36,7 +36,7 @@ type foundBundle struct { priority int32 } -// Resolve returns a Bundle from a catalog that needs to get installed on the cluster. +// Resolve returns a Bundle from a content-management that needs to get installed on the cluster. func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterExtension, installedBundle *ocv1alpha1.BundleMetadata) (*declcfg.Bundle, *bsemver.Version, *declcfg.Deprecation, error) { packageName := ext.Spec.Source.Catalog.PackageName versionRange := ext.Spec.Source.Catalog.Version @@ -44,7 +44,7 @@ func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterEx selector, err := metav1.LabelSelectorAsSelector(&ext.Spec.Source.Catalog.Selector) if err != nil { - return nil, nil, nil, fmt.Errorf("desired catalog selector is invalid: %w", err) + return nil, nil, nil, fmt.Errorf("desired content-management selector is invalid: %w", err) } // A nothing (empty) seletor selects everything if selector == labels.Nothing() { @@ -67,7 +67,7 @@ func (r *CatalogResolver) Resolve(ctx context.Context, ext *ocv1alpha1.ClusterEx } if err := r.WalkCatalogsFunc(ctx, packageName, func(ctx context.Context, cat *catalogd.ClusterCatalog, packageFBC *declcfg.DeclarativeConfig, err error) error { if err != nil { - return fmt.Errorf("error getting package %q from catalog %q: %w", packageName, cat.Name, err) + return fmt.Errorf("error getting package %q from content-management %q: %w", packageName, cat.Name, err) } var predicates []filter.Predicate[declcfg.Bundle] diff --git a/internal/resolve/catalog_test.go b/internal/resolve/catalog_test.go index 17d0007bc..5c5a9027e 100644 --- a/internal/resolve/catalog_test.go +++ b/internal/resolve/catalog_test.go @@ -52,7 +52,7 @@ func TestErrorGettingPackage(t *testing.T) { pkgName := randPkg() ce := buildFooClusterExtension(pkgName, []string{}, "", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided) _, _, _, err := r.Resolve(context.Background(), ce, nil) - assert.EqualError(t, err, fmt.Sprintf(`error walking catalogs: error getting package %q from catalog "a": fake error`, pkgName)) + assert.EqualError(t, err, fmt.Sprintf(`error walking catalogs: error getting package %q from content-management "a": fake error`, pkgName)) } func TestPackageDoesNotExist(t *testing.T) { @@ -382,7 +382,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) { } r := CatalogResolver{WalkCatalogsFunc: w.WalkCatalogs} - t.Run("when bundle candidates for a package are deprecated in all but one catalog", func(t *testing.T) { + t.Run("when bundle candidates for a package are deprecated in all but one content-management", func(t *testing.T) { ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.3", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided) gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil) require.NoError(t, err) @@ -396,7 +396,7 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) { ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.1", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided) gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil) require.Error(t, err) - // We will not make a decision on which catalog to use + // We will not make a decision on which content-management to use assert.ErrorContains(t, err, "in multiple catalogs with the same priority [b c]") assert.Nil(t, gotBundle) assert.Nil(t, gotVersion) @@ -407,18 +407,18 @@ func TestPackageVariationsBetweenCatalogs(t *testing.T) { ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.0 <=1.0.4", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided) gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil) require.Error(t, err) - // We will not make a decision on which catalog to use + // We will not make a decision on which content-management to use assert.ErrorContains(t, err, "in multiple catalogs with the same priority [d f]") assert.Nil(t, gotBundle) assert.Nil(t, gotVersion) assert.Nil(t, gotDeprecation) }) - t.Run("highest semver bundle is chosen when candidates are all from the same catalog", func(t *testing.T) { + t.Run("highest semver bundle is chosen when candidates are all from the same content-management", func(t *testing.T) { ce := buildFooClusterExtension(pkgName, []string{}, ">=1.0.4 <=1.0.5", ocv1alpha1.UpgradeConstraintPolicyCatalogProvided) gotBundle, gotVersion, gotDeprecation, err := r.Resolve(context.Background(), ce, nil) require.NoError(t, err) - // Bundles within one catalog for a package will be sorted by semver and deprecation and the best is returned + // Bundles within one content-management for a package will be sorted by semver and deprecation and the best is returned assert.Equal(t, genBundle(pkgName, "1.0.5").Name, gotBundle.Name) assert.Equal(t, bsemver.MustParse("1.0.5"), *gotVersion) assert.Equal(t, (*declcfg.Deprecation)(nil), gotDeprecation) @@ -784,7 +784,7 @@ func TestInvalidClusterExtensionCatalogMatchExpressions(t *testing.T) { }, } _, _, _, err := r.Resolve(context.Background(), ce, nil) - assert.EqualError(t, err, "desired catalog selector is invalid: \"bad\" is not a valid label selector operator") + assert.EqualError(t, err, "desired content-management selector is invalid: \"bad\" is not a valid label selector operator") } func TestInvalidClusterExtensionCatalogMatchLabelsName(t *testing.T) { @@ -810,7 +810,7 @@ func TestInvalidClusterExtensionCatalogMatchLabelsName(t *testing.T) { }, } _, _, _, err := r.Resolve(context.Background(), ce, nil) - assert.ErrorContains(t, err, "desired catalog selector is invalid: key: Invalid value:") + assert.ErrorContains(t, err, "desired content-management selector is invalid: key: Invalid value:") } func TestInvalidClusterExtensionCatalogMatchLabelsValue(t *testing.T) { @@ -836,7 +836,7 @@ func TestInvalidClusterExtensionCatalogMatchLabelsValue(t *testing.T) { }, } _, _, _, err := r.Resolve(context.Background(), ce, nil) - assert.ErrorContains(t, err, "desired catalog selector is invalid: values[0][name]: Invalid value:") + assert.ErrorContains(t, err, "desired content-management selector is invalid: values[0][name]: Invalid value:") } func TestClusterExtensionMatchLabel(t *testing.T) { diff --git a/internal/resolve/validation_test.go b/internal/resolve/validation_test.go index ed2599a88..12e367b66 100644 --- a/internal/resolve/validation_test.go +++ b/internal/resolve/validation_test.go @@ -19,9 +19,9 @@ func TestNoDependencyValidation(t *testing.T) { { name: "package with no dependencies", bundle: declcfg.Bundle{ - Name: "fake-catalog/no-dependencies-package/alpha/1.0.0", + Name: "fake-content-management/no-dependencies-package/alpha/1.0.0", Package: "no-dependencies-package", - Image: "quay.io/fake-catalog/no-dependencies-package@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", + Image: "quay.io/fake-content-management/no-dependencies-package@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName":"no-dependencies-package","version":"1.0.0"}`)}, }, @@ -30,41 +30,41 @@ func TestNoDependencyValidation(t *testing.T) { { name: "package with olm.package.required property", bundle: declcfg.Bundle{ - Name: "fake-catalog/package-required-test/alpha/1.0.0", + Name: "fake-content-management/package-required-test/alpha/1.0.0", Package: "package-required-test", - Image: "quay.io/fake-catalog/package-required-test@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", + Image: "quay.io/fake-content-management/package-required-test@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName":"package-required-test","version":"1.0.0"}`)}, {Type: property.TypePackageRequired, Value: json.RawMessage("content-is-not-relevant")}, }, }, - wantErr: `bundle "fake-catalog/package-required-test/alpha/1.0.0" has a dependency declared via property "olm.package.required" which is currently not supported`, + wantErr: `bundle "fake-content-management/package-required-test/alpha/1.0.0" has a dependency declared via property "olm.package.required" which is currently not supported`, }, { name: "package with olm.gvk.required property", bundle: declcfg.Bundle{ - Name: "fake-catalog/gvk-required-test/alpha/1.0.0", + Name: "fake-content-management/gvk-required-test/alpha/1.0.0", Package: "gvk-required-test", - Image: "quay.io/fake-catalog/gvk-required-test@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", + Image: "quay.io/fake-content-management/gvk-required-test@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName":"gvk-required-test","version":"1.0.0"}`)}, {Type: property.TypeGVKRequired, Value: json.RawMessage(`content-is-not-relevant`)}, }, }, - wantErr: `bundle "fake-catalog/gvk-required-test/alpha/1.0.0" has a dependency declared via property "olm.gvk.required" which is currently not supported`, + wantErr: `bundle "fake-content-management/gvk-required-test/alpha/1.0.0" has a dependency declared via property "olm.gvk.required" which is currently not supported`, }, { name: "package with olm.constraint property", bundle: declcfg.Bundle{ - Name: "fake-catalog/constraint-test/alpha/1.0.0", + Name: "fake-content-management/constraint-test/alpha/1.0.0", Package: "constraint-test", - Image: "quay.io/fake-catalog/constraint-test@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", + Image: "quay.io/fake-content-management/constraint-test@sha256:3e281e587de3d03011440685fc4fb782672beab044c1ebadc42788ce05a21c35", Properties: []property.Property{ {Type: property.TypePackage, Value: json.RawMessage(`{"packageName":"constraint-test","version":"1.0.0"}`)}, {Type: property.TypeConstraint, Value: json.RawMessage(`content-is-not-relevant`)}, }, }, - wantErr: `bundle "fake-catalog/constraint-test/alpha/1.0.0" has a dependency declared via property "olm.constraint" which is currently not supported`, + wantErr: `bundle "fake-content-management/constraint-test/alpha/1.0.0" has a dependency declared via property "olm.constraint" which is currently not supported`, }, } { t.Run(tt.name, func(t *testing.T) { diff --git a/mkdocs.yml b/mkdocs.yml index aecac92b5..ce54ba1d9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,28 +1,48 @@ # yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json -site_name: Operator Controller documentation +site_name: Operator Lifecycle Manager v1 theme: name: "material" features: - content.code.copy + - navigation.tabs repo_url: https://github.com/operator-framework/operator-controller nav: - - Home: 'olmv1_overview.md' - - Components: 'components.md' - - Tasks: - - Adding a catalog of extensions: 'tasks/adding-a-catalog.md' - - Finding extensions to install: 'tasks/exploring-available-packages.md' - - Installing an extension: 'tasks/installing-an-extension.md' - - Deleting an extension: 'tasks/uninstalling-an-extension.md' - - References: + - Home: 'index.md' + - Overview: + - Overview: 'overview/olmv1_overview.md' + - Architecture: 'overview/olmv1_architecture.md' + - Design Decisions: 'overview/olmv1_design_decisions.md' + - Roadmap: 'overview/olmv1_roadmap.md' + - Contribute: + - Contributing: 'contribute/contributing.md' + - Developing OLM v1: 'contribute/developer.md' + - API Reference: + - Operator Controller API reference: 'api-reference/operator-controller-api-reference.md' + - CatalogD API reference: 'api-reference/catalogd-api-reference.md' + - Tutorials: + - Add a Catalog: 'tasks/add-a-catalog.md' + - Explore Content: 'tasks/explore-available-content.md' + - Install an Extension: 'tasks/install-extension.md' + - Upgrade an Extension: 'tasks/upgrade-extension.md' + - Downgrade an Extension: 'tasks/downgrade-extension.md' + - Uninstall an Extension: 'tasks/uninstall-extension.md' + - How-To Guides: + - Catalog queries: 'refs/catalog-queries.md' + - Channel-Based Upgrades: 'refs/how-to-channel-based-upgrades.md' + - Version Pinning: 'refs/how-to-pin-version.md' + - Version Range Upgrades: 'refs/how-to-version-range-upgrades.md' + - Z-Stream Upgrades: 'refs/how-to-z-stream-upgrades.md' + - Cluster Extension Service Account Permissions: 'refs/derive-service-account.md' + - Conceptual Guides: + - Single Owner Objects: 'refs/single-owner-objects.md' - Supported extensions: 'refs/supported-extensions.md' - - API references: - - Operator Controller API reference: 'refs/api/operator-controller-api-reference.md' - - CatalogD API reference: 'refs/api/catalogd-api-reference.md' - - Catalog queries: 'refs/catalog-queries.md' + - Upgrade Support: 'refs/upgrade-support.md' - CRD Upgrade Safety: 'refs/crd-upgrade-safety.md' + - Content Resolution: 'refs/controlling-catalog-selection.md' + - Version Ranges: 'refs/version-ranges.md' markdown_extensions: - pymdownx.highlight: diff --git a/test/e2e/cluster_extension_install_test.go b/test/e2e/cluster_extension_install_test.go index 1e32166cb..4731a30fc 100644 --- a/test/e2e/cluster_extension_install_test.go +++ b/test/e2e/cluster_extension_install_test.go @@ -237,7 +237,7 @@ func TestClusterExtensionInstallRegistry(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") t.Log("When the extension bundle format is registry+v1") clusterExtension, extensionCatalog, sa := testInit(t) @@ -294,7 +294,7 @@ func TestClusterExtensionInstallRegistry(t *testing.T) { } func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") clusterExtension, extensionCatalog, sa := testInit(t) defer testCleanup(t, extensionCatalog, clusterExtension, sa) @@ -330,12 +330,12 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) { require.NotNil(ct, cond) assert.Equal(ct, metav1.ConditionTrue, cond.Status) assert.Equal(ct, ocv1alpha1.ReasonRetrying, cond.Reason) - assert.Contains(ct, cond.Message, "in multiple catalogs with the same priority [operatorhubio test-catalog]") + assert.Contains(ct, cond.Message, "in multiple catalogs with the same priority [operatorhubio test-content-management]") }, pollDuration, pollInterval) } func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") t.Log("When resolving upgrade edges") clusterExtension, extensionCatalog, sa := testInit(t) @@ -398,7 +398,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) { } func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") t.Log("When resolving upgrade edges") clusterExtension, extensionCatalog, sa := testInit(t) @@ -448,7 +448,7 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) { } func TestClusterExtensionInstallSuccessorVersion(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") t.Log("When resolving upgrade edges") clusterExtension, extensionCatalog, sa := testInit(t) defer testCleanup(t, extensionCatalog, clusterExtension, sa) @@ -482,7 +482,7 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) { t.Log("It does allow to upgrade the ClusterExtension to any of the successor versions within non-zero major version") t.Log("By updating the ClusterExtension resource by skipping versions") - // 1.0.1 replaces 1.0.0 in the test catalog + // 1.0.1 replaces 1.0.0 in the test content-management clusterExtension.Spec.Source.Catalog.Version = "1.0.1" require.NoError(t, c.Update(context.Background(), clusterExtension)) t.Log("By eventually reporting a successful resolution and bundle path") @@ -496,8 +496,8 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) { } func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") - t.Log("It resolves again when a catalog is patched with new ImageRef") + t.Log("When a cluster extension is installed from a content-management") + t.Log("It resolves again when a content-management is patched with new ImageRef") clusterExtension, extensionCatalog, sa := testInit(t) defer testCleanup(t, extensionCatalog, clusterExtension, sa) defer getArtifactsOutput(t) @@ -538,9 +538,9 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) { assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason) }, pollDuration, pollInterval) - // patch imageRef tag on test-catalog image with v2 image - t.Log("By patching the catalog ImageRef to point to the v2 catalog") - updatedCatalogImage := fmt.Sprintf("%s/e2e/test-catalog:v2", os.Getenv("LOCAL_REGISTRY_HOST")) + // patch imageRef tag on test-content-management image with v2 image + t.Log("By patching the content-management ImageRef to point to the v2 content-management") + updatedCatalogImage := fmt.Sprintf("%s/e2e/test-content-management:v2", os.Getenv("LOCAL_REGISTRY_HOST")) err := patchTestCatalog(context.Background(), testCatalogName, updatedCatalogImage) require.NoError(t, err) require.EventuallyWithT(t, func(ct *assert.CollectT) { @@ -562,8 +562,8 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) { } func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") - t.Log("It resolves again when a new catalog is available") + t.Log("When a cluster extension is installed from a content-management") + t.Log("It resolves again when a new content-management is available") // Tag the image with the new tag var err error @@ -571,8 +571,8 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) { err = crane.Tag(v1Image, latestImageTag, crane.Insecure) require.NoError(t, err) - // create a test-catalog with latest image tag - latestCatalogImage := fmt.Sprintf("%s/e2e/test-catalog:latest", os.Getenv("LOCAL_REGISTRY_HOST")) + // create a test-content-management with latest image tag + latestCatalogImage := fmt.Sprintf("%s/e2e/test-content-management:latest", os.Getenv("LOCAL_REGISTRY_HOST")) extensionCatalog, err := createTestCatalog(context.Background(), testCatalogName, latestCatalogImage) require.NoError(t, err) clusterExtensionName := fmt.Sprintf("clusterextension-%s", rand.String(8)) @@ -616,8 +616,8 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) { assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason) }, pollDuration, pollInterval) - // update tag on test-catalog image with v2 image - t.Log("By updating the catalog tag to point to the v2 catalog") + // update tag on test-content-management image with v2 image + t.Log("By updating the content-management tag to point to the v2 content-management") v2Image := fmt.Sprintf("%s/%s", os.Getenv("CLUSTER_REGISTRY_HOST"), os.Getenv("E2E_TEST_CATALOG_V2")) err = crane.Tag(v2Image, latestImageTag, crane.Insecure) require.NoError(t, err) @@ -640,7 +640,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) { } func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") t.Log("It resolves again when managed content is changed") clusterExtension, extensionCatalog, sa := testInit(t) defer testCleanup(t, extensionCatalog, clusterExtension, sa) @@ -693,7 +693,7 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T } func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *testing.T) { - t.Log("When a cluster extension is installed from a catalog") + t.Log("When a cluster extension is installed from a content-management") t.Log("When the extension bundle format is registry+v1") clusterExtension, extensionCatalog, _ := testInit(t) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index b292c4653..df46733fc 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -24,7 +24,7 @@ var ( const ( testCatalogRefEnvVar = "CATALOG_IMG" - testCatalogName = "test-catalog" + testCatalogName = "test-content-management" latestImageTag = "latest" ) @@ -38,9 +38,9 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } -// createTestCatalog will create a new catalog on the test cluster, provided -// the context, catalog name, and the image reference. It returns the created catalog -// or an error if any errors occurred while creating the catalog. +// createTestCatalog will create a new content-management on the test cluster, provided +// the context, content-management name, and the image reference. It returns the created content-management +// or an error if any errors occurred while creating the content-management. // Note that catalogd will automatically create the label: // // "olm.operatorframework.io/metadata.name": name @@ -65,8 +65,8 @@ func createTestCatalog(ctx context.Context, name string, imageRef string) (*cata } // patchTestCatalog will patch the existing clusterCatalog on the test cluster, provided -// the context, catalog name, and the image reference. It returns an error -// if any errors occurred while updating the catalog. +// the context, content-management name, and the image reference. It returns an error +// if any errors occurred while updating the content-management. func patchTestCatalog(ctx context.Context, name string, newImageRef string) error { // Fetch the existing ClusterCatalog catalog := &catalogd.ClusterCatalog{} diff --git a/test/extension-developer-e2e/extension_developer_test.go b/test/extension-developer-e2e/extension_developer_test.go index 2db90b674..7c4807cbf 100644 --- a/test/extension-developer-e2e/extension_developer_test.go +++ b/test/extension-developer-e2e/extension_developer_test.go @@ -41,7 +41,7 @@ func TestExtensionDeveloper(t *testing.T) { catalog := &catalogd.ClusterCatalog{ ObjectMeta: metav1.ObjectMeta{ - GenerateName: "catalog", + GenerateName: "content-management", }, Spec: catalogd.ClusterCatalogSpec{ Source: catalogd.CatalogSource{ diff --git a/test/extension-developer-e2e/setup.sh b/test/extension-developer-e2e/setup.sh index 889080ad6..20222d045 100755 --- a/test/extension-developer-e2e/setup.sh +++ b/test/extension-developer-e2e/setup.sh @@ -110,14 +110,14 @@ reg_pkg_name="${REG_PKG_NAME}" # the registry+v1 extensions ############################### -cat << EOF > "${TMP_ROOT}"/catalog.Dockerfile +cat << EOF > "${TMP_ROOT}"/content-management.Dockerfile FROM scratch ADD catalog /configs LABEL operators.operatorframework.io.index.configs.v1=/configs EOF mkdir -p "${TMP_ROOT}/catalog" -cat < "${TMP_ROOT}"/catalog/index.yaml +cat < "${TMP_ROOT}"/content-management/index.yaml { "schema": "olm.package", "name": "${reg_pkg_name}" @@ -152,12 +152,12 @@ EOF # Add a .indexignore to make catalogd ignore # reading the symlinked ..* files that are created when # mounting a ConfigMap -cat < "${TMP_ROOT}"/catalog/.indexignore +cat < "${TMP_ROOT}"/content-management/.indexignore ..* EOF -kubectl create configmap -n "${namespace}" --from-file="${TMP_ROOT}"/catalog.Dockerfile extension-dev-e2e.dockerfile -kubectl create configmap -n "${namespace}" --from-file="${TMP_ROOT}"/catalog extension-dev-e2e.build-contents +kubectl create configmap -n "${namespace}" --from-file="${TMP_ROOT}"/content-management.Dockerfile extension-dev-e2e.dockerfile +kubectl create configmap -n "${namespace}" --from-file="${TMP_ROOT}"/content-management extension-dev-e2e.build-contents kubectl apply -f - << EOF apiVersion: batch/v1