Skip to content

Commit

Permalink
Allow namespace for inlets-operator with helm3
Browse files Browse the repository at this point in the history
With helm3 the namespace isn't an issue - so allow the user
to give an alternative namespace.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Jun 5, 2020
1 parent 37f082e commit 74b7e04
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/apps/inletsoperator_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ func MakeInstallInletsOperator() *cobra.Command {
namespace, _ := command.Flags().GetString("namespace")

if namespace != "default" {
return fmt.Errorf(`to override the namespace, install inlets-operator via helm manually`)
if helm3 == false {
return fmt.Errorf(`to override the namespace, use helm3 or install inlets-operator via helm manually`)
}
}

arch := getNodeArchitecture()
Expand Down Expand Up @@ -125,6 +127,7 @@ func MakeInstallInletsOperator() *cobra.Command {

res, err := kubectlTask("create", "secret", "generic",
"inlets-access-key",
"--namespace="+namespace,
"--from-file", "inlets-access-key="+tokenFileName)

if len(res.Stderr) > 0 && strings.Contains(res.Stderr, "AlreadyExists") {
Expand All @@ -140,6 +143,7 @@ func MakeInstallInletsOperator() *cobra.Command {
if len(secretKeyFile) > 0 {
res, err := kubectlTask("create", "secret", "generic",
"inlets-secret-key",
"--namespace="+namespace,
"--from-file", "inlets-secret-key="+secretKeyFile)
if len(res.Stderr) > 0 && strings.Contains(res.Stderr, "AlreadyExists") {
fmt.Println("[Warning] secret inlets-access-key already exists and will be used.")
Expand Down Expand Up @@ -288,7 +292,8 @@ func getInletsOperatorOverrides(command *cobra.Command) (map[string]string, erro
}

const InletsOperatorInfoMsg = `# The default configuration is for DigitalOcean and your secret is
# stored as "inlets-access-key" in the "default" namespace.
# stored as "inlets-access-key" in the "default" namespace or the namespace
# you gave if installing with helm3
# To get your first Public IP run the following:
Expand Down

0 comments on commit 74b7e04

Please sign in to comment.