From 14be71c179d7cd2b399d7b36ef6b6238038f5611 Mon Sep 17 00:00:00 2001 From: "jesus m. rodriguez" Date: Mon, 14 Sep 2020 22:26:45 -0400 Subject: [PATCH 1/2] Enable run bundle command --- internal/cmd/operator-sdk/run/cmd.go | 8 ++--- internal/cmd/operator-sdk/run/cmd_test.go | 5 +-- .../content/en/docs/cli/operator-sdk_run.md | 2 +- .../en/docs/cli/operator-sdk_run_bundle.md | 36 +++++++++++++++++++ 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 website/content/en/docs/cli/operator-sdk_run_bundle.md diff --git a/internal/cmd/operator-sdk/run/cmd.go b/internal/cmd/operator-sdk/run/cmd.go index 5fb87cda1b..17aecfb236 100644 --- a/internal/cmd/operator-sdk/run/cmd.go +++ b/internal/cmd/operator-sdk/run/cmd.go @@ -17,6 +17,7 @@ package run import ( "github.com/spf13/cobra" + "github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/run/bundle" "github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/run/packagemanifests" "github.com/operator-framework/operator-sdk/internal/olm/operator" ) @@ -25,16 +26,13 @@ func NewCmd() *cobra.Command { cmd := &cobra.Command{ Use: "run", Short: "Run an Operator in a variety of environments", - // TODO(joelanford): remove the second sentence when `run bundle` implementation is complete - Long: `This command has subcommands that will deploy your Operator with OLM. -Currently only the package manifests format is supported via the 'packagemanifests' subcommand.`, + Long: `This command has subcommands that will deploy your Operator with OLM.`, } cfg := &operator.Configuration{} cmd.AddCommand( - // TODO(joelanford): enable bundle command when implementation is complete - // bundle.NewCmd(cfg), + bundle.NewCmd(cfg), packagemanifests.NewCmd(cfg), ) diff --git a/internal/cmd/operator-sdk/run/cmd_test.go b/internal/cmd/operator-sdk/run/cmd_test.go index c7784db851..ea4d80cc86 100644 --- a/internal/cmd/operator-sdk/run/cmd_test.go +++ b/internal/cmd/operator-sdk/run/cmd_test.go @@ -29,8 +29,9 @@ var _ = Describe("Running a run command", func() { Expect(cmd.Long).NotTo(BeNil()) subcommands := cmd.Commands() - Expect(len(subcommands)).To(Equal(1)) - Expect(subcommands[0].Use).To(Equal("packagemanifests [packagemanifests-root-dir]")) + Expect(len(subcommands)).To(Equal(2)) + Expect(subcommands[0].Use).To(Equal("bundle ")) + Expect(subcommands[1].Use).To(Equal("packagemanifests [packagemanifests-root-dir]")) }) }) }) diff --git a/website/content/en/docs/cli/operator-sdk_run.md b/website/content/en/docs/cli/operator-sdk_run.md index 414fccc760..7b667d2955 100644 --- a/website/content/en/docs/cli/operator-sdk_run.md +++ b/website/content/en/docs/cli/operator-sdk_run.md @@ -8,7 +8,6 @@ Run an Operator in a variety of environments ### Synopsis This command has subcommands that will deploy your Operator with OLM. -Currently only the package manifests format is supported via the 'packagemanifests' subcommand. ### Options @@ -25,5 +24,6 @@ Currently only the package manifests format is supported via the 'packagemanifes ### SEE ALSO * [operator-sdk](../operator-sdk) - Development kit for building Kubernetes extensions and tools. +* [operator-sdk run bundle](../operator-sdk_run_bundle) - Deploy an Operator in the bundle format with OLM * [operator-sdk run packagemanifests](../operator-sdk_run_packagemanifests) - Deploy an Operator in the package manifests format with OLM diff --git a/website/content/en/docs/cli/operator-sdk_run_bundle.md b/website/content/en/docs/cli/operator-sdk_run_bundle.md new file mode 100644 index 0000000000..5708e29187 --- /dev/null +++ b/website/content/en/docs/cli/operator-sdk_run_bundle.md @@ -0,0 +1,36 @@ +--- +title: "operator-sdk run bundle" +--- +## operator-sdk run bundle + +Deploy an Operator in the bundle format with OLM + +### Synopsis + +Deploy an Operator in the bundle format with OLM + +``` +operator-sdk run bundle [flags] +``` + +### Options + +``` + --index-image string index image in which to inject bundle (default "quay.io/operator-framework/upstream-opm-builder:latest") + --install-mode InstallModeValue install mode + --timeout duration install timeout (default 2m0s) + --kubeconfig string Path to the kubeconfig file to use for CLI requests. + -n, --namespace string If present, namespace scope for this CLI request + -h, --help help for bundle +``` + +### Options inherited from parent commands + +``` + --verbose Enable verbose logging +``` + +### SEE ALSO + +* [operator-sdk run](../operator-sdk_run) - Run an Operator in a variety of environments + From e4a447af9987efb024e3de2c225cbecce7c4b221 Mon Sep 17 00:00:00 2001 From: "jesus m. rodriguez" Date: Mon, 5 Oct 2020 22:05:59 -0400 Subject: [PATCH 2/2] fix test sanity --- ...cached-operator.clusterserviceversion.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/testdata/helm/memcached-operator/bundle/manifests/memcached-operator.clusterserviceversion.yaml b/testdata/helm/memcached-operator/bundle/manifests/memcached-operator.clusterserviceversion.yaml index 3d3879a52d..420931dfe3 100644 --- a/testdata/helm/memcached-operator/bundle/manifests/memcached-operator.clusterserviceversion.yaml +++ b/testdata/helm/memcached-operator/bundle/manifests/memcached-operator.clusterserviceversion.yaml @@ -172,17 +172,6 @@ spec: control-plane: controller-manager spec: containers: - - args: - - --secure-listen-address=0.0.0.0:8443 - - --upstream=http://127.0.0.1:8080/ - - --logtostderr=true - - --v=10 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0 - name: kube-rbac-proxy - ports: - - containerPort: 8443 - name: https - resources: {} - args: - --metrics-addr=127.0.0.1:8080 - --enable-leader-election @@ -196,6 +185,17 @@ spec: requests: cpu: 100m memory: 60Mi + - args: + - --secure-listen-address=0.0.0.0:8443 + - --upstream=http://127.0.0.1:8080/ + - --logtostderr=true + - --v=10 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0 + name: kube-rbac-proxy + ports: + - containerPort: 8443 + name: https + resources: {} terminationGracePeriodSeconds: 10 permissions: - rules: