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
1 change: 1 addition & 0 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ spec:
- Build
- DeploymentConfig
- ImageRegistry
- OperatorLifecycleManager
type: string
type: array
baselineCapabilitySet:
Expand Down
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ require (
github.com/microsoftgraph/msgraph-sdk-go v0.47.0
github.com/nutanix-cloud-native/prism-go-client v0.2.1-0.20220804130801-c8a253627c64
github.com/onsi/gomega v1.27.10
github.com/openshift/api v0.0.0-20230831095235-8891815aa476
github.com/openshift/api v0.0.0-20231003083825-c3f7566f6ef6
github.com/openshift/assisted-image-service v0.0.0-20230829160050-0b98ec74397b
github.com/openshift/assisted-service/api v0.0.0
github.com/openshift/assisted-service/client v0.0.0
Expand Down Expand Up @@ -91,20 +91,20 @@ require (
golang.org/x/oauth2 v0.8.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.10.0
golang.org/x/term v0.6.0
golang.org/x/term v0.10.0
google.golang.org/api v0.107.0
google.golang.org/genproto v0.0.0-20230112194545-e10362b5ecf9
google.golang.org/grpc v1.51.0
gopkg.in/ini.v1 v1.66.6
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.27.2
k8s.io/api v0.28.2
k8s.io/apiextensions-apiserver v0.26.1
k8s.io/apimachinery v0.27.2
k8s.io/apimachinery v0.28.2
k8s.io/client-go v12.0.0+incompatible
k8s.io/cloud-provider-vsphere v0.0.0
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.90.1
k8s.io/utils v0.0.0-20230209194617-a36077c30491
k8s.io/klog/v2 v2.100.1
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/controller-tools v0.10.0
sigs.k8s.io/yaml v1.3.0
)
Expand Down Expand Up @@ -151,7 +151,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
Expand Down Expand Up @@ -212,7 +212,7 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
Expand All @@ -224,7 +224,7 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/gorm v1.24.5 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
sigs.k8s.io/controller-runtime v0.14.5 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand All @@ -246,7 +246,7 @@ replace github.com/openshift/machine-config-operator => github.com/openshift/mac

// Needed because machine-api-operator uses a "later" v12 version, which is actually an earlier version.
// This should be kept in line with the k8s version used.
replace k8s.io/client-go => k8s.io/client-go v0.27.2
replace k8s.io/client-go => k8s.io/client-go v0.28.2

// Needed so that the InstallConfig CRD can be created. Later versions of controller-gen balk at using IPNet as a field.
replace sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.3.1-0.20200617211605-651903477185
Expand Down
72 changes: 29 additions & 43 deletions go.sum

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pkg/types/validation/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ func ValidateInstallConfig(c *types.InstallConfig, usingAgentMethod bool) field.
allErrs = append(allErrs, field.Invalid(field.NewPath("additionalEnabledCapabilities"), c.Capabilities.AdditionalEnabledCapabilities,
"the baremetal capability requires the MachineAPI capability"))
}
if enabledCaps.Has(configv1.ClusterVersionCapabilityMarketplace) && !enabledCaps.Has(configv1.ClusterVersionCapabilityOperatorLifecycleManager) {
allErrs = append(allErrs, field.Invalid(field.NewPath("additionalEnabledCapabilities"), c.Capabilities.AdditionalEnabledCapabilities,
"the marketplace capability requires the OperatorLifecycleManager capability"))
}
}
}

Expand Down
20 changes: 20 additions & 0 deletions pkg/types/validation/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,26 @@ func TestValidateInstallConfig(t *testing.T) {
}(),
expectedError: `capabilities.baselineCapabilitySet: Unsupported value: "vNotValid": supported values: .*`,
},
{
name: "invalid capability marketplace specified without OperatorLifecycleManager",
installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.Capabilities = &types.Capabilities{BaselineCapabilitySet: "None",
AdditionalEnabledCapabilities: []configv1.ClusterVersionCapability{"marketplace"}}
return c
}(),
expectedError: `additionalEnabledCapabilities: Invalid value: \[\]v1.ClusterVersionCapability{"marketplace"}: the marketplace capability requires the OperatorLifecycleManager capability`,
},
{
name: "invalid capability baremetal specified without MachineAPI",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This test seems unrelated to the current PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I noticed we were missing one for that case, so I figured it wouldn't hurt to add one since they're a similar code path

installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.Capabilities = &types.Capabilities{BaselineCapabilitySet: "None",
AdditionalEnabledCapabilities: []configv1.ClusterVersionCapability{"baremetal"}}
return c
}(),
expectedError: `additionalEnabledCapabilities: Invalid value: \[\]v1.ClusterVersionCapability{"baremetal"}: the baremetal capability requires the MachineAPI capability`,
},
{
name: "valid additional enabled capability specified",
installConfig: func() *types.InstallConfig {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading