From 905a82934f43913cfe742ad4568f57d83fd9e24f Mon Sep 17 00:00:00 2001 From: Eric Stroczynski Date: Wed, 29 Jul 2020 11:45:28 -0700 Subject: [PATCH] ` packagemanifests` flag `--include-paths` has been removed, and `--operator-version` has been changed to `--version` --- .../run-packagemanifests-flags-1.yaml | 16 ++++ internal/olm/operator/operator_manager.go | 62 +------------ internal/olm/operator/packagemanifests.go | 24 ++--- .../olm/operator/packagemanifests_manager.go | 87 +++++-------------- test/e2e-helm/e2e_helm_olm_test.go | 4 +- test/e2e/e2e_suite.go | 4 +- test/integration/integration_helpers.go | 8 +- test/integration/operator_olm_test.go | 20 ++--- .../operator-sdk_cleanup_packagemanifests.md | 5 +- .../cli/operator-sdk_run_packagemanifests.md | 5 +- .../quickstart-package-manifests.md | 4 +- .../olm-integration/testing-deployment.md | 11 +-- 12 files changed, 72 insertions(+), 178 deletions(-) create mode 100644 changelog/fragments/run-packagemanifests-flags-1.yaml diff --git a/changelog/fragments/run-packagemanifests-flags-1.yaml b/changelog/fragments/run-packagemanifests-flags-1.yaml new file mode 100644 index 0000000000..ef532a3545 --- /dev/null +++ b/changelog/fragments/run-packagemanifests-flags-1.yaml @@ -0,0 +1,16 @@ +entries: + - description: Removed the `--include-paths` flag from `run packagemanifests`. + kind: removal + breaking: true + migration: + header: Create resources manually that were passed to `run packagemanifests --include-paths` + body: > + The `run packagemanifests` subcommand no longer has the `--include-paths` flag to create + additional resources. Instead, use `kubectl apply -f ` before invoking `run packagemanifests`. + - description: Changed the `--operator-version` flag to `--version` in `run packagemanifests`. + kind: change + breaking: true + migration: + header: Change the `run packagemanifests` flag `--operator-version` to `--version` + body: > + `--operator-version` is now `--version`. diff --git a/internal/olm/operator/operator_manager.go b/internal/olm/operator/operator_manager.go index d7fbd07bb7..b789613ac0 100644 --- a/internal/olm/operator/operator_manager.go +++ b/internal/olm/operator/operator_manager.go @@ -15,10 +15,8 @@ package olm import ( - "bytes" "context" "fmt" - "io/ioutil" "log" "sync" "time" @@ -30,7 +28,6 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/yaml" "github.com/operator-framework/operator-sdk/internal/olm" internalolmclient "github.com/operator-framework/operator-sdk/internal/olm/client" @@ -64,8 +61,7 @@ type OperatorCmd struct { KubeconfigPath string // OperatorNamespace is the cluster namespace in which operator resources // are created. - // OperatorNamespace must already exist in the cluster or be defined in - // a manifest passed to IncludePaths. + // OperatorNamespace must already exist in the cluster. OperatorNamespace string // OLMNamespace is the namespace in which OLM is installed. OLMNamespace string @@ -75,9 +71,8 @@ type OperatorCmd struct { // "InstallModeType=[ns1,ns2[, ...]]" // // The InstallModeType string passed must be marked as "supported" in the - // CSV being installed. The namespaces passed must exist or be created by - // passing a Namespace manifest to IncludePaths. An empty set of namespaces - // can be used for AllNamespaces. + // CSV being installed. The namespaces passed must exist in the cluster. + // An empty set of namespaces can be used for AllNamespaces. InstallMode string // Timeout dictates how long to wait for a REST call to complete. A call // exceeding Timeout will generate an error. @@ -95,8 +90,7 @@ func (c *OperatorCmd) AddToFlagSet(fs *pflag.FlagSet) { fs.StringVar(&c.OLMNamespace, "olm-namespace", olm.DefaultOLMNamespace, "The namespace where OLM is installed") fs.StringVar(&c.OperatorNamespace, "operator-namespace", "", - "The namespace where operator resources are created. It must already exist "+ - "in the cluster or be defined in a manifest passed to --include") + "The namespace where operator resources are created. It must already exist in the cluster") fs.StringVar(&c.InstallMode, "install-mode", "", "InstallMode to create OperatorGroup with. Format: "+installModeFormat) fs.DurationVar(&c.Timeout, "timeout", defaultTimeout, @@ -129,7 +123,6 @@ type operatorManager struct { installMode operatorsv1alpha1.InstallModeType //nolint:structcheck targetNamespaces []string //nolint:structcheck - olmObjects []runtime.Object } func (c *OperatorCmd) newManager() (*operatorManager, error) { @@ -171,50 +164,3 @@ func (m *operatorManager) status(ctx context.Context, us ...*unstructured.Unstru } return m.client.GetObjectsStatus(ctx, objs...) } - -func (m operatorManager) hasCatalogSource() bool { - return containsKind(m.olmObjects, operatorsv1alpha1.CatalogSourceKind) -} - -func (m operatorManager) hasSubscription() bool { - return containsKind(m.olmObjects, operatorsv1alpha1.SubscriptionKind) -} - -func (m operatorManager) hasOperatorGroup() bool { - return containsKind(m.olmObjects, operatorsv1.OperatorGroupKind) -} - -func containsKind(objs []runtime.Object, kind string) bool { - for _, obj := range objs { - if obj.GetObjectKind().GroupVersionKind().Kind == kind { - return true - } - } - return false -} - -func readObjectsFromFile(path string) (objs []*unstructured.Unstructured, err error) { - b, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - scanner := k8sutil.NewYAMLScanner(bytes.NewBuffer(b)) - for scanner.Scan() { - b, err := yaml.YAMLToJSON(scanner.Bytes()) - if err != nil { - return nil, fmt.Errorf("failed to convert YAML to JSON before decode: %v", err) - } - u := &unstructured.Unstructured{} - if err := u.UnmarshalJSON(b); err != nil { - return nil, fmt.Errorf("failed to decode object from manifest %s: %w", path, err) - } - objs = append(objs, u) - } - if scanner.Err() != nil { - return nil, fmt.Errorf("failed to scan manifest %s: %w", path, scanner.Err()) - } - if len(objs) == 0 { - return nil, fmt.Errorf("no objects found in manifest %s", path) - } - return objs, nil -} diff --git a/internal/olm/operator/packagemanifests.go b/internal/olm/operator/packagemanifests.go index 85fd256e7e..a46568ffec 100644 --- a/internal/olm/operator/packagemanifests.go +++ b/internal/olm/operator/packagemanifests.go @@ -30,32 +30,18 @@ type PackageManifestsCmd struct { // ManifestsDir is a directory containing 1..N package directories and // a package manifest. - // OperatorVersion can be set to the version of the desired operator package + // Version can be set to the version of the desired operator package // and Run()/Cleanup() will deploy that operator version. ManifestsDir string - // OperatorVersion is the version of the operator to deploy. It must be + // Version is the version of the operator to deploy. It must be // a semantic version, ex. 0.0.1. - OperatorVersion string - // IncludePaths are path to manifests of Kubernetes resources that either - // supplement or override defaults generated by methods of PackageManifestsCmd. These - // manifests can be but are not limited to: RBAC, Subscriptions, - // CatalogSources, OperatorGroups. - // - // Kinds that are overridden if supplied: - // - CatalogSource - // - Subscription - // - OperatorGroup - IncludePaths []string + Version string } func (c *PackageManifestsCmd) AddToFlagSet(fs *pflag.FlagSet) { c.OperatorCmd.AddToFlagSet(fs) - fs.StringVar(&c.OperatorVersion, "operator-version", "", - "Version of operator to deploy") - fs.StringSliceVar(&c.IncludePaths, "include", nil, - "Path to Kubernetes resource manifests, ex. Role, Subscription. "+ - "These supplement or override defaults generated by run/cleanup") + fs.StringVar(&c.Version, "version", "", "Packaged version of the operator to deploy") } func (c *PackageManifestsCmd) validate() error { @@ -70,7 +56,7 @@ func (c *PackageManifestsCmd) validate() error { return fmt.Errorf("%s must be a directory", c.ManifestsDir) } - if c.OperatorVersion == "" { + if c.Version == "" { return errors.New("operator version must be set") } diff --git a/internal/olm/operator/packagemanifests_manager.go b/internal/olm/operator/packagemanifests_manager.go index 703c3e4f8e..608e4b5355 100644 --- a/internal/olm/operator/packagemanifests_manager.go +++ b/internal/olm/operator/packagemanifests_manager.go @@ -41,32 +41,13 @@ type packageManifestsManager struct { func (c *PackageManifestsCmd) newManager() (m *packageManifestsManager, err error) { m = &packageManifestsManager{ - version: c.OperatorVersion, + version: c.Version, forceRegistry: c.ForceRegistry, } if m.operatorManager, err = c.OperatorCmd.newManager(); err != nil { return nil, err } - // Parse k8s objects. - for _, path := range c.IncludePaths { - if path != "" { - objs, err := readObjectsFromFile(path) - if err != nil { - return nil, err - } - for _, obj := range objs { - m.olmObjects = append(m.olmObjects, obj) - } - } - } - // Since a Subscription refers to a CatalogSource, supplying one but - // not the other is an error. - hasSub, hasCatSrc := m.hasSubscription(), m.hasCatalogSource() - if hasSub || hasCatSrc && !(hasSub && hasCatSrc) { - return nil, errors.New("both a CatalogSource and Subscription must be supplied if one is supplied") - } - // Operator bundles and metadata. m.pkg, m.bundles, err = apimanifests.GetManifestsDir(c.ManifestsDir) if err != nil { @@ -135,39 +116,22 @@ func (m *packageManifestsManager) run(ctx context.Context) (err error) { return fmt.Errorf("error creating registry resources: %w", err) } + // New CatalogSource. + registryGRPCAddr := internalregistry.GetRegistryServiceAddr(pkgName, m.olmNamespace) + catsrc := newCatalogSource(pkgName, m.operatorNamespace, withGRPC(registryGRPCAddr)) + // New Subscription. + channel, err := getChannelForCSVName(m.pkg, csv.GetName()) + if err != nil { + return err + } + sub := newSubscription(csv.GetName(), m.operatorNamespace, + withPackageChannel(pkgName, channel), + withCatalogSource(getCatalogSourceName(pkgName), m.operatorNamespace)) + // New SDK-managed OperatorGroup. + og := newSDKOperatorGroup(m.operatorNamespace, + withTargetNamespaces(m.targetNamespaces...)) + objects := []runtime.Object{catsrc, sub, og} log.Info("Creating resources") - if !m.hasCatalogSource() { - registryGRPCAddr := internalregistry.GetRegistryServiceAddr(pkgName, m.olmNamespace) - catsrc := newCatalogSource(pkgName, m.operatorNamespace, withGRPC(registryGRPCAddr)) - m.olmObjects = append(m.olmObjects, catsrc) - } - if !m.hasSubscription() { - channel, err := getChannelForCSVName(m.pkg, csv.GetName()) - if err != nil { - return err - } - sub := newSubscription(csv.GetName(), m.operatorNamespace, - withPackageChannel(pkgName, channel), - withCatalogSource(getCatalogSourceName(pkgName), m.operatorNamespace)) - m.olmObjects = append(m.olmObjects, sub) - } - if !m.hasOperatorGroup() { - og := newSDKOperatorGroup(m.operatorNamespace, - withTargetNamespaces(m.targetNamespaces...)) - m.olmObjects = append(m.olmObjects, og) - } - // Check for Namespace objects and create those first. - namespaces, objects := []runtime.Object{}, []runtime.Object{} - for _, obj := range m.olmObjects { - if obj.GetObjectKind().GroupVersionKind().Kind == "Namespace" { - namespaces = append(namespaces, obj) - } else { - objects = append(objects, obj) - } - } - if err = m.client.DoCreate(ctx, namespaces...); err != nil { - return fmt.Errorf("error creating operator resources: %w", err) - } if err = m.client.DoCreate(ctx, objects...); err != nil { return fmt.Errorf("error creating operator resources: %w", err) } @@ -213,25 +177,18 @@ func (m *packageManifestsManager) cleanup(ctx context.Context) (err error) { return fmt.Errorf("error removing registry resources: %w", err) } - log.Info("Deleting resources") - if !m.hasCatalogSource() { - m.olmObjects = append(m.olmObjects, newCatalogSource(pkgName, m.operatorNamespace)) - } - if !m.hasSubscription() { - m.olmObjects = append(m.olmObjects, newSubscription(csv.GetName(), m.operatorNamespace)) - } - if !m.hasOperatorGroup() { - m.olmObjects = append(m.olmObjects, newSDKOperatorGroup(m.operatorNamespace)) - } - toDelete := []runtime.Object{} - for _, obj := range m.olmObjects { - toDelete = append(toDelete, obj.DeepCopyObject()) + // Delete CatalogSource, Subscription, the SDK-managed OperatorGroup, and any bundle objects. + toDelete := []runtime.Object{ + newCatalogSource(pkgName, m.operatorNamespace), + newSubscription(csv.GetName(), m.operatorNamespace), + newSDKOperatorGroup(m.operatorNamespace), } for _, obj := range bundle.Objects { objc := obj.DeepCopy() objc.SetNamespace(m.operatorNamespace) toDelete = append(toDelete, objc) } + log.Info("Deleting resources") if err = m.client.DoDelete(ctx, toDelete...); err != nil { return fmt.Errorf("error deleting operator resources: %w", err) } diff --git a/test/e2e-helm/e2e_helm_olm_test.go b/test/e2e-helm/e2e_helm_olm_test.go index c69f590fab..cac7960912 100644 --- a/test/e2e-helm/e2e_helm_olm_test.go +++ b/test/e2e-helm/e2e_helm_olm_test.go @@ -40,7 +40,7 @@ var _ = Describe("Integrating Helm Projects with OLM", func() { AfterEach(func() { By("destroying the deployed package manifests-formatted operator") cleanupPkgManCmd := exec.Command(tc.BinaryName, "cleanup", "packagemanifests", - "--operator-version", operatorVersion, + "--version", operatorVersion, "--timeout", "4m") _, _ = tc.Run(cleanupPkgManCmd) @@ -93,7 +93,7 @@ var _ = Describe("Integrating Helm Projects with OLM", func() { By("running the package") runPkgManCmd := exec.Command(tc.BinaryName, "run", "packagemanifests", "--install-mode", "AllNamespaces", - "--operator-version", operatorVersion, + "--version", operatorVersion, "--timeout", "4m") _, err = tc.Run(runPkgManCmd) Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/e2e_suite.go b/test/e2e/e2e_suite.go index 5ae3d7cb76..08b196e091 100644 --- a/test/e2e/e2e_suite.go +++ b/test/e2e/e2e_suite.go @@ -197,7 +197,7 @@ var _ = Describe("operator-sdk", func() { runPkgManCmd := exec.Command(tc.BinaryName, "run", "packagemanifests", "--install-mode", "AllNamespaces", "--operator-namespace", tc.Kubectl.Namespace, - "--operator-version", operatorVersion, + "--version", operatorVersion, "--timeout", "4m") _, err = tc.Run(runPkgManCmd) Expect(err).NotTo(HaveOccurred()) @@ -205,7 +205,7 @@ var _ = Describe("operator-sdk", func() { By("destroying the deployed package manifests-formatted operator") cleanupPkgManCmd := exec.Command(tc.BinaryName, "cleanup", "packagemanifests", "--operator-namespace", tc.Kubectl.Namespace, - "--operator-version", operatorVersion, + "--version", operatorVersion, "--timeout", "4m") _, err = tc.Run(cleanupPkgManCmd) Expect(err).NotTo(HaveOccurred()) diff --git a/test/integration/integration_helpers.go b/test/integration/integration_helpers.go index c4b1a59f23..b6d85b17d7 100644 --- a/test/integration/integration_helpers.go +++ b/test/integration/integration_helpers.go @@ -49,7 +49,7 @@ type DefinitionKey struct { type CSVTemplateConfig struct { OperatorName string - OperatorVersion string + Version string TestImageTag string ReplacesCSVName string CRDKeys []DefinitionKey @@ -63,7 +63,7 @@ kind: ClusterServiceVersion metadata: annotations: capabilities: Basic Install - name: {{ .OperatorName }}.v{{ .OperatorVersion }} + name: {{ .OperatorName }}.v{{ .Version }} namespace: placeholder spec: apiservicedefinitions: {} @@ -196,7 +196,7 @@ spec: {{- if .ReplacesCSVName }} replaces: {{ .ReplacesCSVName }} {{- end }} - version: {{ .OperatorVersion }} + version: {{ .Version }} ` func writeOperatorManifests(dir string, csvConfig CSVTemplateConfig) error { @@ -204,7 +204,7 @@ func writeOperatorManifests(dir string, csvConfig CSVTemplateConfig) error { if csvConfig.IsBundle { manifestDir = filepath.Join(dir, bundle.ManifestsDir) } else { - manifestDir = filepath.Join(dir, csvConfig.OperatorVersion) + manifestDir = filepath.Join(dir, csvConfig.Version) } for _, key := range csvConfig.CRDKeys { crd := apiextv1beta1.CustomResourceDefinition{ diff --git a/test/integration/operator_olm_test.go b/test/integration/operator_olm_test.go index 84a17c0885..718cdc6cc8 100644 --- a/test/integration/operator_olm_test.go +++ b/test/integration/operator_olm_test.go @@ -58,7 +58,7 @@ func PackageManifestsAllNamespaces(t *testing.T) { csvConfig := CSVTemplateConfig{ OperatorName: defaultOperatorName, - OperatorVersion: defaultOperatorVersion, + Version: defaultOperatorVersion, TestImageTag: testImageTag, ReplacesCSVName: "", CRDKeys: []DefinitionKey{ @@ -102,8 +102,8 @@ func PackageManifestsAllNamespaces(t *testing.T) { OLMNamespace: olm.DefaultOLMNamespace, InstallMode: string(operatorsv1alpha1.InstallModeTypeAllNamespaces), }, - ManifestsDir: manifestsDir, - OperatorVersion: defaultOperatorVersion, + ManifestsDir: manifestsDir, + Version: defaultOperatorVersion, } // Cleanup. defer func() { @@ -121,7 +121,7 @@ func PackageManifestsBasic(t *testing.T) { csvConfig := CSVTemplateConfig{ OperatorName: defaultOperatorName, - OperatorVersion: defaultOperatorVersion, + Version: defaultOperatorVersion, TestImageTag: testImageTag, ReplacesCSVName: "", CRDKeys: []DefinitionKey{ @@ -164,8 +164,8 @@ func PackageManifestsBasic(t *testing.T) { Timeout: defaultTimeout, OLMNamespace: olm.DefaultOLMNamespace, }, - ManifestsDir: manifestsDir, - OperatorVersion: defaultOperatorVersion, + ManifestsDir: manifestsDir, + Version: defaultOperatorVersion, } // Cleanup. defer func() { @@ -196,7 +196,7 @@ func PackageManifestsMultiplePackages(t *testing.T) { csvConfigs := []CSVTemplateConfig{ { OperatorName: defaultOperatorName, - OperatorVersion: operatorVersion1, + Version: operatorVersion1, TestImageTag: testImageTag, ReplacesCSVName: "", CRDKeys: []DefinitionKey{ @@ -218,7 +218,7 @@ func PackageManifestsMultiplePackages(t *testing.T) { }, { OperatorName: defaultOperatorName, - OperatorVersion: operatorVersion2, + Version: operatorVersion2, TestImageTag: testImageTag, ReplacesCSVName: fmt.Sprintf("%s.v%s", defaultOperatorName, operatorVersion1), CRDKeys: []DefinitionKey{ @@ -267,8 +267,8 @@ func PackageManifestsMultiplePackages(t *testing.T) { Timeout: defaultTimeout, OLMNamespace: olm.DefaultOLMNamespace, }, - ManifestsDir: manifestsDir, - OperatorVersion: operatorVersion2, + ManifestsDir: manifestsDir, + Version: operatorVersion2, } // Cleanup. defer func() { diff --git a/website/content/en/docs/cli/operator-sdk_cleanup_packagemanifests.md b/website/content/en/docs/cli/operator-sdk_cleanup_packagemanifests.md index 49f2bb0ae2..6c1ef41673 100644 --- a/website/content/en/docs/cli/operator-sdk_cleanup_packagemanifests.md +++ b/website/content/en/docs/cli/operator-sdk_cleanup_packagemanifests.md @@ -19,13 +19,12 @@ operator-sdk cleanup packagemanifests [flags] ``` -h, --help help for packagemanifests - --include strings Path to Kubernetes resource manifests, ex. Role, Subscription. These supplement or override defaults generated by run/cleanup --install-mode string InstallMode to create OperatorGroup with. Format: InstallModeType[=ns1,ns2[, ...]] --kubeconfig string The file path to kubernetes configuration file. Defaults to location specified by $KUBECONFIG, or to default file rules if not set --olm-namespace string The namespace where OLM is installed (default "olm") - --operator-namespace string The namespace where operator resources are created. It must already exist in the cluster or be defined in a manifest passed to --include - --operator-version string Version of operator to deploy + --operator-namespace string The namespace where operator resources are created. It must already exist in the cluster --timeout duration Time to wait for the command to complete before failing (default 2m0s) + --version string Packaged version of the operator to deploy ``` ### Options inherited from parent commands diff --git a/website/content/en/docs/cli/operator-sdk_run_packagemanifests.md b/website/content/en/docs/cli/operator-sdk_run_packagemanifests.md index d162ad8bc0..c14ee4d4bb 100644 --- a/website/content/en/docs/cli/operator-sdk_run_packagemanifests.md +++ b/website/content/en/docs/cli/operator-sdk_run_packagemanifests.md @@ -18,13 +18,12 @@ operator-sdk run packagemanifests [flags] ``` -h, --help help for packagemanifests - --include strings Path to Kubernetes resource manifests, ex. Role, Subscription. These supplement or override defaults generated by run/cleanup --install-mode string InstallMode to create OperatorGroup with. Format: InstallModeType[=ns1,ns2[, ...]] --kubeconfig string The file path to kubernetes configuration file. Defaults to location specified by $KUBECONFIG, or to default file rules if not set --olm-namespace string The namespace where OLM is installed (default "olm") - --operator-namespace string The namespace where operator resources are created. It must already exist in the cluster or be defined in a manifest passed to --include - --operator-version string Version of operator to deploy + --operator-namespace string The namespace where operator resources are created. It must already exist in the cluster --timeout duration Time to wait for the command to complete before failing (default 2m0s) + --version string Packaged version of the operator to deploy ``` ### Options inherited from parent commands diff --git a/website/content/en/docs/olm-integration/quickstart-package-manifests.md b/website/content/en/docs/olm-integration/quickstart-package-manifests.md index da5cc08ab5..45605a183e 100644 --- a/website/content/en/docs/olm-integration/quickstart-package-manifests.md +++ b/website/content/en/docs/olm-integration/quickstart-package-manifests.md @@ -37,7 +37,7 @@ to make sure OLM can deploy our Operator successfully before attempting real pro most use cases the following invocation is all we need: ```console -$ operator-sdk run packagemanifests --operator-version 0.0.1 +$ operator-sdk run packagemanifests --version 0.0.1 INFO[0000] Running operator from directory packagemanifests INFO[0000] Creating memcached-operator registry INFO[0000] Creating ConfigMap "olm/memcached-operator-registry-manifests-package" @@ -71,7 +71,7 @@ Now that we're done testing the memcached-operator, we should probably clean up [`operator-sdk cleanup packagemanifests`][cli-cleanup-packagemanifests] will do this for you: ```console -$ operator-sdk cleanup packagemanifests --operator-version 0.0.1 +$ operator-sdk cleanup packagemanifests --version 0.0.1 INFO[0000] Deleting resources INFO[0000] Deleting CatalogSource "default/memcached-operator-ocs" INFO[0000] Deleting Subscription "default/memcached-operator-v0-0-1-sub" diff --git a/website/content/en/docs/olm-integration/testing-deployment.md b/website/content/en/docs/olm-integration/testing-deployment.md index 010cefb524..18f0fce0ff 100644 --- a/website/content/en/docs/olm-integration/testing-deployment.md +++ b/website/content/en/docs/olm-integration/testing-deployment.md @@ -26,7 +26,7 @@ Let's look at the anatomy of the `run packagemanifests` (which is the same for ` - **operator-namespace**: the cluster namespace in which Operator resources are created. - This namespace must already exist in the cluster or be defined in a manifest passed to **include-paths**. - **manifests-dir**: a directory containing the Operator's package manifests. -- **operator-version**: the version of the Operator to deploy. It must be a semantic version, ex. 0.0.1. +- **version**: the version of the Operator to deploy. It must be a semantic version, ex. 0.0.1. - This version must match the version of the CSV manifest found in **manifests-dir**, ex. `packagemanifests/0.0.1` in an Operator SDK project. - **install-mode**: specifies which supported [`installMode`][csv-install-modes] should be used to @@ -38,15 +38,6 @@ Let's look at the anatomy of the `run packagemanifests` (which is the same for ` This is the default. - `SingleNamespace="my-ns"`: the Operator will watch a namespace, not necessarily its own. - `AllNamespaces=""`: the Operator will watch all namespaces (cluster-scoped Operators). -- **include-paths**: a list of paths to manifests of Kubernetes resources that either - supplement or supplant defaults generated by `run`, ex. RBAC kinds. - - This option can be used if you have an existing set of manifests outside your versioned package - (ex. catalog manifests like a `Subscription`, `CatalogSource`, and/or `OperatorGroup`) - you wish to use instead of the corresponding defaults. - - Paths supplied to this command will be created with the same behavior of `kubectl create -f `. - - Kinds that are overridden if supplied: `CatalogSource`, `Subscription`, `OperatorGroup`. - - If a `Subscription` or `CatalogSource` are supplied, the other must be supplied - since they are linked by field references. - **timeout**: a time string dictating the maximum time that `run` can run. The command will return an error if the timeout is exceeded.