-
Notifications
You must be signed in to change notification settings - Fork 1.8k
cmd/operator-sdk/alpha: 'up/down olm' commands to run an operator #1912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 39 commits
b890ef5
2da1009
ea20611
7324bfd
17471e5
fefa150
6c89c93
86f170f
11e63dd
e62ca67
bc43140
4e11d1d
5ef2709
cf7e499
320bec7
9dce014
54f2dbd
52931a2
bbf43c1
d82f7da
61ce024
1e51543
1c600c3
a5eb84f
918a6a0
74e4b8c
3842b55
ec2fab6
50ee689
a97f01e
c382576
e61fd47
a87c6e9
ed368ae
ea728e3
c489e80
4a303c3
94382d2
d95369e
b695492
5e150cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux | ||
|
||
# Prow CI setup. | ||
component="memcached-operator" | ||
eval IMAGE=$IMAGE_FORMAT | ||
export OSDK_INTEGRATION_IMAGE="$IMAGE" | ||
|
||
# Integration tests will use default loading rules for the kubeconfig if | ||
# KUBECONFIG is not set. | ||
# Assumes OLM is installed. | ||
go test -v ./test/integration |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2019 The Operator-SDK Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package olm | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
olmoperator "github.com/operator-framework/operator-sdk/internal/olm/operator" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewDownCmd() *cobra.Command { | ||
c := &olmoperator.OLMCmd{} | ||
cmd := &cobra.Command{ | ||
Use: "down", | ||
Short: "Tears down the operator with Operator Lifecycle Manager", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
if len(args) != 1 { | ||
return fmt.Errorf("command %q requires exactly one argument", cmd.CommandPath()) | ||
} | ||
c.ManifestsDir = args[0] | ||
if err := c.Down(); err != nil { | ||
log.Fatalf("Failed to uninstall operator: %v", err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the log we have unninstall, so wdyt about the command be olm uninstall instead of down? |
||
} | ||
return nil | ||
}, | ||
} | ||
c.AddToFlagSet(cmd.Flags()) | ||
return cmd | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2019 The Operator-SDK Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package olm | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
olmoperator "github.com/operator-framework/operator-sdk/internal/olm/operator" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewUpCmd() *cobra.Command { | ||
c := &olmoperator.OLMCmd{} | ||
cmd := &cobra.Command{ | ||
Use: "up", | ||
Short: "Launches the operator with Operator Lifecycle Manager", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
if len(args) != 1 { | ||
return fmt.Errorf("command %q requires exactly one argument", cmd.CommandPath()) | ||
} | ||
c.ManifestsDir = args[0] | ||
if err := c.Up(); err != nil { | ||
log.Fatalf("Failed to install operator: %v", err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the log we have install, so wdyt about the command be olm install instead of up? |
||
} | ||
return nil | ||
}, | ||
} | ||
c.AddToFlagSet(cmd.Flags()) | ||
return cmd | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,10 +1,10 @@ | ||||||
## operator-sdk alpha olm | ||||||
|
||||||
Manage the Operator Lifecycle Manager installation in your cluster | ||||||
Manage the Operator Lifecycle Manager installation and Operators in your cluster | ||||||
|
||||||
### Synopsis | ||||||
|
||||||
Manage the Operator Lifecycle Manager installation in your cluster | ||||||
Manage the Operator Lifecycle Manager installation and Operators in your cluster | ||||||
|
||||||
### Options | ||||||
|
||||||
|
@@ -15,7 +15,9 @@ Manage the Operator Lifecycle Manager installation in your cluster | |||||
### SEE ALSO | ||||||
|
||||||
* [operator-sdk alpha](operator-sdk_alpha.md) - Run an alpha subcommand | ||||||
* [operator-sdk alpha olm down](operator-sdk_alpha_olm_down.md) - Tears down the operator with Operator Lifecycle Manager | ||||||
* [operator-sdk alpha olm install](operator-sdk_alpha_olm_install.md) - Install Operator Lifecycle Manager in your cluster | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since it will enable the OLM on the cluster wdyt about we use to enable/disable and install/uninstall? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The terminology will change depending on how you view "running software in a Kubernetes cluster". For example, OLM has two operator components that manage operator installation through CSVs, so technically you're "installing" both OLM and your operator. You're not explicitly "enabling" anything because installation implies enablement here. For now, OLM installation management will use That being said, there's room to adjust command names while these commands are in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* [operator-sdk alpha olm status](operator-sdk_alpha_olm_status.md) - Get the status of the Operator Lifecycle Manager installation in your cluster | ||||||
* [operator-sdk alpha olm uninstall](operator-sdk_alpha_olm_uninstall.md) - Uninstall Operator Lifecycle Manager from your cluster | ||||||
* [operator-sdk alpha olm up](operator-sdk_alpha_olm_up.md) - Launches the operator with Operator Lifecycle Manager | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doc is auto-generated correctly, hence the passing tests. |
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## operator-sdk alpha olm down | ||
|
||
Tears down the operator with Operator Lifecycle Manager | ||
|
||
### Synopsis | ||
|
||
Tears down the operator with Operator Lifecycle Manager | ||
|
||
``` | ||
operator-sdk alpha olm down [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--force Force operator-sdk up/down to overwrite/delete all resources known to the command, respectively | ||
-h, --help help for down | ||
--include strings Path to Kubernetes resource manifests, ex. Role, Subscription. These supplement or override defaults generated by up/down | ||
--install-mode string InstallMode to create OperatorGroup with. Format: InstallModeType=[ns1,ns2[, ...]] | ||
--kubeconfig string Path to kubeconfig | ||
--namespace string Namespace in which to create resources | ||
--operator-version string Version of operator to deploy | ||
--timeout duration Time to wait for the command to complete before failing (default 2m0s) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [operator-sdk alpha olm](operator-sdk_alpha_olm.md) - Manage the Operator Lifecycle Manager installation and Operators in your cluster | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## operator-sdk alpha olm up | ||
|
||
Launches the operator with Operator Lifecycle Manager | ||
|
||
### Synopsis | ||
|
||
Launches the operator with Operator Lifecycle Manager | ||
|
||
``` | ||
operator-sdk alpha olm up [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--force Force operator-sdk up/down to overwrite/delete all resources known to the command, respectively | ||
-h, --help help for up | ||
--include strings Path to Kubernetes resource manifests, ex. Role, Subscription. These supplement or override defaults generated by up/down | ||
--install-mode string InstallMode to create OperatorGroup with. Format: InstallModeType=[ns1,ns2[, ...]] | ||
--kubeconfig string Path to kubeconfig | ||
--namespace string Namespace in which to create resources | ||
--operator-version string Version of operator to deploy | ||
--timeout duration Time to wait for the command to complete before failing (default 2m0s) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [operator-sdk alpha olm](operator-sdk_alpha_olm.md) - Manage the Operator Lifecycle Manager installation and Operators in your cluster | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not it just about the integration with OLM? WDYT about we add olm in the name to make it clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always add more tests to
test-integration
later. We shouldn't have separate targets for every integration test IMO. The Makefile will explode more than it already has.