Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changelog/fragments/bundle-validate-default-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
entries:
- description: >
The `generate bundle` subcommand no longer requires a default channel be set nor defaults
to the first channel provided to `--channels`.
kind: change
breaking: false
- description: >
The `bundle validate` subcommand no longer returns an error if a bundle does not have a default channel.
kind: change
breaking: false
11 changes: 0 additions & 11 deletions cmd/operator-sdk/generate/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/operator-framework/operator-registry/pkg/lib/bundle"
"sigs.k8s.io/kubebuilder/pkg/model/config"
Expand Down Expand Up @@ -102,11 +101,6 @@ func (c *bundleCmd) setCommonDefaults(cfg *config.Config) {
if c.operatorName == "" {
c.operatorName = filepath.Base(cfg.Repo)
}
// A default channel can be inferred if there is only one channel. Don't infer
// default otherwise; the user must set this value.
if c.defaultChannel == "" && strings.Count(c.channels, ",") == 0 {
c.defaultChannel = c.channels
}
}

// validateManifests validates c for bundle manifests generation.
Expand Down Expand Up @@ -221,11 +215,6 @@ func (c bundleCmd) runManifests(cfg *config.Config) (err error) {

// validateMetadata validates c for bundle metadata generation.
func (c bundleCmd) validateMetadata(*config.Config) (err error) {
// Ensure a default channel is present.
if c.defaultChannel == "" {
return fmt.Errorf("--default-channel must be set if setting multiple channels")
}

return nil
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/operator-framework/api v0.3.8
github.com/operator-framework/operator-registry v1.12.6-0.20200611222234-275301b779f8
github.com/operator-framework/operator-registry v1.13.4
github.com/pborman/uuid v1.2.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.5.1
Expand All @@ -31,7 +31,7 @@ require (
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.5.1
go.uber.org/zap v1.14.1
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/net v0.0.0-20200625001655-4c5254603344
golang.org/x/tools v0.0.0-20200403190813-44a64ad78b9b
gomodules.xyz/jsonpatch/v3 v3.0.1
gopkg.in/yaml.v2 v2.2.8
Expand Down
Loading