diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index cfca43165..5ee29939c 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -29,11 +29,11 @@ $(CONFTEST): $(BINGO_DIR)/conftest.mod @echo "(re)installing $(GOBIN)/conftest-v0.62.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=conftest.mod -o=$(GOBIN)/conftest-v0.62.0 "github.com/open-policy-agent/conftest" -CONTROLLER_GEN := $(GOBIN)/controller-gen-v0.20.0 +CONTROLLER_GEN := $(GOBIN)/controller-gen-v0.20.1 $(CONTROLLER_GEN): $(BINGO_DIR)/controller-gen.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/controller-gen-v0.20.0" - @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=controller-gen.mod -o=$(GOBIN)/controller-gen-v0.20.0 "sigs.k8s.io/controller-tools/cmd/controller-gen" + @echo "(re)installing $(GOBIN)/controller-gen-v0.20.1" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=controller-gen.mod -o=$(GOBIN)/controller-gen-v0.20.1 "sigs.k8s.io/controller-tools/cmd/controller-gen" CRD_DIFF := $(GOBIN)/crd-diff-v0.5.0 $(CRD_DIFF): $(BINGO_DIR)/crd-diff.mod diff --git a/.bingo/controller-gen.mod b/.bingo/controller-gen.mod index 3a1d74ca3..62af3f7f7 100644 --- a/.bingo/controller-gen.mod +++ b/.bingo/controller-gen.mod @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT go 1.25.0 -require sigs.k8s.io/controller-tools v0.20.0 // cmd/controller-gen +require sigs.k8s.io/controller-tools v0.20.1 // cmd/controller-gen diff --git a/.bingo/controller-gen.sum b/.bingo/controller-gen.sum index 0c3abcb92..b22b093bc 100644 --- a/.bingo/controller-gen.sum +++ b/.bingo/controller-gen.sum @@ -175,6 +175,8 @@ sigs.k8s.io/controller-tools v0.19.0 h1:OU7jrPPiZusryu6YK0jYSjPqg8Vhf8cAzluP9XGI sigs.k8s.io/controller-tools v0.19.0/go.mod h1:y5HY/iNDFkmFla2CfQoVb2AQXMsBk4ad84iR1PLANB0= sigs.k8s.io/controller-tools v0.20.0 h1:VWZF71pwSQ2lZZCt7hFGJsOfDc5dVG28/IysjjMWXL8= sigs.k8s.io/controller-tools v0.20.0/go.mod h1:b4qPmjGU3iZwqn34alUU5tILhNa9+VXK+J3QV0fT/uU= +sigs.k8s.io/controller-tools v0.20.1 h1:gkfMt9YodI0K85oT8rVi80NTXO/kDmabKR5Ajn5GYxs= +sigs.k8s.io/controller-tools v0.20.1/go.mod h1:b4qPmjGU3iZwqn34alUU5tILhNa9+VXK+J3QV0fT/uU= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= diff --git a/.bingo/variables.env b/.bingo/variables.env index 7acfcea8d..ec6e75c3f 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -12,7 +12,7 @@ BINGO="${GOBIN}/bingo-v0.9.0" CONFTEST="${GOBIN}/conftest-v0.62.0" -CONTROLLER_GEN="${GOBIN}/controller-gen-v0.20.0" +CONTROLLER_GEN="${GOBIN}/controller-gen-v0.20.1" CRD_DIFF="${GOBIN}/crd-diff-v0.5.0" diff --git a/Makefile b/Makefile index a173f9b44..3b8c3079f 100644 --- a/Makefile +++ b/Makefile @@ -197,8 +197,10 @@ manifests: update-crds $(MANIFESTS) $(HELM) #EXHELP Generate OLMv1 manifests $(HELM) template olmv1 helm/olmv1 --set "options.openshift.enabled=true" > /dev/null .PHONY: generate -generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. - @find api cmd hack internal -name "zz_generated.deepcopy.go" -not -path "*/vendor/*" -delete # Need to delete the files for them to be generated properly +generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, DeepCopyObject, and ApplyConfiguration type implementations. + # Need to delete the files for them to be generated properly + @find api cmd hack internal -name "zz_generated.deepcopy.go" -not -path "*/vendor/*" -delete && rm -rf applyconfigurations + $(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) applyconfiguration:headerFile="hack/boilerplate.go.txt" paths="./api/..." $(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) object:headerFile="hack/boilerplate.go.txt" paths="./..." .PHONY: verify diff --git a/api/v1/clustercatalog_types.go b/api/v1/clustercatalog_types.go index 7afe631db..c8690cbaf 100644 --- a/api/v1/clustercatalog_types.go +++ b/api/v1/clustercatalog_types.go @@ -44,6 +44,8 @@ const ( ReasonUserSpecifiedUnavailable = "UserSpecifiedUnavailable" ) +// +genclient +// +genclient:nonNamespaced //+kubebuilder:object:root=true //+kubebuilder:resource:scope=Cluster //+kubebuilder:subresource:status diff --git a/api/v1/clusterextension_types.go b/api/v1/clusterextension_types.go index 7b0a39ef1..ee55109f8 100644 --- a/api/v1/clusterextension_types.go +++ b/api/v1/clusterextension_types.go @@ -537,6 +537,8 @@ type ClusterExtensionInstallStatus struct { Bundle BundleMetadata `json:"bundle"` } +// +genclient +// +genclient:nonNamespaced // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster // +kubebuilder:subresource:status diff --git a/api/v1/clusterextensionrevision_types.go b/api/v1/clusterextensionrevision_types.go index 389e4a5b3..f7e90db89 100644 --- a/api/v1/clusterextensionrevision_types.go +++ b/api/v1/clusterextensionrevision_types.go @@ -252,6 +252,8 @@ type ClusterExtensionRevisionStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } +// +genclient +// +genclient:nonNamespaced // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster // +kubebuilder:subresource:status diff --git a/api/v1/groupversion_info.go b/api/v1/groupversion_info.go index f2e8582ee..39efbee0d 100644 --- a/api/v1/groupversion_info.go +++ b/api/v1/groupversion_info.go @@ -17,6 +17,8 @@ limitations under the License. // Package v1 contains API Schema definitions for the olm v1 API group // +kubebuilder:object:generate=true // +groupName=olm.operatorframework.io +// +kubebuilder:ac:generate=true +// +kubebuilder:ac:output:package=../../applyconfigurations package v1 import ( @@ -28,6 +30,10 @@ var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "olm.operatorframework.io", Version: "v1"} + // SchemeGroupVersion is an alias for GroupVersion, required by the + // generated apply configuration code. + SchemeGroupVersion = GroupVersion + // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/applyconfigurations/api/v1/bundlemetadata.go b/applyconfigurations/api/v1/bundlemetadata.go new file mode 100644 index 000000000..acf9d152f --- /dev/null +++ b/applyconfigurations/api/v1/bundlemetadata.go @@ -0,0 +1,54 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// BundleMetadataApplyConfiguration represents a declarative configuration of the BundleMetadata type for use +// with apply. +// +// BundleMetadata is a representation of the identifying attributes of a bundle. +type BundleMetadataApplyConfiguration struct { + // name is required and follows the DNS subdomain standard as defined in [RFC 1123]. + // It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), + // start and end with an alphanumeric character, and be no longer than 253 characters. + Name *string `json:"name,omitempty"` + // version is required and references the version that this bundle represents. + // It follows the semantic versioning standard as defined in https://semver.org/. + Version *string `json:"version,omitempty"` +} + +// BundleMetadataApplyConfiguration constructs a declarative configuration of the BundleMetadata type for use with +// apply. +func BundleMetadata() *BundleMetadataApplyConfiguration { + return &BundleMetadataApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BundleMetadataApplyConfiguration) WithName(value string) *BundleMetadataApplyConfiguration { + b.Name = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *BundleMetadataApplyConfiguration) WithVersion(value string) *BundleMetadataApplyConfiguration { + b.Version = &value + return b +} diff --git a/applyconfigurations/api/v1/catalogfilter.go b/applyconfigurations/api/v1/catalogfilter.go new file mode 100644 index 000000000..4464897e0 --- /dev/null +++ b/applyconfigurations/api/v1/catalogfilter.go @@ -0,0 +1,232 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CatalogFilterApplyConfiguration represents a declarative configuration of the CatalogFilter type for use +// with apply. +// +// CatalogFilter defines the attributes used to identify and filter content from a catalog. +type CatalogFilterApplyConfiguration struct { + // packageName specifies the name of the package to be installed and is used to filter + // the content from catalogs. + // + // It is required, immutable, and follows the DNS subdomain standard as defined in [RFC 1123]. + // It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), + // start and end with an alphanumeric character, and be no longer than 253 characters. + // + // Some examples of valid values are: + // - some-package + // - 123-package + // - 1-package-2 + // - somepackage + // + // Some examples of invalid values are: + // - -some-package + // - some-package- + // - thisisareallylongpackagenamethatisgreaterthanthemaximumlength + // - some.package + // + // [RFC 1123]: https://tools.ietf.org/html/rfc1123 + PackageName *string `json:"packageName,omitempty"` + // version is an optional semver constraint (a specific version or range of versions). + // When unspecified, the latest version available is installed. + // + // Acceptable version ranges are no longer than 64 characters. + // Version ranges are composed of comma- or space-delimited values and one or more comparison operators, + // known as comparison strings. + // You can add additional comparison strings using the OR operator (||). + // + // # Range Comparisons + // + // To specify a version range, you can use a comparison string like ">=3.0, + // <3.6". When specifying a range, automatic updates will occur within that + // range. The example comparison string means "install any version greater than + // or equal to 3.0.0 but less than 3.6.0.". It also states intent that if any + // upgrades are available within the version range after initial installation, + // those upgrades should be automatically performed. + // + // # Pinned Versions + // + // To specify an exact version to install you can use a version range that + // "pins" to a specific version. When pinning to a specific version, no + // automatic updates will occur. An example of a pinned version range is + // "0.6.0", which means "only install version 0.6.0 and never + // upgrade from this version". + // + // # Basic Comparison Operators + // + // The basic comparison operators and their meanings are: + // - "=", equal (not aliased to an operator) + // - "!=", not equal + // - "<", less than + // - ">", greater than + // - ">=", greater than OR equal to + // - "<=", less than OR equal to + // + // # Wildcard Comparisons + // + // You can use the "x", "X", and "*" characters as wildcard characters in all + // comparison operations. Some examples of using the wildcard characters: + // - "1.2.x", "1.2.X", and "1.2.*" is equivalent to ">=1.2.0, < 1.3.0" + // - ">= 1.2.x", ">= 1.2.X", and ">= 1.2.*" is equivalent to ">= 1.2.0" + // - "<= 2.x", "<= 2.X", and "<= 2.*" is equivalent to "< 3" + // - "x", "X", and "*" is equivalent to ">= 0.0.0" + // + // # Patch Release Comparisons + // + // When you want to specify a minor version up to the next major version you + // can use the "~" character to perform patch comparisons. Some examples: + // - "~1.2.3" is equivalent to ">=1.2.3, <1.3.0" + // - "~1" and "~1.x" is equivalent to ">=1, <2" + // - "~2.3" is equivalent to ">=2.3, <2.4" + // - "~1.2.x" is equivalent to ">=1.2.0, <1.3.0" + // + // # Major Release Comparisons + // + // You can use the "^" character to make major release comparisons after a + // stable 1.0.0 version is published. If there is no stable version published, // minor versions define the stability level. Some examples: + // - "^1.2.3" is equivalent to ">=1.2.3, <2.0.0" + // - "^1.2.x" is equivalent to ">=1.2.0, <2.0.0" + // - "^2.3" is equivalent to ">=2.3, <3" + // - "^2.x" is equivalent to ">=2.0.0, <3" + // - "^0.2.3" is equivalent to ">=0.2.3, <0.3.0" + // - "^0.2" is equivalent to ">=0.2.0, <0.3.0" + // - "^0.0.3" is equvalent to ">=0.0.3, <0.0.4" + // - "^0.0" is equivalent to ">=0.0.0, <0.1.0" + // - "^0" is equivalent to ">=0.0.0, <1.0.0" + // + // # OR Comparisons + // You can use the "||" character to represent an OR operation in the version + // range. Some examples: + // - ">=1.2.3, <2.0.0 || >3.0.0" + // - "^0 || ^3 || ^5" + // + // For more information on semver, please see https://semver.org/ + Version *string `json:"version,omitempty"` + // channels is optional and specifies a set of channels belonging to the package + // specified in the packageName field. + // + // A channel is a package-author-defined stream of updates for an extension. + // + // Each channel in the list must follow the DNS subdomain standard as defined in [RFC 1123]. + // It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), + // start and end with an alphanumeric character, and be no longer than 253 characters. + // You can specify no more than 256 channels. + // + // When specified, it constrains the set of installable bundles and the automated upgrade path. + // This constraint is an AND operation with the version field. For example: + // - Given channel is set to "foo" + // - Given version is set to ">=1.0.0, <1.5.0" + // - Only bundles that exist in channel "foo" AND satisfy the version range comparison are considered installable + // - Automatic upgrades are constrained to upgrade edges defined by the selected channel + // + // When unspecified, upgrade edges across all channels are used to identify valid automatic upgrade paths. + // + // Some examples of valid values are: + // - 1.1.x + // - alpha + // - stable + // - stable-v1 + // - v1-stable + // - dev-preview + // - preview + // - community + // + // Some examples of invalid values are: + // - -some-channel + // - some-channel- + // - thisisareallylongchannelnamethatisgreaterthanthemaximumlength + // - original_40 + // - --default-channel + // + // [RFC 1123]: https://tools.ietf.org/html/rfc1123 + Channels []string `json:"channels,omitempty"` + // selector is optional and filters the set of ClusterCatalogs used in the bundle selection process. + // + // When unspecified, all ClusterCatalogs are used in the bundle selection process. + Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + // upgradeConstraintPolicy is optional and controls whether the upgrade paths defined in the catalog + // are enforced for the package referenced in the packageName field. + // + // Allowed values are "CatalogProvided", "SelfCertified", or omitted. + // + // When set to "CatalogProvided", automatic upgrades only occur when upgrade constraints specified by the package + // author are met. + // + // When set to "SelfCertified", the upgrade constraints specified by the package author are ignored. + // This allows upgrades and downgrades to any version of the package. + // This is considered a dangerous operation as it can lead to unknown and potentially disastrous outcomes, + // such as data loss. + // Use this option only if you have independently verified the changes. + // + // When omitted, the default value is "CatalogProvided". + UpgradeConstraintPolicy *apiv1.UpgradeConstraintPolicy `json:"upgradeConstraintPolicy,omitempty"` +} + +// CatalogFilterApplyConfiguration constructs a declarative configuration of the CatalogFilter type for use with +// apply. +func CatalogFilter() *CatalogFilterApplyConfiguration { + return &CatalogFilterApplyConfiguration{} +} + +// WithPackageName sets the PackageName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PackageName field is set to the value of the last call. +func (b *CatalogFilterApplyConfiguration) WithPackageName(value string) *CatalogFilterApplyConfiguration { + b.PackageName = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *CatalogFilterApplyConfiguration) WithVersion(value string) *CatalogFilterApplyConfiguration { + b.Version = &value + return b +} + +// WithChannels adds the given value to the Channels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Channels field. +func (b *CatalogFilterApplyConfiguration) WithChannels(values ...string) *CatalogFilterApplyConfiguration { + for i := range values { + b.Channels = append(b.Channels, values[i]) + } + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *CatalogFilterApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *CatalogFilterApplyConfiguration { + b.Selector = value + return b +} + +// WithUpgradeConstraintPolicy sets the UpgradeConstraintPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpgradeConstraintPolicy field is set to the value of the last call. +func (b *CatalogFilterApplyConfiguration) WithUpgradeConstraintPolicy(value apiv1.UpgradeConstraintPolicy) *CatalogFilterApplyConfiguration { + b.UpgradeConstraintPolicy = &value + return b +} diff --git a/applyconfigurations/api/v1/catalogsource.go b/applyconfigurations/api/v1/catalogsource.go new file mode 100644 index 000000000..da1ca5cab --- /dev/null +++ b/applyconfigurations/api/v1/catalogsource.go @@ -0,0 +1,62 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" +) + +// CatalogSourceApplyConfiguration represents a declarative configuration of the CatalogSource type for use +// with apply. +// +// CatalogSource is a discriminated union of possible sources for a Catalog. +// CatalogSource contains the sourcing information for a Catalog +type CatalogSourceApplyConfiguration struct { + // type is a required field that specifies the type of source for the catalog. + // + // The only allowed value is "Image". + // + // When set to "Image", the ClusterCatalog content is sourced from an OCI image. + // When using an image source, the image field must be set and must be the only field defined for this type. + Type *apiv1.SourceType `json:"type,omitempty"` + // image configures how catalog contents are sourced from an OCI image. + // It is required when type is Image, and forbidden otherwise. + Image *ImageSourceApplyConfiguration `json:"image,omitempty"` +} + +// CatalogSourceApplyConfiguration constructs a declarative configuration of the CatalogSource type for use with +// apply. +func CatalogSource() *CatalogSourceApplyConfiguration { + return &CatalogSourceApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *CatalogSourceApplyConfiguration) WithType(value apiv1.SourceType) *CatalogSourceApplyConfiguration { + b.Type = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *CatalogSourceApplyConfiguration) WithImage(value *ImageSourceApplyConfiguration) *CatalogSourceApplyConfiguration { + b.Image = value + return b +} diff --git a/applyconfigurations/api/v1/clustercatalog.go b/applyconfigurations/api/v1/clustercatalog.go new file mode 100644 index 000000000..13a50c26b --- /dev/null +++ b/applyconfigurations/api/v1/clustercatalog.go @@ -0,0 +1,252 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterCatalogApplyConfiguration represents a declarative configuration of the ClusterCatalog type for use +// with apply. +// +// ClusterCatalog makes File-Based Catalog (FBC) data available to your cluster. +// For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs +type ClusterCatalogApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is a required field that defines the desired state of the ClusterCatalog. + // The controller ensures that the catalog is unpacked and served over the catalog content HTTP server. + Spec *ClusterCatalogSpecApplyConfiguration `json:"spec,omitempty"` + // status contains the following information about the state of the ClusterCatalog: + // - Whether the catalog contents are being served via the catalog content HTTP server + // - Whether the ClusterCatalog is progressing to a new state + // - A reference to the source from which the catalog contents were retrieved + Status *ClusterCatalogStatusApplyConfiguration `json:"status,omitempty"` +} + +// ClusterCatalog constructs a declarative configuration of the ClusterCatalog type for use with +// apply. +func ClusterCatalog(name string) *ClusterCatalogApplyConfiguration { + b := &ClusterCatalogApplyConfiguration{} + b.WithName(name) + b.WithKind("ClusterCatalog") + b.WithAPIVersion("olm.operatorframework.io/v1") + return b +} + +func (b ClusterCatalogApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithKind(value string) *ClusterCatalogApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithAPIVersion(value string) *ClusterCatalogApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithName(value string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithGenerateName(value string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithNamespace(value string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithUID(value types.UID) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithResourceVersion(value string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithGeneration(value int64) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterCatalogApplyConfiguration) WithLabels(entries map[string]string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterCatalogApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterCatalogApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterCatalogApplyConfiguration) WithFinalizers(values ...string) *ClusterCatalogApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterCatalogApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithSpec(value *ClusterCatalogSpecApplyConfiguration) *ClusterCatalogApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ClusterCatalogApplyConfiguration) WithStatus(value *ClusterCatalogStatusApplyConfiguration) *ClusterCatalogApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterCatalogApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterCatalogApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterCatalogApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterCatalogApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/applyconfigurations/api/v1/clustercatalogspec.go b/applyconfigurations/api/v1/clustercatalogspec.go new file mode 100644 index 000000000..f4b2a8385 --- /dev/null +++ b/applyconfigurations/api/v1/clustercatalogspec.go @@ -0,0 +1,102 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" +) + +// ClusterCatalogSpecApplyConfiguration represents a declarative configuration of the ClusterCatalogSpec type for use +// with apply. +// +// ClusterCatalogSpec defines the desired state of ClusterCatalog +type ClusterCatalogSpecApplyConfiguration struct { + // source is a required field that defines the source of a catalog. + // A catalog contains information on content that can be installed on a cluster. + // The catalog source makes catalog contents discoverable and usable by other on-cluster components. + // These components can present the content in a GUI dashboard or install content from the catalog on the cluster. + // The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format. + // For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs. + // + // Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image: + // + // source: + // type: Image + // image: + // ref: quay.io/operatorhubio/catalog:latest + Source *CatalogSourceApplyConfiguration `json:"source,omitempty"` + // priority is an optional field that defines a priority for this ClusterCatalog. + // + // Clients use the ClusterCatalog priority as a tie-breaker between ClusterCatalogs that meet their requirements. + // Higher numbers mean higher priority. + // + // Clients decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements. + // Clients should prompt users for additional input to break the tie. + // + // When omitted, the default priority is 0. + // + // Use negative numbers to specify a priority lower than the default. + // Use positive numbers to specify a priority higher than the default. + // + // The lowest possible value is -2147483648. + // The highest possible value is 2147483647. + Priority *int32 `json:"priority,omitempty"` + // availabilityMode is an optional field that defines how the ClusterCatalog is made available to clients on the cluster. + // + // Allowed values are "Available", "Unavailable", or omitted. + // + // When omitted, the default value is "Available". + // + // When set to "Available", the catalog contents are unpacked and served over the catalog content HTTP server. + // Clients should consider this ClusterCatalog and its contents as usable. + // + // When set to "Unavailable", the catalog contents are no longer served over the catalog content HTTP server. + // Treat this the same as if the ClusterCatalog does not exist. + // Use "Unavailable" when you want to keep the ClusterCatalog but treat it as if it doesn't exist. + AvailabilityMode *apiv1.AvailabilityMode `json:"availabilityMode,omitempty"` +} + +// ClusterCatalogSpecApplyConfiguration constructs a declarative configuration of the ClusterCatalogSpec type for use with +// apply. +func ClusterCatalogSpec() *ClusterCatalogSpecApplyConfiguration { + return &ClusterCatalogSpecApplyConfiguration{} +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *ClusterCatalogSpecApplyConfiguration) WithSource(value *CatalogSourceApplyConfiguration) *ClusterCatalogSpecApplyConfiguration { + b.Source = value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *ClusterCatalogSpecApplyConfiguration) WithPriority(value int32) *ClusterCatalogSpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithAvailabilityMode sets the AvailabilityMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailabilityMode field is set to the value of the last call. +func (b *ClusterCatalogSpecApplyConfiguration) WithAvailabilityMode(value apiv1.AvailabilityMode) *ClusterCatalogSpecApplyConfiguration { + b.AvailabilityMode = &value + return b +} diff --git a/applyconfigurations/api/v1/clustercatalogstatus.go b/applyconfigurations/api/v1/clustercatalogstatus.go new file mode 100644 index 000000000..4bd82c89e --- /dev/null +++ b/applyconfigurations/api/v1/clustercatalogstatus.go @@ -0,0 +1,99 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterCatalogStatusApplyConfiguration represents a declarative configuration of the ClusterCatalogStatus type for use +// with apply. +// +// ClusterCatalogStatus defines the observed state of ClusterCatalog +type ClusterCatalogStatusApplyConfiguration struct { + // conditions represents the current state of this ClusterCatalog. + // + // The current condition types are Serving and Progressing. + // + // The Serving condition represents whether the catalog contents are being served via the HTTP(S) web server: + // - When status is True and reason is Available, the catalog contents are being served. + // - When status is False and reason is Unavailable, the catalog contents are not being served because the contents are not yet available. + // - When status is False and reason is UserSpecifiedUnavailable, the catalog contents are not being served because the catalog has been intentionally marked as unavailable. + // + // The Progressing condition represents whether the ClusterCatalog is progressing or is ready to progress towards a new state: + // - When status is True and reason is Retrying, an error occurred that may be resolved on subsequent reconciliation attempts. + // - When status is True and reason is Succeeded, the ClusterCatalog has successfully progressed to a new state and is ready to continue progressing. + // - When status is False and reason is Blocked, an error occurred that requires manual intervention for recovery. + // + // If the system initially fetched contents and polling identifies updates, both conditions can be active simultaneously: + // - The Serving condition remains True with reason Available because the previous contents are still served via the HTTP(S) web server. + // - The Progressing condition is True with reason Retrying because the system is working to serve the new version. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // resolvedSource contains information about the resolved source based on the source type. + ResolvedSource *ResolvedCatalogSourceApplyConfiguration `json:"resolvedSource,omitempty"` + // urls contains the URLs that can be used to access the catalog. + URLs *ClusterCatalogURLsApplyConfiguration `json:"urls,omitempty"` + // lastUnpacked represents the last time the catalog contents were extracted from their source format. + // For example, when using an Image source, the OCI image is pulled and image layers are written to a file-system backed cache. + // This extraction from the source format is called "unpacking". + LastUnpacked *apismetav1.Time `json:"lastUnpacked,omitempty"` +} + +// ClusterCatalogStatusApplyConfiguration constructs a declarative configuration of the ClusterCatalogStatus type for use with +// apply. +func ClusterCatalogStatus() *ClusterCatalogStatusApplyConfiguration { + return &ClusterCatalogStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ClusterCatalogStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ClusterCatalogStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithResolvedSource sets the ResolvedSource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResolvedSource field is set to the value of the last call. +func (b *ClusterCatalogStatusApplyConfiguration) WithResolvedSource(value *ResolvedCatalogSourceApplyConfiguration) *ClusterCatalogStatusApplyConfiguration { + b.ResolvedSource = value + return b +} + +// WithURLs sets the URLs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URLs field is set to the value of the last call. +func (b *ClusterCatalogStatusApplyConfiguration) WithURLs(value *ClusterCatalogURLsApplyConfiguration) *ClusterCatalogStatusApplyConfiguration { + b.URLs = value + return b +} + +// WithLastUnpacked sets the LastUnpacked field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUnpacked field is set to the value of the last call. +func (b *ClusterCatalogStatusApplyConfiguration) WithLastUnpacked(value apismetav1.Time) *ClusterCatalogStatusApplyConfiguration { + b.LastUnpacked = &value + return b +} diff --git a/applyconfigurations/api/v1/clustercatalogurls.go b/applyconfigurations/api/v1/clustercatalogurls.go new file mode 100644 index 000000000..99ec14042 --- /dev/null +++ b/applyconfigurations/api/v1/clustercatalogurls.go @@ -0,0 +1,50 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ClusterCatalogURLsApplyConfiguration represents a declarative configuration of the ClusterCatalogURLs type for use +// with apply. +// +// ClusterCatalogURLs contains the URLs that can be used to access the catalog. +type ClusterCatalogURLsApplyConfiguration struct { + // base is a cluster-internal URL that provides endpoints for accessing the catalog content. + // + // Clients should append the path for the endpoint they want to access. + // + // Currently, only a single endpoint is served and is accessible at the path /api/v1. + // + // The endpoints served for the v1 API are: + // - /all - this endpoint returns the entire catalog contents in the FBC format + // + // New endpoints may be added as needs evolve. + Base *string `json:"base,omitempty"` +} + +// ClusterCatalogURLsApplyConfiguration constructs a declarative configuration of the ClusterCatalogURLs type for use with +// apply. +func ClusterCatalogURLs() *ClusterCatalogURLsApplyConfiguration { + return &ClusterCatalogURLsApplyConfiguration{} +} + +// WithBase sets the Base field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Base field is set to the value of the last call. +func (b *ClusterCatalogURLsApplyConfiguration) WithBase(value string) *ClusterCatalogURLsApplyConfiguration { + b.Base = &value + return b +} diff --git a/applyconfigurations/api/v1/clusterextension.go b/applyconfigurations/api/v1/clusterextension.go new file mode 100644 index 000000000..b5826dd0d --- /dev/null +++ b/applyconfigurations/api/v1/clusterextension.go @@ -0,0 +1,247 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterExtensionApplyConfiguration represents a declarative configuration of the ClusterExtension type for use +// with apply. +// +// ClusterExtension is the Schema for the clusterextensions API +type ClusterExtensionApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is an optional field that defines the desired state of the ClusterExtension. + Spec *ClusterExtensionSpecApplyConfiguration `json:"spec,omitempty"` + // status is an optional field that defines the observed state of the ClusterExtension. + Status *ClusterExtensionStatusApplyConfiguration `json:"status,omitempty"` +} + +// ClusterExtension constructs a declarative configuration of the ClusterExtension type for use with +// apply. +func ClusterExtension(name string) *ClusterExtensionApplyConfiguration { + b := &ClusterExtensionApplyConfiguration{} + b.WithName(name) + b.WithKind("ClusterExtension") + b.WithAPIVersion("olm.operatorframework.io/v1") + return b +} + +func (b ClusterExtensionApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithKind(value string) *ClusterExtensionApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithAPIVersion(value string) *ClusterExtensionApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithName(value string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithGenerateName(value string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithNamespace(value string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithUID(value types.UID) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithResourceVersion(value string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithGeneration(value int64) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterExtensionApplyConfiguration) WithLabels(entries map[string]string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterExtensionApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterExtensionApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterExtensionApplyConfiguration) WithFinalizers(values ...string) *ClusterExtensionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterExtensionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithSpec(value *ClusterExtensionSpecApplyConfiguration) *ClusterExtensionApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ClusterExtensionApplyConfiguration) WithStatus(value *ClusterExtensionStatusApplyConfiguration) *ClusterExtensionApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterExtensionApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterExtensionApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterExtensionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterExtensionApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/applyconfigurations/api/v1/clusterextensionconfig.go b/applyconfigurations/api/v1/clusterextensionconfig.go new file mode 100644 index 000000000..1661031da --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionconfig.go @@ -0,0 +1,65 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// ClusterExtensionConfigApplyConfiguration represents a declarative configuration of the ClusterExtensionConfig type for use +// with apply. +// +// ClusterExtensionConfig is a discriminated union which selects the source configuration values to be merged into +// the ClusterExtension's rendered manifests. +type ClusterExtensionConfigApplyConfiguration struct { + // configType is required and specifies the type of configuration source. + // + // The only allowed value is "Inline". + // + // When set to "Inline", the cluster extension configuration is defined inline within the ClusterExtension resource. + ConfigType *apiv1.ClusterExtensionConfigType `json:"configType,omitempty"` + // inline contains JSON or YAML values specified directly in the ClusterExtension. + // + // It is used to specify arbitrary configuration values for the ClusterExtension. + // It must be set if configType is 'Inline' and must be a valid JSON/YAML object containing at least one property. + // The configuration values are validated at runtime against a JSON schema provided by the bundle. + Inline *apiextensionsv1.JSON `json:"inline,omitempty"` +} + +// ClusterExtensionConfigApplyConfiguration constructs a declarative configuration of the ClusterExtensionConfig type for use with +// apply. +func ClusterExtensionConfig() *ClusterExtensionConfigApplyConfiguration { + return &ClusterExtensionConfigApplyConfiguration{} +} + +// WithConfigType sets the ConfigType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigType field is set to the value of the last call. +func (b *ClusterExtensionConfigApplyConfiguration) WithConfigType(value apiv1.ClusterExtensionConfigType) *ClusterExtensionConfigApplyConfiguration { + b.ConfigType = &value + return b +} + +// WithInline sets the Inline field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Inline field is set to the value of the last call. +func (b *ClusterExtensionConfigApplyConfiguration) WithInline(value apiextensionsv1.JSON) *ClusterExtensionConfigApplyConfiguration { + b.Inline = &value + return b +} diff --git a/applyconfigurations/api/v1/clusterextensioninstallconfig.go b/applyconfigurations/api/v1/clusterextensioninstallconfig.go new file mode 100644 index 000000000..4e38abc93 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensioninstallconfig.go @@ -0,0 +1,46 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ClusterExtensionInstallConfigApplyConfiguration represents a declarative configuration of the ClusterExtensionInstallConfig type for use +// with apply. +// +// ClusterExtensionInstallConfig is a union which selects the clusterExtension installation config. +// ClusterExtensionInstallConfig requires the namespace and serviceAccount which should be used for the installation of packages. +type ClusterExtensionInstallConfigApplyConfiguration struct { + // preflight is optional and configures the checks that run before installation or upgrade + // of the content for the package specified in the packageName field. + // + // When specified, it replaces the default preflight configuration for install/upgrade actions. + // When not specified, the default configuration is used. + Preflight *PreflightConfigApplyConfiguration `json:"preflight,omitempty"` +} + +// ClusterExtensionInstallConfigApplyConfiguration constructs a declarative configuration of the ClusterExtensionInstallConfig type for use with +// apply. +func ClusterExtensionInstallConfig() *ClusterExtensionInstallConfigApplyConfiguration { + return &ClusterExtensionInstallConfigApplyConfiguration{} +} + +// WithPreflight sets the Preflight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Preflight field is set to the value of the last call. +func (b *ClusterExtensionInstallConfigApplyConfiguration) WithPreflight(value *PreflightConfigApplyConfiguration) *ClusterExtensionInstallConfigApplyConfiguration { + b.Preflight = value + return b +} diff --git a/applyconfigurations/api/v1/clusterextensioninstallstatus.go b/applyconfigurations/api/v1/clusterextensioninstallstatus.go new file mode 100644 index 000000000..403b285d0 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensioninstallstatus.go @@ -0,0 +1,44 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ClusterExtensionInstallStatusApplyConfiguration represents a declarative configuration of the ClusterExtensionInstallStatus type for use +// with apply. +// +// ClusterExtensionInstallStatus is a representation of the status of the identified bundle. +type ClusterExtensionInstallStatusApplyConfiguration struct { + // bundle is required and represents the identifying attributes of a bundle. + // + // A "bundle" is a versioned set of content that represents the resources that need to be applied + // to a cluster to install a package. + Bundle *BundleMetadataApplyConfiguration `json:"bundle,omitempty"` +} + +// ClusterExtensionInstallStatusApplyConfiguration constructs a declarative configuration of the ClusterExtensionInstallStatus type for use with +// apply. +func ClusterExtensionInstallStatus() *ClusterExtensionInstallStatusApplyConfiguration { + return &ClusterExtensionInstallStatusApplyConfiguration{} +} + +// WithBundle sets the Bundle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Bundle field is set to the value of the last call. +func (b *ClusterExtensionInstallStatusApplyConfiguration) WithBundle(value *BundleMetadataApplyConfiguration) *ClusterExtensionInstallStatusApplyConfiguration { + b.Bundle = value + return b +} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfig.go b/applyconfigurations/api/v1/clusterextensionrevision.go similarity index 54% rename from openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfig.go rename to applyconfigurations/api/v1/clusterextensionrevision.go index 221728dca..5ccee31c2 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfig.go +++ b/applyconfigurations/api/v1/clusterextensionrevision.go @@ -1,75 +1,64 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. +/* +Copyright 2022. -package v1alpha1 +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 import ( - configv1alpha1 "github.com/openshift/api/config/v1alpha1" - internal "github.com/openshift/client-go/config/applyconfigurations/internal" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CRIOCredentialProviderConfigApplyConfiguration represents a declarative configuration of the CRIOCredentialProviderConfig type for use +// ClusterExtensionRevisionApplyConfiguration represents a declarative configuration of the ClusterExtensionRevision type for use // with apply. -type CRIOCredentialProviderConfigApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *CRIOCredentialProviderConfigSpecApplyConfiguration `json:"spec,omitempty"` - Status *CRIOCredentialProviderConfigStatusApplyConfiguration `json:"status,omitempty"` -} - -// CRIOCredentialProviderConfig constructs a declarative configuration of the CRIOCredentialProviderConfig type for use with +// +// ClusterExtensionRevision represents an immutable snapshot of Kubernetes objects +// for a specific version of a ClusterExtension. Each revision contains objects +// organized into phases that roll out sequentially. The same object can only be managed by a single revision +// at a time. Ownership of objects is transitioned from one revision to the next as the extension is upgraded +// or reconfigured. Once the latest revision has rolled out successfully, previous active revisions are archived for +// posterity. +type ClusterExtensionRevisionApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the desired state of the ClusterExtensionRevision. + Spec *ClusterExtensionRevisionSpecApplyConfiguration `json:"spec,omitempty"` + // status is optional and defines the observed state of the ClusterExtensionRevision. + Status *ClusterExtensionRevisionStatusApplyConfiguration `json:"status,omitempty"` +} + +// ClusterExtensionRevision constructs a declarative configuration of the ClusterExtensionRevision type for use with // apply. -func CRIOCredentialProviderConfig(name string) *CRIOCredentialProviderConfigApplyConfiguration { - b := &CRIOCredentialProviderConfigApplyConfiguration{} +func ClusterExtensionRevision(name string) *ClusterExtensionRevisionApplyConfiguration { + b := &ClusterExtensionRevisionApplyConfiguration{} b.WithName(name) - b.WithKind("CRIOCredentialProviderConfig") - b.WithAPIVersion("config.openshift.io/v1alpha1") + b.WithKind("ClusterExtensionRevision") + b.WithAPIVersion("olm.operatorframework.io/v1") return b } -// ExtractCRIOCredentialProviderConfig extracts the applied configuration owned by fieldManager from -// cRIOCredentialProviderConfig. If no managedFields are found in cRIOCredentialProviderConfig for fieldManager, a -// CRIOCredentialProviderConfigApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// cRIOCredentialProviderConfig must be a unmodified CRIOCredentialProviderConfig API object that was retrieved from the Kubernetes API. -// ExtractCRIOCredentialProviderConfig provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractCRIOCredentialProviderConfig(cRIOCredentialProviderConfig *configv1alpha1.CRIOCredentialProviderConfig, fieldManager string) (*CRIOCredentialProviderConfigApplyConfiguration, error) { - return extractCRIOCredentialProviderConfig(cRIOCredentialProviderConfig, fieldManager, "") -} - -// ExtractCRIOCredentialProviderConfigStatus is the same as ExtractCRIOCredentialProviderConfig except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractCRIOCredentialProviderConfigStatus(cRIOCredentialProviderConfig *configv1alpha1.CRIOCredentialProviderConfig, fieldManager string) (*CRIOCredentialProviderConfigApplyConfiguration, error) { - return extractCRIOCredentialProviderConfig(cRIOCredentialProviderConfig, fieldManager, "status") -} - -func extractCRIOCredentialProviderConfig(cRIOCredentialProviderConfig *configv1alpha1.CRIOCredentialProviderConfig, fieldManager string, subresource string) (*CRIOCredentialProviderConfigApplyConfiguration, error) { - b := &CRIOCredentialProviderConfigApplyConfiguration{} - err := managedfields.ExtractInto(cRIOCredentialProviderConfig, internal.Parser().Type("com.github.openshift.api.config.v1alpha1.CRIOCredentialProviderConfig"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(cRIOCredentialProviderConfig.Name) - - b.WithKind("CRIOCredentialProviderConfig") - b.WithAPIVersion("config.openshift.io/v1alpha1") - return b, nil -} -func (b CRIOCredentialProviderConfigApplyConfiguration) IsApplyConfiguration() {} +func (b ClusterExtensionRevisionApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithKind(value string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithKind(value string) *ClusterExtensionRevisionApplyConfiguration { b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -77,7 +66,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithKind(value string) // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithAPIVersion(value string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithAPIVersion(value string) *ClusterExtensionRevisionApplyConfiguration { b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -85,7 +74,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithAPIVersion(value st // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithName(value string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithName(value string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.Name = &value return b @@ -94,7 +83,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithName(value string) // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithGenerateName(value string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithGenerateName(value string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.GenerateName = &value return b @@ -103,7 +92,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithGenerateName(value // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithNamespace(value string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithNamespace(value string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.Namespace = &value return b @@ -112,7 +101,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithNamespace(value str // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithUID(value types.UID) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithUID(value types.UID) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.UID = &value return b @@ -121,7 +110,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithUID(value types.UID // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithResourceVersion(value string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithResourceVersion(value string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b @@ -130,7 +119,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithResourceVersion(val // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithGeneration(value int64) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithGeneration(value int64) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.Generation = &value return b @@ -139,7 +128,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithGeneration(value in // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b @@ -148,7 +137,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithCreationTimestamp(v // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b @@ -157,7 +146,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithDeletionTimestamp(v // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b @@ -167,7 +156,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithDeletionGracePeriod // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithLabels(entries map[string]string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithLabels(entries map[string]string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) @@ -182,7 +171,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithLabels(entries map[ // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithAnnotations(entries map[string]string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) @@ -196,7 +185,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithAnnotations(entries // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { @@ -210,7 +199,7 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithOwnerReferences(val // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithFinalizers(values ...string) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithFinalizers(values ...string) *ClusterExtensionRevisionApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) @@ -218,16 +207,16 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithFinalizers(values . return b } -func (b *CRIOCredentialProviderConfigApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { +func (b *ClusterExtensionRevisionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} } } // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithSpec(value *CRIOCredentialProviderConfigSpecApplyConfiguration) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithSpec(value *ClusterExtensionRevisionSpecApplyConfiguration) *ClusterExtensionRevisionApplyConfiguration { b.Spec = value return b } @@ -235,29 +224,29 @@ func (b *CRIOCredentialProviderConfigApplyConfiguration) WithSpec(value *CRIOCre // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. -func (b *CRIOCredentialProviderConfigApplyConfiguration) WithStatus(value *CRIOCredentialProviderConfigStatusApplyConfiguration) *CRIOCredentialProviderConfigApplyConfiguration { +func (b *ClusterExtensionRevisionApplyConfiguration) WithStatus(value *ClusterExtensionRevisionStatusApplyConfiguration) *ClusterExtensionRevisionApplyConfiguration { b.Status = value return b } // GetKind retrieves the value of the Kind field in the declarative configuration. -func (b *CRIOCredentialProviderConfigApplyConfiguration) GetKind() *string { +func (b *ClusterExtensionRevisionApplyConfiguration) GetKind() *string { return b.TypeMetaApplyConfiguration.Kind } // GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. -func (b *CRIOCredentialProviderConfigApplyConfiguration) GetAPIVersion() *string { +func (b *ClusterExtensionRevisionApplyConfiguration) GetAPIVersion() *string { return b.TypeMetaApplyConfiguration.APIVersion } // GetName retrieves the value of the Name field in the declarative configuration. -func (b *CRIOCredentialProviderConfigApplyConfiguration) GetName() *string { +func (b *ClusterExtensionRevisionApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Name } // GetNamespace retrieves the value of the Namespace field in the declarative configuration. -func (b *CRIOCredentialProviderConfigApplyConfiguration) GetNamespace() *string { +func (b *ClusterExtensionRevisionApplyConfiguration) GetNamespace() *string { b.ensureObjectMetaApplyConfigurationExists() return b.ObjectMetaApplyConfiguration.Namespace } diff --git a/applyconfigurations/api/v1/clusterextensionrevisionobject.go b/applyconfigurations/api/v1/clusterextensionrevisionobject.go new file mode 100644 index 000000000..fc482bf88 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionrevisionobject.go @@ -0,0 +1,76 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" + unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +// ClusterExtensionRevisionObjectApplyConfiguration represents a declarative configuration of the ClusterExtensionRevisionObject type for use +// with apply. +// +// ClusterExtensionRevisionObject represents a Kubernetes object to be applied as part +// of a phase, along with its collision protection settings. +type ClusterExtensionRevisionObjectApplyConfiguration struct { + // object is a required embedded Kubernetes object to be applied. + // + // This object must be a valid Kubernetes resource with apiVersion, kind, and metadata fields. + Object *unstructured.Unstructured `json:"object,omitempty"` + // collisionProtection controls whether the operator can adopt and modify objects + // that already exist on the cluster. + // + // Allowed values are: "Prevent", "IfNoController", and "None". + // + // When set to "Prevent", the operator only manages objects it created itself. + // This prevents ownership collisions. + // + // When set to "IfNoController", the operator can adopt and modify pre-existing objects + // that are not owned by another controller. + // This is useful for taking over management of manually-created resources. + // + // When set to "None", the operator can adopt and modify any pre-existing object, even if + // owned by another controller. + // Use this setting with extreme caution as it may cause multiple controllers to fight over + // the same resource, resulting in increased load on the API server and etcd. + // + // When omitted, the value is inherited from the phase, then spec. + CollisionProtection *apiv1.CollisionProtection `json:"collisionProtection,omitempty"` +} + +// ClusterExtensionRevisionObjectApplyConfiguration constructs a declarative configuration of the ClusterExtensionRevisionObject type for use with +// apply. +func ClusterExtensionRevisionObject() *ClusterExtensionRevisionObjectApplyConfiguration { + return &ClusterExtensionRevisionObjectApplyConfiguration{} +} + +// WithObject sets the Object field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Object field is set to the value of the last call. +func (b *ClusterExtensionRevisionObjectApplyConfiguration) WithObject(value unstructured.Unstructured) *ClusterExtensionRevisionObjectApplyConfiguration { + b.Object = &value + return b +} + +// WithCollisionProtection sets the CollisionProtection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CollisionProtection field is set to the value of the last call. +func (b *ClusterExtensionRevisionObjectApplyConfiguration) WithCollisionProtection(value apiv1.CollisionProtection) *ClusterExtensionRevisionObjectApplyConfiguration { + b.CollisionProtection = &value + return b +} diff --git a/applyconfigurations/api/v1/clusterextensionrevisionphase.go b/applyconfigurations/api/v1/clusterextensionrevisionphase.go new file mode 100644 index 000000000..462b0e721 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionrevisionphase.go @@ -0,0 +1,88 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" +) + +// ClusterExtensionRevisionPhaseApplyConfiguration represents a declarative configuration of the ClusterExtensionRevisionPhase type for use +// with apply. +// +// ClusterExtensionRevisionPhase represents a group of objects that are applied together. The phase is considered +// complete only after all objects pass their status probes. +type ClusterExtensionRevisionPhaseApplyConfiguration struct { + // name is a required identifier for this phase. + // + // phase names must follow the DNS label standard as defined in [RFC 1123]. + // They must contain only lowercase alphanumeric characters or hyphens (-), + // start and end with an alphanumeric character, and be no longer than 63 characters. + // + // Common phase names include: namespaces, policies, rbac, crds, storage, deploy, publish. + // + // [RFC 1123]: https://tools.ietf.org/html/rfc1123 + Name *string `json:"name,omitempty"` + // objects is a required list of all Kubernetes objects that belong to this phase. + // + // All objects in this list are applied to the cluster in no particular order. The maximum number of objects per phase is 50. + Objects []ClusterExtensionRevisionObjectApplyConfiguration `json:"objects,omitempty"` + // collisionProtection specifies the default collision protection strategy for all objects + // in this phase. Individual objects can override this value. + // + // When set, this value is used as the default for any object in this phase that does not + // explicitly specify its own collisionProtection. + // + // When omitted, we use .spec.collistionProtection as the default for any object in this phase that does not + // explicitly specify its own collisionProtection. + CollisionProtection *apiv1.CollisionProtection `json:"collisionProtection,omitempty"` +} + +// ClusterExtensionRevisionPhaseApplyConfiguration constructs a declarative configuration of the ClusterExtensionRevisionPhase type for use with +// apply. +func ClusterExtensionRevisionPhase() *ClusterExtensionRevisionPhaseApplyConfiguration { + return &ClusterExtensionRevisionPhaseApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterExtensionRevisionPhaseApplyConfiguration) WithName(value string) *ClusterExtensionRevisionPhaseApplyConfiguration { + b.Name = &value + return b +} + +// WithObjects adds the given value to the Objects field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Objects field. +func (b *ClusterExtensionRevisionPhaseApplyConfiguration) WithObjects(values ...*ClusterExtensionRevisionObjectApplyConfiguration) *ClusterExtensionRevisionPhaseApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithObjects") + } + b.Objects = append(b.Objects, *values[i]) + } + return b +} + +// WithCollisionProtection sets the CollisionProtection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CollisionProtection field is set to the value of the last call. +func (b *ClusterExtensionRevisionPhaseApplyConfiguration) WithCollisionProtection(value apiv1.CollisionProtection) *ClusterExtensionRevisionPhaseApplyConfiguration { + b.CollisionProtection = &value + return b +} diff --git a/applyconfigurations/api/v1/clusterextensionrevisionspec.go b/applyconfigurations/api/v1/clusterextensionrevisionspec.go new file mode 100644 index 000000000..8a3a7ee08 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionrevisionspec.go @@ -0,0 +1,133 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" +) + +// ClusterExtensionRevisionSpecApplyConfiguration represents a declarative configuration of the ClusterExtensionRevisionSpec type for use +// with apply. +// +// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision. +type ClusterExtensionRevisionSpecApplyConfiguration struct { + // lifecycleState specifies the lifecycle state of the ClusterExtensionRevision. + // + // When set to "Active", the revision is actively managed and reconciled. + // When set to "Archived", the revision is inactive and any resources not managed by a subsequent revision are deleted. + // The revision is removed from the owner list of all objects previously under management. + // All objects that did not transition to a succeeding revision are deleted. + // + // Once a revision is set to "Archived", it cannot be un-archived. + // + // It is possible for more than one revision to be "Active" simultaneously. This will occur when + // moving from one revision to another. The old revision will not be set to "Archived" until the + // new revision has been completely rolled out. + LifecycleState *apiv1.ClusterExtensionRevisionLifecycleState `json:"lifecycleState,omitempty"` + // revision is a required, immutable sequence number representing a specific revision + // of the parent ClusterExtension. + // + // The revision field must be a positive integer. + // Each ClusterExtensionRevision belonging to the same parent ClusterExtension must have a unique revision number. + // The revision number must always be the previous revision number plus one, or 1 for the first revision. + Revision *int64 `json:"revision,omitempty"` + // phases is an optional, immutable list of phases that group objects to be applied together. + // + // Objects are organized into phases based on their Group-Kind. Common phases include: + // - namespaces: Namespace objects + // - policies: ResourceQuota, LimitRange, NetworkPolicy objects + // - rbac: ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding objects + // - crds: CustomResourceDefinition objects + // - storage: PersistentVolume, PersistentVolumeClaim, StorageClass objects + // - deploy: Deployment, StatefulSet, DaemonSet, Service, ConfigMap, Secret objects + // - publish: Ingress, APIService, Route, Webhook objects + // + // All objects in a phase are applied in no particular order. + // The revision progresses to the next phase only after all objects in the current phase pass their readiness probes. + // + // Once set, even if empty, the phases field is immutable. + // + // Each phase in the list must have a unique name. The maximum number of phases is 20. + Phases []ClusterExtensionRevisionPhaseApplyConfiguration `json:"phases,omitempty"` + // progressDeadlineMinutes is an optional field that defines the maximum period + // of time in minutes after which an installation should be considered failed and + // require manual intervention. This functionality is disabled when no value + // is provided. The minimum period is 10 minutes, and the maximum is 720 minutes (12 hours). + // + // + ProgressDeadlineMinutes *int32 `json:"progressDeadlineMinutes,omitempty"` + // collisionProtection specifies the default collision protection strategy for all objects + // in this revision. Individual phases or objects can override this value. + // + // When set, this value is used as the default for any phase or object that does not + // explicitly specify its own collisionProtection. + // + // The resolution order is: object > phase > spec + CollisionProtection *apiv1.CollisionProtection `json:"collisionProtection,omitempty"` +} + +// ClusterExtensionRevisionSpecApplyConfiguration constructs a declarative configuration of the ClusterExtensionRevisionSpec type for use with +// apply. +func ClusterExtensionRevisionSpec() *ClusterExtensionRevisionSpecApplyConfiguration { + return &ClusterExtensionRevisionSpecApplyConfiguration{} +} + +// WithLifecycleState sets the LifecycleState field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LifecycleState field is set to the value of the last call. +func (b *ClusterExtensionRevisionSpecApplyConfiguration) WithLifecycleState(value apiv1.ClusterExtensionRevisionLifecycleState) *ClusterExtensionRevisionSpecApplyConfiguration { + b.LifecycleState = &value + return b +} + +// WithRevision sets the Revision field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Revision field is set to the value of the last call. +func (b *ClusterExtensionRevisionSpecApplyConfiguration) WithRevision(value int64) *ClusterExtensionRevisionSpecApplyConfiguration { + b.Revision = &value + return b +} + +// WithPhases adds the given value to the Phases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Phases field. +func (b *ClusterExtensionRevisionSpecApplyConfiguration) WithPhases(values ...*ClusterExtensionRevisionPhaseApplyConfiguration) *ClusterExtensionRevisionSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPhases") + } + b.Phases = append(b.Phases, *values[i]) + } + return b +} + +// WithProgressDeadlineMinutes sets the ProgressDeadlineMinutes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProgressDeadlineMinutes field is set to the value of the last call. +func (b *ClusterExtensionRevisionSpecApplyConfiguration) WithProgressDeadlineMinutes(value int32) *ClusterExtensionRevisionSpecApplyConfiguration { + b.ProgressDeadlineMinutes = &value + return b +} + +// WithCollisionProtection sets the CollisionProtection field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CollisionProtection field is set to the value of the last call. +func (b *ClusterExtensionRevisionSpecApplyConfiguration) WithCollisionProtection(value apiv1.CollisionProtection) *ClusterExtensionRevisionSpecApplyConfiguration { + b.CollisionProtection = &value + return b +} diff --git a/applyconfigurations/api/v1/clusterextensionrevisionstatus.go b/applyconfigurations/api/v1/clusterextensionrevisionstatus.go new file mode 100644 index 000000000..f86797115 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionrevisionstatus.go @@ -0,0 +1,68 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterExtensionRevisionStatusApplyConfiguration represents a declarative configuration of the ClusterExtensionRevisionStatus type for use +// with apply. +// +// ClusterExtensionRevisionStatus defines the observed state of a ClusterExtensionRevision. +type ClusterExtensionRevisionStatusApplyConfiguration struct { + // conditions is an optional list of status conditions describing the state of the + // ClusterExtensionRevision. + // + // The Progressing condition represents whether the revision is actively rolling out: + // - When status is True and reason is RollingOut, the ClusterExtensionRevision rollout is actively making progress and is in transition. + // - When status is True and reason is Retrying, the ClusterExtensionRevision has encountered an error that could be resolved on subsequent reconciliation attempts. + // - When status is True and reason is Succeeded, the ClusterExtensionRevision has reached the desired state. + // - When status is False and reason is Blocked, the ClusterExtensionRevision has encountered an error that requires manual intervention for recovery. + // - When status is False and reason is Archived, the ClusterExtensionRevision is archived and not being actively reconciled. + // + // The Available condition represents whether the revision has been successfully rolled out and is available: + // - When status is True and reason is ProbesSucceeded, the ClusterExtensionRevision has been successfully rolled out and all objects pass their readiness probes. + // - When status is False and reason is ProbeFailure, one or more objects are failing their readiness probes during rollout. + // - When status is Unknown and reason is Reconciling, the ClusterExtensionRevision has encountered an error that prevented it from observing the probes. + // - When status is Unknown and reason is Archived, the ClusterExtensionRevision has been archived and its objects have been torn down. + // - When status is Unknown and reason is Migrated, the ClusterExtensionRevision was migrated from an existing release and object status probe results have not yet been observed. + // + // The Succeeded condition represents whether the revision has successfully completed its rollout: + // - When status is True and reason is Succeeded, the ClusterExtensionRevision has successfully completed its rollout. This condition is set once and persists even if the revision later becomes unavailable. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ClusterExtensionRevisionStatusApplyConfiguration constructs a declarative configuration of the ClusterExtensionRevisionStatus type for use with +// apply. +func ClusterExtensionRevisionStatus() *ClusterExtensionRevisionStatusApplyConfiguration { + return &ClusterExtensionRevisionStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ClusterExtensionRevisionStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ClusterExtensionRevisionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/applyconfigurations/api/v1/clusterextensionspec.go b/applyconfigurations/api/v1/clusterextensionspec.go new file mode 100644 index 000000000..56c653392 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionspec.go @@ -0,0 +1,128 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ClusterExtensionSpecApplyConfiguration represents a declarative configuration of the ClusterExtensionSpec type for use +// with apply. +// +// ClusterExtensionSpec defines the desired state of ClusterExtension +type ClusterExtensionSpecApplyConfiguration struct { + // namespace specifies a Kubernetes namespace. + // This is the namespace where the provided ServiceAccount must exist. + // It also designates the default namespace where namespace-scoped resources for the extension are applied to the cluster. + // Some extensions may contain namespace-scoped resources to be applied in other namespaces. + // This namespace must exist. + // + // The namespace field is required, immutable, and follows the DNS label standard as defined in [RFC 1123]. + // It must contain only lowercase alphanumeric characters or hyphens (-), start and end with an alphanumeric character, + // and be no longer than 63 characters. + // + // [RFC 1123]: https://tools.ietf.org/html/rfc1123 + Namespace *string `json:"namespace,omitempty"` + // serviceAccount specifies a ServiceAccount used to perform all interactions with the cluster + // that are required to manage the extension. + // The ServiceAccount must be configured with the necessary permissions to perform these interactions. + // The ServiceAccount must exist in the namespace referenced in the spec. + // The serviceAccount field is required. + ServiceAccount *ServiceAccountReferenceApplyConfiguration `json:"serviceAccount,omitempty"` + // source is required and selects the installation source of content for this ClusterExtension. + // Set the sourceType field to perform the selection. + // + // Catalog is currently the only implemented sourceType. + // Setting sourceType to "Catalog" requires the catalog field to also be defined. + // + // Below is a minimal example of a source definition (in yaml): + // + // source: + // sourceType: Catalog + // catalog: + // packageName: example-package + Source *SourceConfigApplyConfiguration `json:"source,omitempty"` + // install is optional and configures installation options for the ClusterExtension, + // such as the pre-flight check configuration. + Install *ClusterExtensionInstallConfigApplyConfiguration `json:"install,omitempty"` + // config is optional and specifies bundle-specific configuration. + // Configuration is bundle-specific and a bundle may provide a configuration schema. + // When not specified, the default configuration of the resolved bundle is used. + // + // config is validated against a configuration schema provided by the resolved bundle. If the bundle does not provide + // a configuration schema the bundle is deemed to not be configurable. More information on how + // to configure bundles can be found in the OLM documentation associated with your current OLM version. + Config *ClusterExtensionConfigApplyConfiguration `json:"config,omitempty"` + // progressDeadlineMinutes is an optional field that defines the maximum period + // of time in minutes after which an installation should be considered failed and + // require manual intervention. This functionality is disabled when no value + // is provided. The minimum period is 10 minutes, and the maximum is 720 minutes (12 hours). + // + // + ProgressDeadlineMinutes *int32 `json:"progressDeadlineMinutes,omitempty"` +} + +// ClusterExtensionSpecApplyConfiguration constructs a declarative configuration of the ClusterExtensionSpec type for use with +// apply. +func ClusterExtensionSpec() *ClusterExtensionSpecApplyConfiguration { + return &ClusterExtensionSpecApplyConfiguration{} +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterExtensionSpecApplyConfiguration) WithNamespace(value string) *ClusterExtensionSpecApplyConfiguration { + b.Namespace = &value + return b +} + +// WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccount field is set to the value of the last call. +func (b *ClusterExtensionSpecApplyConfiguration) WithServiceAccount(value *ServiceAccountReferenceApplyConfiguration) *ClusterExtensionSpecApplyConfiguration { + b.ServiceAccount = value + return b +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *ClusterExtensionSpecApplyConfiguration) WithSource(value *SourceConfigApplyConfiguration) *ClusterExtensionSpecApplyConfiguration { + b.Source = value + return b +} + +// WithInstall sets the Install field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Install field is set to the value of the last call. +func (b *ClusterExtensionSpecApplyConfiguration) WithInstall(value *ClusterExtensionInstallConfigApplyConfiguration) *ClusterExtensionSpecApplyConfiguration { + b.Install = value + return b +} + +// WithConfig sets the Config field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Config field is set to the value of the last call. +func (b *ClusterExtensionSpecApplyConfiguration) WithConfig(value *ClusterExtensionConfigApplyConfiguration) *ClusterExtensionSpecApplyConfiguration { + b.Config = value + return b +} + +// WithProgressDeadlineMinutes sets the ProgressDeadlineMinutes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProgressDeadlineMinutes field is set to the value of the last call. +func (b *ClusterExtensionSpecApplyConfiguration) WithProgressDeadlineMinutes(value int32) *ClusterExtensionSpecApplyConfiguration { + b.ProgressDeadlineMinutes = &value + return b +} diff --git a/applyconfigurations/api/v1/clusterextensionstatus.go b/applyconfigurations/api/v1/clusterextensionstatus.go new file mode 100644 index 000000000..dd76e76a1 --- /dev/null +++ b/applyconfigurations/api/v1/clusterextensionstatus.go @@ -0,0 +1,98 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterExtensionStatusApplyConfiguration represents a declarative configuration of the ClusterExtensionStatus type for use +// with apply. +// +// ClusterExtensionStatus defines the observed state of a ClusterExtension. +type ClusterExtensionStatusApplyConfiguration struct { + // conditions represents the current state of the ClusterExtension. + // + // The set of condition types which apply to all spec.source variations are Installed and Progressing. + // + // The Installed condition represents whether the bundle has been installed for this ClusterExtension: + // - When Installed is True and the Reason is Succeeded, the bundle has been successfully installed. + // - When Installed is False and the Reason is Failed, the bundle has failed to install. + // + // The Progressing condition represents whether or not the ClusterExtension is advancing towards a new state. + // When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state. + // When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts. + // When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery. + // + // When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out. + // + // + // When the ClusterExtension is sourced from a catalog, it surfaces deprecation conditions based on catalog metadata. + // These are indications from a package owner to guide users away from a particular package, channel, or bundle: + // - BundleDeprecated is True if the installed bundle is marked deprecated, False if not deprecated, or Unknown if no bundle is installed yet or if catalog data is unavailable. + // - ChannelDeprecated is True if any requested channel is marked deprecated, False if not deprecated, or Unknown if catalog data is unavailable. + // - PackageDeprecated is True if the requested package is marked deprecated, False if not deprecated, or Unknown if catalog data is unavailable. + // - Deprecated is a rollup condition that is True when any deprecation exists, False when none exist, or Unknown when catalog data is unavailable. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // install is a representation of the current installation status for this ClusterExtension. + Install *ClusterExtensionInstallStatusApplyConfiguration `json:"install,omitempty"` + // activeRevisions holds a list of currently active (non-archived) ClusterExtensionRevisions, + // including both installed and rolling out revisions. + // + ActiveRevisions []RevisionStatusApplyConfiguration `json:"activeRevisions,omitempty"` +} + +// ClusterExtensionStatusApplyConfiguration constructs a declarative configuration of the ClusterExtensionStatus type for use with +// apply. +func ClusterExtensionStatus() *ClusterExtensionStatusApplyConfiguration { + return &ClusterExtensionStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ClusterExtensionStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ClusterExtensionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithInstall sets the Install field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Install field is set to the value of the last call. +func (b *ClusterExtensionStatusApplyConfiguration) WithInstall(value *ClusterExtensionInstallStatusApplyConfiguration) *ClusterExtensionStatusApplyConfiguration { + b.Install = value + return b +} + +// WithActiveRevisions adds the given value to the ActiveRevisions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ActiveRevisions field. +func (b *ClusterExtensionStatusApplyConfiguration) WithActiveRevisions(values ...*RevisionStatusApplyConfiguration) *ClusterExtensionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithActiveRevisions") + } + b.ActiveRevisions = append(b.ActiveRevisions, *values[i]) + } + return b +} diff --git a/applyconfigurations/api/v1/crdupgradesafetypreflightconfig.go b/applyconfigurations/api/v1/crdupgradesafetypreflightconfig.go new file mode 100644 index 000000000..00c8c9f0f --- /dev/null +++ b/applyconfigurations/api/v1/crdupgradesafetypreflightconfig.go @@ -0,0 +1,52 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" +) + +// CRDUpgradeSafetyPreflightConfigApplyConfiguration represents a declarative configuration of the CRDUpgradeSafetyPreflightConfig type for use +// with apply. +// +// CRDUpgradeSafetyPreflightConfig is the configuration for CRD upgrade safety preflight check. +type CRDUpgradeSafetyPreflightConfigApplyConfiguration struct { + // enforcement is required and configures the state of the CRD Upgrade Safety pre-flight check. + // + // Allowed values are "None" or "Strict". The default value is "Strict". + // + // When set to "None", the CRD Upgrade Safety pre-flight check is skipped during an upgrade operation. + // Use this option with caution as unintended consequences such as data loss can occur. + // + // When set to "Strict", the CRD Upgrade Safety pre-flight check runs during an upgrade operation. + Enforcement *apiv1.CRDUpgradeSafetyEnforcement `json:"enforcement,omitempty"` +} + +// CRDUpgradeSafetyPreflightConfigApplyConfiguration constructs a declarative configuration of the CRDUpgradeSafetyPreflightConfig type for use with +// apply. +func CRDUpgradeSafetyPreflightConfig() *CRDUpgradeSafetyPreflightConfigApplyConfiguration { + return &CRDUpgradeSafetyPreflightConfigApplyConfiguration{} +} + +// WithEnforcement sets the Enforcement field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Enforcement field is set to the value of the last call. +func (b *CRDUpgradeSafetyPreflightConfigApplyConfiguration) WithEnforcement(value apiv1.CRDUpgradeSafetyEnforcement) *CRDUpgradeSafetyPreflightConfigApplyConfiguration { + b.Enforcement = &value + return b +} diff --git a/applyconfigurations/api/v1/imagesource.go b/applyconfigurations/api/v1/imagesource.go new file mode 100644 index 000000000..e07b28ffc --- /dev/null +++ b/applyconfigurations/api/v1/imagesource.go @@ -0,0 +1,92 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ImageSourceApplyConfiguration represents a declarative configuration of the ImageSource type for use +// with apply. +// +// # ImageSource enables users to define the information required for sourcing a Catalog from an OCI image +// +// If we see that there is a possibly valid digest-based image reference AND pollIntervalMinutes is specified, +// reject the resource since there is no use in polling a digest-based image reference. +type ImageSourceApplyConfiguration struct { + // ref is a required field that defines the reference to a container image containing catalog contents. + // It cannot be more than 1000 characters. + // + // A reference has 3 parts: the domain, name, and identifier. + // + // The domain is typically the registry where an image is located. + // It must be alphanumeric characters (lowercase and uppercase) separated by the "." character. + // Hyphenation is allowed, but the domain must start and end with alphanumeric characters. + // Specifying a port to use is also allowed by adding the ":" character followed by numeric values. + // The port must be the last value in the domain. + // Some examples of valid domain values are "registry.mydomain.io", "quay.io", "my-registry.io:8080". + // + // The name is typically the repository in the registry where an image is located. + // It must contain lowercase alphanumeric characters separated only by the ".", "_", "__", "-" characters. + // Multiple names can be concatenated with the "/" character. + // The domain and name are combined using the "/" character. + // Some examples of valid name values are "operatorhubio/catalog", "catalog", "my-catalog.prod". + // An example of the domain and name parts of a reference being combined is "quay.io/operatorhubio/catalog". + // + // The identifier is typically the tag or digest for an image reference and is present at the end of the reference. + // It starts with a separator character used to distinguish the end of the name and beginning of the identifier. + // For a digest-based reference, the "@" character is the separator. + // For a tag-based reference, the ":" character is the separator. + // An identifier is required in the reference. + // + // Digest-based references must contain an algorithm reference immediately after the "@" separator. + // The algorithm reference must be followed by the ":" character and an encoded string. + // The algorithm must start with an uppercase or lowercase alpha character followed by alphanumeric characters and may contain the "-", "_", "+", and "." characters. + // Some examples of valid algorithm values are "sha256", "sha256+b64u", "multihash+base58". + // The encoded string following the algorithm must be hex digits (a-f, A-F, 0-9) and must be a minimum of 32 characters. + // + // Tag-based references must begin with a word character (alphanumeric + "_") followed by word characters or ".", and "-" characters. + // The tag must not be longer than 127 characters. + // + // An example of a valid digest-based image reference is "quay.io/operatorhubio/catalog@sha256:200d4ddb2a73594b91358fe6397424e975205bfbe44614f5846033cad64b3f05" + // An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest" + Ref *string `json:"ref,omitempty"` + // pollIntervalMinutes is an optional field that sets the interval, in minutes, at which the image source is polled for new content. + // You cannot specify pollIntervalMinutes when ref is a digest-based reference. + // + // When omitted, the image is not polled for new content. + PollIntervalMinutes *int `json:"pollIntervalMinutes,omitempty"` +} + +// ImageSourceApplyConfiguration constructs a declarative configuration of the ImageSource type for use with +// apply. +func ImageSource() *ImageSourceApplyConfiguration { + return &ImageSourceApplyConfiguration{} +} + +// WithRef sets the Ref field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ref field is set to the value of the last call. +func (b *ImageSourceApplyConfiguration) WithRef(value string) *ImageSourceApplyConfiguration { + b.Ref = &value + return b +} + +// WithPollIntervalMinutes sets the PollIntervalMinutes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PollIntervalMinutes field is set to the value of the last call. +func (b *ImageSourceApplyConfiguration) WithPollIntervalMinutes(value int) *ImageSourceApplyConfiguration { + b.PollIntervalMinutes = &value + return b +} diff --git a/applyconfigurations/api/v1/preflightconfig.go b/applyconfigurations/api/v1/preflightconfig.go new file mode 100644 index 000000000..91b533ade --- /dev/null +++ b/applyconfigurations/api/v1/preflightconfig.go @@ -0,0 +1,45 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// PreflightConfigApplyConfiguration represents a declarative configuration of the PreflightConfig type for use +// with apply. +// +// PreflightConfig holds the configuration for the preflight checks. If used, at least one preflight check must be non-nil. +type PreflightConfigApplyConfiguration struct { + // crdUpgradeSafety configures the CRD Upgrade Safety pre-flight checks that run + // before upgrades of installed content. + // + // The CRD Upgrade Safety pre-flight check safeguards from unintended consequences of upgrading a CRD, + // such as data loss. + CRDUpgradeSafety *CRDUpgradeSafetyPreflightConfigApplyConfiguration `json:"crdUpgradeSafety,omitempty"` +} + +// PreflightConfigApplyConfiguration constructs a declarative configuration of the PreflightConfig type for use with +// apply. +func PreflightConfig() *PreflightConfigApplyConfiguration { + return &PreflightConfigApplyConfiguration{} +} + +// WithCRDUpgradeSafety sets the CRDUpgradeSafety field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CRDUpgradeSafety field is set to the value of the last call. +func (b *PreflightConfigApplyConfiguration) WithCRDUpgradeSafety(value *CRDUpgradeSafetyPreflightConfigApplyConfiguration) *PreflightConfigApplyConfiguration { + b.CRDUpgradeSafety = value + return b +} diff --git a/applyconfigurations/api/v1/resolvedcatalogsource.go b/applyconfigurations/api/v1/resolvedcatalogsource.go new file mode 100644 index 000000000..3897e5733 --- /dev/null +++ b/applyconfigurations/api/v1/resolvedcatalogsource.go @@ -0,0 +1,61 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + apiv1 "github.com/operator-framework/operator-controller/api/v1" +) + +// ResolvedCatalogSourceApplyConfiguration represents a declarative configuration of the ResolvedCatalogSource type for use +// with apply. +// +// ResolvedCatalogSource is a discriminated union of resolution information for a Catalog. +// ResolvedCatalogSource contains the information about a sourced Catalog +type ResolvedCatalogSourceApplyConfiguration struct { + // type is a required field that specifies the type of source for the catalog. + // + // The only allowed value is "Image". + // + // When set to "Image", information about the resolved image source is set in the image field. + Type *apiv1.SourceType `json:"type,omitempty"` + // image contains resolution information for a catalog sourced from an image. + // It must be set when type is Image, and forbidden otherwise. + Image *ResolvedImageSourceApplyConfiguration `json:"image,omitempty"` +} + +// ResolvedCatalogSourceApplyConfiguration constructs a declarative configuration of the ResolvedCatalogSource type for use with +// apply. +func ResolvedCatalogSource() *ResolvedCatalogSourceApplyConfiguration { + return &ResolvedCatalogSourceApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ResolvedCatalogSourceApplyConfiguration) WithType(value apiv1.SourceType) *ResolvedCatalogSourceApplyConfiguration { + b.Type = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ResolvedCatalogSourceApplyConfiguration) WithImage(value *ResolvedImageSourceApplyConfiguration) *ResolvedCatalogSourceApplyConfiguration { + b.Image = value + return b +} diff --git a/applyconfigurations/api/v1/resolvedimagesource.go b/applyconfigurations/api/v1/resolvedimagesource.go new file mode 100644 index 000000000..87be653a4 --- /dev/null +++ b/applyconfigurations/api/v1/resolvedimagesource.go @@ -0,0 +1,43 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ResolvedImageSourceApplyConfiguration represents a declarative configuration of the ResolvedImageSource type for use +// with apply. +// +// ResolvedImageSource provides information about the resolved source of a Catalog sourced from an image. +type ResolvedImageSourceApplyConfiguration struct { + // ref contains the resolved image digest-based reference. + // The digest format allows you to use other tooling to fetch the exact OCI manifests + // that were used to extract the catalog contents. + Ref *string `json:"ref,omitempty"` +} + +// ResolvedImageSourceApplyConfiguration constructs a declarative configuration of the ResolvedImageSource type for use with +// apply. +func ResolvedImageSource() *ResolvedImageSourceApplyConfiguration { + return &ResolvedImageSourceApplyConfiguration{} +} + +// WithRef sets the Ref field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ref field is set to the value of the last call. +func (b *ResolvedImageSourceApplyConfiguration) WithRef(value string) *ResolvedImageSourceApplyConfiguration { + b.Ref = &value + return b +} diff --git a/applyconfigurations/api/v1/revisionstatus.go b/applyconfigurations/api/v1/revisionstatus.go new file mode 100644 index 000000000..d8a2e248f --- /dev/null +++ b/applyconfigurations/api/v1/revisionstatus.go @@ -0,0 +1,63 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// RevisionStatusApplyConfiguration represents a declarative configuration of the RevisionStatus type for use +// with apply. +// +// RevisionStatus defines the observed state of a ClusterExtensionRevision. +type RevisionStatusApplyConfiguration struct { + // name of the ClusterExtensionRevision resource + Name *string `json:"name,omitempty"` + // conditions optionally expose Progressing and Available condition of the revision, + // in case when it is not yet marked as successfully installed (condition Succeeded is not set to True). + // Given that a ClusterExtension should remain available during upgrades, an observer may use these conditions + // to get more insights about reasons for its current state. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// RevisionStatusApplyConfiguration constructs a declarative configuration of the RevisionStatus type for use with +// apply. +func RevisionStatus() *RevisionStatusApplyConfiguration { + return &RevisionStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *RevisionStatusApplyConfiguration) WithName(value string) *RevisionStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *RevisionStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *RevisionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/applyconfigurations/api/v1/serviceaccountreference.go b/applyconfigurations/api/v1/serviceaccountreference.go new file mode 100644 index 000000000..436cab65f --- /dev/null +++ b/applyconfigurations/api/v1/serviceaccountreference.go @@ -0,0 +1,61 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// ServiceAccountReferenceApplyConfiguration represents a declarative configuration of the ServiceAccountReference type for use +// with apply. +// +// ServiceAccountReference identifies the serviceAccount used fo install a ClusterExtension. +type ServiceAccountReferenceApplyConfiguration struct { + // name is a required, immutable reference to the name of the ServiceAccount used for installation + // and management of the content for the package specified in the packageName field. + // + // This ServiceAccount must exist in the installNamespace. + // + // The name field follows the DNS subdomain standard as defined in [RFC 1123]. + // It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), + // start and end with an alphanumeric character, and be no longer than 253 characters. + // + // Some examples of valid values are: + // - some-serviceaccount + // - 123-serviceaccount + // - 1-serviceaccount-2 + // - someserviceaccount + // - some.serviceaccount + // + // Some examples of invalid values are: + // - -some-serviceaccount + // - some-serviceaccount- + // + // [RFC 1123]: https://tools.ietf.org/html/rfc1123 + Name *string `json:"name,omitempty"` +} + +// ServiceAccountReferenceApplyConfiguration constructs a declarative configuration of the ServiceAccountReference type for use with +// apply. +func ServiceAccountReference() *ServiceAccountReferenceApplyConfiguration { + return &ServiceAccountReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceAccountReferenceApplyConfiguration) WithName(value string) *ServiceAccountReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/applyconfigurations/api/v1/sourceconfig.go b/applyconfigurations/api/v1/sourceconfig.go new file mode 100644 index 000000000..13221594a --- /dev/null +++ b/applyconfigurations/api/v1/sourceconfig.go @@ -0,0 +1,58 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package v1 + +// SourceConfigApplyConfiguration represents a declarative configuration of the SourceConfig type for use +// with apply. +// +// SourceConfig is a discriminated union which selects the installation source. +type SourceConfigApplyConfiguration struct { + // sourceType is required and specifies the type of install source. + // + // The only allowed value is "Catalog". + // + // When set to "Catalog", information for determining the appropriate bundle of content to install + // is fetched from ClusterCatalog resources on the cluster. + // When using the Catalog sourceType, the catalog field must also be set. + SourceType *string `json:"sourceType,omitempty"` + // catalog configures how information is sourced from a catalog. + // It is required when sourceType is "Catalog", and forbidden otherwise. + Catalog *CatalogFilterApplyConfiguration `json:"catalog,omitempty"` +} + +// SourceConfigApplyConfiguration constructs a declarative configuration of the SourceConfig type for use with +// apply. +func SourceConfig() *SourceConfigApplyConfiguration { + return &SourceConfigApplyConfiguration{} +} + +// WithSourceType sets the SourceType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SourceType field is set to the value of the last call. +func (b *SourceConfigApplyConfiguration) WithSourceType(value string) *SourceConfigApplyConfiguration { + b.SourceType = &value + return b +} + +// WithCatalog sets the Catalog field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Catalog field is set to the value of the last call. +func (b *SourceConfigApplyConfiguration) WithCatalog(value *CatalogFilterApplyConfiguration) *SourceConfigApplyConfiguration { + b.Catalog = value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go new file mode 100644 index 000000000..a296a1a64 --- /dev/null +++ b/applyconfigurations/internal/internal.go @@ -0,0 +1,61 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package internal + +import ( + fmt "fmt" + sync "sync" + + typed "sigs.k8s.io/structured-merge-diff/v6/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go new file mode 100644 index 000000000..4c4a80e9f --- /dev/null +++ b/applyconfigurations/utils.go @@ -0,0 +1,93 @@ +/* +Copyright 2022. + +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. +*/ +// Code generated by controller-gen-v0.20. DO NOT EDIT. + +package applyconfigurations + +import ( + v1 "github.com/operator-framework/operator-controller/api/v1" + apiv1 "github.com/operator-framework/operator-controller/applyconfigurations/api/v1" + internal "github.com/operator-framework/operator-controller/applyconfigurations/internal" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=olm.operatorframework.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("BundleMetadata"): + return &apiv1.BundleMetadataApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CatalogFilter"): + return &apiv1.CatalogFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CatalogSource"): + return &apiv1.CatalogSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterCatalog"): + return &apiv1.ClusterCatalogApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterCatalogSpec"): + return &apiv1.ClusterCatalogSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterCatalogStatus"): + return &apiv1.ClusterCatalogStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterCatalogURLs"): + return &apiv1.ClusterCatalogURLsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtension"): + return &apiv1.ClusterExtensionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionConfig"): + return &apiv1.ClusterExtensionConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionInstallConfig"): + return &apiv1.ClusterExtensionInstallConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionInstallStatus"): + return &apiv1.ClusterExtensionInstallStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionRevision"): + return &apiv1.ClusterExtensionRevisionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionRevisionObject"): + return &apiv1.ClusterExtensionRevisionObjectApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionRevisionPhase"): + return &apiv1.ClusterExtensionRevisionPhaseApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionRevisionSpec"): + return &apiv1.ClusterExtensionRevisionSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionRevisionStatus"): + return &apiv1.ClusterExtensionRevisionStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionSpec"): + return &apiv1.ClusterExtensionSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ClusterExtensionStatus"): + return &apiv1.ClusterExtensionStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CRDUpgradeSafetyPreflightConfig"): + return &apiv1.CRDUpgradeSafetyPreflightConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ImageSource"): + return &apiv1.ImageSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("PreflightConfig"): + return &apiv1.PreflightConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ResolvedCatalogSource"): + return &apiv1.ResolvedCatalogSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ResolvedImageSource"): + return &apiv1.ResolvedImageSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RevisionStatus"): + return &apiv1.RevisionStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ServiceAccountReference"): + return &apiv1.ServiceAccountReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SourceConfig"): + return &apiv1.SourceConfigApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) managedfields.TypeConverter { + return managedfields.NewSchemeTypeConverter(scheme, internal.Parser()) +} diff --git a/cmd/operator-controller/main.go b/cmd/operator-controller/main.go index 759056fb5..f026c0222 100644 --- a/cmd/operator-controller/main.go +++ b/cmd/operator-controller/main.go @@ -479,6 +479,7 @@ func run() error { CertificateProvider: certProvider, IsWebhookSupportEnabled: certProvider != nil, IsSingleOwnNamespaceEnabled: features.OperatorControllerFeatureGate.Enabled(features.SingleOwnNamespaceInstallSupport), + IsDeploymentConfigEnabled: features.OperatorControllerFeatureGate.Enabled(features.DeploymentConfig), } var cerCfg reconcilerConfigurator if features.OperatorControllerFeatureGate.Enabled(features.BoxcutterRuntime) { @@ -610,13 +611,14 @@ func (c *boxcutterReconcilerConfigurator) Configure(ceReconciler *controllers.Cl Scheme: c.mgr.GetScheme(), ManifestProvider: c.regv1ManifestProvider, } + fieldOwner := fmt.Sprintf("%s/clusterextension-controller", fieldOwnerPrefix) appl := &applier.Boxcutter{ Client: c.mgr.GetClient(), Scheme: c.mgr.GetScheme(), RevisionGenerator: rg, Preflights: c.preflights, PreAuthorizer: preAuth, - FieldOwner: fmt.Sprintf("%s/clusterextension-controller", fieldOwnerPrefix), + FieldOwner: fieldOwner, } revisionStatesGetter := &controllers.BoxcutterRevisionStatesGetter{Reader: c.mgr.GetClient()} storageMigrator := &applier.BoxcutterStorageMigrator{ @@ -624,6 +626,7 @@ func (c *boxcutterReconcilerConfigurator) Configure(ceReconciler *controllers.Cl Scheme: c.mgr.GetScheme(), ActionClientGetter: acg, RevisionGenerator: rg, + FieldOwner: fieldOwner, } ceReconciler.ReconcileSteps = []controllers.ReconcileStepFunc{ controllers.HandleFinalizers(c.finalizers), diff --git a/commitchecker.yaml b/commitchecker.yaml index db447ae2c..1b7977fb3 100644 --- a/commitchecker.yaml +++ b/commitchecker.yaml @@ -1,4 +1,4 @@ -expectedMergeBase: 25704ad1e1d3dd9029d01b918829850f7139a63a +expectedMergeBase: 55473d8c697164b75dbda5b62a0e5cc701524501 upstreamBranch: main upstreamOrg: operator-framework upstreamRepo: operator-controller diff --git a/docs/draft/howto/configure-bundles.md b/docs/draft/howto/configure-bundles.md index 3db23a4f2..1cdd82739 100644 --- a/docs/draft/howto/configure-bundles.md +++ b/docs/draft/howto/configure-bundles.md @@ -1,7 +1,7 @@ ## Description !!! note -This feature is still in `alpha` and the `SingleOwnNamespaceInstallSupport` feature-gate must be enabled to make use of it. +This feature is still `experimental` and the `SingleOwnNamespaceInstallSupport` feature-gate must be enabled to make use of it. See the instructions below on how to enable it. --- diff --git a/docs/draft/howto/customize-operator-deployments.md b/docs/draft/howto/customize-operator-deployments.md new file mode 100644 index 000000000..59932b42f --- /dev/null +++ b/docs/draft/howto/customize-operator-deployments.md @@ -0,0 +1,431 @@ +# How to Customize Operator Deployments with DeploymentConfig + +## Description + +!!! note + This feature is still in `alpha` and the `DeploymentConfig` feature gate must be enabled to make use of it. + See the instructions below on how to enable it. + +--- + +The Bundle Deployment Configuration feature allows you to customize how operators are deployed in your cluster by configuring deployment-level settings such as resource requirements, node placement, environment variables, storage, and annotations. This provides feature parity with OLM v0's `Subscription.spec.config` (SubscriptionConfig) functionality. + +This is particularly useful for: +- **Targeted Scheduling**: Control operator pod placement using node selectors, affinity rules, and tolerations +- **Custom Environments**: Modify operator behavior for different deployment contexts using environment variables +- **Resource Management**: Set precise CPU and memory allocation requirements +- **Flexible Storage**: Attach custom storage volumes to operator pods +- **Operational Metadata**: Add custom annotations to deployments and pods + +## Enabling the Feature Gate + +To enable the Bundle Deployment Configuration feature gate, you need to patch the `operator-controller-controller-manager` deployment in the `olmv1-system` namespace. This will add the `--feature-gates=DeploymentConfig=true` argument to the manager container. + +1. **Patch the deployment:** + + ```bash + kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=DeploymentConfig=true"}]' + ``` + +2. **Wait for the controller manager pods to be ready:** + + ```bash + kubectl -n olmv1-system wait --for=condition=ready pods -l app.kubernetes.io/name=operator-controller + ``` + +Once the above wait condition is met, the `DeploymentConfig` feature gate should be enabled in operator-controller. + +## Configuring Operator Deployments + +Deployment customizations are specified in the `spec.config.inline` field of a ClusterExtension resource, which accepts a JSON object. Within this object, you can include a `deploymentConfig` key with your deployment customization settings. The configuration structure follows the same format as OLM v0's SubscriptionConfig. + +### Basic Example + +```yaml +apiVersion: olm.operatorframework.io/v1 +kind: ClusterExtension +metadata: + name: my-operator +spec: + namespace: my-namespace + serviceAccount: + name: my-operator-sa + source: + sourceType: Catalog + catalog: + packageName: my-operator + config: + inline: + deploymentConfig: + # Add environment variables + env: + - name: LOG_LEVEL + value: "debug" + # Set resource requirements + resources: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "200m" +``` + +## Configuration Options + +### Environment Variables + +Add or override environment variables in operator containers: + +```yaml +config: + inline: + deploymentConfig: + env: + - name: LOG_LEVEL + value: "debug" + - name: ENABLE_WEBHOOKS + value: "true" + envFrom: + - configMapRef: + name: operator-config + - secretRef: + name: operator-secrets +``` + +**Behavior**: Environment variables specified in the `env` list are merged with existing container environment variables. If a variable with the same name exists, the `deploymentConfig` value takes precedence. Variables from `envFrom` are appended to the existing list. + +### Resource Requirements + +Control CPU and memory allocation: + +```yaml +config: + inline: + deploymentConfig: + resources: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "200m" +``` + +**Behavior**: Completely replaces any existing resource requirements defined in the bundle. + +### Node Placement + +#### Node Selector + +Schedule operator pods on specific nodes: + +```yaml +config: + inline: + deploymentConfig: + nodeSelector: + infrastructure: "dedicated" + disktype: "ssd" +``` + +**Behavior**: Completely replaces any existing nodeSelector defined in the bundle. + +#### Tolerations + +Allow operator pods to be scheduled on tainted nodes: + +```yaml +config: + inline: + deploymentConfig: + tolerations: + - key: "dedicated" + operator: "Equal" + value: "operators" + effect: "NoSchedule" + - key: "gpu" + operator: "Exists" + effect: "NoSchedule" +``` + +**Behavior**: Tolerations are appended to any existing tolerations defined in the bundle. + +#### Affinity + +Control pod placement with affinity rules: + +```yaml +config: + inline: + deploymentConfig: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - amd64 + - arm64 + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - my-operator + topologyKey: kubernetes.io/hostname +``` + +**Behavior**: Selectively overrides affinity attributes. Non-nil fields in the `affinity` configuration replace the corresponding fields in the bundle's affinity configuration. + +### Storage + +Add custom volumes and volume mounts: + +```yaml +config: + inline: + deploymentConfig: + volumes: + - name: cache-volume + emptyDir: + sizeLimit: 1Gi + - name: config-volume + configMap: + name: operator-config + volumeMounts: + - name: cache-volume + mountPath: /var/cache + - name: config-volume + mountPath: /etc/config + readOnly: true +``` + +**Behavior**: Volumes and volumeMounts are appended to any existing volumes/volumeMounts defined in the bundle. + +### Annotations + +Add custom annotations to deployment and pod templates: + +```yaml +config: + inline: + deploymentConfig: + annotations: + monitoring.io/scrape: "true" + monitoring.io/port: "8080" + custom.annotation/key: "value" +``` + +**Behavior**: Annotations are merged with existing annotations. If the same annotation key exists in both the bundle and the configuration, the bundle's annotation value takes precedence. + +## Complete Example + +Here's a comprehensive example that demonstrates multiple configuration options: + +```yaml +apiVersion: olm.operatorframework.io/v1 +kind: ClusterExtension +metadata: + name: production-operator +spec: + namespace: production-operators + serviceAccount: + name: production-operator-installer + source: + sourceType: Catalog + catalog: + packageName: production-operator + version: 1.2.3 + config: + inline: + # Combined with deploymentConfig for operators that support namespace scoping + watchNamespace: "production-workloads" + + deploymentConfig: + # Schedule on dedicated operator nodes + nodeSelector: + node-role.kubernetes.io/operator: "" + + # Tolerate the operator node taint + tolerations: + - key: "node-role.kubernetes.io/operator" + operator: "Exists" + effect: "NoSchedule" + + # Set resource requirements + resources: + requests: + memory: "512Mi" + cpu: "250m" + limits: + memory: "1Gi" + cpu: "500m" + + # Configure environment + env: + - name: LOG_LEVEL + value: "info" + - name: ENABLE_METRICS + value: "true" + - name: METRICS_PORT + value: "8080" + envFrom: + - secretRef: + name: operator-credentials + + # Add cache volume + volumes: + - name: operator-cache + emptyDir: + sizeLimit: 2Gi + volumeMounts: + - name: operator-cache + mountPath: /var/cache/operator + + # Add monitoring annotations + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8080" + prometheus.io/path: "/metrics" + + # Prefer spreading across zones + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + olm.operatorframework.io/owner-kind: ClusterExtension + olm.operatorframework.io/owner-name: production-operator + topologyKey: topology.kubernetes.io/zone +``` + +## Migration from OLM v0 + +If you're migrating from OLM v0, you can directly transfer your `Subscription.spec.config` settings to the `deploymentConfig` object within `ClusterExtension.spec.config.inline`. The structure is identical. + +### OLM v0 Example + +```yaml +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: my-operator + namespace: operators +spec: + channel: stable + name: my-operator + source: operatorhubio-catalog + sourceNamespace: olm + config: + env: + - name: LOG_LEVEL + value: "debug" + resources: + requests: + memory: "256Mi" + cpu: "100m" +``` + +### OLM v1 Equivalent + +```yaml +apiVersion: olm.operatorframework.io/v1 +kind: ClusterExtension +metadata: + name: my-operator +spec: + namespace: operators + serviceAccount: + name: my-operator-installer + source: + sourceType: Catalog + catalog: + packageName: my-operator + channel: stable + config: + inline: + deploymentConfig: + env: + - name: LOG_LEVEL + value: "debug" + resources: + requests: + memory: "256Mi" + cpu: "100m" +``` + +## Validation + +When you apply a ClusterExtension with `deploymentConfig` in the `inline` configuration object, OLM v1 validates the configuration against a JSON schema. + +### How the Schema is Generated (Registry+v1 Bundles) + +For registry+v1 bundles, the validation schema is automatically generated from the official Kubernetes API definitions to ensure accuracy and consistency: + +1. **Source**: The schema is based on the `v1alpha1.SubscriptionConfig` type from `github.com/operator-framework/api`, the same type used in OLM v0 +2. **Schema Generation**: A tool parses the SubscriptionConfig struct and maps each field to official Kubernetes OpenAPI v3 schema definitions +3. **Kubernetes API Schemas**: Field types like `ResourceRequirements`, `Toleration`, `Affinity`, etc. are validated against the official Kubernetes schema specifications, ensuring the same validation rules apply as in native Kubernetes resources +4. **Exclusions**: The `selector` field from v0's SubscriptionConfig is excluded because it was never implemented in OLM v0 +5. **Frozen Snapshot**: The generated schema is stored as a frozen snapshot in the operator-controller codebase, providing stability between releases + +This approach guarantees that for registry+v1 bundles: +- Configuration validation matches official Kubernetes API validation +- There is perfect parity with OLM v0's SubscriptionConfig structure +- New fields added to the upstream SubscriptionConfig type can be automatically incorporated when the operator-controller dependency is updated + +### Validation Errors + +If the configuration is invalid, the ClusterExtension will report a `Progressing` condition with details about the validation error. + +Common validation errors: + +| Error | Cause | Solution | +|:------|:------|:---------| +| `unknown field "deploymentConfig"` | The `DeploymentConfig` feature gate is not enabled | Enable the feature gate using the instructions above | +| `invalid value for field "X"` | The field value doesn't match the expected type or format | Check the field type in the examples above | +| `required field "Y" is missing` | A required nested field is missing | Add the required field with an appropriate value | + +## Verify Deployment Customization + +After applying your ClusterExtension with deployment configuration, you can verify that the customizations were applied: + +1. **Check ClusterExtension status:** + + ```bash + kubectl get clusterextension my-operator -o yaml + ``` + + Look for the `Installed` condition to be `True`. + +2. **Inspect the generated deployment:** + + ```bash + kubectl get deployment -n my-namespace -l olm.operatorframework.io/owner-name=my-operator -o yaml + ``` + + Verify that your custom environment variables, resource requirements, node selectors, tolerations, volumes, and annotations are present in the deployment spec. + +3. **Check pod configuration:** + + ```bash + kubectl get pods -n my-namespace -l olm.operatorframework.io/owner-name=my-operator -o yaml + ``` + + Confirm that pods are running with the expected configuration. + +## Notes + +- **Feature Parity**: This feature provides complete feature parity with OLM v0's `SubscriptionConfig`, with the exception of the `selector` field, which was never implemented in OLM v0 and is ignored in both versions. +- **Merge Behavior**: Different configuration fields have different merge behaviors (replace, merge, or append). See the individual sections above for details. +- **Validation Timing**: Configuration is validated when the ClusterExtension is created or updated. Invalid configurations will prevent installation. +- **Updates**: Changes to the `deploymentConfig` object will trigger a reconciliation and update the operator deployment accordingly. +- **JSON Object**: The `spec.config.inline` field accepts a JSON object. The `deploymentConfig` key is one of the supported keys within this object, alongside others like `watchNamespace`. diff --git a/go.mod b/go.mod index ca711474a..77a60448e 100644 --- a/go.mod +++ b/go.mod @@ -47,8 +47,9 @@ require ( k8s.io/utils v0.0.0-20260108192941-914a6e750570 pkg.package-operator.run/boxcutter v0.10.0 sigs.k8s.io/controller-runtime v0.23.1 - sigs.k8s.io/controller-tools v0.20.0 + sigs.k8s.io/controller-tools v0.20.1 sigs.k8s.io/crdify v0.5.0 + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 sigs.k8s.io/yaml v1.6.0 ) @@ -252,7 +253,6 @@ require ( sigs.k8s.io/kustomize/api v0.21.1 // indirect sigs.k8s.io/kustomize/kyaml v0.21.1 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect ) retract v1.5.0 // contains filename with ':' which causes failure creating module zip file diff --git a/go.sum b/go.sum index 8b79ce449..974ecd3fd 100644 --- a/go.sum +++ b/go.sum @@ -802,8 +802,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 h1:hSfpvjjTQXQY2 sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/controller-runtime v0.23.1 h1:TjJSM80Nf43Mg21+RCy3J70aj/W6KyvDtOlpKf+PupE= sigs.k8s.io/controller-runtime v0.23.1/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0= -sigs.k8s.io/controller-tools v0.20.0 h1:VWZF71pwSQ2lZZCt7hFGJsOfDc5dVG28/IysjjMWXL8= -sigs.k8s.io/controller-tools v0.20.0/go.mod h1:b4qPmjGU3iZwqn34alUU5tILhNa9+VXK+J3QV0fT/uU= +sigs.k8s.io/controller-tools v0.20.1 h1:gkfMt9YodI0K85oT8rVi80NTXO/kDmabKR5Ajn5GYxs= +sigs.k8s.io/controller-tools v0.20.1/go.mod h1:b4qPmjGU3iZwqn34alUU5tILhNa9+VXK+J3QV0fT/uU= sigs.k8s.io/crdify v0.5.0 h1:mrMH9CgXQPTZUpTU6Klqfnlys8bggv/7uvLT2lXSP7A= sigs.k8s.io/crdify v0.5.0/go.mod h1:ZIFxaYNgKYmFtZCLPysncXQ8oqwnNlHQbRUfxJHZwzU= sigs.k8s.io/gateway-api v1.4.1 h1:NPxFutNkKNa8UfLd2CMlEuhIPMQgDQ6DXNKG9sHbJU8= diff --git a/hack/tools/crd-generator/main_test.go b/hack/tools/crd-generator/main_test.go index 4987b4324..353707c1d 100644 --- a/hack/tools/crd-generator/main_test.go +++ b/hack/tools/crd-generator/main_test.go @@ -11,7 +11,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" ) -const controllerToolsVersion = "v0.20.0" +const controllerToolsVersion = "v0.20.1" func TestRunGenerator(t *testing.T) { here, err := os.Getwd() diff --git a/hack/tools/crd-generator/testdata/output/experimental/olm.operatorframework.io_clusterextensions.yaml b/hack/tools/crd-generator/testdata/output/experimental/olm.operatorframework.io_clusterextensions.yaml index 3ee03a42f..73505ecd5 100644 --- a/hack/tools/crd-generator/testdata/output/experimental/olm.operatorframework.io_clusterextensions.yaml +++ b/hack/tools/crd-generator/testdata/output/experimental/olm.operatorframework.io_clusterextensions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensions.olm.operatorframework.io spec: diff --git a/hack/tools/crd-generator/testdata/output/standard/olm.operatorframework.io_clusterextensions.yaml b/hack/tools/crd-generator/testdata/output/standard/olm.operatorframework.io_clusterextensions.yaml index 161f1b383..90c33c902 100644 --- a/hack/tools/crd-generator/testdata/output/standard/olm.operatorframework.io_clusterextensions.yaml +++ b/hack/tools/crd-generator/testdata/output/standard/olm.operatorframework.io_clusterextensions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clusterextensions.olm.operatorframework.io spec: diff --git a/helm/experimental.yaml b/helm/experimental.yaml index 1d2761714..e1c7f37cb 100644 --- a/helm/experimental.yaml +++ b/helm/experimental.yaml @@ -12,6 +12,7 @@ options: - PreflightPermissions - HelmChartSupport - BoxcutterRuntime + - DeploymentConfig disabled: - WebhookProviderOpenshiftServiceCA # List of enabled experimental features for catalogd diff --git a/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml b/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml index 39d6e906f..df13bfd73 100644 --- a/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml +++ b/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clustercatalogs.olm.operatorframework.io spec: diff --git a/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml b/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml index 1a97fdfe0..56a326b31 100644 --- a/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml +++ b/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clustercatalogs.olm.operatorframework.io spec: diff --git a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml index 5ac459dea..0ff49e01b 100644 --- a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml +++ b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensionrevisions.olm.operatorframework.io spec: diff --git a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml index b857b9c1c..83631dc27 100644 --- a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml +++ b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensions.olm.operatorframework.io spec: diff --git a/helm/olmv1/base/operator-controller/crd/standard/olm.operatorframework.io_clusterextensions.yaml b/helm/olmv1/base/operator-controller/crd/standard/olm.operatorframework.io_clusterextensions.yaml index 1840c756f..0b824025e 100644 --- a/helm/olmv1/base/operator-controller/crd/standard/olm.operatorframework.io_clusterextensions.yaml +++ b/helm/olmv1/base/operator-controller/crd/standard/olm.operatorframework.io_clusterextensions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clusterextensions.olm.operatorframework.io spec: diff --git a/internal/operator-controller/applier/boxcutter.go b/internal/operator-controller/applier/boxcutter.go index cd3579a4e..cb4da7e53 100644 --- a/internal/operator-controller/applier/boxcutter.go +++ b/internal/operator-controller/applier/boxcutter.go @@ -22,15 +22,16 @@ import ( "k8s.io/apiserver/pkg/authentication/user" "k8s.io/apiserver/pkg/authorization/authorizer" "k8s.io/cli-runtime/pkg/printers" + metav1ac "k8s.io/client-go/applyconfigurations/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/yaml" helmclient "github.com/operator-framework/helm-operator-plugins/pkg/client" ocv1 "github.com/operator-framework/operator-controller/api/v1" + ocv1ac "github.com/operator-framework/operator-controller/applyconfigurations/api/v1" "github.com/operator-framework/operator-controller/internal/operator-controller/authorization" "github.com/operator-framework/operator-controller/internal/operator-controller/labels" "github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/bundle/source" @@ -42,12 +43,12 @@ const ( ) type ClusterExtensionRevisionGenerator interface { - GenerateRevision(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) + GenerateRevision(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) GenerateRevisionFromHelmRelease( ctx context.Context, helmRelease *release.Release, ext *ocv1.ClusterExtension, objectLabels map[string]string, - ) (*ocv1.ClusterExtensionRevision, error) + ) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) } type SimpleRevisionGenerator struct { @@ -59,9 +60,9 @@ func (r *SimpleRevisionGenerator) GenerateRevisionFromHelmRelease( ctx context.Context, helmRelease *release.Release, ext *ocv1.ClusterExtension, objectLabels map[string]string, -) (*ocv1.ClusterExtensionRevision, error) { +) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { docs := splitManifestDocuments(helmRelease.Manifest) - objs := make([]ocv1.ClusterExtensionRevisionObject, 0, len(docs)) + objs := make([]ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration, 0, len(docs)) for _, doc := range docs { obj := unstructured.Unstructured{} if err := yaml.Unmarshal([]byte(doc), &obj); err != nil { @@ -74,9 +75,8 @@ func (r *SimpleRevisionGenerator) GenerateRevisionFromHelmRelease( _ = cache.ApplyStripAnnotationsTransform(&obj) sanitizedUnstructured(ctx, &obj) - objs = append(objs, ocv1.ClusterExtensionRevisionObject{ - Object: obj, - }) + objs = append(objs, *ocv1ac.ClusterExtensionRevisionObject(). + WithObject(obj)) } rev := r.buildClusterExtensionRevision(objs, ext, map[string]string{ @@ -85,9 +85,9 @@ func (r *SimpleRevisionGenerator) GenerateRevisionFromHelmRelease( labels.BundleVersionKey: helmRelease.Labels[labels.BundleVersionKey], labels.BundleReferenceKey: helmRelease.Labels[labels.BundleReferenceKey], }) - rev.Name = fmt.Sprintf("%s-1", ext.Name) - rev.Spec.Revision = 1 - rev.Spec.CollisionProtection = ocv1.CollisionProtectionNone // allow to adopt objects from previous release + rev.WithName(fmt.Sprintf("%s-1", ext.Name)) + rev.Spec.WithRevision(1) + rev.Spec.WithCollisionProtection(ocv1.CollisionProtectionNone) // allow to adopt objects from previous release return rev, nil } @@ -95,7 +95,7 @@ func (r *SimpleRevisionGenerator) GenerateRevision( ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string, -) (*ocv1.ClusterExtensionRevision, error) { +) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { // extract plain manifests plain, err := r.ManifestProvider.Get(bundleFS, ext) if err != nil { @@ -124,7 +124,7 @@ func (r *SimpleRevisionGenerator) GenerateRevision( } // objectLabels - objs := make([]ocv1.ClusterExtensionRevisionObject, 0, len(plain)) + objs := make([]ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration, 0, len(plain)) for _, obj := range plain { obj.SetLabels(mergeLabelMaps(obj.GetLabels(), objectLabels)) @@ -146,12 +146,11 @@ func (r *SimpleRevisionGenerator) GenerateRevision( } sanitizedUnstructured(ctx, &unstr) - objs = append(objs, ocv1.ClusterExtensionRevisionObject{ - Object: unstr, - }) + objs = append(objs, *ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstr)) } rev := r.buildClusterExtensionRevision(objs, ext, revisionAnnotations) - rev.Spec.CollisionProtection = ocv1.CollisionProtectionPrevent + rev.Spec.WithCollisionProtection(ocv1.CollisionProtectionPrevent) return rev, nil } @@ -198,33 +197,32 @@ func sanitizedUnstructured(ctx context.Context, unstr *unstructured.Unstructured } func (r *SimpleRevisionGenerator) buildClusterExtensionRevision( - objects []ocv1.ClusterExtensionRevisionObject, + objects []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration, ext *ocv1.ClusterExtension, annotations map[string]string, -) *ocv1.ClusterExtensionRevision { +) *ocv1ac.ClusterExtensionRevisionApplyConfiguration { if annotations == nil { annotations = make(map[string]string) } annotations[labels.ServiceAccountNameKey] = ext.Spec.ServiceAccount.Name annotations[labels.ServiceAccountNamespaceKey] = ext.Spec.Namespace - cer := &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: annotations, - Labels: map[string]string{ - labels.OwnerKindKey: ocv1.ClusterExtensionKind, - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{ - LifecycleState: ocv1.ClusterExtensionRevisionLifecycleStateActive, - Phases: PhaseSort(objects), - }, - } + phases := PhaseSort(objects) + + spec := ocv1ac.ClusterExtensionRevisionSpec(). + WithLifecycleState(ocv1.ClusterExtensionRevisionLifecycleStateActive). + WithPhases(phases...) if p := ext.Spec.ProgressDeadlineMinutes; p > 0 { - cer.Spec.ProgressDeadlineMinutes = p + spec.WithProgressDeadlineMinutes(p) } - return cer + + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(annotations). + WithLabels(map[string]string{ + labels.OwnerKindKey: ocv1.ClusterExtensionKind, + labels.OwnerNameKey: ext.Name, + }). + WithSpec(spec) } // BoxcutterStorageMigrator migrates ClusterExtensions from Helm-based storage to @@ -234,12 +232,13 @@ type BoxcutterStorageMigrator struct { RevisionGenerator ClusterExtensionRevisionGenerator Client boxcutterStorageMigratorClient Scheme *runtime.Scheme + FieldOwner string } type boxcutterStorageMigratorClient interface { + Apply(ctx context.Context, obj runtime.ApplyConfiguration, opts ...client.ApplyOption) error List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error - Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error Status() client.StatusWriter } @@ -295,17 +294,22 @@ func (m *BoxcutterStorageMigrator) Migrate(ctx context.Context, ext *ocv1.Cluste // normal Boxcutter revisions. This label is critical for ensuring we only // set Succeeded=True status on actually-migrated revisions, not on revision 1 // created during normal Boxcutter operation. - if rev.Labels == nil { - rev.Labels = make(map[string]string) - } - rev.Labels[labels.MigratedFromHelmKey] = "true" + rev.WithLabels(map[string]string{labels.MigratedFromHelmKey: "true"}) // Set ownerReference for proper garbage collection when the ClusterExtension is deleted. - if err := controllerutil.SetControllerReference(ext, rev, m.Scheme); err != nil { - return fmt.Errorf("set ownerref: %w", err) + gvk, err := apiutil.GVKForObject(ext, m.Scheme) + if err != nil { + return fmt.Errorf("get GVK for owner: %w", err) } + rev.WithOwnerReferences(metav1ac.OwnerReference(). + WithAPIVersion(gvk.GroupVersion().String()). + WithKind(gvk.Kind). + WithName(ext.Name). + WithUID(ext.UID). + WithBlockOwnerDeletion(true). + WithController(true)) - if err := m.Client.Create(ctx, rev); err != nil { + if err := m.Client.Apply(ctx, rev, client.FieldOwner(m.FieldOwner), client.ForceOwnership); err != nil { return err } @@ -325,7 +329,7 @@ func (m *BoxcutterStorageMigrator) Migrate(ctx context.Context, ext *ocv1.Cluste // // Since we're creating this revision from a successfully deployed Helm release, we know it // represents a working installation and can safely mark it as succeeded immediately. - return m.ensureRevisionStatus(ctx, rev) + return m.ensureRevisionStatus(ctx, *rev.GetName()) } // ensureMigratedRevisionStatus checks if revision 1 exists and needs its status set. @@ -342,7 +346,7 @@ func (m *BoxcutterStorageMigrator) ensureMigratedRevisionStatus(ctx context.Cont } // Ensure revision 1 status is set correctly, including for previously migrated // revisions that may not carry the MigratedFromHelm label. - return m.ensureRevisionStatus(ctx, &revisions[i]) + return m.ensureRevisionStatus(ctx, revisions[i].Name) } // No revision 1 found - migration not applicable (revisions created by normal operation). return nil @@ -379,9 +383,9 @@ func (m *BoxcutterStorageMigrator) findLatestDeployedRelease(ac helmclient.Actio // ensureRevisionStatus ensures the revision has the Succeeded status condition set. // Returns nil if the status is already set or after successfully setting it. // Only sets status on revisions that were actually migrated from Helm (marked with MigratedFromHelmKey label). -func (m *BoxcutterStorageMigrator) ensureRevisionStatus(ctx context.Context, rev *ocv1.ClusterExtensionRevision) error { - // Re-fetch to get latest version before checking status - if err := m.Client.Get(ctx, client.ObjectKeyFromObject(rev), rev); err != nil { +func (m *BoxcutterStorageMigrator) ensureRevisionStatus(ctx context.Context, name string) error { + rev := &ocv1.ClusterExtensionRevision{} + if err := m.Client.Get(ctx, client.ObjectKey{Name: name}, rev); err != nil { return fmt.Errorf("getting existing revision for status check: %w", err) } @@ -422,53 +426,15 @@ type Boxcutter struct { FieldOwner string } -// createOrUpdate creates or updates the revision object. PreAuthorization checks are performed to ensure the -// user has sufficient permissions to manage the revision and its resources -func (bc *Boxcutter) createOrUpdate(ctx context.Context, user user.Info, rev *ocv1.ClusterExtensionRevision) error { - if rev.GetObjectKind().GroupVersionKind().Empty() { - gvk, err := apiutil.GVKForObject(rev, bc.Scheme) - if err != nil { - return err - } - rev.GetObjectKind().SetGroupVersionKind(gvk) - } - +// apply applies the revision object using server-side apply. PreAuthorization checks are performed +// to ensure the user has sufficient permissions to manage the revision and its resources. +func (bc *Boxcutter) apply(ctx context.Context, user user.Info, rev *ocv1ac.ClusterExtensionRevisionApplyConfiguration) error { // Run auth preflight checks if err := bc.runPreAuthorizationChecks(ctx, user, rev); err != nil { return err } - // DEPRECATION NOTICE: Using client.Apply (deprecated in controller-runtime v0.23.0+) - // - // WHY WE CAN'T FIX THIS YET: - // The recommended replacement is the new typed Apply() method that requires generated - // apply configurations (ApplyConfiguration types). However, this project does not - // currently generate these apply configurations for its API types. - // - // WHY WE NEED SERVER-SIDE APPLY SEMANTICS: - // This controller requires server-side apply with field ownership management to: - // 1. Track which controller owns which fields (via client.FieldOwner) - // 2. Take ownership of fields from other managers during upgrades (via client.ForceOwnership) - // 3. Automatically create-or-update without explicit Get/Create/Update logic - // - // WHY ALTERNATIVES DON'T WORK: - // - client.MergeFrom(): Lacks field ownership - causes conflicts during controller upgrades - // - client.StrategicMergePatch(): No field management - upgrade tests fail with ownership errors - // - Manual Create/Update: Loses server-side apply benefits, complex to implement correctly - // - // WHAT'S REQUIRED TO FIX PROPERLY: - // 1. Generate apply configurations for all API types (ClusterExtensionRevision, etc.) - // - Requires running controller-gen with --with-applyconfig flag - // - Generates ClusterExtensionRevisionApplyConfiguration types - // 2. Update all resource creation/update code to use typed Apply methods - // 3. Update all tests to work with new patterns - // This is a project-wide effort beyond the scope of the k8s v1.35 upgrade. - // - // MIGRATION PATH: - // Track in a future issue: "Generate apply configurations and migrate to typed Apply methods" - // - // nolint:staticcheck // SA1019: server-side apply required, needs generated apply configurations - return bc.Client.Patch(ctx, rev, client.Apply, client.FieldOwner(bc.FieldOwner), client.ForceOwnership) + return bc.Client.Apply(ctx, rev, client.FieldOwner(bc.FieldOwner), client.ForceOwnership) } func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (bool, string, error) { @@ -501,9 +467,17 @@ func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust return false, "", err } - if err := controllerutil.SetControllerReference(ext, desiredRevision, bc.Scheme); err != nil { - return false, "", fmt.Errorf("set ownerref: %w", err) + gvk, err := apiutil.GVKForObject(ext, bc.Scheme) + if err != nil { + return false, "", fmt.Errorf("get GVK for owner: %w", err) } + desiredRevision.WithOwnerReferences(metav1ac.OwnerReference(). + WithAPIVersion(gvk.GroupVersion().String()). + WithKind(gvk.Kind). + WithName(ext.Name). + WithUID(ext.UID). + WithBlockOwnerDeletion(true). + WithController(true)) currentRevision := &ocv1.ClusterExtensionRevision{} state := StateNeedsInstall @@ -511,10 +485,10 @@ func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust if len(existingRevisions) > 0 { // try first to update the current revision. currentRevision = &existingRevisions[len(existingRevisions)-1] - desiredRevision.Spec.Revision = currentRevision.Spec.Revision - desiredRevision.Name = currentRevision.Name + desiredRevision.Spec.WithRevision(currentRevision.Spec.Revision) + desiredRevision.WithName(currentRevision.Name) - err := bc.createOrUpdate(ctx, getUserInfo(ext), desiredRevision) + err := bc.apply(ctx, getUserInfo(ext), desiredRevision) switch { case apierrors.IsInvalid(err): // We could not update the current revision due to trying to update an immutable field. @@ -524,7 +498,7 @@ func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust // inplace patch was successful, no changes in phases state = StateUnchanged default: - return false, "", fmt.Errorf("patching %s Revision: %w", desiredRevision.Name, err) + return false, "", fmt.Errorf("patching %s Revision: %w", *desiredRevision.GetName(), err) } } @@ -557,14 +531,14 @@ func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust prevRevisions := existingRevisions revisionNumber := latestRevisionNumber(prevRevisions) + 1 - desiredRevision.Name = fmt.Sprintf("%s-%d", ext.Name, revisionNumber) - desiredRevision.Spec.Revision = revisionNumber + desiredRevision.WithName(fmt.Sprintf("%s-%d", ext.Name, revisionNumber)) + desiredRevision.Spec.WithRevision(revisionNumber) if err = bc.garbageCollectOldRevisions(ctx, prevRevisions); err != nil { return false, "", fmt.Errorf("garbage collecting old revisions: %w", err) } - if err := bc.createOrUpdate(ctx, getUserInfo(ext), desiredRevision); err != nil { + if err := bc.apply(ctx, getUserInfo(ext), desiredRevision); err != nil { return false, "", fmt.Errorf("creating new Revision: %w", err) } } @@ -574,7 +548,7 @@ func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust // runPreAuthorizationChecks runs PreAuthorization checks if the PreAuthorizer is set. An error will be returned if // the ClusterExtension service account does not have the necessary permissions to manage the revision's resources -func (bc *Boxcutter) runPreAuthorizationChecks(ctx context.Context, user user.Info, rev *ocv1.ClusterExtensionRevision) error { +func (bc *Boxcutter) runPreAuthorizationChecks(ctx context.Context, user user.Info, rev *ocv1ac.ClusterExtensionRevisionApplyConfiguration) error { if bc.PreAuthorizer == nil { return nil } @@ -649,22 +623,27 @@ func splitManifestDocuments(file string) []string { } // getObjects returns a slice of all objects in the revision -func getObjects(rev *ocv1.ClusterExtensionRevision) []client.Object { +func getObjects(rev *ocv1ac.ClusterExtensionRevisionApplyConfiguration) []client.Object { + if rev.Spec == nil { + return nil + } totalObjects := 0 for _, phase := range rev.Spec.Phases { totalObjects += len(phase.Objects) } objs := make([]client.Object, 0, totalObjects) for _, phase := range rev.Spec.Phases { - for _, phaseObject := range phase.Objects { - objs = append(objs, &phaseObject.Object) + for i := range phase.Objects { + if phase.Objects[i].Object != nil { + objs = append(objs, phase.Objects[i].Object) + } } } return objs } // revisionManifestReader returns an io.Reader containing all manifests in the revision -func revisionManifestReader(rev *ocv1.ClusterExtensionRevision) (io.Reader, error) { +func revisionManifestReader(rev *ocv1ac.ClusterExtensionRevisionApplyConfiguration) (io.Reader, error) { printer := printers.YAMLPrinter{} buf := new(bytes.Buffer) for _, obj := range getObjects(rev) { @@ -676,12 +655,12 @@ func revisionManifestReader(rev *ocv1.ClusterExtensionRevision) (io.Reader, erro return buf, nil } -func revisionManagementPerms(rev *ocv1.ClusterExtensionRevision) func(user.Info) []authorizer.AttributesRecord { +func revisionManagementPerms(rev *ocv1ac.ClusterExtensionRevisionApplyConfiguration) func(user.Info) []authorizer.AttributesRecord { return func(user user.Info) []authorizer.AttributesRecord { return []authorizer.AttributesRecord{ { User: user, - Name: rev.Name, + Name: *rev.GetName(), APIGroup: ocv1.GroupVersion.Group, APIVersion: ocv1.GroupVersion.Version, Resource: "clusterextensionrevisions/finalizers", diff --git a/internal/operator-controller/applier/boxcutter_test.go b/internal/operator-controller/applier/boxcutter_test.go index 9e70f61ee..4f8461250 100644 --- a/internal/operator-controller/applier/boxcutter_test.go +++ b/internal/operator-controller/applier/boxcutter_test.go @@ -33,6 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/interceptor" ocv1 "github.com/operator-framework/operator-controller/api/v1" + ocv1ac "github.com/operator-framework/operator-controller/applyconfigurations/api/v1" "github.com/operator-framework/operator-controller/internal/operator-controller/applier" "github.com/operator-framework/operator-controller/internal/operator-controller/authorization" "github.com/operator-framework/operator-controller/internal/operator-controller/labels" @@ -97,32 +98,29 @@ func Test_SimpleRevisionGenerator_GenerateRevisionFromHelmRelease(t *testing.T) rev, err := g.GenerateRevisionFromHelmRelease(t.Context(), helmRelease, ext, objectLabels) require.NoError(t, err) - assert.Equal(t, &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-123-1", - Annotations: map[string]string{ - "olm.operatorframework.io/bundle-name": "my-bundle", - "olm.operatorframework.io/bundle-reference": "bundle-ref", - "olm.operatorframework.io/bundle-version": "1.2.0", - "olm.operatorframework.io/package-name": "my-package", - "olm.operatorframework.io/service-account-name": "test-sa", - "olm.operatorframework.io/service-account-namespace": "test-namespace", - }, - Labels: map[string]string{ - labels.OwnerKindKey: ocv1.ClusterExtensionKind, - labels.OwnerNameKey: "test-123", - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{ - LifecycleState: ocv1.ClusterExtensionRevisionLifecycleStateActive, - CollisionProtection: ocv1.CollisionProtectionNone, - Revision: 1, - Phases: []ocv1.ClusterExtensionRevisionPhase{ - { - Name: "configuration", - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + expected := ocv1ac.ClusterExtensionRevision("test-123-1"). + WithAnnotations(map[string]string{ + "olm.operatorframework.io/bundle-name": "my-bundle", + "olm.operatorframework.io/bundle-reference": "bundle-ref", + "olm.operatorframework.io/bundle-version": "1.2.0", + "olm.operatorframework.io/package-name": "my-package", + "olm.operatorframework.io/service-account-name": "test-sa", + "olm.operatorframework.io/service-account-namespace": "test-namespace", + }). + WithLabels(map[string]string{ + labels.OwnerKindKey: ocv1.ClusterExtensionKind, + labels.OwnerNameKey: "test-123", + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec(). + WithLifecycleState(ocv1.ClusterExtensionRevisionLifecycleStateActive). + WithCollisionProtection(ocv1.CollisionProtectionNone). + WithRevision(1). + WithPhases( + ocv1ac.ClusterExtensionRevisionPhase(). + WithName("configuration"). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -132,10 +130,9 @@ func Test_SimpleRevisionGenerator_GenerateRevisionFromHelmRelease(t *testing.T) }, }, }, - }, - }, - { - Object: unstructured.Unstructured{ + }), + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -145,13 +142,11 @@ func Test_SimpleRevisionGenerator_GenerateRevisionFromHelmRelease(t *testing.T) }, }, }, - }, - }, - }, - }, - }, - }, - }, rev) + }), + ), + ), + ) + assert.Equal(t, expected, rev) } func Test_SimpleRevisionGenerator_GenerateRevision(t *testing.T) { @@ -212,17 +207,17 @@ func Test_SimpleRevisionGenerator_GenerateRevision(t *testing.T) { labels.OwnerKindKey: ocv1.ClusterExtensionKind, labels.OwnerNameKey: "test-extension", }, rev.Labels) - t.Log("by checking the revision number is 0") - require.Equal(t, int64(0), rev.Spec.Revision) + t.Log("by checking the revision number is not set (defaults to zero value)") + require.Nil(t, rev.Spec.Revision) t.Log("by checking the spec-level collisionProtection is set") - require.Equal(t, ocv1.CollisionProtectionPrevent, rev.Spec.CollisionProtection) + require.Equal(t, ptr.To(ocv1.CollisionProtectionPrevent), rev.Spec.CollisionProtection) t.Log("by checking the rendered objects are present in the correct phases") - require.Equal(t, []ocv1.ClusterExtensionRevisionPhase{ - { - Name: string(applier.PhaseInfrastructure), - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + require.Equal(t, []ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ + *ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(applier.PhaseInfrastructure)). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Service", @@ -231,15 +226,13 @@ func Test_SimpleRevisionGenerator_GenerateRevision(t *testing.T) { }, "spec": map[string]interface{}{}, }, - }, - }, - }, - }, - { - Name: string(applier.PhaseDeploy), - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + }), + ), + *ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(applier.PhaseDeploy)). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -264,10 +257,8 @@ func Test_SimpleRevisionGenerator_GenerateRevision(t *testing.T) { "strategy": map[string]interface{}{}, }, }, - }, - }, - }, - }, + }), + ), }, rev.Spec.Phases) } @@ -447,7 +438,7 @@ func Test_SimpleRevisionGenerator_PropagatesProgressDeadlineMinutes(t *testing.T progressDeadlineMinutes *int32 } type want struct { - progressDeadlineMinutes int32 + progressDeadlineMinutes *int32 } type testCase struct { args args @@ -459,12 +450,12 @@ func Test_SimpleRevisionGenerator_PropagatesProgressDeadlineMinutes(t *testing.T progressDeadlineMinutes: ptr.To(int32(10)), }, want: want{ - progressDeadlineMinutes: 10, + progressDeadlineMinutes: ptr.To(int32(10)), }, }, "do not propagate when unset": { want: want{ - progressDeadlineMinutes: 0, + progressDeadlineMinutes: nil, }, }, } { @@ -558,17 +549,20 @@ func TestBoxcutter_Apply(t *testing.T) { allowedRevisionValue := func(revNum int64) *interceptor.Funcs { return &interceptor.Funcs{ - Patch: func(ctx context.Context, client client.WithWatch, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { - cer, ok := obj.(*ocv1.ClusterExtensionRevision) + Apply: func(ctx context.Context, client client.WithWatch, obj runtime.ApplyConfiguration, opts ...client.ApplyOption) error { + cer, ok := obj.(*ocv1ac.ClusterExtensionRevisionApplyConfiguration) if !ok { - return fmt.Errorf("expected ClusterExtensionRevision, got %T", obj) + return fmt.Errorf("expected ClusterExtensionRevisionApplyConfiguration, got %T", obj) } - fmt.Println(cer.Spec.Revision) - if cer.Spec.Revision != revNum { - fmt.Println("AAA") - return apierrors.NewInvalid(cer.GroupVersionKind().GroupKind(), cer.GetName(), field.ErrorList{field.Invalid(field.NewPath("spec.phases"), "immutable", "spec.phases is immutable")}) + if cer.Spec == nil || cer.Spec.Revision == nil || *cer.Spec.Revision != revNum { + gk := ocv1.SchemeGroupVersion.WithKind("ClusterExtensionRevision").GroupKind() + name := "" + if n := cer.GetName(); n != nil { + name = *n + } + return apierrors.NewInvalid(gk, name, field.ErrorList{field.Invalid(field.NewPath("spec.phases"), "immutable", "spec.phases is immutable")}) } - return client.Patch(ctx, obj, patch, opts...) + return client.Apply(ctx, obj, opts...) }, } } @@ -583,21 +577,19 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "first revision", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: revisionAnnotations, - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{ - Phases: []ocv1.ClusterExtensionRevisionPhase{ - { - Name: string(applier.PhaseDeploy), - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(revisionAnnotations). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec(). + WithPhases( + ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(applier.PhaseDeploy)). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -605,13 +597,10 @@ func TestBoxcutter_Apply(t *testing.T) { "name": "test-cm", }, }, - }, - }, - }, - }, - }, - }, - }, nil + }), + ), + ), + ), nil }, }, validate: func(t *testing.T, c client.Client) { @@ -631,21 +620,19 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "no change, revision exists", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: revisionAnnotations, - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{ - Phases: []ocv1.ClusterExtensionRevisionPhase{ - { - Name: string(applier.PhaseDeploy), - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(revisionAnnotations). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec(). + WithPhases( + ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(applier.PhaseDeploy)). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -653,13 +640,10 @@ func TestBoxcutter_Apply(t *testing.T) { "name": "test-cm", }, }, - }, - }, - }, - }, - }, - }, - }, nil + }), + ), + ), + ), nil }, }, existingObjs: []client.Object{ @@ -677,21 +661,19 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "new revision created when objects in new revision are different", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: revisionAnnotations, - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{ - Phases: []ocv1.ClusterExtensionRevisionPhase{ - { - Name: string(applier.PhaseDeploy), - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(revisionAnnotations). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec(). + WithPhases( + ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(applier.PhaseDeploy)). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -699,13 +681,10 @@ func TestBoxcutter_Apply(t *testing.T) { "name": "new-secret", }, }, - }, - }, - }, - }, - }, - }, - }, nil + }), + ), + ), + ), nil }, }, clientIterceptor: allowedRevisionValue(2), @@ -735,7 +714,7 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "error from GenerateRevision", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { return nil, errors.New("render boom") }, }, @@ -751,16 +730,13 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "keep at most 5 past revisions", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: revisionAnnotations, - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{}, - }, nil + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(revisionAnnotations). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec()), nil }, }, existingObjs: []client.Object{ @@ -855,16 +831,13 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "keep active revisions when they are out of limit", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: revisionAnnotations, - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{}, - }, nil + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(revisionAnnotations). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec()), nil }, }, existingObjs: []client.Object{ @@ -975,21 +948,19 @@ func TestBoxcutter_Apply(t *testing.T) { { name: "annotation-only update (same phases, different annotations)", mockBuilder: &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Annotations: revisionAnnotations, - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{ - Phases: []ocv1.ClusterExtensionRevisionPhase{ - { - Name: string(applier.PhaseDeploy), - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithAnnotations(revisionAnnotations). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec(). + WithPhases( + ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(applier.PhaseDeploy)). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -997,13 +968,10 @@ func TestBoxcutter_Apply(t *testing.T) { "name": "test-cm", }, }, - }, - }, - }, - }, - }, - }, - }, nil + }), + ), + ), + ), nil }, }, existingObjs: []client.Object{ @@ -1135,15 +1103,15 @@ func Test_PreAuthorizer_Integration(t *testing.T) { } fakeClient := fake.NewClientBuilder().WithScheme(testScheme).Build() dummyGenerator := &mockBundleRevisionBuilder{ - makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotation map[string]string) (*ocv1.ClusterExtensionRevision, error) { - return &ocv1.ClusterExtensionRevision{ - Spec: ocv1.ClusterExtensionRevisionSpec{ - Phases: []ocv1.ClusterExtensionRevisionPhase{ - { - Name: "some-phase", - Objects: []ocv1.ClusterExtensionRevisionObject{ - { - Object: unstructured.Unstructured{ + makeRevisionFunc: func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotation map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { + return ocv1ac.ClusterExtensionRevision(""). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec(). + WithPhases( + ocv1ac.ClusterExtensionRevisionPhase(). + WithName("some-phase"). + WithObjects( + ocv1ac.ClusterExtensionRevisionObject(). + WithObject(unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -1151,13 +1119,10 @@ func Test_PreAuthorizer_Integration(t *testing.T) { "test-data": "test-data", }, }, - }, - }, - }, - }, - }, - }, - }, nil + }), + ), + ), + ), nil }, } dummyBundleFs := fstest.MapFS{} @@ -1320,6 +1285,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1330,16 +1296,12 @@ func TestBoxcutterStorageMigrator(t *testing.T) { On("List", mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevisionList"), mock.Anything). Return(nil) client. - On("Create", mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevision"), mock.Anything). + On("Apply", mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevisionApplyConfiguration"), mock.Anything). Once(). Run(func(args mock.Arguments) { - // Verify the migration marker label is set before creation - rev := args.Get(1).(*ocv1.ClusterExtensionRevision) + // Verify the migration marker label is set before apply + rev := args.Get(1).(*ocv1ac.ClusterExtensionRevisionApplyConfiguration) require.Equal(t, "true", rev.Labels[labels.MigratedFromHelmKey], "Migration marker label should be set") - - // Simulate real Kubernetes behavior: Create() populates server-managed fields - rev.Generation = 1 - rev.ResourceVersion = "1" }). Return(nil) client. @@ -1348,8 +1310,12 @@ func TestBoxcutterStorageMigrator(t *testing.T) { Run(func(args mock.Arguments) { // Simulate Get() returning the created revision with server-managed fields rev := args.Get(2).(*ocv1.ClusterExtensionRevision) + rev.Name = "test-revision" rev.Generation = 1 rev.ResourceVersion = "1" + rev.Labels = map[string]string{ + labels.MigratedFromHelmKey: "true", + } }). Return(nil) @@ -1386,6 +1352,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1440,6 +1407,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1507,6 +1475,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1584,6 +1553,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1666,6 +1636,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1677,16 +1648,12 @@ func TestBoxcutterStorageMigrator(t *testing.T) { Return(nil) client. - On("Create", mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevision"), mock.Anything). + On("Apply", mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevisionApplyConfiguration"), mock.Anything). Once(). Run(func(args mock.Arguments) { - // Verify the migration marker label is set before creation - rev := args.Get(1).(*ocv1.ClusterExtensionRevision) + // Verify the migration marker label is set before apply + rev := args.Get(1).(*ocv1ac.ClusterExtensionRevisionApplyConfiguration) require.Equal(t, "true", rev.Labels[labels.MigratedFromHelmKey], "Migration marker label should be set") - - // Simulate real Kubernetes behavior: Create() populates server-managed fields - rev.Generation = 1 - rev.ResourceVersion = "1" }). Return(nil) @@ -1755,6 +1722,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1787,6 +1755,7 @@ func TestBoxcutterStorageMigrator(t *testing.T) { ActionClientGetter: mag, Client: client, Scheme: testScheme, + FieldOwner: "test-owner", } ext := &ocv1.ClusterExtension{ @@ -1806,12 +1775,12 @@ func TestBoxcutterStorageMigrator(t *testing.T) { // mockBundleRevisionBuilder is a mock implementation of the ClusterExtensionRevisionGenerator for testing. type mockBundleRevisionBuilder struct { - makeRevisionFunc func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotation map[string]string) (*ocv1.ClusterExtensionRevision, error) + makeRevisionFunc func(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotation map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) generateRevisionFromHelmReleaseCalled bool helmReleaseUsed *release.Release } -func (m *mockBundleRevisionBuilder) GenerateRevision(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1.ClusterExtensionRevision, error) { +func (m *mockBundleRevisionBuilder) GenerateRevision(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { return m.makeRevisionFunc(ctx, bundleFS, ext, objectLabels, revisionAnnotations) } @@ -1819,18 +1788,14 @@ func (m *mockBundleRevisionBuilder) GenerateRevisionFromHelmRelease( ctx context.Context, helmRelease *release.Release, ext *ocv1.ClusterExtension, objectLabels map[string]string, -) (*ocv1.ClusterExtensionRevision, error) { +) (*ocv1ac.ClusterExtensionRevisionApplyConfiguration, error) { m.generateRevisionFromHelmReleaseCalled = true m.helmReleaseUsed = helmRelease - return &ocv1.ClusterExtensionRevision{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-revision", - Labels: map[string]string{ - labels.OwnerNameKey: ext.Name, - }, - }, - Spec: ocv1.ClusterExtensionRevisionSpec{}, - }, nil + return ocv1ac.ClusterExtensionRevision("test-revision"). + WithLabels(map[string]string{ + labels.OwnerNameKey: ext.Name, + }). + WithSpec(ocv1ac.ClusterExtensionRevisionSpec()), nil } type clientMock struct { @@ -1848,7 +1813,7 @@ func (m *clientMock) Get(ctx context.Context, key client.ObjectKey, obj client.O return args.Error(0) } -func (m *clientMock) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { +func (m *clientMock) Apply(ctx context.Context, obj runtime.ApplyConfiguration, opts ...client.ApplyOption) error { args := m.Called(ctx, obj, opts) return args.Error(0) } diff --git a/internal/operator-controller/applier/phase.go b/internal/operator-controller/applier/phase.go index 5af360143..767526590 100644 --- a/internal/operator-controller/applier/phase.go +++ b/internal/operator-controller/applier/phase.go @@ -6,7 +6,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" - ocv1 "github.com/operator-framework/operator-controller/api/v1" + ocv1ac "github.com/operator-framework/operator-controller/applyconfigurations/api/v1" ) // The following, with modifications, is taken from: @@ -155,7 +155,7 @@ func init() { // to ensure consistent ordering regardless of input order. This is critical for // Helm-to-Boxcutter migration where the same resources may come from different sources // (Helm release manifest vs bundle manifest) and need to produce identical phases. -func compareClusterExtensionRevisionObjects(a, b ocv1.ClusterExtensionRevisionObject) int { +func compareClusterExtensionRevisionObjectApplyConfigurations(a, b ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration) int { aGVK := a.Object.GroupVersionKind() bGVK := b.Object.GroupVersionKind() @@ -171,9 +171,9 @@ func compareClusterExtensionRevisionObjects(a, b ocv1.ClusterExtensionRevisionOb // PhaseSort takes an unsorted list of objects and organizes them into sorted phases. // Each phase will be applied in order according to DefaultPhaseOrder. Objects // within a single phase are applied simultaneously. -func PhaseSort(unsortedObjs []ocv1.ClusterExtensionRevisionObject) []ocv1.ClusterExtensionRevisionPhase { - phasesSorted := make([]ocv1.ClusterExtensionRevisionPhase, 0) - phaseMap := make(map[Phase][]ocv1.ClusterExtensionRevisionObject, 0) +func PhaseSort(unsortedObjs []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration) []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration { + phasesSorted := make([]*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration, 0) + phaseMap := make(map[Phase][]ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration) for _, obj := range unsortedObjs { phase := determinePhase(obj.Object.GroupVersionKind().GroupKind()) @@ -183,12 +183,16 @@ func PhaseSort(unsortedObjs []ocv1.ClusterExtensionRevisionObject) []ocv1.Cluste for _, phaseName := range defaultPhaseOrder { if objs, ok := phaseMap[phaseName]; ok { // Sort objects within the phase deterministically - slices.SortFunc(objs, compareClusterExtensionRevisionObjects) - - phasesSorted = append(phasesSorted, ocv1.ClusterExtensionRevisionPhase{ - Name: string(phaseName), - Objects: objs, - }) + slices.SortFunc(objs, compareClusterExtensionRevisionObjectApplyConfigurations) + + // Convert to pointers for WithObjects + objPtrs := make([]*ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration, len(objs)) + for i := range objs { + objPtrs[i] = &objs[i] + } + phasesSorted = append(phasesSorted, ocv1ac.ClusterExtensionRevisionPhase(). + WithName(string(phaseName)). + WithObjects(objPtrs...)) } } diff --git a/internal/operator-controller/applier/phase_test.go b/internal/operator-controller/applier/phase_test.go index 741a76b0d..25e291670 100644 --- a/internal/operator-controller/applier/phase_test.go +++ b/internal/operator-controller/applier/phase_test.go @@ -5,22 +5,23 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/utils/ptr" - v1 "github.com/operator-framework/operator-controller/api/v1" + ocv1ac "github.com/operator-framework/operator-controller/applyconfigurations/api/v1" "github.com/operator-framework/operator-controller/internal/operator-controller/applier" ) func Test_PhaseSort(t *testing.T) { for _, tt := range []struct { name string - objs []v1.ClusterExtensionRevisionObject - want []v1.ClusterExtensionRevisionPhase + objs []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration + want []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration }{ { name: "single deploy obj", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -28,12 +29,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseDeploy), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -46,9 +47,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "all phases", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "admissionregistration.k8s.io/v1", "kind": "ValidatingWebhookConfiguration", @@ -56,7 +57,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -64,7 +65,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Namespace", @@ -72,7 +73,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "some.api/v1", "kind": "SomeCustomResource", @@ -80,7 +81,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", @@ -88,7 +89,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRoleBinding", @@ -96,7 +97,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "RoleBinding", @@ -104,7 +105,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "Role", @@ -112,7 +113,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "PersistentVolume", @@ -120,7 +121,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "networking.k8s.io/v1", "kind": "NetworkPolicy", @@ -128,7 +129,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apiextensions.k8s.io/v1", "kind": "CustomResourceDefinition", @@ -136,7 +137,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ServiceAccount", @@ -144,7 +145,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -152,7 +153,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Service", @@ -160,7 +161,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "autoscaling.k8s.io/v1", "kind": "VerticalPodAutoscaler", @@ -168,7 +169,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "monitoring.coreos.com/v1", "kind": "PrometheusRule", @@ -176,12 +177,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseNamespaces), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseNamespaces)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Namespace", @@ -191,10 +192,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhasePolicies), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhasePolicies)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "networking.k8s.io/v1", "kind": "NetworkPolicy", @@ -204,10 +205,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseIdentity), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseIdentity)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ServiceAccount", @@ -217,10 +218,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseConfiguration), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseConfiguration)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -230,10 +231,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseStorage), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseStorage)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "PersistentVolume", @@ -243,10 +244,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseCRDs), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseCRDs)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apiextensions.k8s.io/v1", "kind": "CustomResourceDefinition", @@ -256,10 +257,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseRoles), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseRoles)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", @@ -267,7 +268,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "Role", @@ -277,10 +278,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseBindings), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseBindings)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRoleBinding", @@ -288,7 +289,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "RoleBinding", @@ -298,10 +299,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseInfrastructure), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseInfrastructure)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Service", @@ -311,10 +312,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseDeploy), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -322,7 +323,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "some.api/v1", "kind": "SomeCustomResource", @@ -332,10 +333,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseScaling), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseScaling)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "autoscaling.k8s.io/v1", "kind": "VerticalPodAutoscaler", @@ -345,10 +346,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhasePublish), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhasePublish)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "monitoring.coreos.com/v1", "kind": "PrometheusRule", @@ -358,10 +359,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseAdmission), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseAdmission)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "admissionregistration.k8s.io/v1", "kind": "ValidatingWebhookConfiguration", @@ -374,9 +375,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "sorted and batched", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -384,7 +385,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -392,7 +393,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ServiceAccount", @@ -400,12 +401,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseIdentity), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseIdentity)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ServiceAccount", @@ -415,10 +416,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseConfiguration), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseConfiguration)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -428,10 +429,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseDeploy), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -444,14 +445,14 @@ func Test_PhaseSort(t *testing.T) { }, { name: "no objects", - objs: []v1.ClusterExtensionRevisionObject{}, - want: []v1.ClusterExtensionRevisionPhase{}, + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{}, + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{}, }, { name: "sort by group within same phase", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -462,7 +463,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "cert-manager.io/v1", "kind": "Certificate", @@ -473,12 +474,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseDeploy), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -489,7 +490,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "cert-manager.io/v1", "kind": "Certificate", @@ -505,9 +506,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "sort by version within same group and phase", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "batch/v1", "kind": "Job", @@ -518,7 +519,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "batch/v1beta1", "kind": "CronJob", @@ -529,12 +530,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseDeploy), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "batch/v1", "kind": "Job", @@ -545,7 +546,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "batch/v1beta1", "kind": "CronJob", @@ -561,9 +562,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "sort by kind within same group, version, and phase", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -574,7 +575,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -585,12 +586,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseConfiguration), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseConfiguration)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -601,7 +602,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -617,9 +618,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "sort by namespace within same GVK and phase", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -631,7 +632,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -643,7 +644,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -655,12 +656,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseConfiguration), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseConfiguration)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -672,7 +673,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -684,7 +685,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -701,9 +702,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "sort by name within same GVK, namespace, and phase", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -715,7 +716,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -727,7 +728,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -739,12 +740,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseConfiguration), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseConfiguration)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -756,7 +757,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -768,7 +769,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -785,9 +786,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "comprehensive sorting - all dimensions", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -799,7 +800,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -811,7 +812,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -823,7 +824,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -835,7 +836,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -847,7 +848,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -859,12 +860,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseConfiguration), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseConfiguration)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -876,7 +877,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "ConfigMap", @@ -888,7 +889,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -900,7 +901,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "v1", "kind": "Secret", @@ -914,10 +915,10 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Name: string(applier.PhaseDeploy), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseDeploy)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -929,7 +930,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "apps/v1", "kind": "Deployment", @@ -946,9 +947,9 @@ func Test_PhaseSort(t *testing.T) { }, { name: "cluster-scoped vs namespaced resources - empty namespace sorts first", - objs: []v1.ClusterExtensionRevisionObject{ + objs: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", @@ -959,7 +960,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", @@ -970,7 +971,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "Role", @@ -982,12 +983,12 @@ func Test_PhaseSort(t *testing.T) { }, }, }, - want: []v1.ClusterExtensionRevisionPhase{ + want: []*ocv1ac.ClusterExtensionRevisionPhaseApplyConfiguration{ { - Name: string(applier.PhaseRoles), - Objects: []v1.ClusterExtensionRevisionObject{ + Name: ptr.To(string(applier.PhaseRoles)), + Objects: []ocv1ac.ClusterExtensionRevisionObjectApplyConfiguration{ { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", @@ -998,7 +999,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", @@ -1009,7 +1010,7 @@ func Test_PhaseSort(t *testing.T) { }, }, { - Object: unstructured.Unstructured{ + Object: &unstructured.Unstructured{ Object: map[string]interface{}{ "apiVersion": "rbac.authorization.k8s.io/v1", "kind": "Role", diff --git a/internal/operator-controller/applier/provider.go b/internal/operator-controller/applier/provider.go index 4602803ab..49e5a8df0 100644 --- a/internal/operator-controller/applier/provider.go +++ b/internal/operator-controller/applier/provider.go @@ -33,6 +33,7 @@ type RegistryV1ManifestProvider struct { CertificateProvider render.CertificateProvider IsWebhookSupportEnabled bool IsSingleOwnNamespaceEnabled bool + IsDeploymentConfigEnabled bool } func (r *RegistryV1ManifestProvider) Get(bundleFS fs.FS, ext *ocv1.ClusterExtension) ([]client.Object, error) { @@ -70,7 +71,11 @@ func (r *RegistryV1ManifestProvider) Get(bundleFS fs.FS, ext *ocv1.ClusterExtens render.WithCertificateProvider(r.CertificateProvider), } - if r.IsSingleOwnNamespaceEnabled { + // Always validate inline config when present so that disabled features produce + // a clear error rather than being silently ignored. When IsSingleOwnNamespaceEnabled + // is true we also call this with no config to validate required fields (e.g. + // watchNamespace for OwnNamespace-only bundles). + if r.IsSingleOwnNamespaceEnabled || ext.Spec.Config != nil { configOpts, err := r.extractBundleConfigOptions(&rv1, ext) if err != nil { return nil, err @@ -88,6 +93,14 @@ func (r *RegistryV1ManifestProvider) extractBundleConfigOptions(rv1 *bundle.Regi return nil, fmt.Errorf("error getting configuration schema: %w", err) } + // When the DeploymentConfig feature gate is disabled, remove deploymentConfig from the + // schema so that users get a clear "unknown field" error if they attempt to use it. + if !r.IsDeploymentConfigEnabled { + if props, ok := schema["properties"].(map[string]any); ok { + delete(props, "deploymentConfig") + } + } + bundleConfigBytes := extensionConfigBytes(ext) bundleConfig, err := config.UnmarshalConfig(bundleConfigBytes, schema, ext.Spec.Namespace) if err != nil { @@ -99,13 +112,15 @@ func (r *RegistryV1ManifestProvider) extractBundleConfigOptions(rv1 *bundle.Regi opts = append(opts, render.WithTargetNamespaces(*watchNS)) } - // Extract and convert deploymentConfig if present - if deploymentConfigMap := bundleConfig.GetDeploymentConfig(); deploymentConfigMap != nil { - deploymentConfig, err := convertToDeploymentConfig(deploymentConfigMap) - if err != nil { - return nil, errorutil.NewTerminalError(ocv1.ReasonInvalidConfiguration, fmt.Errorf("invalid deploymentConfig: %w", err)) + // Extract and convert deploymentConfig if present and the feature gate is enabled. + if r.IsDeploymentConfigEnabled { + if deploymentConfigMap := bundleConfig.GetDeploymentConfig(); deploymentConfigMap != nil { + deploymentConfig, err := convertToDeploymentConfig(deploymentConfigMap) + if err != nil { + return nil, errorutil.NewTerminalError(ocv1.ReasonInvalidConfiguration, fmt.Errorf("invalid deploymentConfig: %w", err)) + } + opts = append(opts, render.WithDeploymentConfig(deploymentConfig)) } - opts = append(opts, render.WithDeploymentConfig(deploymentConfig)) } return opts, nil diff --git a/internal/operator-controller/applier/provider_test.go b/internal/operator-controller/applier/provider_test.go index 26d565209..71b1ab3bd 100644 --- a/internal/operator-controller/applier/provider_test.go +++ b/internal/operator-controller/applier/provider_test.go @@ -461,6 +461,7 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { }, }, IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: true, } bundleFS := bundlefs.Builder().WithPackageName("test"). @@ -492,6 +493,7 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { }, }, IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: true, } bundleFS := bundlefs.Builder().WithPackageName("test"). @@ -524,6 +526,7 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { }, }, IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: true, } bundleFS := bundlefs.Builder().WithPackageName("test"). @@ -566,6 +569,7 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { }, }, IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: true, } bundleFS := bundlefs.Builder().WithPackageName("test"). @@ -602,6 +606,7 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { }, }, IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: true, } bundleFS := bundlefs.Builder().WithPackageName("test"). @@ -631,6 +636,7 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { }, }, IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: true, } bundleFS := bundlefs.Builder().WithPackageName("test"). @@ -654,6 +660,70 @@ func Test_RegistryV1ManifestProvider_DeploymentConfig(t *testing.T) { require.Contains(t, err.Error(), "deploymentConfig.env") require.ErrorIs(t, err, reconcile.TerminalError(nil), "config validation errors should be terminal") }) + + t.Run("returns terminal error when deploymentConfig is used but feature gate is disabled", func(t *testing.T) { + provider := applier.RegistryV1ManifestProvider{ + BundleRenderer: render.BundleRenderer{ + ResourceGenerators: []render.ResourceGenerator{ + func(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error) { + return nil, nil + }, + }, + }, + IsSingleOwnNamespaceEnabled: true, + IsDeploymentConfigEnabled: false, + } + + bundleFS := bundlefs.Builder().WithPackageName("test"). + WithCSV(clusterserviceversion.Builder().WithInstallModeSupportFor(v1alpha1.InstallModeTypeAllNamespaces).Build()).Build() + + _, err := provider.Get(bundleFS, &ocv1.ClusterExtension{ + Spec: ocv1.ClusterExtensionSpec{ + Namespace: "install-namespace", + Config: &ocv1.ClusterExtensionConfig{ + ConfigType: ocv1.ClusterExtensionConfigTypeInline, + Inline: &apiextensionsv1.JSON{ + Raw: []byte(`{"deploymentConfig": {"env": [{"name": "TEST_ENV", "value": "test-value"}]}}`), + }, + }, + }, + }) + require.Error(t, err) + require.Contains(t, err.Error(), "unknown field \"deploymentConfig\"") + require.ErrorIs(t, err, reconcile.TerminalError(nil), "feature gate disabled error should be terminal") + }) + + t.Run("returns terminal error when deploymentConfig is used with SingleOwnNamespace disabled and DeploymentConfig gate disabled", func(t *testing.T) { + provider := applier.RegistryV1ManifestProvider{ + BundleRenderer: render.BundleRenderer{ + ResourceGenerators: []render.ResourceGenerator{ + func(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error) { + return nil, nil + }, + }, + }, + IsSingleOwnNamespaceEnabled: false, + IsDeploymentConfigEnabled: false, + } + + bundleFS := bundlefs.Builder().WithPackageName("test"). + WithCSV(clusterserviceversion.Builder().WithInstallModeSupportFor(v1alpha1.InstallModeTypeAllNamespaces).Build()).Build() + + _, err := provider.Get(bundleFS, &ocv1.ClusterExtension{ + Spec: ocv1.ClusterExtensionSpec{ + Namespace: "install-namespace", + Config: &ocv1.ClusterExtensionConfig{ + ConfigType: ocv1.ClusterExtensionConfigTypeInline, + Inline: &apiextensionsv1.JSON{ + Raw: []byte(`{"deploymentConfig": {"env": [{"name": "TEST_ENV", "value": "test-value"}]}}`), + }, + }, + }, + }) + require.Error(t, err) + require.Contains(t, err.Error(), "unknown field \"deploymentConfig\"") + require.ErrorIs(t, err, reconcile.TerminalError(nil), "config should not be silently ignored when both feature gates are disabled") + }) } func Test_RegistryV1HelmChartProvider_Integration(t *testing.T) { diff --git a/internal/operator-controller/features/features.go b/internal/operator-controller/features/features.go index e0ddd6401..53ee2626a 100644 --- a/internal/operator-controller/features/features.go +++ b/internal/operator-controller/features/features.go @@ -18,6 +18,7 @@ const ( WebhookProviderOpenshiftServiceCA featuregate.Feature = "WebhookProviderOpenshiftServiceCA" HelmChartSupport featuregate.Feature = "HelmChartSupport" BoxcutterRuntime featuregate.Feature = "BoxcutterRuntime" + DeploymentConfig featuregate.Feature = "DeploymentConfig" ) var operatorControllerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ @@ -80,6 +81,14 @@ var operatorControllerFeatureGates = map[featuregate.Feature]featuregate.Feature PreRelease: featuregate.Alpha, LockToDefault: false, }, + + // DeploymentConfig enables support for customizing operator deployments + // via spec.config.inline.deploymentConfig in ClusterExtension resources. + DeploymentConfig: { + Default: false, + PreRelease: featuregate.Alpha, + LockToDefault: false, + }, } var OperatorControllerFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate() diff --git a/manifests/experimental-e2e.yaml b/manifests/experimental-e2e.yaml index 316684dbd..8655035d4 100644 --- a/manifests/experimental-e2e.yaml +++ b/manifests/experimental-e2e.yaml @@ -189,7 +189,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clustercatalogs.olm.operatorframework.io spec: @@ -615,7 +615,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensionrevisions.olm.operatorframework.io spec: @@ -949,7 +949,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensions.olm.operatorframework.io spec: @@ -2454,6 +2454,7 @@ spec: - --feature-gates=PreflightPermissions=true - --feature-gates=HelmChartSupport=true - --feature-gates=BoxcutterRuntime=true + - --feature-gates=DeploymentConfig=true - --feature-gates=WebhookProviderOpenshiftServiceCA=false - --tls-cert=/var/certs/tls.crt - --tls-key=/var/certs/tls.key diff --git a/manifests/experimental.yaml b/manifests/experimental.yaml index 189d18965..dd641cb9b 100644 --- a/manifests/experimental.yaml +++ b/manifests/experimental.yaml @@ -150,7 +150,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clustercatalogs.olm.operatorframework.io spec: @@ -576,7 +576,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensionrevisions.olm.operatorframework.io spec: @@ -910,7 +910,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensions.olm.operatorframework.io spec: @@ -2360,6 +2360,7 @@ spec: - --feature-gates=PreflightPermissions=true - --feature-gates=HelmChartSupport=true - --feature-gates=BoxcutterRuntime=true + - --feature-gates=DeploymentConfig=true - --feature-gates=WebhookProviderOpenshiftServiceCA=false - --tls-cert=/var/certs/tls.crt - --tls-key=/var/certs/tls.key diff --git a/manifests/standard-e2e.yaml b/manifests/standard-e2e.yaml index 34679e1cb..0d6060a1b 100644 --- a/manifests/standard-e2e.yaml +++ b/manifests/standard-e2e.yaml @@ -189,7 +189,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clustercatalogs.olm.operatorframework.io spec: @@ -615,7 +615,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clusterextensions.olm.operatorframework.io spec: diff --git a/manifests/standard.yaml b/manifests/standard.yaml index 819f07c40..b337169e2 100644 --- a/manifests/standard.yaml +++ b/manifests/standard.yaml @@ -150,7 +150,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clustercatalogs.olm.operatorframework.io spec: @@ -576,7 +576,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clusterextensions.olm.operatorframework.io spec: diff --git a/openshift/catalogd/manifests-experimental.yaml b/openshift/catalogd/manifests-experimental.yaml index 3b56124e0..27dae4b68 100644 --- a/openshift/catalogd/manifests-experimental.yaml +++ b/openshift/catalogd/manifests-experimental.yaml @@ -95,7 +95,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clustercatalogs.olm.operatorframework.io spec: diff --git a/openshift/catalogd/manifests.yaml b/openshift/catalogd/manifests.yaml index 432228814..2a2d09e03 100644 --- a/openshift/catalogd/manifests.yaml +++ b/openshift/catalogd/manifests.yaml @@ -95,7 +95,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clustercatalogs.olm.operatorframework.io spec: diff --git a/openshift/operator-controller/manifests-experimental.yaml b/openshift/operator-controller/manifests-experimental.yaml index 5d7aed9f3..acd7ff164 100644 --- a/openshift/operator-controller/manifests-experimental.yaml +++ b/openshift/operator-controller/manifests-experimental.yaml @@ -91,7 +91,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: experimental name: clusterextensions.olm.operatorframework.io spec: diff --git a/openshift/operator-controller/manifests.yaml b/openshift/operator-controller/manifests.yaml index bd3689591..9ff57a089 100644 --- a/openshift/operator-controller/manifests.yaml +++ b/openshift/operator-controller/manifests.yaml @@ -91,7 +91,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.20.0 + controller-gen.kubebuilder.io/version: v0.20.1 olm.operatorframework.io/generator: standard name: clusterextensions.olm.operatorframework.io spec: diff --git a/openshift/tests-extension/go.mod b/openshift/tests-extension/go.mod index 038a6ee4e..1ea5a36a5 100644 --- a/openshift/tests-extension/go.mod +++ b/openshift/tests-extension/go.mod @@ -5,11 +5,11 @@ go 1.25.7 require ( github.com/blang/semver/v4 v4.0.0 github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 - github.com/onsi/ginkgo/v2 v2.28.1 + github.com/onsi/ginkgo/v2 v2.28.0 github.com/onsi/gomega v1.39.1 - github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818 - github.com/openshift/api v0.0.0-20260226164249-f733385bc39e - github.com/openshift/client-go v0.0.0-20260226152647-d8b2196ff0d9 + github.com/openshift-eng/openshift-tests-extension v0.0.0-20251105193959-75a0be5d9bd7 + github.com/openshift/api v0.0.0-20260128000234-c16ec2bcf089 + github.com/openshift/client-go v0.0.0-20260108185524-48f4ccfc4e13 github.com/openshift/origin v1.5.0-alpha.3.0.20251010041851-79ff1dbbe815 github.com/operator-framework/operator-controller v1.8.0 github.com/pborman/uuid v1.2.1 @@ -17,13 +17,13 @@ require ( github.com/tidwall/gjson v1.18.0 github.com/tidwall/pretty v1.2.1 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.35.1 - k8s.io/apiextensions-apiserver v0.35.1 - k8s.io/apimachinery v0.35.1 - k8s.io/apiserver v0.35.1 - k8s.io/client-go v1.5.2 - k8s.io/kubernetes v1.35.1 - k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 + k8s.io/api v0.35.0 + k8s.io/apiextensions-apiserver v0.35.0 + k8s.io/apimachinery v0.35.0 + k8s.io/apiserver v0.35.0 + k8s.io/client-go v0.35.0 + k8s.io/kubernetes v1.35.0 + k8s.io/utils v0.0.0-20260108192941-914a6e750570 sigs.k8s.io/controller-runtime v0.23.1 ) @@ -60,10 +60,10 @@ require ( github.com/google/cel-go v0.27.0 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/pprof v0.0.0-20260202012954-cb029daf43ef // indirect + github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kylelemons/godebug v1.1.0 // indirect @@ -80,7 +80,7 @@ require ( github.com/prometheus/common v0.67.5 // indirect github.com/prometheus/procfs v0.20.0 // indirect github.com/spf13/pflag v1.0.10 // indirect - github.com/tidwall/match v1.2.0 // indirect + github.com/tidwall/match v1.1.1 // indirect github.com/x448/float16 v0.8.4 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect @@ -94,8 +94,8 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.48.0 // indirect - golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect - golang.org/x/net v0.51.0 // indirect + golang.org/x/exp v0.0.0-20260209203927-2842357ff358 // indirect + golang.org/x/net v0.50.0 // indirect golang.org/x/oauth2 v0.35.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect @@ -103,21 +103,21 @@ require ( golang.org/x/text v0.34.0 // indirect golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260223185530-2f722ef697dc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260223185530-2f722ef697dc // indirect - google.golang.org/grpc v1.79.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect + google.golang.org/grpc v1.78.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/component-base v0.35.1 // indirect - k8s.io/component-helpers v0.35.1 // indirect - k8s.io/controller-manager v0.35.1 // indirect + k8s.io/component-base v0.35.0 // indirect + k8s.io/component-helpers v0.35.0 // indirect + k8s.io/controller-manager v0.33.2 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 // indirect - k8s.io/kubectl v0.35.1 // indirect - k8s.io/kubelet v0.35.1 // indirect - k8s.io/pod-security-admission v0.35.1 // indirect + k8s.io/kubectl v0.35.0 // indirect + k8s.io/kubelet v0.31.1 // indirect + k8s.io/pod-security-admission v0.33.4 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect diff --git a/openshift/tests-extension/go.sum b/openshift/tests-extension/go.sum index 601147d03..b50ae7cfe 100644 --- a/openshift/tests-extension/go.sum +++ b/openshift/tests-extension/go.sum @@ -83,15 +83,15 @@ github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7O github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20260202012954-cb029daf43ef h1:xpF9fUHpoIrrjX24DURVKiwHcFpw19ndIs+FwTSMbno= -github.com/google/pprof v0.0.0-20260202012954-cb029daf43ef/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 h1:X+2YciYSxvMQK0UZ7sg45ZVabVZBeBuvMkmuI2V3Fak= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7/go.mod h1:lW34nIZuQ8UDPdkon5fmfp2l3+ZkQ2me/+oecHYLOII= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -122,12 +122,12 @@ github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818 h1:jJLE/aCAqDf8U4wc3bE1IEKgIxbb0ICjCNVFA49x/8s= -github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M= -github.com/openshift/api v0.0.0-20260226164249-f733385bc39e h1:8oQA5MNsymHQjlI0Wq8yWJT7x2ob2tvr1unO1w3VID0= -github.com/openshift/api v0.0.0-20260226164249-f733385bc39e/go.mod h1:ZYAxo9t1AALeEotN07tNzIvqqqWSxcZIqMUKnY/xCeQ= -github.com/openshift/client-go v0.0.0-20260226152647-d8b2196ff0d9 h1:5gHG1T3PUm5Ly7vILl9+byccl9eAUiV2RZuWXVVNnB4= -github.com/openshift/client-go v0.0.0-20260226152647-d8b2196ff0d9/go.mod h1:TeUQXSUW0UPXSmEtMZLfTYIE3MajxnziS3lbdH0WSwk= +github.com/openshift-eng/openshift-tests-extension v0.0.0-20251105193959-75a0be5d9bd7 h1:Z1swlS6b3Adm6RPhjqefs3DWnNFLDxRX+WC8GMXhja4= +github.com/openshift-eng/openshift-tests-extension v0.0.0-20251105193959-75a0be5d9bd7/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M= +github.com/openshift/api v0.0.0-20260128000234-c16ec2bcf089 h1:qcKLN7H1dh2wt59Knpc1J5XzCCStSeaaFyEHHilFypg= +github.com/openshift/api v0.0.0-20260128000234-c16ec2bcf089/go.mod h1:d5uzF0YN2nQQFA0jIEWzzOZ+edmo6wzlGLvx5Fhz4uY= +github.com/openshift/client-go v0.0.0-20260108185524-48f4ccfc4e13 h1:6rd4zSo2UaWQcAPZfHK9yzKVqH0BnMv1hqMzqXZyTds= +github.com/openshift/client-go v0.0.0-20260108185524-48f4ccfc4e13/go.mod h1:YvOmPmV7wcJxpfhTDuFqqs2Xpb3M3ovsM6Qs/i2ptq4= github.com/openshift/kubernetes v0.0.0-20251108023427-891f5bb03061 h1:XVgudZfcjtF8UPIUarXXu6z7tZJLxrenIXOaB8e0tRk= github.com/openshift/kubernetes v0.0.0-20251108023427-891f5bb03061/go.mod h1:w3+IfrXNp5RosdDXg3LB55yijJqR/FwouvVntYHQf0o= github.com/openshift/kubernetes/staging/src/k8s.io/api v0.0.0-20251108023427-891f5bb03061 h1:uE4i/OdgU+YypcJ7vc8abZJQRyd6zwnUpY9nSdBAHEs= @@ -187,9 +187,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM= -github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -232,16 +231,16 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= -golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa h1:Zt3DZoOFFYkKhDT3v7Lm9FDMEV06GpzjG2jrqW+QTE0= -golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA= +golang.org/x/exp v0.0.0-20260209203927-2842357ff358 h1:kpfSV7uLwKJbFSEgNhWzGSL47NDSF/5pYYQw1V0ub6c= +golang.org/x/exp v0.0.0-20260209203927-2842357ff358/go.mod h1:R3t0oliuryB5eenPWl3rrQxwnNM3WTwnsRZZiXLAAW8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= -golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -274,12 +273,12 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/api v0.0.0-20260223185530-2f722ef697dc h1:ULD+ToGXUIU6Pkzr1ARxdyvwfHbelw+agoFDRbLg4TU= -google.golang.org/genproto/googleapis/api v0.0.0-20260223185530-2f722ef697dc/go.mod h1:M5krXqk4GhBKvB596udGL3UyjL4I1+cTbK0orROM9ng= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260223185530-2f722ef697dc h1:51Wupg8spF+5FC6D+iMKbOddFjMckETnNnEiZ+HX37s= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260223185530-2f722ef697dc/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY= -google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0= +google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 h1:mWPCjDEyshlQYzBpMNHaEof6UX1PmHcaUODUywQ0uac= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= +google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -298,8 +297,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 h1:HhDfevmPS+OalTjQRKbTHppRIz01AWi8s45TMXStgYY= k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU= -k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY= +k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 h1:hSfpvjjTQXQY2Fol2CS0QHMNs/WI1MOSGzCm1KhM5ec= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/controller-runtime v0.23.1 h1:TjJSM80Nf43Mg21+RCy3J70aj/W6KyvDtOlpKf+PupE= diff --git a/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go index 4c9083d79..2f0b9e9e0 100644 --- a/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go +++ b/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go @@ -28,9 +28,7 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal } handleForwardResponseServerMetadata(w, mux, md) - if !mux.disableChunkedEncoding { - w.Header().Set("Transfer-Encoding", "chunked") - } + w.Header().Set("Transfer-Encoding", "chunked") if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil { HTTPError(ctx, mux, marshaler, w, req, err) return diff --git a/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go b/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go index 4e684c7de..3eb161671 100644 --- a/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go +++ b/openshift/tests-extension/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go @@ -73,7 +73,6 @@ type ServeMux struct { disablePathLengthFallback bool unescapingMode UnescapingMode writeContentLength bool - disableChunkedEncoding bool } // ServeMuxOption is an option that can be given to a ServeMux on construction. @@ -126,16 +125,6 @@ func WithMiddlewares(middlewares ...Middleware) ServeMuxOption { } } -// WithDisableChunkedEncoding disables the Transfer-Encoding: chunked header -// for streaming responses. This is useful for streaming implementations that use -// Content-Length, which is mutually exclusive with Transfer-Encoding:chunked. -// Note that this option will not automatically add Content-Length headers, so it should be used with caution. -func WithDisableChunkedEncoding() ServeMuxOption { - return func(mux *ServeMux) { - mux.disableChunkedEncoding = true - } -} - // SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters. // Configuring this will mean the generated OpenAPI output is no longer correct, and it should be // done with careful consideration. diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go index 998fd7040..d81d07cb2 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runsuite.go @@ -2,11 +2,9 @@ package cmdrun import ( "context" - "encoding/json" "fmt" "os" "os/signal" - "path/filepath" "syscall" "time" @@ -24,13 +22,11 @@ func NewRunSuiteCommand(registry *extension.Registry) *cobra.Command { outputFlags *flags.OutputFlags concurrencyFlags *flags.ConcurrencyFlags junitPath string - htmlPath string }{ componentFlags: flags.NewComponentFlags(), outputFlags: flags.NewOutputFlags(), concurrencyFlags: flags.NewConcurrencyFlags(), junitPath: "", - htmlPath: "", } cmd := &cobra.Command{ @@ -92,14 +88,6 @@ func NewRunSuiteCommand(registry *extension.Registry) *cobra.Command { } compositeWriter.AddWriter(junitWriter) } - // HTML writer if needed - if opts.htmlPath != "" { - htmlWriter, err := extensiontests.NewHTMLResultWriter(opts.htmlPath, suite.Name) - if err != nil { - return errors.Wrap(err, "couldn't create html writer") - } - compositeWriter.AddWriter(htmlWriter) - } // JSON writer jsonWriter, err := extensiontests.NewJSONResultWriter(os.Stdout, @@ -114,40 +102,13 @@ func NewRunSuiteCommand(registry *extension.Registry) *cobra.Command { return errors.Wrap(err, "couldn't filter specs") } - concurrency := opts.concurrencyFlags.MaxConcurency - if suite.Parallelism > 0 { - concurrency = min(concurrency, suite.Parallelism) - } - results, runErr := specs.Run(ctx, compositeWriter, concurrency) - if opts.junitPath != "" { - // we want to commit the results to disk regardless of the success or failure of the specs - if err := writeResults(opts.junitPath, results); err != nil { - fmt.Fprintf(os.Stderr, "Failed to write test results to disk: %v\n", err) - } - } - return runErr + return specs.Run(ctx, compositeWriter, opts.concurrencyFlags.MaxConcurency) }, } opts.componentFlags.BindFlags(cmd.Flags()) opts.outputFlags.BindFlags(cmd.Flags()) opts.concurrencyFlags.BindFlags(cmd.Flags()) cmd.Flags().StringVarP(&opts.junitPath, "junit-path", "j", opts.junitPath, "write results to junit XML") - cmd.Flags().StringVar(&opts.htmlPath, "html-path", opts.htmlPath, "write results to summary HTML") return cmd } - -func writeResults(jUnitPath string, results []*extensiontests.ExtensionTestResult) error { - jUnitDir := filepath.Dir(jUnitPath) - if err := os.MkdirAll(jUnitDir, 0755); err != nil { - return fmt.Errorf("failed to create output directory: %v", err) - } - - encodedResults, err := json.MarshalIndent(results, "", " ") - if err != nil { - return fmt.Errorf("failed to marshal results: %v", err) - } - - outputPath := filepath.Join(jUnitDir, fmt.Sprintf("extension_test_result_e2e_%s.json", time.Now().UTC().Format("20060102-150405"))) - return os.WriteFile(outputPath, encodedResults, 0644) -} diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go index c62021e7e..c06894ed9 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdrun/runtest.go @@ -3,9 +3,9 @@ package cmdrun import ( "bufio" "context" - "errors" "fmt" "os" + "errors" "os/signal" "syscall" "time" @@ -100,8 +100,7 @@ func NewRunTestCommand(registry *extension.Registry) *cobra.Command { } defer w.Flush() - _, err = specs.Run(ctx, w, opts.concurrencyFlags.MaxConcurency) - return err + return specs.Run(ctx, w, opts.concurrencyFlags.MaxConcurency) }, } opts.componentFlags.BindFlags(cmd.Flags()) diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go index 9c03a0a84..2e36969fe 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result.go @@ -1,12 +1,8 @@ package extensiontests import ( - "bytes" - _ "embed" - "encoding/json" "fmt" "strings" - "text/template" "github.com/openshift-eng/openshift-tests-extension/pkg/junit" ) @@ -71,55 +67,3 @@ func (results ExtensionTestResults) ToJUnit(suiteName string) junit.TestSuite { return suite } - -//go:embed viewer.html -var viewerHtml []byte - -// RenderResultsHTML renders the HTML viewer template with the provided JSON data. -// The caller is responsible for marshaling their results to JSON. This allows -// callers with different result struct types to use the same HTML viewer. -func RenderResultsHTML(jsonData []byte, suiteName string) ([]byte, error) { - tmpl, err := template.New("viewer").Parse(string(viewerHtml)) - if err != nil { - return nil, fmt.Errorf("failed to parse template: %w", err) - } - var out bytes.Buffer - if err := tmpl.Execute(&out, struct { - Data string - SuiteName string - }{ - string(jsonData), - suiteName, - }); err != nil { - return nil, fmt.Errorf("failed to execute template: %w", err) - } - return out.Bytes(), nil -} - -func (results ExtensionTestResults) ToHTML(suiteName string) ([]byte, error) { - encoded, err := json.Marshal(results) - if err != nil { - return nil, fmt.Errorf("failed to marshal extension test results: %w", err) - } - // pare down the output if there's a lot, we want this to load in some reasonable amount of time - if len(encoded) > 2<<20 { - // n.b. this is wasteful, but we want to mutate our inputs in a safe manner, so the encode/decode/encode - // pass is useful as a deep copy - var copiedResults ExtensionTestResults - if err := json.Unmarshal(encoded, &copiedResults); err != nil { - return nil, fmt.Errorf("failed to unmarshal extension test results: %w", err) - } - copiedResults.Walk(func(result *ExtensionTestResult) { - if result.Result == ResultPassed { - result.Error = "" - result.Output = "" - result.Details = nil - } - }) - encoded, err = json.Marshal(copiedResults) - if err != nil { - return nil, fmt.Errorf("failed to marshal extension test results: %w", err) - } - } - return RenderResultsHTML(encoded, suiteName) -} diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go index f9ca434ca..aedc409c1 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/result_writer.go @@ -124,9 +124,8 @@ func NewJSONResultWriter(out io.Writer, format ResultFormat) (*JSONResultWriter, } return &JSONResultWriter{ - out: out, - format: format, - results: ExtensionTestResults{}, + out: out, + format: format, }, nil } @@ -163,51 +162,3 @@ func (w *JSONResultWriter) Flush() error { return nil } - -type HTMLResultWriter struct { - lock sync.Mutex - testSuite *junit.TestSuite - out *os.File - suiteName string - path string - results ExtensionTestResults -} - -func NewHTMLResultWriter(path, suiteName string) (ResultWriter, error) { - file, err := os.Create(path) - if err != nil { - return nil, err - } - - return &HTMLResultWriter{ - testSuite: &junit.TestSuite{ - Name: suiteName, - }, - out: file, - suiteName: suiteName, - path: path, - }, nil -} - -func (w *HTMLResultWriter) Write(res *ExtensionTestResult) { - w.lock.Lock() - defer w.lock.Unlock() - w.results = append(w.results, res) -} - -func (w *HTMLResultWriter) Flush() error { - w.lock.Lock() - defer w.lock.Unlock() - data, err := w.results.ToHTML(w.suiteName) - if err != nil { - return fmt.Errorf("failed to create result HTML: %w", err) - } - if _, err := w.out.Write(data); err != nil { - return err - } - if err := w.out.Close(); err != nil { - return err - } - - return nil -} \ No newline at end of file diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go index e87809c8a..1b3635423 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/spec.go @@ -107,32 +107,18 @@ func (specs ExtensionTestSpecs) MustSelectAll(selectFns []SelectFunction) (Exten return filtered, nil } -// ModuleTestsOnly ensures that ginkgo tests from vendored sources aren't selected. Unfortunately, making -// use of kubernetes test helpers results in the entire Ginkgo suite being initialized (ginkgo loves global state), -// so we need to be careful about which tests we select. -// -// A test is excluded if ALL of its code locations with full paths are external (vendored or from external test -// suites). If at least one code location with a full path is from the local module, the test is included, because -// local tests may legitimately call helper functions from vendored test frameworks. +// ModuleTestsOnly ensures that ginkgo tests from vendored sources aren't selected, +// except for the Origin extended util packages, that may contain Ginkgo nodes but +// should not cause a test exclusion. func ModuleTestsOnly() SelectFunction { return func(spec *ExtensionTestSpec) bool { - hasLocalCode := false - for _, cl := range spec.CodeLocations { - // Short-form code locations (e.g., "set up framework | framework.go:200") are ignored in this determination. - if !strings.Contains(cl, "/") { - continue - } - - // If this code location is not external (vendored or k8s test), it's local code - if !(strings.Contains(cl, "/vendor/") || strings.HasPrefix(cl, "k8s.io/kubernetes")) { - hasLocalCode = true - break + if strings.Contains(cl, "/vendor/") && !strings.Contains(cl, "github.com/openshift/origin/test/extended/util") { + return false } } - // Include the test only if it has at least one local code location - return hasLocalCode + return true } } @@ -196,7 +182,7 @@ func (specs ExtensionTestSpecs) Names() []string { // are written to the given ResultWriter after each spec has completed execution. BeforeEach, // BeforeAll, AfterEach, AfterAll hooks are executed when specified. "Each" hooks must be thread // safe. Returns an error if any test spec failed, indicating the quantity of failures. -func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConcurrent int) ([]*ExtensionTestResult, error) { +func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConcurrent int) error { queue := make(chan *ExtensionTestSpec) terminalFailures := atomic.Int64{} nonTerminalFailures := atomic.Int64{} @@ -224,7 +210,6 @@ func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConc // Start consumers var wg sync.WaitGroup - resultChan := make(chan *ExtensionTestResult, len(specs)) for i := 0; i < maxConcurrent; i++ { wg.Add(1) go func() { @@ -251,14 +236,12 @@ func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConc // it does, we may want to modify it (e.g. k8s-tests for annotations currently). res.Name = spec.Name w.Write(res) - resultChan <- res } }() } // Wait for all consumers to finish wg.Wait() - close(resultChan) // Execute afterAll for _, spec := range specs { @@ -267,11 +250,6 @@ func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConc } } - var results []*ExtensionTestResult - for res := range resultChan { - results = append(results, res) - } - terminalFailCount := terminalFailures.Load() nonTerminalFailCount := nonTerminalFailures.Load() @@ -283,12 +261,12 @@ func (specs ExtensionTestSpecs) Run(ctx context.Context, w ResultWriter, maxConc // Only exit with error if terminal lifecycle tests failed if terminalFailCount > 0 { if nonTerminalFailCount > 0 { - return results, fmt.Errorf("%d tests failed (%d informing)", terminalFailCount+nonTerminalFailCount, nonTerminalFailCount) + return fmt.Errorf("%d tests failed (%d informing)", terminalFailCount+nonTerminalFailCount, nonTerminalFailCount) } - return results, fmt.Errorf("%d tests failed", terminalFailCount) + return fmt.Errorf("%d tests failed", terminalFailCount) } - return results, nil + return nil } // AddBeforeAll adds a function to be run once before all tests start executing. diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go index cd23be81f..5bfaab2f1 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/types.go @@ -74,10 +74,8 @@ type Resources struct { } type Isolation struct { - Mode string `json:"mode,omitempty"` - Conflict []string `json:"conflict,omitempty"` - Taint []string `json:"taint,omitempty"` - Toleration []string `json:"toleration,omitempty"` + Mode string `json:"mode,omitempty"` + Conflict []string `json:"conflict,omitempty"` } type EnvironmentSelector struct { diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/viewer.html b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/viewer.html deleted file mode 100644 index 2ff236aa3..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests/viewer.html +++ /dev/null @@ -1,1520 +0,0 @@ - - - - - - Results for {{ .SuiteName }} - - - -
-
-

- - - - - Results for {{ .SuiteName }} -

-

No file loaded

-
- -
-

Load Test Results

-

Drag and drop a JSON test results file here, or click to browse

- -
- - - - -
- - - - - diff --git a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go index 1cf299a7c..0b84ca41c 100644 --- a/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go +++ b/openshift/tests-extension/vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go @@ -17,9 +17,5 @@ func GinkgoLogrFunc(writer ginkgo.GinkgoWriterInterface) logr.Logger { } else { writer.Printf("%s %s\n", prefix, args) } - }, funcr.Options{ - // LogTimestamp adds timestamps to log lines using the format "2006-01-02 15:04:05.000000" - // See: https://github.com/go-logr/logr/blob/bb8ea8159175ccb4eddf4ac8704f84e40ac6d9b0/funcr/funcr.go#L211 - LogTimestamp: true, - }) + }, funcr.Options{}) } diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_ingress.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_ingress.go index 26e0ebf21..f70fe8f44 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_ingress.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_ingress.go @@ -43,7 +43,6 @@ type IngressSpec struct { // default ingresscontroller domain will follow this pattern: "*.". // // Once set, changing domain is not currently supported. - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="domain is immutable once set" Domain string `json:"domain"` // appsDomain is an optional domain to use instead of the one specified diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_insights.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_insights.go index 710d4303d..b0959881f 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_insights.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_insights.go @@ -13,7 +13,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2448 // +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 // +openshift:enable:FeatureGate=InsightsConfig -// +openshift:capability=Insights // // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). // +openshift:compatibility-gen:level=1 diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_network.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_network.go index fb8ed2fff..c0d1602b3 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_network.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_network.go @@ -41,7 +41,7 @@ type Network struct { // As a general rule, this SHOULD NOT be read directly. Instead, you should // consume the NetworkStatus, as it indicates the currently deployed configuration. // Currently, most spec fields are immutable after installation. Please view the individual ones for further details on each. -// +kubebuilder:validation:XValidation:rule="!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode) || self.networkDiagnostics.mode!='Disabled' || !has(self.networkDiagnostics.sourcePlacement) && !has(self.networkDiagnostics.targetPlacement)",message="cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement when networkDiagnostics.mode is Disabled" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=NetworkDiagnosticsConfig,rule="!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode) || self.networkDiagnostics.mode!='Disabled' || !has(self.networkDiagnostics.sourcePlacement) && !has(self.networkDiagnostics.targetPlacement)",message="cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement when networkDiagnostics.mode is Disabled" type NetworkSpec struct { // IP address pool to use for pod IPs. // This field is immutable after installation. @@ -85,6 +85,7 @@ type NetworkSpec struct { // the network diagnostics feature will be disabled. // // +optional + // +openshift:enable:FeatureGate=NetworkDiagnosticsConfig NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"` } @@ -118,6 +119,7 @@ type NetworkStatus struct { // +optional // +listType=map // +listMapKey=type + // +openshift:enable:FeatureGate=NetworkDiagnosticsConfig Conditions []metav1.Condition `json:"conditions,omitempty"` } diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go index 48657b089..1e5189796 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go @@ -7,10 +7,9 @@ type TLSSecurityProfile struct { // type is one of Old, Intermediate, Modern or Custom. Custom provides the // ability to specify individual TLS security profile parameters. // - // The profiles are based on version 5.7 of the Mozilla Server Side TLS - // configuration guidelines. The cipher lists consist of the configuration's - // "ciphersuites" followed by the Go-specific "ciphers" from the guidelines. - // See: https://ssl-config.mozilla.org/guidelines/5.7.json + // The profiles are currently based on version 5.0 of the Mozilla Server Side TLS + // configuration guidelines (released 2019-06-28) with TLS 1.3 ciphers added for + // forward compatibility. See: https://ssl-config.mozilla.org/guidelines/5.0.json // // The profiles are intent based, so they may change over time as new ciphers are // developed and existing ciphers are found to be insecure. Depending on @@ -23,6 +22,9 @@ type TLSSecurityProfile struct { // old is a TLS profile for use when services need to be accessed by very old // clients or libraries and should be used only as a last resort. // + // The cipher list includes TLS 1.3 ciphers for forward compatibility, followed + // by the "old" profile ciphers. + // // This profile is equivalent to a Custom profile specified as: // minTLSVersion: VersionTLS10 // ciphers: @@ -35,15 +37,23 @@ type TLSSecurityProfile struct { // - ECDHE-RSA-AES256-GCM-SHA384 // - ECDHE-ECDSA-CHACHA20-POLY1305 // - ECDHE-RSA-CHACHA20-POLY1305 + // - DHE-RSA-AES128-GCM-SHA256 + // - DHE-RSA-AES256-GCM-SHA384 + // - DHE-RSA-CHACHA20-POLY1305 // - ECDHE-ECDSA-AES128-SHA256 // - ECDHE-RSA-AES128-SHA256 // - ECDHE-ECDSA-AES128-SHA // - ECDHE-RSA-AES128-SHA + // - ECDHE-ECDSA-AES256-SHA384 + // - ECDHE-RSA-AES256-SHA384 // - ECDHE-ECDSA-AES256-SHA // - ECDHE-RSA-AES256-SHA + // - DHE-RSA-AES128-SHA256 + // - DHE-RSA-AES256-SHA256 // - AES128-GCM-SHA256 // - AES256-GCM-SHA384 // - AES128-SHA256 + // - AES256-SHA256 // - AES128-SHA // - AES256-SHA // - DES-CBC3-SHA @@ -56,6 +66,9 @@ type TLSSecurityProfile struct { // legacy clients and want to remain highly secure while being compatible with // most clients currently in use. // + // The cipher list includes TLS 1.3 ciphers for forward compatibility, followed + // by the "intermediate" profile ciphers. + // // This profile is equivalent to a Custom profile specified as: // minTLSVersion: VersionTLS12 // ciphers: @@ -68,6 +81,8 @@ type TLSSecurityProfile struct { // - ECDHE-RSA-AES256-GCM-SHA384 // - ECDHE-ECDSA-CHACHA20-POLY1305 // - ECDHE-RSA-CHACHA20-POLY1305 + // - DHE-RSA-AES128-GCM-SHA256 + // - DHE-RSA-AES256-GCM-SHA384 // // +optional // +nullable @@ -145,14 +160,12 @@ const ( // TLSProfileSpec is the desired behavior of a TLSSecurityProfile. type TLSProfileSpec struct { // ciphers is used to specify the cipher algorithms that are negotiated - // during the TLS handshake. Operators may remove entries that their operands - // do not support. For example, to use only ECDHE-RSA-AES128-GCM-SHA256 (yaml): + // during the TLS handshake. Operators may remove entries their operands + // do not support. For example, to use DES-CBC3-SHA (yaml): // // ciphers: - // - ECDHE-RSA-AES128-GCM-SHA256 + // - DES-CBC3-SHA // - // TLS 1.3 cipher suites (e.g. TLS_AES_128_GCM_SHA256) are not configurable - // and are always enabled when TLS 1.3 is negotiated. // +listType=atomic Ciphers []string `json:"ciphers"` // minTLSVersion is used to specify the minimal version of the TLS protocol @@ -187,11 +200,9 @@ const ( // TLSProfiles contains a map of TLSProfileType names to TLSProfileSpec. // -// These profiles are based on version 5.7 of the Mozilla Server Side TLS -// configuration guidelines. See: https://ssl-config.mozilla.org/guidelines/5.7.json -// -// Each Ciphers slice is the configuration's "ciphersuites" followed by the -// Go-specific "ciphers" from the guidelines JSON. +// These profiles are based on version 5.0 of the Mozilla Server Side TLS +// configuration guidelines (2019-06-28) with TLS 1.3 cipher suites prepended for +// forward compatibility. See: https://ssl-config.mozilla.org/guidelines/5.0.json // // NOTE: The caller needs to make sure to check that these constants are valid // for their binary. Not all entries map to values for all binaries. In the case @@ -209,15 +220,23 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305", + "DHE-RSA-AES128-GCM-SHA256", + "DHE-RSA-AES256-GCM-SHA384", + "DHE-RSA-CHACHA20-POLY1305", "ECDHE-ECDSA-AES128-SHA256", "ECDHE-RSA-AES128-SHA256", "ECDHE-ECDSA-AES128-SHA", "ECDHE-RSA-AES128-SHA", + "ECDHE-ECDSA-AES256-SHA384", + "ECDHE-RSA-AES256-SHA384", "ECDHE-ECDSA-AES256-SHA", "ECDHE-RSA-AES256-SHA", + "DHE-RSA-AES128-SHA256", + "DHE-RSA-AES256-SHA256", "AES128-GCM-SHA256", "AES256-GCM-SHA384", "AES128-SHA256", + "AES256-SHA256", "AES128-SHA", "AES256-SHA", "DES-CBC3-SHA", @@ -235,6 +254,8 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305", + "DHE-RSA-AES128-GCM-SHA256", + "DHE-RSA-AES256-GCM-SHA384", }, MinTLSVersion: VersionTLS12, }, diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml index eb7c485e0..576fd510c 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml @@ -417,7 +417,7 @@ insightsdatagathers.config.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/2448 CRDName: insightsdatagathers.config.openshift.io - Capability: Insights + Capability: "" Category: "" FeatureGates: - InsightsConfig @@ -443,7 +443,8 @@ networks.config.openshift.io: CRDName: networks.config.openshift.io Capability: "" Category: "" - FeatureGates: [] + FeatureGates: + - NetworkDiagnosticsConfig FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index 69fb37c52..7f0018950 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -3004,7 +3004,7 @@ func (OldTLSProfile) SwaggerDoc() map[string]string { var map_TLSProfileSpec = map[string]string{ "": "TLSProfileSpec is the desired behavior of a TLSSecurityProfile.", - "ciphers": "ciphers is used to specify the cipher algorithms that are negotiated during the TLS handshake. Operators may remove entries that their operands do not support. For example, to use only ECDHE-RSA-AES128-GCM-SHA256 (yaml):\n\n ciphers:\n - ECDHE-RSA-AES128-GCM-SHA256\n\nTLS 1.3 cipher suites (e.g. TLS_AES_128_GCM_SHA256) are not configurable and are always enabled when TLS 1.3 is negotiated.", + "ciphers": "ciphers is used to specify the cipher algorithms that are negotiated during the TLS handshake. Operators may remove entries their operands do not support. For example, to use DES-CBC3-SHA (yaml):\n\n ciphers:\n - DES-CBC3-SHA", "minTLSVersion": "minTLSVersion is used to specify the minimal version of the TLS protocol that is negotiated during the TLS handshake. For example, to use TLS versions 1.1, 1.2 and 1.3 (yaml):\n\n minTLSVersion: VersionTLS11", } @@ -3014,9 +3014,9 @@ func (TLSProfileSpec) SwaggerDoc() map[string]string { var map_TLSSecurityProfile = map[string]string{ "": "TLSSecurityProfile defines the schema for a TLS security profile. This object is used by operators to apply TLS security settings to operands.", - "type": "type is one of Old, Intermediate, Modern or Custom. Custom provides the ability to specify individual TLS security profile parameters.\n\nThe profiles are based on version 5.7 of the Mozilla Server Side TLS configuration guidelines. The cipher lists consist of the configuration's \"ciphersuites\" followed by the Go-specific \"ciphers\" from the guidelines. See: https://ssl-config.mozilla.org/guidelines/5.7.json\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be reduced.", - "old": "old is a TLS profile for use when services need to be accessed by very old clients or libraries and should be used only as a last resort.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS10\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-ECDSA-AES128-SHA256\n - ECDHE-RSA-AES128-SHA256\n - ECDHE-ECDSA-AES128-SHA\n - ECDHE-RSA-AES128-SHA\n - ECDHE-ECDSA-AES256-SHA\n - ECDHE-RSA-AES256-SHA\n - AES128-GCM-SHA256\n - AES256-GCM-SHA384\n - AES128-SHA256\n - AES128-SHA\n - AES256-SHA\n - DES-CBC3-SHA", - "intermediate": "intermediate is a TLS profile for use when you do not need compatibility with legacy clients and want to remain highly secure while being compatible with most clients currently in use.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS12\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305", + "type": "type is one of Old, Intermediate, Modern or Custom. Custom provides the ability to specify individual TLS security profile parameters.\n\nThe profiles are currently based on version 5.0 of the Mozilla Server Side TLS configuration guidelines (released 2019-06-28) with TLS 1.3 ciphers added for forward compatibility. See: https://ssl-config.mozilla.org/guidelines/5.0.json\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be reduced.", + "old": "old is a TLS profile for use when services need to be accessed by very old clients or libraries and should be used only as a last resort.\n\nThe cipher list includes TLS 1.3 ciphers for forward compatibility, followed by the \"old\" profile ciphers.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS10\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - DHE-RSA-AES128-GCM-SHA256\n - DHE-RSA-AES256-GCM-SHA384\n - DHE-RSA-CHACHA20-POLY1305\n - ECDHE-ECDSA-AES128-SHA256\n - ECDHE-RSA-AES128-SHA256\n - ECDHE-ECDSA-AES128-SHA\n - ECDHE-RSA-AES128-SHA\n - ECDHE-ECDSA-AES256-SHA384\n - ECDHE-RSA-AES256-SHA384\n - ECDHE-ECDSA-AES256-SHA\n - ECDHE-RSA-AES256-SHA\n - DHE-RSA-AES128-SHA256\n - DHE-RSA-AES256-SHA256\n - AES128-GCM-SHA256\n - AES256-GCM-SHA384\n - AES128-SHA256\n - AES256-SHA256\n - AES128-SHA\n - AES256-SHA\n - DES-CBC3-SHA", + "intermediate": "intermediate is a TLS profile for use when you do not need compatibility with legacy clients and want to remain highly secure while being compatible with most clients currently in use.\n\nThe cipher list includes TLS 1.3 ciphers for forward compatibility, followed by the \"intermediate\" profile ciphers.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS12\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - DHE-RSA-AES128-GCM-SHA256\n - DHE-RSA-AES256-GCM-SHA384", "modern": "modern is a TLS security profile for use with clients that support TLS 1.3 and do not need backward compatibility for older clients.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS13\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256", "custom": "custom is a user-defined TLS security profile. Be extremely careful using a custom profile as invalid configurations can be catastrophic. An example custom profile looks like this:\n\n minTLSVersion: VersionTLS11\n ciphers:\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256", } diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/register.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/register.go index c90962495..4b30ea380 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/register.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/register.go @@ -40,8 +40,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ImagePolicyList{}, &ClusterImagePolicy{}, &ClusterImagePolicyList{}, - &CRIOCredentialProviderConfig{}, - &CRIOCredentialProviderConfigList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) return nil diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go index e72f537f9..0653eeb5a 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go @@ -94,19 +94,6 @@ type ClusterMonitoringSpec struct { // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. // +optional MetricsServerConfig MetricsServerConfig `json:"metricsServerConfig,omitempty,omitzero"` - // prometheusOperatorConfig is an optional field that can be used to configure the Prometheus Operator component. - // Specifically, it can configure how the Prometheus Operator instance is deployed, pod scheduling, and resource allocation. - // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - // +optional - PrometheusOperatorConfig PrometheusOperatorConfig `json:"prometheusOperatorConfig,omitempty,omitzero"` - // prometheusOperatorAdmissionWebhookConfig is an optional field that can be used to configure the - // admission webhook component of Prometheus Operator that runs in the openshift-monitoring namespace. - // The admission webhook validates PrometheusRule and AlertmanagerConfig objects to ensure they are - // semantically valid, mutates PrometheusRule annotations, and converts AlertmanagerConfig objects - // between API versions. - // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - // +optional - PrometheusOperatorAdmissionWebhookConfig PrometheusOperatorAdmissionWebhookConfig `json:"prometheusOperatorAdmissionWebhookConfig,omitempty,omitzero"` } // UserDefinedMonitoring config for user-defined projects. @@ -198,7 +185,6 @@ type AlertmanagerCustomConfig struct { // limit: null // Maximum length for this list is 10. // Minimum length for this list is 1. - // Each resource name must be unique within this list. // +optional // +listType=map // +listMapKey=name @@ -232,8 +218,8 @@ type AlertmanagerCustomConfig struct { // When omitted, this means the user has no opinion and the platform is left // to choose reasonable defaults. These defaults are subject to change over time. // Defaults are empty/unset. - // Maximum length for this list is 10. - // Minimum length for this list is 1. + // Maximum length for this list is 10 + // Minimum length for this list is 1 // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:MinItems=1 // +listType=atomic @@ -249,7 +235,7 @@ type AlertmanagerCustomConfig struct { // This field maps directly to the `topologySpreadConstraints` field in the Pod spec. // Default is empty list. // Maximum length for this list is 10. - // Minimum length for this list is 1. + // Minimum length for this list is 1 // Entries must have unique topologyKey and whenUnsatisfiable pairs. // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:MinItems=1 @@ -370,8 +356,8 @@ type MetricsServerConfig struct { // When omitted, this means the user has no opinion and the platform is left // to choose reasonable defaults. These defaults are subject to change over time. // Defaults are empty/unset. - // Maximum length for this list is 10. - // Minimum length for this list is 1. + // Maximum length for this list is 10 + // Minimum length for this list is 1 // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:MinItems=1 // +listType=atomic @@ -403,7 +389,6 @@ type MetricsServerConfig struct { // limit: null // Maximum length for this list is 10. // Minimum length for this list is 1. - // Each resource name must be unique within this list. // +optional // +listType=map // +listMapKey=name @@ -420,142 +405,7 @@ type MetricsServerConfig struct { // This field maps directly to the `topologySpreadConstraints` field in the Pod spec. // Default is empty list. // Maximum length for this list is 10. - // Minimum length for this list is 1. - // Entries must have unique topologyKey and whenUnsatisfiable pairs. - // +kubebuilder:validation:MaxItems=10 - // +kubebuilder:validation:MinItems=1 - // +listType=map - // +listMapKey=topologyKey - // +listMapKey=whenUnsatisfiable - // +optional - TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` -} - -// PrometheusOperatorConfig provides configuration options for the Prometheus Operator instance -// Use this configuration to control how the Prometheus Operator instance is deployed, how it logs, and how its pods are scheduled. -// +kubebuilder:validation:MinProperties=1 -type PrometheusOperatorConfig struct { - // logLevel defines the verbosity of logs emitted by Prometheus Operator. - // This field allows users to control the amount and severity of logs generated, which can be useful - // for debugging issues or reducing noise in production environments. - // Allowed values are Error, Warn, Info, and Debug. - // When set to Error, only errors will be logged. - // When set to Warn, both warnings and errors will be logged. - // When set to Info, general information, warnings, and errors will all be logged. - // When set to Debug, detailed debugging information will be logged. - // When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. - // The current default value is `Info`. - // +optional - LogLevel LogLevel `json:"logLevel,omitempty"` - // nodeSelector defines the nodes on which the Pods are scheduled - // nodeSelector is optional. - // - // When omitted, this means the user has no opinion and the platform is left - // to choose reasonable defaults. These defaults are subject to change over time. - // The current default value is `kubernetes.io/os: linux`. - // When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries. - // +optional - // +kubebuilder:validation:MinProperties=1 - // +kubebuilder:validation:MaxProperties=10 - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // resources defines the compute resource requests and limits for the Prometheus Operator container. - // This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. - // When not specified, defaults are used by the platform. Requests cannot exceed limits. - // This field is optional. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - // This is a simplified API that maps to Kubernetes ResourceRequirements. - // The current default values are: - // resources: - // - name: cpu - // request: 4m - // limit: null - // - name: memory - // request: 40Mi - // limit: null - // Maximum length for this list is 10. - // Minimum length for this list is 1. - // Each resource name must be unique within this list. - // +optional - // +listType=map - // +listMapKey=name - // +kubebuilder:validation:MaxItems=10 - // +kubebuilder:validation:MinItems=1 - Resources []ContainerResource `json:"resources,omitempty"` - // tolerations defines tolerations for the pods. - // tolerations is optional. - // - // When omitted, this means the user has no opinion and the platform is left - // to choose reasonable defaults. These defaults are subject to change over time. - // Defaults are empty/unset. - // Maximum length for this list is 10. - // Minimum length for this list is 1. - // +kubebuilder:validation:MaxItems=10 - // +kubebuilder:validation:MinItems=1 - // +listType=atomic - // +optional - Tolerations []v1.Toleration `json:"tolerations,omitempty"` - // topologySpreadConstraints defines rules for how Prometheus Operator Pods should be distributed - // across topology domains such as zones, nodes, or other user-defined labels. - // topologySpreadConstraints is optional. - // This helps improve high availability and resource efficiency by avoiding placing - // too many replicas in the same failure domain. - // - // When omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. - // This field maps directly to the `topologySpreadConstraints` field in the Pod spec. - // Default is empty list. - // Maximum length for this list is 10. - // Minimum length for this list is 1. - // Entries must have unique topologyKey and whenUnsatisfiable pairs. - // +kubebuilder:validation:MaxItems=10 - // +kubebuilder:validation:MinItems=1 - // +listType=map - // +listMapKey=topologyKey - // +listMapKey=whenUnsatisfiable - // +optional - TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` -} - -// PrometheusOperatorAdmissionWebhookConfig provides configuration options for the admission webhook -// component of Prometheus Operator that runs in the `openshift-monitoring` namespace. The admission -// webhook validates PrometheusRule and AlertmanagerConfig objects, mutates PrometheusRule annotations, -// and converts AlertmanagerConfig objects between API versions. -// +kubebuilder:validation:MinProperties=1 -type PrometheusOperatorAdmissionWebhookConfig struct { - // resources defines the compute resource requests and limits for the - // prometheus-operator-admission-webhook container. - // This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. - // When not specified, defaults are used by the platform. Requests cannot exceed limits. - // This field is optional. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - // This is a simplified API that maps to Kubernetes ResourceRequirements. - // The current default values are: - // resources: - // - name: cpu - // request: 5m - // limit: null - // - name: memory - // request: 30Mi - // limit: null - // Maximum length for this list is 10. - // Minimum length for this list is 1. - // Each resource name must be unique within this list. - // +optional - // +listType=map - // +listMapKey=name - // +kubebuilder:validation:MaxItems=10 - // +kubebuilder:validation:MinItems=1 - Resources []ContainerResource `json:"resources,omitempty"` - // topologySpreadConstraints defines rules for how admission webhook Pods should be distributed - // across topology domains such as zones, nodes, or other user-defined labels. - // topologySpreadConstraints is optional. - // This helps improve high availability and resource efficiency by avoiding placing - // too many replicas in the same failure domain. - // - // When omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. - // This field maps directly to the `topologySpreadConstraints` field in the Pod spec. - // Default is empty list. - // Maximum length for this list is 10. - // Minimum length for this list is 1. + // Minimum length for this list is 1 // Entries must have unique topologyKey and whenUnsatisfiable pairs. // +kubebuilder:validation:MaxItems=10 // +kubebuilder:validation:MinItems=1 diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_crio_credential_provider_config.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_crio_credential_provider_config.go deleted file mode 100644 index 9e2e0d39d..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_crio_credential_provider_config.go +++ /dev/null @@ -1,186 +0,0 @@ -package v1alpha1 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CRIOCredentialProviderConfig holds cluster-wide singleton resource configurations for CRI-O credential provider, the name of this instance is "cluster". CRI-O credential provider is a binary shipped with CRI-O that provides a way to obtain container image pull credentials from external sources. -// For example, it can be used to fetch mirror registry credentials from secrets resources in the cluster within the same namespace the pod will be running in. -// CRIOCredentialProviderConfig configuration specifies the pod image sources registries that should trigger the CRI-O credential provider execution, which will resolve the CRI-O mirror configurations and obtain the necessary credentials for pod creation. -// Note: Configuration changes will only take effect after the kubelet restarts, which is automatically managed by the cluster during rollout. -// -// The resource is a singleton named "cluster". -// -// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=criocredentialproviderconfigs,scope=Cluster -// +kubebuilder:subresource:status -// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2557 -// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 -// +openshift:enable:FeatureGate=CRIOCredentialProviderConfig -// +openshift:compatibility-gen:level=4 -// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'cluster'",message="criocredentialproviderconfig is a singleton, .metadata.name must be 'cluster'" -type CRIOCredentialProviderConfig struct { - metav1.TypeMeta `json:",inline"` - - // metadata is the standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitzero"` - - // spec defines the desired configuration of the CRI-O Credential Provider. - // This field is required and must be provided when creating the resource. - // +required - Spec *CRIOCredentialProviderConfigSpec `json:"spec,omitempty,omitzero"` - - // status represents the current state of the CRIOCredentialProviderConfig. - // When omitted or nil, it indicates that the status has not yet been set by the controller. - // The controller will populate this field with validation conditions and operational state. - // +optional - Status CRIOCredentialProviderConfigStatus `json:"status,omitzero,omitempty"` -} - -// CRIOCredentialProviderConfigSpec defines the desired configuration of the CRI-O Credential Provider. -// +kubebuilder:validation:MinProperties=0 -type CRIOCredentialProviderConfigSpec struct { - // matchImages is a list of string patterns used to determine whether - // the CRI-O credential provider should be invoked for a given image. This list is - // passed to the kubelet CredentialProviderConfig, and if any pattern matches - // the requested image, CRI-O credential provider will be invoked to obtain credentials for pulling - // that image or its mirrors. - // Depending on the platform, the CRI-O credential provider may be installed alongside an existing platform specific provider. - // Conflicts between the existing platform specific provider image match configuration and this list will be handled by - // the following precedence rule: credentials from built-in kubelet providers (e.g., ECR, GCR, ACR) take precedence over those - // from the CRIOCredentialProviderConfig when both match the same image. - // To avoid uncertainty, it is recommended to avoid configuring your private image patterns to overlap with - // existing platform specific provider config(e.g., the entries from https://github.com/openshift/machine-config-operator/blob/main/templates/common/aws/files/etc-kubernetes-credential-providers-ecr-credential-provider.yaml). - // You can check the resource's Status conditions - // to see if any entries were ignored due to exact matches with known built-in provider patterns. - // - // This field is optional, the items of the list must contain between 1 and 50 entries. - // The list is treated as a set, so duplicate entries are not allowed. - // - // For more details, see: - // https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/ - // https://github.com/cri-o/crio-credential-provider#architecture - // - // Each entry in matchImages is a pattern which can optionally contain a port and a path. Each entry must be no longer than 512 characters. - // Wildcards ('*') are supported for full subdomain labels, such as '*.k8s.io' or 'k8s.*.io', - // and for top-level domains, such as 'k8s.*' (which matches 'k8s.io' or 'k8s.net'). - // A global wildcard '*' (matching any domain) is not allowed. - // Wildcards may replace an entire hostname label (e.g., *.example.com), but they cannot appear within a label (e.g., f*oo.example.com) and are not allowed in the port or path. - // For example, 'example.*.com' is valid, but 'exa*mple.*.com' is not. - // Each wildcard matches only a single domain label, - // so '*.io' does **not** match '*.k8s.io'. - // - // A match exists between an image and a matchImage when all of the below are true: - // Both contain the same number of domain parts and each part matches. - // The URL path of an matchImages must be a prefix of the target image URL path. - // If the matchImages contains a port, then the port must match in the image as well. - // - // Example values of matchImages: - // - 123456789.dkr.ecr.us-east-1.amazonaws.com - // - *.azurecr.io - // - gcr.io - // - *.*.registry.io - // - registry.io:8080/path - // - // +kubebuilder:validation:MaxItems=50 - // +kubebuilder:validation:MinItems=1 - // +listType=set - // +optional - MatchImages []MatchImage `json:"matchImages,omitempty"` -} - -// MatchImage is a string pattern used to match container image registry addresses. -// It must be a valid fully qualified domain name with optional wildcard, port, and path. -// The maximum length is 512 characters. -// -// Wildcards ('*') are supported for full subdomain labels and top-level domains. -// Each entry can optionally contain a port (e.g., :8080) and a path (e.g., /path). -// Wildcards are not allowed in the port or path portions. -// -// Examples: -// - "registry.io" - matches exactly registry.io -// - "*.azurecr.io" - matches any single subdomain of azurecr.io -// - "registry.io:8080/path" - matches with specific port and path prefix -// -// +kubebuilder:validation:MaxLength=512 -// +kubebuilder:validation:MinLength=1 -// +kubebuilder:validation:XValidation:rule="self != '*'",message="global wildcard '*' is not allowed" -// +kubebuilder:validation:XValidation:rule=`self.matches('^((\\*|[a-z0-9]([a-z0-9-]*[a-z0-9])?)(\\.(\\*|[a-z0-9]([a-z0-9-]*[a-z0-9])?))*)(:[0-9]+)?(/[-a-z0-9._/]*)?$')`,message="invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path" -type MatchImage string - -// +k8s:deepcopy-gen=true -// CRIOCredentialProviderConfigStatus defines the observed state of CRIOCredentialProviderConfig -// +kubebuilder:validation:MinProperties=1 -type CRIOCredentialProviderConfigStatus struct { - // conditions represent the latest available observations of the configuration state. - // When omitted, it indicates that no conditions have been reported yet. - // The maximum number of conditions is 16. - // Conditions are stored as a map keyed by condition type, ensuring uniqueness. - // - // Expected condition types include: - // "Validated": indicates whether the matchImages configuration is valid - // +optional - // +kubebuilder:validation:MaxItems=16 - // +kubebuilder:validation:MinItems=1 - // +listType=map - // +listMapKey=type - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// CRIOCredentialProviderConfigList contains a list of CRIOCredentialProviderConfig resources -// -// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. -// +openshift:compatibility-gen:level=4 -type CRIOCredentialProviderConfigList struct { - metav1.TypeMeta `json:",inline"` - - // metadata is the standard list's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - metav1.ListMeta `json:"metadata"` - - Items []CRIOCredentialProviderConfig `json:"items"` -} - -const ( - // ConditionTypeValidated is a condition type that indicates whether the CRIOCredentialProviderConfig - // matchImages configuration has been validated successfully. - // When True, all matchImage patterns are valid and have been applied. - // When False, the configuration contains errors (see Reason for details). - // Possible reasons for False status: - // - ValidationFailed: matchImages contains invalid patterns - // - ConfigurationPartiallyApplied: some matchImage entries were ignored due to conflicts - ConditionTypeValidated = "Validated" - - // ReasonValidationFailed is a condition reason used with ConditionTypeValidated=False - // to indicate that the matchImages configuration contains one or more invalid registry patterns - // that do not conform to the required format (valid FQDN with optional wildcard, port, and path). - ReasonValidationFailed = "ValidationFailed" - - // ReasonConfigurationPartiallyApplied is a condition reason used with ConditionTypeValidated=False - // to indicate that some matchImage entries were ignored due to conflicts or overlapping patterns. - // The condition message will contain details about which entries were ignored and why. - ReasonConfigurationPartiallyApplied = "ConfigurationPartiallyApplied" - - // ConditionTypeMachineConfigRendered is a condition type that indicates whether - // the CRIOCredentialProviderConfig has been successfully rendered into a - // MachineConfig object. - // When True, the corresponding MachineConfig is present in the cluster. - // When False, rendering failed. - ConditionTypeMachineConfigRendered = "MachineConfigRendered" - - // ReasonMachineConfigRenderingSucceeded is a condition reason used with ConditionTypeMachineConfigRendered=True - // to indicate that the MachineConfig was successfully created/updated in the API server. - ReasonMachineConfigRenderingSucceeded = "MachineConfigRenderingSucceeded" - - // ReasonMachineConfigRenderingFailed is a condition reason used with ConditionTypeMachineConfigRendered=False - // to indicate that the MachineConfig creation/update failed. - // The condition message will contain details about the failure. - ReasonMachineConfigRenderingFailed = "MachineConfigRenderingFailed" -) diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_insights.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_insights.go index 43546d03b..46666ae3b 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_insights.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/types_insights.go @@ -16,7 +16,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 // +openshift:enable:FeatureGate=InsightsConfig // +openshift:compatibility-gen:level=4 -// +openshift:capability=Insights type InsightsDataGather struct { metav1.TypeMeta `json:",inline"` @@ -59,7 +58,6 @@ type GatherConfig struct { // "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'" // An example of disabling gatherers looks like this: `disabledGatherers: ["clusterconfig/machine_configs", "workloads/workload_info"]` // +kubebuilder:validation:MaxItems=100 - // +listType=atomic // +optional DisabledGatherers []DisabledGatherer `json:"disabledGatherers"` // storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive. diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go index d648413ab..9ead6aba2 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go @@ -192,115 +192,6 @@ func (in *BackupStatus) DeepCopy() *BackupStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CRIOCredentialProviderConfig) DeepCopyInto(out *CRIOCredentialProviderConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Spec != nil { - in, out := &in.Spec, &out.Spec - *out = new(CRIOCredentialProviderConfigSpec) - (*in).DeepCopyInto(*out) - } - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfig. -func (in *CRIOCredentialProviderConfig) DeepCopy() *CRIOCredentialProviderConfig { - if in == nil { - return nil - } - out := new(CRIOCredentialProviderConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CRIOCredentialProviderConfig) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CRIOCredentialProviderConfigList) DeepCopyInto(out *CRIOCredentialProviderConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CRIOCredentialProviderConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfigList. -func (in *CRIOCredentialProviderConfigList) DeepCopy() *CRIOCredentialProviderConfigList { - if in == nil { - return nil - } - out := new(CRIOCredentialProviderConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CRIOCredentialProviderConfigList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CRIOCredentialProviderConfigSpec) DeepCopyInto(out *CRIOCredentialProviderConfigSpec) { - *out = *in - if in.MatchImages != nil { - in, out := &in.MatchImages, &out.MatchImages - *out = make([]MatchImage, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfigSpec. -func (in *CRIOCredentialProviderConfigSpec) DeepCopy() *CRIOCredentialProviderConfigSpec { - if in == nil { - return nil - } - out := new(CRIOCredentialProviderConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CRIOCredentialProviderConfigStatus) DeepCopyInto(out *CRIOCredentialProviderConfigStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfigStatus. -func (in *CRIOCredentialProviderConfigStatus) DeepCopy() *CRIOCredentialProviderConfigStatus { - if in == nil { - return nil - } - out := new(CRIOCredentialProviderConfigStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterImagePolicy) DeepCopyInto(out *ClusterImagePolicy) { *out = *in @@ -474,8 +365,6 @@ func (in *ClusterMonitoringSpec) DeepCopyInto(out *ClusterMonitoringSpec) { out.UserDefined = in.UserDefined in.AlertmanagerConfig.DeepCopyInto(&out.AlertmanagerConfig) in.MetricsServerConfig.DeepCopyInto(&out.MetricsServerConfig) - in.PrometheusOperatorConfig.DeepCopyInto(&out.PrometheusOperatorConfig) - in.PrometheusOperatorAdmissionWebhookConfig.DeepCopyInto(&out.PrometheusOperatorAdmissionWebhookConfig) return } @@ -1063,80 +952,6 @@ func (in *PolicyRootOfTrust) DeepCopy() *PolicyRootOfTrust { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PrometheusOperatorAdmissionWebhookConfig) DeepCopyInto(out *PrometheusOperatorAdmissionWebhookConfig) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ContainerResource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.TopologySpreadConstraints != nil { - in, out := &in.TopologySpreadConstraints, &out.TopologySpreadConstraints - *out = make([]v1.TopologySpreadConstraint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusOperatorAdmissionWebhookConfig. -func (in *PrometheusOperatorAdmissionWebhookConfig) DeepCopy() *PrometheusOperatorAdmissionWebhookConfig { - if in == nil { - return nil - } - out := new(PrometheusOperatorAdmissionWebhookConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PrometheusOperatorConfig) DeepCopyInto(out *PrometheusOperatorConfig) { - *out = *in - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ContainerResource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.TopologySpreadConstraints != nil { - in, out := &in.TopologySpreadConstraints, &out.TopologySpreadConstraints - *out = make([]v1.TopologySpreadConstraint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusOperatorConfig. -func (in *PrometheusOperatorConfig) DeepCopy() *PrometheusOperatorConfig { - if in == nil { - return nil - } - out := new(PrometheusOperatorConfig) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RetentionNumberConfig) DeepCopyInto(out *RetentionNumberConfig) { *out = *in diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml index 14091b587..2f79f801d 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -21,29 +21,6 @@ backups.config.openshift.io: - AutomatedEtcdBackup Version: v1alpha1 -criocredentialproviderconfigs.config.openshift.io: - Annotations: {} - ApprovedPRNumber: https://github.com/openshift/api/pull/2557 - CRDName: criocredentialproviderconfigs.config.openshift.io - Capability: "" - Category: "" - FeatureGates: - - CRIOCredentialProviderConfig - FilenameOperatorName: config-operator - FilenameOperatorOrdering: "01" - FilenameRunLevel: "0000_10" - GroupName: config.openshift.io - HasStatus: true - KindName: CRIOCredentialProviderConfig - Labels: {} - PluralName: criocredentialproviderconfigs - PrinterColumns: [] - Scope: Cluster - ShortNames: null - TopLevelFeatureGates: - - CRIOCredentialProviderConfig - Version: v1alpha1 - clusterimagepolicies.config.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/1457 @@ -120,7 +97,7 @@ insightsdatagathers.config.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/1245 CRDName: insightsdatagathers.config.openshift.io - Capability: Insights + Capability: "" Category: "" FeatureGates: - InsightsConfig diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go index 343947f59..59a5b3708 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go @@ -132,10 +132,10 @@ var map_AlertmanagerCustomConfig = map[string]string{ "": "AlertmanagerCustomConfig represents the configuration for a custom Alertmanager deployment. alertmanagerCustomConfig provides configuration options for the default Alertmanager instance that runs in the `openshift-monitoring` namespace. Use this configuration to control whether the default Alertmanager is deployed, how it logs, and how its pods are scheduled.", "logLevel": "logLevel defines the verbosity of logs emitted by Alertmanager. This field allows users to control the amount and severity of logs generated, which can be useful for debugging issues or reducing noise in production environments. Allowed values are Error, Warn, Info, and Debug. When set to Error, only errors will be logged. When set to Warn, both warnings and errors will be logged. When set to Info, general information, warnings, and errors will all be logged. When set to Debug, detailed debugging information will be logged. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `Info`.", "nodeSelector": "nodeSelector defines the nodes on which the Pods are scheduled nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`.", - "resources": "resources defines the compute resource requests and limits for the Alertmanager container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 10. Minimum length for this list is 1. Each resource name must be unique within this list.", + "resources": "resources defines the compute resource requests and limits for the Alertmanager container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 10. Minimum length for this list is 1.", "secrets": "secrets defines a list of secrets that need to be mounted into the Alertmanager. The secrets must reside within the same namespace as the Alertmanager object. They will be added as volumes named secret- and mounted at /etc/alertmanager/secrets/ within the 'alertmanager' container of the Alertmanager Pods.\n\nThese secrets can be used to authenticate Alertmanager with endpoint receivers. For example, you can use secrets to: - Provide certificates for TLS authentication with receivers that require private CA certificates - Store credentials for Basic HTTP authentication with receivers that require password-based auth - Store any other authentication credentials needed by your alert receivers\n\nThis field is optional. Maximum length for this list is 10. Minimum length for this list is 1. Entries in this list must be unique.", - "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Defaults are empty/unset. Maximum length for this list is 10. Minimum length for this list is 1.", - "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Alertmanager Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1. Entries must have unique topologyKey and whenUnsatisfiable pairs.", + "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Defaults are empty/unset. Maximum length for this list is 10 Minimum length for this list is 1", + "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Alertmanager Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1 Entries must have unique topologyKey and whenUnsatisfiable pairs.", "volumeClaimTemplate": "volumeClaimTemplate Defines persistent storage for Alertmanager. Use this setting to configure the persistent volume claim, including storage class, volume size, and name. If omitted, the Pod uses ephemeral storage and alert data will not persist across restarts. This field is optional.", } @@ -174,12 +174,10 @@ func (ClusterMonitoringList) SwaggerDoc() map[string]string { } var map_ClusterMonitoringSpec = map[string]string{ - "": "ClusterMonitoringSpec defines the desired state of Cluster Monitoring Operator", - "userDefined": "userDefined set the deployment mode for user-defined monitoring in addition to the default platform monitoring. userDefined is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default value is `Disabled`.", - "alertmanagerConfig": "alertmanagerConfig allows users to configure how the default Alertmanager instance should be deployed in the `openshift-monitoring` namespace. alertmanagerConfig is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `DefaultConfig`.", - "metricsServerConfig": "metricsServerConfig is an optional field that can be used to configure the Kubernetes Metrics Server that runs in the openshift-monitoring namespace. Specifically, it can configure how the Metrics Server instance is deployed, pod scheduling, its audit policy and log verbosity. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", - "prometheusOperatorConfig": "prometheusOperatorConfig is an optional field that can be used to configure the Prometheus Operator component. Specifically, it can configure how the Prometheus Operator instance is deployed, pod scheduling, and resource allocation. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", - "prometheusOperatorAdmissionWebhookConfig": "prometheusOperatorAdmissionWebhookConfig is an optional field that can be used to configure the admission webhook component of Prometheus Operator that runs in the openshift-monitoring namespace. The admission webhook validates PrometheusRule and AlertmanagerConfig objects to ensure they are semantically valid, mutates PrometheusRule annotations, and converts AlertmanagerConfig objects between API versions. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", + "": "ClusterMonitoringSpec defines the desired state of Cluster Monitoring Operator", + "userDefined": "userDefined set the deployment mode for user-defined monitoring in addition to the default platform monitoring. userDefined is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default value is `Disabled`.", + "alertmanagerConfig": "alertmanagerConfig allows users to configure how the default Alertmanager instance should be deployed in the `openshift-monitoring` namespace. alertmanagerConfig is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `DefaultConfig`.", + "metricsServerConfig": "metricsServerConfig is an optional field that can be used to configure the Kubernetes Metrics Server that runs in the openshift-monitoring namespace. Specifically, it can configure how the Metrics Server instance is deployed, pod scheduling, its audit policy and log verbosity. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", } func (ClusterMonitoringSpec) SwaggerDoc() map[string]string { @@ -209,39 +207,16 @@ var map_MetricsServerConfig = map[string]string{ "": "MetricsServerConfig provides configuration options for the Metrics Server instance that runs in the `openshift-monitoring` namespace. Use this configuration to control how the Metrics Server instance is deployed, how it logs, and how its pods are scheduled.", "audit": "audit defines the audit configuration used by the Metrics Server instance. audit is optional. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default sets audit.profile to Metadata", "nodeSelector": "nodeSelector defines the nodes on which the Pods are scheduled nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`.", - "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Defaults are empty/unset. Maximum length for this list is 10. Minimum length for this list is 1.", + "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Defaults are empty/unset. Maximum length for this list is 10 Minimum length for this list is 1", "verbosity": "verbosity defines the verbosity of log messages for Metrics Server. Valid values are Errors, Info, Trace, TraceAll and omitted. When set to Errors, only critical messages and errors are logged. When set to Info, only basic information messages are logged. When set to Trace, information useful for general debugging is logged. When set to TraceAll, detailed information about metric scraping is logged. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `Errors`", - "resources": "resources defines the compute resource requests and limits for the Metrics Server container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 10. Minimum length for this list is 1. Each resource name must be unique within this list.", - "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Metrics Server Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1. Entries must have unique topologyKey and whenUnsatisfiable pairs.", + "resources": "resources defines the compute resource requests and limits for the Metrics Server container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 10. Minimum length for this list is 1.", + "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Metrics Server Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1 Entries must have unique topologyKey and whenUnsatisfiable pairs.", } func (MetricsServerConfig) SwaggerDoc() map[string]string { return map_MetricsServerConfig } -var map_PrometheusOperatorAdmissionWebhookConfig = map[string]string{ - "": "PrometheusOperatorAdmissionWebhookConfig provides configuration options for the admission webhook component of Prometheus Operator that runs in the `openshift-monitoring` namespace. The admission webhook validates PrometheusRule and AlertmanagerConfig objects, mutates PrometheusRule annotations, and converts AlertmanagerConfig objects between API versions.", - "resources": "resources defines the compute resource requests and limits for the prometheus-operator-admission-webhook container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 5m\n limit: null\n - name: memory\n request: 30Mi\n limit: null\nMaximum length for this list is 10. Minimum length for this list is 1. Each resource name must be unique within this list.", - "topologySpreadConstraints": "topologySpreadConstraints defines rules for how admission webhook Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1. Entries must have unique topologyKey and whenUnsatisfiable pairs.", -} - -func (PrometheusOperatorAdmissionWebhookConfig) SwaggerDoc() map[string]string { - return map_PrometheusOperatorAdmissionWebhookConfig -} - -var map_PrometheusOperatorConfig = map[string]string{ - "": "PrometheusOperatorConfig provides configuration options for the Prometheus Operator instance Use this configuration to control how the Prometheus Operator instance is deployed, how it logs, and how its pods are scheduled.", - "logLevel": "logLevel defines the verbosity of logs emitted by Prometheus Operator. This field allows users to control the amount and severity of logs generated, which can be useful for debugging issues or reducing noise in production environments. Allowed values are Error, Warn, Info, and Debug. When set to Error, only errors will be logged. When set to Warn, both warnings and errors will be logged. When set to Info, general information, warnings, and errors will all be logged. When set to Debug, detailed debugging information will be logged. When omitted, this means no opinion and the platform is left to choose a reasonable default, that is subject to change over time. The current default value is `Info`.", - "nodeSelector": "nodeSelector defines the nodes on which the Pods are scheduled nodeSelector is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default value is `kubernetes.io/os: linux`. When specified, nodeSelector must contain at least 1 entry and must not contain more than 10 entries.", - "resources": "resources defines the compute resource requests and limits for the Prometheus Operator container. This includes CPU, memory and HugePages constraints to help control scheduling and resource usage. When not specified, defaults are used by the platform. Requests cannot exceed limits. This field is optional. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ This is a simplified API that maps to Kubernetes ResourceRequirements. The current default values are:\n resources:\n - name: cpu\n request: 4m\n limit: null\n - name: memory\n request: 40Mi\n limit: null\nMaximum length for this list is 10. Minimum length for this list is 1. Each resource name must be unique within this list.", - "tolerations": "tolerations defines tolerations for the pods. tolerations is optional.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. Defaults are empty/unset. Maximum length for this list is 10. Minimum length for this list is 1.", - "topologySpreadConstraints": "topologySpreadConstraints defines rules for how Prometheus Operator Pods should be distributed across topology domains such as zones, nodes, or other user-defined labels. topologySpreadConstraints is optional. This helps improve high availability and resource efficiency by avoiding placing too many replicas in the same failure domain.\n\nWhen omitted, this means no opinion and the platform is left to choose a default, which is subject to change over time. This field maps directly to the `topologySpreadConstraints` field in the Pod spec. Default is empty list. Maximum length for this list is 10. Minimum length for this list is 1. Entries must have unique topologyKey and whenUnsatisfiable pairs.", -} - -func (PrometheusOperatorConfig) SwaggerDoc() map[string]string { - return map_PrometheusOperatorConfig -} - var map_UserDefinedMonitoring = map[string]string{ "": "UserDefinedMonitoring config for user-defined projects.", "mode": "mode defines the different configurations of UserDefinedMonitoring Valid values are Disabled and NamespaceIsolated Disabled disables monitoring for user-defined projects. This restricts the default monitoring stack, installed in the openshift-monitoring project, to monitor only platform namespaces, which prevents any custom monitoring configurations or resources from being applied to user-defined namespaces. NamespaceIsolated enables monitoring for user-defined projects with namespace-scoped tenancy. This ensures that metrics, alerts, and monitoring data are isolated at the namespace level. The current default value is `Disabled`.", @@ -251,44 +226,6 @@ func (UserDefinedMonitoring) SwaggerDoc() map[string]string { return map_UserDefinedMonitoring } -var map_CRIOCredentialProviderConfig = map[string]string{ - "": "CRIOCredentialProviderConfig holds cluster-wide singleton resource configurations for CRI-O credential provider, the name of this instance is \"cluster\". CRI-O credential provider is a binary shipped with CRI-O that provides a way to obtain container image pull credentials from external sources. For example, it can be used to fetch mirror registry credentials from secrets resources in the cluster within the same namespace the pod will be running in. CRIOCredentialProviderConfig configuration specifies the pod image sources registries that should trigger the CRI-O credential provider execution, which will resolve the CRI-O mirror configurations and obtain the necessary credentials for pod creation. Note: Configuration changes will only take effect after the kubelet restarts, which is automatically managed by the cluster during rollout.\n\nThe resource is a singleton named \"cluster\".\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", - "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "spec defines the desired configuration of the CRI-O Credential Provider. This field is required and must be provided when creating the resource.", - "status": "status represents the current state of the CRIOCredentialProviderConfig. When omitted or nil, it indicates that the status has not yet been set by the controller. The controller will populate this field with validation conditions and operational state.", -} - -func (CRIOCredentialProviderConfig) SwaggerDoc() map[string]string { - return map_CRIOCredentialProviderConfig -} - -var map_CRIOCredentialProviderConfigList = map[string]string{ - "": "CRIOCredentialProviderConfigList contains a list of CRIOCredentialProviderConfig resources\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", - "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", -} - -func (CRIOCredentialProviderConfigList) SwaggerDoc() map[string]string { - return map_CRIOCredentialProviderConfigList -} - -var map_CRIOCredentialProviderConfigSpec = map[string]string{ - "": "CRIOCredentialProviderConfigSpec defines the desired configuration of the CRI-O Credential Provider.", - "matchImages": "matchImages is a list of string patterns used to determine whether the CRI-O credential provider should be invoked for a given image. This list is passed to the kubelet CredentialProviderConfig, and if any pattern matches the requested image, CRI-O credential provider will be invoked to obtain credentials for pulling that image or its mirrors. Depending on the platform, the CRI-O credential provider may be installed alongside an existing platform specific provider. Conflicts between the existing platform specific provider image match configuration and this list will be handled by the following precedence rule: credentials from built-in kubelet providers (e.g., ECR, GCR, ACR) take precedence over those from the CRIOCredentialProviderConfig when both match the same image. To avoid uncertainty, it is recommended to avoid configuring your private image patterns to overlap with existing platform specific provider config(e.g., the entries from https://github.com/openshift/machine-config-operator/blob/main/templates/common/aws/files/etc-kubernetes-credential-providers-ecr-credential-provider.yaml). You can check the resource's Status conditions to see if any entries were ignored due to exact matches with known built-in provider patterns.\n\nThis field is optional, the items of the list must contain between 1 and 50 entries. The list is treated as a set, so duplicate entries are not allowed.\n\nFor more details, see: https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/ https://github.com/cri-o/crio-credential-provider#architecture\n\nEach entry in matchImages is a pattern which can optionally contain a port and a path. Each entry must be no longer than 512 characters. Wildcards ('*') are supported for full subdomain labels, such as '*.k8s.io' or 'k8s.*.io', and for top-level domains, such as 'k8s.*' (which matches 'k8s.io' or 'k8s.net'). A global wildcard '*' (matching any domain) is not allowed. Wildcards may replace an entire hostname label (e.g., *.example.com), but they cannot appear within a label (e.g., f*oo.example.com) and are not allowed in the port or path. For example, 'example.*.com' is valid, but 'exa*mple.*.com' is not. Each wildcard matches only a single domain label, so '*.io' does **not** match '*.k8s.io'.\n\nA match exists between an image and a matchImage when all of the below are true: Both contain the same number of domain parts and each part matches. The URL path of an matchImages must be a prefix of the target image URL path. If the matchImages contains a port, then the port must match in the image as well.\n\nExample values of matchImages: - 123456789.dkr.ecr.us-east-1.amazonaws.com - *.azurecr.io - gcr.io - *.*.registry.io - registry.io:8080/path", -} - -func (CRIOCredentialProviderConfigSpec) SwaggerDoc() map[string]string { - return map_CRIOCredentialProviderConfigSpec -} - -var map_CRIOCredentialProviderConfigStatus = map[string]string{ - "": "CRIOCredentialProviderConfigStatus defines the observed state of CRIOCredentialProviderConfig", - "conditions": "conditions represent the latest available observations of the configuration state. When omitted, it indicates that no conditions have been reported yet. The maximum number of conditions is 16. Conditions are stored as a map keyed by condition type, ensuring uniqueness.\n\nExpected condition types include: \"Validated\": indicates whether the matchImages configuration is valid", -} - -func (CRIOCredentialProviderConfigStatus) SwaggerDoc() map[string]string { - return map_CRIOCredentialProviderConfigStatus -} - var map_ImagePolicy = map[string]string{ "": "ImagePolicy holds namespace-wide configuration for image signature verification\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/types_insights.go b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/types_insights.go index fbe666249..d59f5920b 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/types_insights.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/types_insights.go @@ -16,7 +16,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 // +openshift:enable:FeatureGate=InsightsConfig // +openshift:compatibility-gen:level=4 -// +openshift:capability=Insights type InsightsDataGather struct { metav1.TypeMeta `json:",inline"` // metadata is the standard object's metadata. diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/zz_generated.featuregated-crd-manifests.yaml b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/zz_generated.featuregated-crd-manifests.yaml index 1f73e723e..99fe308ef 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/zz_generated.featuregated-crd-manifests.yaml +++ b/openshift/tests-extension/vendor/github.com/openshift/api/config/v1alpha2/zz_generated.featuregated-crd-manifests.yaml @@ -2,7 +2,7 @@ insightsdatagathers.config.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/2195 CRDName: insightsdatagathers.config.openshift.io - Capability: Insights + Capability: "" Category: "" FeatureGates: - InsightsConfig diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/features/features.go b/openshift/tests-extension/vendor/github.com/openshift/api/features/features.go index 2fc3881f1..187edb0e1 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/features/features.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/features/features.go @@ -1,85 +1,46 @@ package features import ( - configv1 "github.com/openshift/api/config/v1" - "k8s.io/apimachinery/pkg/util/sets" -) + "fmt" -// Generating this many versions future proofs us until at least 2040. -const ( - minOpenshiftVersion uint64 = 4 - maxOpenshiftVersion uint64 = 10 + configv1 "github.com/openshift/api/config/v1" ) -func FeatureSets(version uint64, clusterProfile ClusterProfileName, featureSet configv1.FeatureSet) *FeatureGateEnabledDisabled { - enabledDisabled := &FeatureGateEnabledDisabled{} - - for name, statuses := range allFeatureGates { - enabled := false - - for _, status := range statuses { - if status.isEnabled(version, clusterProfile, featureSet) { - enabled = true - break - } - } - - if enabled { - enabledDisabled.Enabled = append(enabledDisabled.Enabled, FeatureGateDescription{ - FeatureGateAttributes: configv1.FeatureGateAttributes{ - Name: name, - }, - }) - } else { - enabledDisabled.Disabled = append(enabledDisabled.Disabled, FeatureGateDescription{ - FeatureGateAttributes: configv1.FeatureGateAttributes{ - Name: name, - }, - }) - } +func FeatureSets(clusterProfile ClusterProfileName, featureSet configv1.FeatureSet) (*FeatureGateEnabledDisabled, error) { + byFeatureSet, ok := allFeatureGates[clusterProfile] + if !ok { + return nil, fmt.Errorf("no information found for ClusterProfile=%q", clusterProfile) } - - return enabledDisabled -} - -func AllFeatureSets() map[uint64]map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled { - versions := sets.New[uint64]() - for version := minOpenshiftVersion; version <= maxOpenshiftVersion; version++ { - versions.Insert(version) + featureGates, ok := byFeatureSet[featureSet] + if !ok { + return nil, fmt.Errorf("no information found for FeatureSet=%q under ClusterProfile=%q", featureSet, clusterProfile) } + return featureGates.DeepCopy(), nil +} - clusterProfiles := sets.New[ClusterProfileName](AllClusterProfiles...) - featureSets := sets.New[configv1.FeatureSet](configv1.AllFixedFeatureSets...) +func AllFeatureSets() map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled { + ret := map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} - // Check for versions explicitly being set among the gates. - for _, statuses := range allFeatureGates { - for _, status := range statuses { - versions.Insert(status.version.UnsortedList()...) - } - } + for clusterProfile, byFeatureSet := range allFeatureGates { + newByFeatureSet := map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} - ret := map[uint64]map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} - for version := range versions { - ret[version] = map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} - for clusterProfile := range clusterProfiles { - ret[version][clusterProfile] = map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} - for featureSet := range featureSets { - ret[version][clusterProfile][featureSet] = FeatureSets(version, clusterProfile, featureSet) - } + for featureSet, enabledDisabled := range byFeatureSet { + newByFeatureSet[featureSet] = enabledDisabled.DeepCopy() } + ret[clusterProfile] = newByFeatureSet } return ret } var ( - allFeatureGates = map[configv1.FeatureGateName][]featureGateStatus{} + allFeatureGates = map[ClusterProfileName]map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} FeatureGateConsolePluginCSP = newFeatureGate("ConsolePluginContentSecurityPolicy"). reportProblemsToJiraComponent("Management Console"). contactPerson("jhadvig"). productScope(ocpSpecific). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). enhancementPR("https://github.com/openshift/enhancements/pull/1706"). mustRegister() @@ -88,7 +49,7 @@ var ( contactPerson("ibihim"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/4193"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMutatingAdmissionPolicy = newFeatureGate("MutatingAdmissionPolicy"). @@ -96,7 +57,7 @@ var ( contactPerson("benluddy"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/3962"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateGatewayAPI = newFeatureGate("GatewayAPI"). @@ -104,7 +65,7 @@ var ( contactPerson("miciah"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateOpenShiftPodSecurityAdmission = newFeatureGate("OpenShiftPodSecurityAdmission"). @@ -112,7 +73,7 @@ var ( contactPerson("ibihim"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/899"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateBuildCSIVolumes = newFeatureGate("BuildCSIVolumes"). @@ -120,7 +81,7 @@ var ( contactPerson("adkaplan"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAzureWorkloadIdentity = newFeatureGate("AzureWorkloadIdentity"). @@ -128,7 +89,7 @@ var ( contactPerson("abutcher"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAzureDedicatedHosts = newFeatureGate("AzureDedicatedHosts"). @@ -136,7 +97,7 @@ var ( contactPerson("rvanderp3"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1783"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMaxUnavailableStatefulSet = newFeatureGate("MaxUnavailableStatefulSet"). @@ -144,7 +105,7 @@ var ( contactPerson("atiratree"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/961"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateEventedPLEG = newFeatureGate("EventedPLEG"). @@ -159,7 +120,7 @@ var ( contactPerson("sgrunert"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateSigstoreImageVerificationPKI = newFeatureGate("SigstoreImageVerificationPKI"). @@ -167,15 +128,7 @@ var ( contactPerson("QiWang"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1658"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). - mustRegister() - - FeatureGateCRIOCredentialProviderConfig = newFeatureGate("CRIOCredentialProviderConfig"). - reportProblemsToJiraComponent("node"). - contactPerson("QiWang"). - productScope(ocpSpecific). - enhancementPR("https://github.com/openshift/enhancements/pull/1861"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateVSphereHostVMGroupZonal = newFeatureGate("VSphereHostVMGroupZonal"). @@ -183,7 +136,7 @@ var ( contactPerson("jcpowermac"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1677"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateVSphereMultiDisk = newFeatureGate("VSphereMultiDisk"). @@ -191,7 +144,7 @@ var ( contactPerson("vr4manta"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1709"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateRouteExternalCertificate = newFeatureGate("RouteExternalCertificate"). @@ -199,15 +152,55 @@ var ( contactPerson("chiragkyal"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + + FeatureGateCPMSMachineNamePrefix = newFeatureGate("CPMSMachineNamePrefix"). + reportProblemsToJiraComponent("Cloud Compute / ControlPlaneMachineSet"). + contactPerson("chiragkyal"). + productScope(ocpSpecific). + enhancementPR("https://github.com/openshift/enhancements/pull/1714"). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() + FeatureGateAdminNetworkPolicy = newFeatureGate("AdminNetworkPolicy"). + reportProblemsToJiraComponent("Networking/ovn-kubernetes"). + contactPerson("tssurya"). + productScope(ocpSpecific). + enhancementPR(legacyFeatureGateWithoutEnhancement). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + + FeatureGateNetworkSegmentation = newFeatureGate("NetworkSegmentation"). + reportProblemsToJiraComponent("Networking/ovn-kubernetes"). + contactPerson("tssurya"). + productScope(ocpSpecific). + enhancementPR("https://github.com/openshift/enhancements/pull/1623"). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + FeatureGateNetworkConnect = newFeatureGate("NetworkConnect"). reportProblemsToJiraComponent("Networking/ovn-kubernetes"). contactPerson("tssurya"). productScope(ocpSpecific). enhancementPR("https://github.com/ovn-kubernetes/ovn-kubernetes/pull/5246"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). + mustRegister() + + FeatureGateAdditionalRoutingCapabilities = newFeatureGate("AdditionalRoutingCapabilities"). + reportProblemsToJiraComponent("Networking/cluster-network-operator"). + contactPerson("jcaamano"). + productScope(ocpSpecific). + enhancementPR(legacyFeatureGateWithoutEnhancement). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + + FeatureGateRouteAdvertisements = newFeatureGate("RouteAdvertisements"). + reportProblemsToJiraComponent("Networking/ovn-kubernetes"). + contactPerson("jcaamano"). + productScope(ocpSpecific). + enhancementPR(legacyFeatureGateWithoutEnhancement). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateEVPN = newFeatureGate("EVPN"). @@ -215,15 +208,31 @@ var ( contactPerson("jcaamano"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1862"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() + FeatureGateNetworkLiveMigration = newFeatureGate("NetworkLiveMigration"). + reportProblemsToJiraComponent("Networking/ovn-kubernetes"). + contactPerson("pliu"). + productScope(ocpSpecific). + enhancementPR(legacyFeatureGateWithoutEnhancement). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + + FeatureGateNetworkDiagnosticsConfig = newFeatureGate("NetworkDiagnosticsConfig"). + reportProblemsToJiraComponent("Networking/cluster-network-operator"). + contactPerson("kyrtapz"). + productScope(ocpSpecific). + enhancementPR(legacyFeatureGateWithoutEnhancement). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + FeatureGateOVNObservability = newFeatureGate("OVNObservability"). reportProblemsToJiraComponent("Networking"). contactPerson("npinaeva"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateBackendQuotaGiB = newFeatureGate("EtcdBackendQuota"). @@ -231,7 +240,7 @@ var ( contactPerson("hasbro17"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAutomatedEtcdBackup = newFeatureGate("AutomatedEtcdBackup"). @@ -239,7 +248,7 @@ var ( contactPerson("hasbro17"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMachineAPIOperatorDisableMachineHealthCheckController = newFeatureGate("MachineAPIOperatorDisableMachineHealthCheckController"). @@ -254,7 +263,7 @@ var ( contactPerson("miciah"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMachineConfigNodes = newFeatureGate("MachineConfigNodes"). @@ -262,7 +271,7 @@ var ( contactPerson("ijanssen"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1765"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateImageModeStatusReporting = newFeatureGate("ImageModeStatusReporting"). @@ -270,7 +279,7 @@ var ( contactPerson("ijanssen"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1809"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateClusterAPIInstall = newFeatureGate("ClusterAPIInstall"). @@ -285,7 +294,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAWSClusterHostedDNS = newFeatureGate("AWSClusterHostedDNS"). @@ -293,7 +302,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAzureClusterHostedDNSInstall = newFeatureGate("AzureClusterHostedDNSInstall"). @@ -301,7 +310,7 @@ var ( contactPerson("sadasu"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1468"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMixedCPUsAllocation = newFeatureGate("MixedCPUsAllocation"). @@ -309,7 +318,7 @@ var ( contactPerson("titzhak"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateManagedBootImages = newFeatureGate("ManagedBootImages"). @@ -317,7 +326,7 @@ var ( contactPerson("djoshy"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateManagedBootImagesAWS = newFeatureGate("ManagedBootImagesAWS"). @@ -325,7 +334,7 @@ var ( contactPerson("djoshy"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateManagedBootImagesvSphere = newFeatureGate("ManagedBootImagesvSphere"). @@ -333,7 +342,7 @@ var ( contactPerson("rsaini"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1496"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateManagedBootImagesAzure = newFeatureGate("ManagedBootImagesAzure"). @@ -341,7 +350,7 @@ var ( contactPerson("djoshy"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1761"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateManagedBootImagesCPMS = newFeatureGate("ManagedBootImagesCPMS"). @@ -349,7 +358,7 @@ var ( contactPerson("djoshy"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1818"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateBootImageSkewEnforcement = newFeatureGate("BootImageSkewEnforcement"). @@ -357,7 +366,7 @@ var ( contactPerson("djoshy"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1761"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateBootcNodeManagement = newFeatureGate("BootcNodeManagement"). @@ -365,7 +374,7 @@ var ( contactPerson("inesqyx"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateSignatureStores = newFeatureGate("SignatureStores"). @@ -373,7 +382,7 @@ var ( contactPerson("lmohanty"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateKMSv1 = newFeatureGate("KMSv1"). @@ -381,7 +390,7 @@ var ( contactPerson("dgrisonnet"). productScope(kubernetes). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGatePinnedImages = newFeatureGate("PinnedImages"). @@ -389,7 +398,7 @@ var ( contactPerson("RishabhSaini"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateUpgradeStatus = newFeatureGate("UpgradeStatus"). @@ -397,15 +406,23 @@ var ( contactPerson("pmuller"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() + FeatureGateVolumeAttributesClass = newFeatureGate("VolumeAttributesClass"). + reportProblemsToJiraComponent("Storage / Kubernetes External Components"). + contactPerson("dfajmon"). + productScope(kubernetes). + enhancementPR("https://github.com/kubernetes/enhancements/issues/3751"). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). + mustRegister() + FeatureGateVolumeGroupSnapshot = newFeatureGate("VolumeGroupSnapshot"). reportProblemsToJiraComponent("Storage / Kubernetes External Components"). contactPerson("fbertina"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/3476"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateExternalSnapshotMetadata = newFeatureGate("ExternalSnapshotMetadata"). @@ -413,7 +430,7 @@ var ( contactPerson("jdobson"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/3314"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateExternalOIDC = newFeatureGate("ExternalOIDC"). @@ -421,7 +438,7 @@ var ( contactPerson("liouk"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1596"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateExternalOIDCWithAdditionalClaimMappings = newFeatureGate("ExternalOIDCWithUIDAndExtraClaimMappings"). @@ -429,7 +446,7 @@ var ( contactPerson("bpalmer"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1777"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateExternalOIDCWithUpstreamParity = newFeatureGate("ExternalOIDCWithUpstreamParity"). @@ -437,7 +454,7 @@ var ( contactPerson("saldawam"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1763"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateExample = newFeatureGate("Example"). @@ -445,7 +462,7 @@ var ( contactPerson("deads"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateExample2 = newFeatureGate("Example2"). @@ -453,7 +470,7 @@ var ( contactPerson("JoelSpeed"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateNewOLM = newFeatureGate("NewOLM"). @@ -461,7 +478,7 @@ var ( contactPerson("joe"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inClusterProfile(SelfManaged), inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateNewOLMCatalogdAPIV1Metas = newFeatureGate("NewOLMCatalogdAPIV1Metas"). @@ -469,7 +486,7 @@ var ( contactPerson("jordank"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1749"). - enable(inClusterProfile(SelfManaged), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateNewOLMPreflightPermissionChecks = newFeatureGate("NewOLMPreflightPermissionChecks"). @@ -477,7 +494,7 @@ var ( contactPerson("tshort"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1768"). - enable(inClusterProfile(SelfManaged), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateNewOLMOwnSingleNamespace = newFeatureGate("NewOLMOwnSingleNamespace"). @@ -485,7 +502,7 @@ var ( contactPerson("nschieder"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1849"). - enable(inClusterProfile(SelfManaged), inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateNewOLMWebhookProviderOpenshiftServiceCA = newFeatureGate("NewOLMWebhookProviderOpenshiftServiceCA"). @@ -493,7 +510,7 @@ var ( contactPerson("pegoncal"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1844"). - enable(inClusterProfile(SelfManaged), inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateNewOLMBoxCutterRuntime = newFeatureGate("NewOLMBoxCutterRuntime"). @@ -501,7 +518,7 @@ var ( contactPerson("pegoncal"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1890"). - enable(inClusterProfile(SelfManaged), inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateInsightsOnDemandDataGather = newFeatureGate("InsightsOnDemandDataGather"). @@ -509,7 +526,7 @@ var ( contactPerson("tremes"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateInsightsConfig = newFeatureGate("InsightsConfig"). @@ -517,7 +534,7 @@ var ( contactPerson("tremes"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMetricsCollectionProfiles = newFeatureGate("MetricsCollectionProfiles"). @@ -525,7 +542,7 @@ var ( contactPerson("rexagod"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateClusterAPIInstallIBMCloud = newFeatureGate("ClusterAPIInstallIBMCloud"). @@ -533,7 +550,7 @@ var ( contactPerson("cjschaef"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMachineAPIMigration = newFeatureGate("MachineAPIMigration"). @@ -541,7 +558,7 @@ var ( contactPerson("jspeed"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateClusterAPIMachineManagement = newFeatureGate("ClusterAPIMachineManagement"). @@ -549,7 +566,7 @@ var ( contactPerson("ddonati"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1465"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateClusterAPIMachineManagementVSphere = newFeatureGate("ClusterAPIMachineManagementVSphere"). @@ -557,7 +574,7 @@ var ( contactPerson("jcpowermac"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1465"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateClusterMonitoringConfig = newFeatureGate("ClusterMonitoringConfig"). @@ -565,7 +582,7 @@ var ( contactPerson("marioferh"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMultiArchInstallAzure = newFeatureGate("MultiArchInstallAzure"). @@ -580,7 +597,7 @@ var ( contactPerson("psundara"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateUserNamespacesSupport = newFeatureGate("UserNamespacesSupport"). @@ -588,7 +605,7 @@ var ( contactPerson("haircommander"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/127"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() // Note: this feature is perma-alpha, but it is safe and desireable to enable. @@ -599,30 +616,38 @@ var ( contactPerson("haircommander"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/127"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() + FeatureGateProcMountType = newFeatureGate("ProcMountType"). + reportProblemsToJiraComponent("Node"). + contactPerson("haircommander"). + productScope(kubernetes). + enhancementPR("https://github.com/kubernetes/enhancements/issues/4265"). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). + mustRegister() + FeatureGateVSphereMultiNetworks = newFeatureGate("VSphereMultiNetworks"). reportProblemsToJiraComponent("SPLAT"). contactPerson("rvanderp"). productScope(ocpSpecific). enhancementPR(legacyFeatureGateWithoutEnhancement). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateIngressControllerDynamicConfigurationManager = newFeatureGate("IngressControllerDynamicConfigurationManager"). reportProblemsToJiraComponent("Networking/router"). contactPerson("miciah"). productScope(ocpSpecific). - enhancementPR("https://github.com/openshift/enhancements/pull/1687"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enhancementPR(legacyFeatureGateWithoutEnhancement). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateMinimumKubeletVersion = newFeatureGate("MinimumKubeletVersion"). reportProblemsToJiraComponent("Node"). contactPerson("haircommander"). productScope(ocpSpecific). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). enhancementPR("https://github.com/openshift/enhancements/pull/1697"). mustRegister() @@ -631,7 +656,7 @@ var ( contactPerson("yanhli"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1711"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateKMSEncryptionProvider = newFeatureGate("KMSEncryptionProvider"). @@ -639,7 +664,7 @@ var ( contactPerson("swghosh"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1682"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateKMSEncryption = newFeatureGate("KMSEncryption"). @@ -647,7 +672,7 @@ var ( contactPerson("ardaguclu"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1900"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateHighlyAvailableArbiter = newFeatureGate("HighlyAvailableArbiter"). @@ -655,7 +680,7 @@ var ( contactPerson("eggfoobar"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1674"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateCVOConfiguration = newFeatureGate("ClusterVersionOperatorConfiguration"). @@ -663,7 +688,7 @@ var ( contactPerson("dhurta"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1492"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateClusterUpdateAcceptRisks = newFeatureGate("ClusterUpdateAcceptRisks"). @@ -671,7 +696,7 @@ var ( contactPerson("hongkliu"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1807"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateGCPCustomAPIEndpoints = newFeatureGate("GCPCustomAPIEndpoints"). @@ -679,7 +704,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1492"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateDyanmicServiceEndpointIBMCloud = newFeatureGate("DyanmicServiceEndpointIBMCloud"). @@ -687,7 +712,7 @@ var ( contactPerson("jared-hayes-dev"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1712"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateSELinuxMount = newFeatureGate("SELinuxMount"). @@ -695,7 +720,7 @@ var ( contactPerson("jsafrane"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/1710"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateDualReplica = newFeatureGate("DualReplica"). @@ -703,7 +728,7 @@ var ( contactPerson("jaypoulz"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1675"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateGatewayAPIController = newFeatureGate("GatewayAPIController"). @@ -716,7 +741,7 @@ var ( // A dedicated feature gate now controls the Gateway Controller to distinguish // its production readiness from that of the CRDs. enhancementPR("https://github.com/openshift/enhancements/pull/1756"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureShortCertRotation = newFeatureGate("ShortCertRotation"). @@ -731,7 +756,7 @@ var ( contactPerson("rbednar"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1748"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAzureMultiDisk = newFeatureGate("AzureMultiDisk"). @@ -739,7 +764,7 @@ var ( contactPerson("jcpowermac"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1779"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateStoragePerformantSecurityPolicy = newFeatureGate("StoragePerformantSecurityPolicy"). @@ -747,7 +772,7 @@ var ( contactPerson("hekumar"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1804"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateMultiDiskSetup = newFeatureGate("MultiDiskSetup"). @@ -755,7 +780,7 @@ var ( contactPerson("jcpowermac"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1805"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAWSDedicatedHosts = newFeatureGate("AWSDedicatedHosts"). @@ -763,7 +788,7 @@ var ( contactPerson("rvanderp3"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1781"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateVSphereMixedNodeEnv = newFeatureGate("VSphereMixedNodeEnv"). @@ -771,15 +796,23 @@ var ( contactPerson("vr4manta"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1772"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() + FeatureGatePreconfiguredUDNAddresses = newFeatureGate("PreconfiguredUDNAddresses"). + reportProblemsToJiraComponent("Networking/ovn-kubernetes"). + contactPerson("kyrtapz"). + productScope(ocpSpecific). + enhancementPR("https://github.com/openshift/enhancements/pull/1793"). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). + mustRegister() + FeatureGateAWSServiceLBNetworkSecurityGroup = newFeatureGate("AWSServiceLBNetworkSecurityGroup"). reportProblemsToJiraComponent("Cloud Compute / Cloud Controller Manager"). contactPerson("mtulio"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1802"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateImageVolume = newFeatureGate("ImageVolume"). @@ -787,7 +820,7 @@ var ( contactPerson("haircommander"). productScope(kubernetes). enhancementPR("https://github.com/openshift/enhancements/pull/1792"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() FeatureGateNoRegistryClusterInstall = newFeatureGate("NoRegistryClusterInstall"). @@ -795,7 +828,7 @@ var ( contactPerson("andfasano"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1821"). - enable(inClusterProfile(SelfManaged), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(SelfManaged, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateGCPClusterHostedDNSInstall = newFeatureGate("GCPClusterHostedDNSInstall"). @@ -803,7 +836,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1468"). - enable(inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.Default, configv1.OKD, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAWSClusterHostedDNSInstall = newFeatureGate("AWSClusterHostedDNSInstall"). @@ -811,7 +844,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1468"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateGCPCustomAPIEndpointsInstall = newFeatureGate("GCPCustomAPIEndpointsInstall"). @@ -819,7 +852,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1492"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateIrreconcilableMachineConfig = newFeatureGate("IrreconcilableMachineConfig"). @@ -827,14 +860,14 @@ var ( contactPerson("pabrodri"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1785"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAWSDualStackInstall = newFeatureGate("AWSDualStackInstall"). reportProblemsToJiraComponent("Installer"). contactPerson("sadasu"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1806"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateAzureDualStackInstall = newFeatureGate("AzureDualStackInstall"). @@ -842,7 +875,7 @@ var ( contactPerson("jhixson74"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1806"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateGCPDualStackInstall = newFeatureGate("GCPDualStackInstall"). @@ -850,7 +883,7 @@ var ( contactPerson("barbacbd"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1806"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureCBORServingAndStorage = newFeatureGate("CBORServingAndStorage"). @@ -858,7 +891,7 @@ var ( contactPerson("benluddy"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/4222"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureCBORClientsAllowCBOR = newFeatureGate("ClientsAllowCBOR"). @@ -873,7 +906,7 @@ var ( contactPerson("benluddy"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/4222"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureEventTTL = newFeatureGate("EventTTL"). @@ -881,7 +914,7 @@ var ( contactPerson("tjungblu"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1857"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateMutableCSINodeAllocatableCount = newFeatureGate("MutableCSINodeAllocatableCount"). @@ -889,14 +922,14 @@ var ( contactPerson("jsafrane"). productScope(kubernetes). enhancementPR("https://github.com/kubernetes/enhancements/issues/4876"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade(), inDefault(), inOKD()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateOSStreams = newFeatureGate("OSStreams"). reportProblemsToJiraComponent("MachineConfigOperator"). contactPerson("pabrodri"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1874"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateCRDCompatibilityRequirementOperator = newFeatureGate("CRDCompatibilityRequirementOperator"). @@ -904,14 +937,14 @@ var ( contactPerson("ddonati"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1845"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateOnPremDNSRecords = newFeatureGate("OnPremDNSRecords"). reportProblemsToJiraComponent("Networking / On-Prem DNS"). contactPerson("bnemec"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1803"). - enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateProvisioningRequestAvailable = newFeatureGate("ProvisioningRequestAvailable"). @@ -919,7 +952,7 @@ var ( contactPerson("elmiko"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1752"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateHyperShiftOnlyDynamicResourceAllocation = newFeatureGate("HyperShiftOnlyDynamicResourceAllocation"). @@ -927,23 +960,15 @@ var ( contactPerson("csrwng"). productScope(ocpSpecific). enhancementPR("https://github.com/kubernetes/enhancements/issues/4381"). - enable(inClusterProfile(Hypershift), inDefault(), inOKD(), inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()). + enableForClusterProfile(Hypershift, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade, configv1.Default, configv1.OKD). mustRegister() - FeatureGateDRAPartitionableDevices = newFeatureGate("DRAPartitionableDevices"). - reportProblemsToJiraComponent("Node"). - contactPerson("harche"). - productScope(kubernetes). - enhancementPR("https://github.com/kubernetes/enhancements/issues/4815"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). - mustRegister() - FeatureGateConfigurablePKI = newFeatureGate("ConfigurablePKI"). reportProblemsToJiraComponent("kube-apiserver"). contactPerson("sanchezl"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1882"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade). mustRegister() FeatureGateClusterAPIControlPlaneInstall = newFeatureGate("ClusterAPIControlPlaneInstall"). @@ -951,7 +976,7 @@ var ( contactPerson("patrickdillon"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1465"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() FeatureGateClusterAPIComputeInstall = newFeatureGate("ClusterAPIComputeInstall"). @@ -959,14 +984,6 @@ var ( contactPerson("patrickdillon"). productScope(ocpSpecific). enhancementPR("https://github.com/openshift/enhancements/pull/1465"). - enable(inDevPreviewNoUpgrade()). + enableIn(configv1.DevPreviewNoUpgrade). mustRegister() - - FeatureGateGatewayAPIWithoutOLM = newFeatureGate("GatewayAPIWithoutOLM"). - reportProblemsToJiraComponent("Routing"). - contactPerson("miciah"). - productScope(ocpSpecific). - enhancementPR("https://github.com/openshift/enhancements/pull/1933"). - enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()). - mustRegister() ) diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/features/legacyfeaturegates.go b/openshift/tests-extension/vendor/github.com/openshift/api/features/legacyfeaturegates.go index a92c0b9bb..dd11fdf66 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/features/legacyfeaturegates.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/features/legacyfeaturegates.go @@ -7,6 +7,10 @@ var legacyFeatureGates = sets.New( // never add to this list, if you think you have an exception ask @deads2k "AWSEFSDriverVolumeMetrics", // never add to this list, if you think you have an exception ask @deads2k + "AdditionalRoutingCapabilities", + // never add to this list, if you think you have an exception ask @deads2k + "AdminNetworkPolicy", + // never add to this list, if you think you have an exception ask @deads2k "AlibabaPlatform", // never add to this list, if you think you have an exception ask @deads2k "AutomatedEtcdBackup", @@ -75,6 +79,12 @@ var legacyFeatureGates = sets.New( // never add to this list, if you think you have an exception ask @deads2k "MultiArchInstallGCP", // never add to this list, if you think you have an exception ask @deads2k + "NetworkDiagnosticsConfig", + // never add to this list, if you think you have an exception ask @deads2k + "NetworkLiveMigration", + // never add to this list, if you think you have an exception ask @deads2k + "NetworkSegmentation", + // never add to this list, if you think you have an exception ask @deads2k "NewOLM", // never add to this list, if you think you have an exception ask @deads2k "OVNObservability", @@ -85,6 +95,8 @@ var legacyFeatureGates = sets.New( // never add to this list, if you think you have an exception ask @deads2k "PrivateHostedZoneAWS", // never add to this list, if you think you have an exception ask @deads2k + "RouteAdvertisements", + // never add to this list, if you think you have an exception ask @deads2k "RouteExternalCertificate", // never add to this list, if you think you have an exception ask @deads2k "SetEIPForNLBIngressController", diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/features/util.go b/openshift/tests-extension/vendor/github.com/openshift/api/features/util.go index e2b35d93a..8606b6bef 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/features/util.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/features/util.go @@ -6,7 +6,6 @@ import ( "strings" configv1 "github.com/openshift/api/config/v1" - "k8s.io/apimachinery/pkg/util/sets" ) // FeatureGateDescription is a golang-only interface used to contains details for a feature gate. @@ -46,77 +45,6 @@ var ( kubernetes = OwningProduct("Kubernetes") ) -type featureGateEnableOption func(s *featureGateStatus) - -type versionOperator string - -var ( - equal = versionOperator("=") - greaterThan = versionOperator(">") - greaterThanOrEqual = versionOperator(">=") - lessThan = versionOperator("<") - lessThanOrEqual = versionOperator("<=") -) - -func inVersion(version uint64, op versionOperator) featureGateEnableOption { - return func(s *featureGateStatus) { - switch op { - case equal: - s.version.Insert(version) - case greaterThan: - for v := version + 1; v <= maxOpenshiftVersion; v++ { - s.version.Insert(v) - } - case greaterThanOrEqual: - for v := version; v <= maxOpenshiftVersion; v++ { - s.version.Insert(v) - } - case lessThan: - for v := minOpenshiftVersion; v < version; v++ { - s.version.Insert(v) - } - case lessThanOrEqual: - for v := minOpenshiftVersion; v <= version; v++ { - s.version.Insert(v) - } - default: - panic(fmt.Sprintf("invalid version operator: %s", op)) - } - } -} - -func inClusterProfile(clusterProfile ClusterProfileName) featureGateEnableOption { - return func(s *featureGateStatus) { - s.clusterProfile.Insert(clusterProfile) - } -} - -func withFeatureSet(featureSet configv1.FeatureSet) featureGateEnableOption { - return func(s *featureGateStatus) { - s.featureSets.Insert(featureSet) - } -} - -func inDefault() featureGateEnableOption { - return withFeatureSet(configv1.Default) -} - -func inTechPreviewNoUpgrade() featureGateEnableOption { - return withFeatureSet(configv1.TechPreviewNoUpgrade) -} - -func inDevPreviewNoUpgrade() featureGateEnableOption { - return withFeatureSet(configv1.DevPreviewNoUpgrade) -} - -func inCustomNoUpgrade() featureGateEnableOption { - return withFeatureSet(configv1.CustomNoUpgrade) -} - -func inOKD() featureGateEnableOption { - return withFeatureSet(configv1.OKD) -} - type featureGateBuilder struct { name string owningJiraComponent string @@ -124,22 +52,7 @@ type featureGateBuilder struct { owningProduct OwningProduct enhancementPRURL string - status []featureGateStatus -} -type featureGateStatus struct { - version sets.Set[uint64] - clusterProfile sets.Set[ClusterProfileName] - featureSets sets.Set[configv1.FeatureSet] -} - -func (s *featureGateStatus) isEnabled(version uint64, clusterProfile ClusterProfileName, featureSet configv1.FeatureSet) bool { - // If either version or clusterprofile are empty, match all. - matchesVersion := len(s.version) == 0 || s.version.Has(version) - matchesClusterProfile := len(s.clusterProfile) == 0 || s.clusterProfile.Has(clusterProfile) - - matchesFeatureSet := s.featureSets.Has(featureSet) - - return matchesVersion && matchesClusterProfile && matchesFeatureSet + statusByClusterProfileByFeatureSet map[ClusterProfileName]map[configv1.FeatureSet]bool } const ( @@ -148,9 +61,18 @@ const ( // newFeatureGate featuregate are disabled in every FeatureSet and selectively enabled func newFeatureGate(name string) *featureGateBuilder { - return &featureGateBuilder{ - name: name, + b := &featureGateBuilder{ + name: name, + statusByClusterProfileByFeatureSet: map[ClusterProfileName]map[configv1.FeatureSet]bool{}, + } + for _, clusterProfile := range AllClusterProfiles { + byFeatureSet := map[configv1.FeatureSet]bool{} + for _, featureSet := range configv1.AllFixedFeatureSets { + byFeatureSet[featureSet] = false + } + b.statusByClusterProfileByFeatureSet[clusterProfile] = byFeatureSet } + return b } func (b *featureGateBuilder) reportProblemsToJiraComponent(owningJiraComponent string) *featureGateBuilder { @@ -173,19 +95,19 @@ func (b *featureGateBuilder) enhancementPR(url string) *featureGateBuilder { return b } -func (b *featureGateBuilder) enable(opts ...featureGateEnableOption) *featureGateBuilder { - status := featureGateStatus{ - version: sets.New[uint64](), - clusterProfile: sets.New[ClusterProfileName](), - featureSets: sets.New[configv1.FeatureSet](), +func (b *featureGateBuilder) enableIn(featureSets ...configv1.FeatureSet) *featureGateBuilder { + for clusterProfile := range b.statusByClusterProfileByFeatureSet { + for _, featureSet := range featureSets { + b.statusByClusterProfileByFeatureSet[clusterProfile][featureSet] = true + } } + return b +} - for _, opt := range opts { - opt(&status) +func (b *featureGateBuilder) enableForClusterProfile(clusterProfile ClusterProfileName, featureSets ...configv1.FeatureSet) *featureGateBuilder { + for _, featureSet := range featureSets { + b.statusByClusterProfileByFeatureSet[clusterProfile][featureSet] = true } - - b.status = append(b.status, status) - return b } @@ -222,8 +144,33 @@ func (b *featureGateBuilder) register() (configv1.FeatureGateName, error) { } featureGateName := configv1.FeatureGateName(b.name) + description := FeatureGateDescription{ + FeatureGateAttributes: configv1.FeatureGateAttributes{ + Name: featureGateName, + }, + OwningJiraComponent: b.owningJiraComponent, + ResponsiblePerson: b.responsiblePerson, + OwningProduct: b.owningProduct, + EnhancementPR: b.enhancementPRURL, + } + + // statusByClusterProfileByFeatureSet is initialized by constructor to be false for every combination + for clusterProfile, byFeatureSet := range b.statusByClusterProfileByFeatureSet { + for featureSet, enabled := range byFeatureSet { + if _, ok := allFeatureGates[clusterProfile]; !ok { + allFeatureGates[clusterProfile] = map[configv1.FeatureSet]*FeatureGateEnabledDisabled{} + } + if _, ok := allFeatureGates[clusterProfile][featureSet]; !ok { + allFeatureGates[clusterProfile][featureSet] = &FeatureGateEnabledDisabled{} + } - allFeatureGates[featureGateName] = b.status + if enabled { + allFeatureGates[clusterProfile][featureSet].Enabled = append(allFeatureGates[clusterProfile][featureSet].Enabled, description) + } else { + allFeatureGates[clusterProfile][featureSet].Disabled = append(allFeatureGates[clusterProfile][featureSet].Disabled, description) + } + } + } return featureGateName, nil } @@ -242,16 +189,12 @@ func (in *FeatureGateEnabledDisabled) DeepCopyInto(out *FeatureGateEnabledDisabl if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled *out = make([]FeatureGateDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } if in.Disabled != nil { in, out := &in.Disabled, &out.Disabled *out = make([]FeatureGateDescription, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } return } diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/types_network.go b/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/types_network.go index 1cf56f549..111240eec 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/types_network.go +++ b/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/types_network.go @@ -54,7 +54,7 @@ type NetworkList struct { // NetworkSpec is the top-level network configuration object. // +kubebuilder:validation:XValidation:rule="!has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding) || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding == oldSelf.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding == 'Restricted' || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding == 'Global'",message="invalid value for IPForwarding, valid values are 'Restricted' or 'Global'" -// +kubebuilder:validation:XValidation:rule="(has(self.additionalRoutingCapabilities) && ('FRR' in self.additionalRoutingCapabilities.providers)) || !has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements) || self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements != 'Enabled'",message="Route advertisements cannot be Enabled if 'FRR' routing capability provider is not available" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=RouteAdvertisements,rule="(has(self.additionalRoutingCapabilities) && ('FRR' in self.additionalRoutingCapabilities.providers)) || !has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements) || self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements != 'Enabled'",message="Route advertisements cannot be Enabled if 'FRR' routing capability provider is not available" type NetworkSpec struct { OperatorSpec `json:",inline"` @@ -136,6 +136,7 @@ type NetworkSpec struct { // capabilities acquired through the enablement of these components but may // require specific configuration on their side to do so; refer to their // respective documentation and configuration options. + // +openshift:enable:FeatureGate=AdditionalRoutingCapabilities // +optional AdditionalRoutingCapabilities *AdditionalRoutingCapabilities `json:"additionalRoutingCapabilities,omitempty"` } @@ -156,7 +157,7 @@ const ( ) // NetworkMigration represents the cluster network migration configuration. -// +kubebuilder:validation:XValidation:rule="!has(self.mtu) || !has(self.networkType) || self.networkType == \"\" || has(self.mode) && self.mode == 'Live'",message="networkType migration in mode other than 'Live' may not be configured at the same time as mtu migration" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=NetworkLiveMigration,rule="!has(self.mtu) || !has(self.networkType) || self.networkType == \"\" || has(self.mode) && self.mode == 'Live'",message="networkType migration in mode other than 'Live' may not be configured at the same time as mtu migration" type NetworkMigration struct { // mtu contains the MTU migration configuration. Set this to allow changing // the MTU values for the default network. If unset, the operation of @@ -464,6 +465,7 @@ type OVNKubernetesConfig struct { // means the user has no opinion and the platform is left to choose // reasonable defaults. These defaults are subject to change over time. The // current default is "Disabled". + // +openshift:enable:FeatureGate=RouteAdvertisements // +optional RouteAdvertisements RouteAdvertisementsEnablement `json:"routeAdvertisements,omitempty"` } diff --git a/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml b/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml index 51a758804..e7c94e286 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/openshift/tests-extension/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml @@ -327,7 +327,10 @@ networks.operator.openshift.io: CRDName: networks.operator.openshift.io Capability: "" Category: "" - FeatureGates: [] + FeatureGates: + - AdditionalRoutingCapabilities + - NetworkLiveMigration + - RouteAdvertisements FilenameOperatorName: network FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_70" diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/acceptrisk.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/acceptrisk.go deleted file mode 100644 index dba8a77ed..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/acceptrisk.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// AcceptRiskApplyConfiguration represents a declarative configuration of the AcceptRisk type for use -// with apply. -type AcceptRiskApplyConfiguration struct { - Name *string `json:"name,omitempty"` -} - -// AcceptRiskApplyConfiguration constructs a declarative configuration of the AcceptRisk type for use with -// apply. -func AcceptRisk() *AcceptRiskApplyConfiguration { - return &AcceptRiskApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *AcceptRiskApplyConfiguration) WithName(value string) *AcceptRiskApplyConfiguration { - b.Name = &value - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go index 4d44643d4..e966cf424 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterversionstatus.go @@ -5,15 +5,14 @@ package v1 // ClusterVersionStatusApplyConfiguration represents a declarative configuration of the ClusterVersionStatus type for use // with apply. type ClusterVersionStatusApplyConfiguration struct { - Desired *ReleaseApplyConfiguration `json:"desired,omitempty"` - History []UpdateHistoryApplyConfiguration `json:"history,omitempty"` - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` - VersionHash *string `json:"versionHash,omitempty"` - Capabilities *ClusterVersionCapabilitiesStatusApplyConfiguration `json:"capabilities,omitempty"` - Conditions []ClusterOperatorStatusConditionApplyConfiguration `json:"conditions,omitempty"` - AvailableUpdates []ReleaseApplyConfiguration `json:"availableUpdates,omitempty"` - ConditionalUpdates []ConditionalUpdateApplyConfiguration `json:"conditionalUpdates,omitempty"` - ConditionalUpdateRisks []ConditionalUpdateRiskApplyConfiguration `json:"conditionalUpdateRisks,omitempty"` + Desired *ReleaseApplyConfiguration `json:"desired,omitempty"` + History []UpdateHistoryApplyConfiguration `json:"history,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + VersionHash *string `json:"versionHash,omitempty"` + Capabilities *ClusterVersionCapabilitiesStatusApplyConfiguration `json:"capabilities,omitempty"` + Conditions []ClusterOperatorStatusConditionApplyConfiguration `json:"conditions,omitempty"` + AvailableUpdates []ReleaseApplyConfiguration `json:"availableUpdates,omitempty"` + ConditionalUpdates []ConditionalUpdateApplyConfiguration `json:"conditionalUpdates,omitempty"` } // ClusterVersionStatusApplyConfiguration constructs a declarative configuration of the ClusterVersionStatus type for use with @@ -105,16 +104,3 @@ func (b *ClusterVersionStatusApplyConfiguration) WithConditionalUpdates(values . } return b } - -// WithConditionalUpdateRisks adds the given value to the ConditionalUpdateRisks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ConditionalUpdateRisks field. -func (b *ClusterVersionStatusApplyConfiguration) WithConditionalUpdateRisks(values ...*ConditionalUpdateRiskApplyConfiguration) *ClusterVersionStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditionalUpdateRisks") - } - b.ConditionalUpdateRisks = append(b.ConditionalUpdateRisks, *values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go index 8bffb192c..f183fc6e2 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdate.go @@ -10,7 +10,6 @@ import ( // with apply. type ConditionalUpdateApplyConfiguration struct { Release *ReleaseApplyConfiguration `json:"release,omitempty"` - RiskNames []string `json:"riskNames,omitempty"` Risks []ConditionalUpdateRiskApplyConfiguration `json:"risks,omitempty"` Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } @@ -29,16 +28,6 @@ func (b *ConditionalUpdateApplyConfiguration) WithRelease(value *ReleaseApplyCon return b } -// WithRiskNames adds the given value to the RiskNames field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the RiskNames field. -func (b *ConditionalUpdateApplyConfiguration) WithRiskNames(values ...string) *ConditionalUpdateApplyConfiguration { - for i := range values { - b.RiskNames = append(b.RiskNames, values[i]) - } - return b -} - // WithRisks adds the given value to the Risks field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Risks field. diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go index fdfc14ebf..6debb6e62 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/conditionalupdaterisk.go @@ -2,14 +2,9 @@ package v1 -import ( - metav1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - // ConditionalUpdateRiskApplyConfiguration represents a declarative configuration of the ConditionalUpdateRisk type for use // with apply. type ConditionalUpdateRiskApplyConfiguration struct { - Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` URL *string `json:"url,omitempty"` Name *string `json:"name,omitempty"` Message *string `json:"message,omitempty"` @@ -22,19 +17,6 @@ func ConditionalUpdateRisk() *ConditionalUpdateRiskApplyConfiguration { return &ConditionalUpdateRiskApplyConfiguration{} } -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *ConditionalUpdateRiskApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ConditionalUpdateRiskApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} - // WithURL sets the URL field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the URL field is set to the value of the last call. diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go index 4f5aec3a5..7d9300367 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go @@ -10,7 +10,6 @@ type OIDCProviderApplyConfiguration struct { OIDCClients []OIDCClientConfigApplyConfiguration `json:"oidcClients,omitempty"` ClaimMappings *TokenClaimMappingsApplyConfiguration `json:"claimMappings,omitempty"` ClaimValidationRules []TokenClaimValidationRuleApplyConfiguration `json:"claimValidationRules,omitempty"` - UserValidationRules []TokenUserValidationRuleApplyConfiguration `json:"userValidationRules,omitempty"` } // OIDCProviderApplyConfiguration constructs a declarative configuration of the OIDCProvider type for use with @@ -68,16 +67,3 @@ func (b *OIDCProviderApplyConfiguration) WithClaimValidationRules(values ...*Tok } return b } - -// WithUserValidationRules adds the given value to the UserValidationRules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the UserValidationRules field. -func (b *OIDCProviderApplyConfiguration) WithUserValidationRules(values ...*TokenUserValidationRuleApplyConfiguration) *OIDCProviderApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithUserValidationRules") - } - b.UserValidationRules = append(b.UserValidationRules, *values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationcelrule.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationcelrule.go deleted file mode 100644 index 8dda73db1..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationcelrule.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// TokenClaimValidationCELRuleApplyConfiguration represents a declarative configuration of the TokenClaimValidationCELRule type for use -// with apply. -type TokenClaimValidationCELRuleApplyConfiguration struct { - Expression *string `json:"expression,omitempty"` - Message *string `json:"message,omitempty"` -} - -// TokenClaimValidationCELRuleApplyConfiguration constructs a declarative configuration of the TokenClaimValidationCELRule type for use with -// apply. -func TokenClaimValidationCELRule() *TokenClaimValidationCELRuleApplyConfiguration { - return &TokenClaimValidationCELRuleApplyConfiguration{} -} - -// WithExpression sets the Expression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Expression field is set to the value of the last call. -func (b *TokenClaimValidationCELRuleApplyConfiguration) WithExpression(value string) *TokenClaimValidationCELRuleApplyConfiguration { - b.Expression = &value - return b -} - -// WithMessage sets the Message field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Message field is set to the value of the last call. -func (b *TokenClaimValidationCELRuleApplyConfiguration) WithMessage(value string) *TokenClaimValidationCELRuleApplyConfiguration { - b.Message = &value - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go index c8b0c6005..74e9f6109 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go @@ -9,9 +9,8 @@ import ( // TokenClaimValidationRuleApplyConfiguration represents a declarative configuration of the TokenClaimValidationRule type for use // with apply. type TokenClaimValidationRuleApplyConfiguration struct { - Type *configv1.TokenValidationRuleType `json:"type,omitempty"` - RequiredClaim *TokenRequiredClaimApplyConfiguration `json:"requiredClaim,omitempty"` - CEL *TokenClaimValidationCELRuleApplyConfiguration `json:"cel,omitempty"` + Type *configv1.TokenValidationRuleType `json:"type,omitempty"` + RequiredClaim *TokenRequiredClaimApplyConfiguration `json:"requiredClaim,omitempty"` } // TokenClaimValidationRuleApplyConfiguration constructs a declarative configuration of the TokenClaimValidationRule type for use with @@ -35,11 +34,3 @@ func (b *TokenClaimValidationRuleApplyConfiguration) WithRequiredClaim(value *To b.RequiredClaim = value return b } - -// WithCEL sets the CEL field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CEL field is set to the value of the last call. -func (b *TokenClaimValidationRuleApplyConfiguration) WithCEL(value *TokenClaimValidationCELRuleApplyConfiguration) *TokenClaimValidationRuleApplyConfiguration { - b.CEL = value - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go index 4c971d292..68f590abc 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go @@ -12,7 +12,6 @@ type TokenIssuerApplyConfiguration struct { URL *string `json:"issuerURL,omitempty"` Audiences []configv1.TokenAudience `json:"audiences,omitempty"` CertificateAuthority *ConfigMapNameReferenceApplyConfiguration `json:"issuerCertificateAuthority,omitempty"` - DiscoveryURL *string `json:"discoveryURL,omitempty"` } // TokenIssuerApplyConfiguration constructs a declarative configuration of the TokenIssuer type for use with @@ -46,11 +45,3 @@ func (b *TokenIssuerApplyConfiguration) WithCertificateAuthority(value *ConfigMa b.CertificateAuthority = value return b } - -// WithDiscoveryURL sets the DiscoveryURL field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DiscoveryURL field is set to the value of the last call. -func (b *TokenIssuerApplyConfiguration) WithDiscoveryURL(value string) *TokenIssuerApplyConfiguration { - b.DiscoveryURL = &value - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenuservalidationrule.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenuservalidationrule.go deleted file mode 100644 index 2aae5f3fe..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenuservalidationrule.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// TokenUserValidationRuleApplyConfiguration represents a declarative configuration of the TokenUserValidationRule type for use -// with apply. -type TokenUserValidationRuleApplyConfiguration struct { - Expression *string `json:"expression,omitempty"` - Message *string `json:"message,omitempty"` -} - -// TokenUserValidationRuleApplyConfiguration constructs a declarative configuration of the TokenUserValidationRule type for use with -// apply. -func TokenUserValidationRule() *TokenUserValidationRuleApplyConfiguration { - return &TokenUserValidationRuleApplyConfiguration{} -} - -// WithExpression sets the Expression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Expression field is set to the value of the last call. -func (b *TokenUserValidationRuleApplyConfiguration) WithExpression(value string) *TokenUserValidationRuleApplyConfiguration { - b.Expression = &value - return b -} - -// WithMessage sets the Message field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Message field is set to the value of the last call. -func (b *TokenUserValidationRuleApplyConfiguration) WithMessage(value string) *TokenUserValidationRuleApplyConfiguration { - b.Message = &value - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go index d20e3ca42..004d1bac2 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/update.go @@ -13,7 +13,6 @@ type UpdateApplyConfiguration struct { Version *string `json:"version,omitempty"` Image *string `json:"image,omitempty"` Force *bool `json:"force,omitempty"` - AcceptRisks []AcceptRiskApplyConfiguration `json:"acceptRisks,omitempty"` } // UpdateApplyConfiguration constructs a declarative configuration of the Update type for use with @@ -53,16 +52,3 @@ func (b *UpdateApplyConfiguration) WithForce(value bool) *UpdateApplyConfigurati b.Force = &value return b } - -// WithAcceptRisks adds the given value to the AcceptRisks field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the AcceptRisks field. -func (b *UpdateApplyConfiguration) WithAcceptRisks(values ...*AcceptRiskApplyConfiguration) *UpdateApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithAcceptRisks") - } - b.AcceptRisks = append(b.AcceptRisks, *values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go index 37a385812..7fcce84b5 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go @@ -5,11 +5,9 @@ package v1alpha1 // ClusterMonitoringSpecApplyConfiguration represents a declarative configuration of the ClusterMonitoringSpec type for use // with apply. type ClusterMonitoringSpecApplyConfiguration struct { - UserDefined *UserDefinedMonitoringApplyConfiguration `json:"userDefined,omitempty"` - AlertmanagerConfig *AlertmanagerConfigApplyConfiguration `json:"alertmanagerConfig,omitempty"` - MetricsServerConfig *MetricsServerConfigApplyConfiguration `json:"metricsServerConfig,omitempty"` - PrometheusOperatorConfig *PrometheusOperatorConfigApplyConfiguration `json:"prometheusOperatorConfig,omitempty"` - PrometheusOperatorAdmissionWebhookConfig *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration `json:"prometheusOperatorAdmissionWebhookConfig,omitempty"` + UserDefined *UserDefinedMonitoringApplyConfiguration `json:"userDefined,omitempty"` + AlertmanagerConfig *AlertmanagerConfigApplyConfiguration `json:"alertmanagerConfig,omitempty"` + MetricsServerConfig *MetricsServerConfigApplyConfiguration `json:"metricsServerConfig,omitempty"` } // ClusterMonitoringSpecApplyConfiguration constructs a declarative configuration of the ClusterMonitoringSpec type for use with @@ -41,19 +39,3 @@ func (b *ClusterMonitoringSpecApplyConfiguration) WithMetricsServerConfig(value b.MetricsServerConfig = value return b } - -// WithPrometheusOperatorConfig sets the PrometheusOperatorConfig field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PrometheusOperatorConfig field is set to the value of the last call. -func (b *ClusterMonitoringSpecApplyConfiguration) WithPrometheusOperatorConfig(value *PrometheusOperatorConfigApplyConfiguration) *ClusterMonitoringSpecApplyConfiguration { - b.PrometheusOperatorConfig = value - return b -} - -// WithPrometheusOperatorAdmissionWebhookConfig sets the PrometheusOperatorAdmissionWebhookConfig field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PrometheusOperatorAdmissionWebhookConfig field is set to the value of the last call. -func (b *ClusterMonitoringSpecApplyConfiguration) WithPrometheusOperatorAdmissionWebhookConfig(value *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration) *ClusterMonitoringSpecApplyConfiguration { - b.PrometheusOperatorAdmissionWebhookConfig = value - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigspec.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigspec.go deleted file mode 100644 index e6588c608..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigspec.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - configv1alpha1 "github.com/openshift/api/config/v1alpha1" -) - -// CRIOCredentialProviderConfigSpecApplyConfiguration represents a declarative configuration of the CRIOCredentialProviderConfigSpec type for use -// with apply. -type CRIOCredentialProviderConfigSpecApplyConfiguration struct { - MatchImages []configv1alpha1.MatchImage `json:"matchImages,omitempty"` -} - -// CRIOCredentialProviderConfigSpecApplyConfiguration constructs a declarative configuration of the CRIOCredentialProviderConfigSpec type for use with -// apply. -func CRIOCredentialProviderConfigSpec() *CRIOCredentialProviderConfigSpecApplyConfiguration { - return &CRIOCredentialProviderConfigSpecApplyConfiguration{} -} - -// WithMatchImages adds the given value to the MatchImages field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the MatchImages field. -func (b *CRIOCredentialProviderConfigSpecApplyConfiguration) WithMatchImages(values ...configv1alpha1.MatchImage) *CRIOCredentialProviderConfigSpecApplyConfiguration { - for i := range values { - b.MatchImages = append(b.MatchImages, values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigstatus.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigstatus.go deleted file mode 100644 index a243b281d..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigstatus.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// CRIOCredentialProviderConfigStatusApplyConfiguration represents a declarative configuration of the CRIOCredentialProviderConfigStatus type for use -// with apply. -type CRIOCredentialProviderConfigStatusApplyConfiguration struct { - Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` -} - -// CRIOCredentialProviderConfigStatusApplyConfiguration constructs a declarative configuration of the CRIOCredentialProviderConfigStatus type for use with -// apply. -func CRIOCredentialProviderConfigStatus() *CRIOCredentialProviderConfigStatusApplyConfiguration { - return &CRIOCredentialProviderConfigStatusApplyConfiguration{} -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *CRIOCredentialProviderConfigStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *CRIOCredentialProviderConfigStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatoradmissionwebhookconfig.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatoradmissionwebhookconfig.go deleted file mode 100644 index 4ec494d17..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatoradmissionwebhookconfig.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// PrometheusOperatorAdmissionWebhookConfigApplyConfiguration represents a declarative configuration of the PrometheusOperatorAdmissionWebhookConfig type for use -// with apply. -type PrometheusOperatorAdmissionWebhookConfigApplyConfiguration struct { - Resources []ContainerResourceApplyConfiguration `json:"resources,omitempty"` - TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` -} - -// PrometheusOperatorAdmissionWebhookConfigApplyConfiguration constructs a declarative configuration of the PrometheusOperatorAdmissionWebhookConfig type for use with -// apply. -func PrometheusOperatorAdmissionWebhookConfig() *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration { - return &PrometheusOperatorAdmissionWebhookConfigApplyConfiguration{} -} - -// WithResources adds the given value to the Resources field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Resources field. -func (b *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration) WithResources(values ...*ContainerResourceApplyConfiguration) *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResources") - } - b.Resources = append(b.Resources, *values[i]) - } - return b -} - -// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. -func (b *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration) WithTopologySpreadConstraints(values ...v1.TopologySpreadConstraint) *PrometheusOperatorAdmissionWebhookConfigApplyConfiguration { - for i := range values { - b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatorconfig.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatorconfig.go deleted file mode 100644 index 3276097b3..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatorconfig.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - configv1alpha1 "github.com/openshift/api/config/v1alpha1" - v1 "k8s.io/api/core/v1" -) - -// PrometheusOperatorConfigApplyConfiguration represents a declarative configuration of the PrometheusOperatorConfig type for use -// with apply. -type PrometheusOperatorConfigApplyConfiguration struct { - LogLevel *configv1alpha1.LogLevel `json:"logLevel,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - Resources []ContainerResourceApplyConfiguration `json:"resources,omitempty"` - Tolerations []v1.Toleration `json:"tolerations,omitempty"` - TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` -} - -// PrometheusOperatorConfigApplyConfiguration constructs a declarative configuration of the PrometheusOperatorConfig type for use with -// apply. -func PrometheusOperatorConfig() *PrometheusOperatorConfigApplyConfiguration { - return &PrometheusOperatorConfigApplyConfiguration{} -} - -// WithLogLevel sets the LogLevel field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LogLevel field is set to the value of the last call. -func (b *PrometheusOperatorConfigApplyConfiguration) WithLogLevel(value configv1alpha1.LogLevel) *PrometheusOperatorConfigApplyConfiguration { - b.LogLevel = &value - return b -} - -// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the NodeSelector field, -// overwriting an existing map entries in NodeSelector field with the same key. -func (b *PrometheusOperatorConfigApplyConfiguration) WithNodeSelector(entries map[string]string) *PrometheusOperatorConfigApplyConfiguration { - if b.NodeSelector == nil && len(entries) > 0 { - b.NodeSelector = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.NodeSelector[k] = v - } - return b -} - -// WithResources adds the given value to the Resources field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Resources field. -func (b *PrometheusOperatorConfigApplyConfiguration) WithResources(values ...*ContainerResourceApplyConfiguration) *PrometheusOperatorConfigApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResources") - } - b.Resources = append(b.Resources, *values[i]) - } - return b -} - -// WithTolerations adds the given value to the Tolerations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Tolerations field. -func (b *PrometheusOperatorConfigApplyConfiguration) WithTolerations(values ...v1.Toleration) *PrometheusOperatorConfigApplyConfiguration { - for i := range values { - b.Tolerations = append(b.Tolerations, values[i]) - } - return b -} - -// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. -func (b *PrometheusOperatorConfigApplyConfiguration) WithTopologySpreadConstraints(values ...v1.TopologySpreadConstraint) *PrometheusOperatorConfigApplyConfiguration { - for i := range values { - b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, values[i]) - } - return b -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go index 65906b80c..f00417a5c 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go @@ -206,12 +206,6 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: com.github.openshift.api.config.v1.AcceptRisk - map: - fields: - - name: name - type: - scalar: string - name: com.github.openshift.api.config.v1.AlibabaCloudPlatformSpec map: elementType: @@ -854,14 +848,6 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.openshift.api.config.v1.ClusterVersionCapabilitiesStatus default: {} - - name: conditionalUpdateRisks - type: - list: - elementType: - namedType: com.github.openshift.api.config.v1.ConditionalUpdateRisk - elementRelationship: associative - keys: - - name - name: conditionalUpdates type: list: @@ -992,12 +978,6 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.openshift.api.config.v1.Release default: {} - - name: riskNames - type: - list: - elementType: - scalar: string - elementRelationship: associative - name: risks type: list: @@ -1009,14 +989,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: com.github.openshift.api.config.v1.ConditionalUpdateRisk map: fields: - - name: conditions - type: - list: - elementType: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition - elementRelationship: associative - keys: - - type - name: matchingRules type: list: @@ -2779,14 +2751,6 @@ var schemaYAML = typed.YAMLObject(`types: keys: - componentNamespace - componentName - - name: userValidationRules - type: - list: - elementType: - namedType: com.github.openshift.api.config.v1.TokenUserValidationRule - elementRelationship: associative - keys: - - expression - name: com.github.openshift.api.config.v1.ObjectReference map: fields: @@ -3725,22 +3689,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: expression type: scalar: string -- name: com.github.openshift.api.config.v1.TokenClaimValidationCELRule - map: - fields: - - name: expression - type: - scalar: string - - name: message - type: - scalar: string - name: com.github.openshift.api.config.v1.TokenClaimValidationRule map: fields: - - name: cel - type: - namedType: com.github.openshift.api.config.v1.TokenClaimValidationCELRule - default: {} - name: requiredClaim type: namedType: com.github.openshift.api.config.v1.TokenRequiredClaim @@ -3769,9 +3720,6 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative - - name: discoveryURL - type: - scalar: string - name: issuerCertificateAuthority type: namedType: com.github.openshift.api.config.v1.ConfigMapNameReference @@ -3791,26 +3739,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: com.github.openshift.api.config.v1.TokenUserValidationRule - map: - fields: - - name: expression - type: - scalar: string - - name: message - type: - scalar: string - name: com.github.openshift.api.config.v1.Update map: fields: - - name: acceptRisks - type: - list: - elementType: - namedType: com.github.openshift.api.config.v1.AcceptRisk - elementRelationship: associative - keys: - - name - name: architecture type: scalar: string @@ -4218,46 +4149,6 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: __untyped_deduced_ elementRelationship: separable -- name: com.github.openshift.api.config.v1alpha1.CRIOCredentialProviderConfig - map: - fields: - - name: apiVersion - type: - scalar: string - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: spec - type: - namedType: com.github.openshift.api.config.v1alpha1.CRIOCredentialProviderConfigSpec - - name: status - type: - namedType: com.github.openshift.api.config.v1alpha1.CRIOCredentialProviderConfigStatus - default: {} -- name: com.github.openshift.api.config.v1alpha1.CRIOCredentialProviderConfigSpec - map: - fields: - - name: matchImages - type: - list: - elementType: - scalar: string - elementRelationship: associative -- name: com.github.openshift.api.config.v1alpha1.CRIOCredentialProviderConfigStatus - map: - fields: - - name: conditions - type: - list: - elementType: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition - elementRelationship: associative - keys: - - type - name: com.github.openshift.api.config.v1alpha1.ClusterImagePolicy map: fields: @@ -4335,10 +4226,6 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.openshift.api.config.v1alpha1.MetricsServerConfig default: {} - - name: prometheusOperatorConfig - type: - namedType: com.github.openshift.api.config.v1alpha1.PrometheusOperatorConfig - default: {} - name: userDefined type: namedType: com.github.openshift.api.config.v1alpha1.UserDefinedMonitoring @@ -4670,40 +4557,6 @@ var schemaYAML = typed.YAMLObject(`types: discriminatorValue: PKI - fieldName: publicKey discriminatorValue: PublicKey -- name: com.github.openshift.api.config.v1alpha1.PrometheusOperatorConfig - map: - fields: - - name: logLevel - type: - scalar: string - - name: nodeSelector - type: - map: - elementType: - scalar: string - - name: resources - type: - list: - elementType: - namedType: com.github.openshift.api.config.v1alpha1.ContainerResource - elementRelationship: associative - keys: - - name - - name: tolerations - type: - list: - elementType: - namedType: io.k8s.api.core.v1.Toleration - elementRelationship: atomic - - name: topologySpreadConstraints - type: - list: - elementType: - namedType: io.k8s.api.core.v1.TopologySpreadConstraint - elementRelationship: associative - keys: - - topologyKey - - whenUnsatisfiable - name: com.github.openshift.api.config.v1alpha1.RetentionNumberConfig map: fields: diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/config_client.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/config_client.go index 58cf671dc..2530a4a64 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/config_client.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/config_client.go @@ -13,7 +13,6 @@ import ( type ConfigV1alpha1Interface interface { RESTClient() rest.Interface BackupsGetter - CRIOCredentialProviderConfigsGetter ClusterImagePoliciesGetter ClusterMonitoringsGetter ImagePoliciesGetter @@ -29,10 +28,6 @@ func (c *ConfigV1alpha1Client) Backups() BackupInterface { return newBackups(c) } -func (c *ConfigV1alpha1Client) CRIOCredentialProviderConfigs() CRIOCredentialProviderConfigInterface { - return newCRIOCredentialProviderConfigs(c) -} - func (c *ConfigV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/criocredentialproviderconfig.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/criocredentialproviderconfig.go deleted file mode 100644 index 3c4962155..000000000 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/criocredentialproviderconfig.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - context "context" - - configv1alpha1 "github.com/openshift/api/config/v1alpha1" - applyconfigurationsconfigv1alpha1 "github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1" - scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - gentype "k8s.io/client-go/gentype" -) - -// CRIOCredentialProviderConfigsGetter has a method to return a CRIOCredentialProviderConfigInterface. -// A group's client should implement this interface. -type CRIOCredentialProviderConfigsGetter interface { - CRIOCredentialProviderConfigs() CRIOCredentialProviderConfigInterface -} - -// CRIOCredentialProviderConfigInterface has methods to work with CRIOCredentialProviderConfig resources. -type CRIOCredentialProviderConfigInterface interface { - Create(ctx context.Context, cRIOCredentialProviderConfig *configv1alpha1.CRIOCredentialProviderConfig, opts v1.CreateOptions) (*configv1alpha1.CRIOCredentialProviderConfig, error) - Update(ctx context.Context, cRIOCredentialProviderConfig *configv1alpha1.CRIOCredentialProviderConfig, opts v1.UpdateOptions) (*configv1alpha1.CRIOCredentialProviderConfig, error) - // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, cRIOCredentialProviderConfig *configv1alpha1.CRIOCredentialProviderConfig, opts v1.UpdateOptions) (*configv1alpha1.CRIOCredentialProviderConfig, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*configv1alpha1.CRIOCredentialProviderConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*configv1alpha1.CRIOCredentialProviderConfigList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *configv1alpha1.CRIOCredentialProviderConfig, err error) - Apply(ctx context.Context, cRIOCredentialProviderConfig *applyconfigurationsconfigv1alpha1.CRIOCredentialProviderConfigApplyConfiguration, opts v1.ApplyOptions) (result *configv1alpha1.CRIOCredentialProviderConfig, err error) - // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, cRIOCredentialProviderConfig *applyconfigurationsconfigv1alpha1.CRIOCredentialProviderConfigApplyConfiguration, opts v1.ApplyOptions) (result *configv1alpha1.CRIOCredentialProviderConfig, err error) - CRIOCredentialProviderConfigExpansion -} - -// cRIOCredentialProviderConfigs implements CRIOCredentialProviderConfigInterface -type cRIOCredentialProviderConfigs struct { - *gentype.ClientWithListAndApply[*configv1alpha1.CRIOCredentialProviderConfig, *configv1alpha1.CRIOCredentialProviderConfigList, *applyconfigurationsconfigv1alpha1.CRIOCredentialProviderConfigApplyConfiguration] -} - -// newCRIOCredentialProviderConfigs returns a CRIOCredentialProviderConfigs -func newCRIOCredentialProviderConfigs(c *ConfigV1alpha1Client) *cRIOCredentialProviderConfigs { - return &cRIOCredentialProviderConfigs{ - gentype.NewClientWithListAndApply[*configv1alpha1.CRIOCredentialProviderConfig, *configv1alpha1.CRIOCredentialProviderConfigList, *applyconfigurationsconfigv1alpha1.CRIOCredentialProviderConfigApplyConfiguration]( - "criocredentialproviderconfigs", - c.RESTClient(), - scheme.ParameterCodec, - "", - func() *configv1alpha1.CRIOCredentialProviderConfig { - return &configv1alpha1.CRIOCredentialProviderConfig{} - }, - func() *configv1alpha1.CRIOCredentialProviderConfigList { - return &configv1alpha1.CRIOCredentialProviderConfigList{} - }, - ), - } -} diff --git a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go index 9f530ae22..ab5198cce 100644 --- a/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go +++ b/openshift/tests-extension/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/generated_expansion.go @@ -4,8 +4,6 @@ package v1alpha1 type BackupExpansion interface{} -type CRIOCredentialProviderConfigExpansion interface{} - type ClusterImagePolicyExpansion interface{} type ClusterMonitoringExpansion interface{} diff --git a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clustercatalog_types.go b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clustercatalog_types.go index 7afe631db..c8690cbaf 100644 --- a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clustercatalog_types.go +++ b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clustercatalog_types.go @@ -44,6 +44,8 @@ const ( ReasonUserSpecifiedUnavailable = "UserSpecifiedUnavailable" ) +// +genclient +// +genclient:nonNamespaced //+kubebuilder:object:root=true //+kubebuilder:resource:scope=Cluster //+kubebuilder:subresource:status diff --git a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go index 7b0a39ef1..ee55109f8 100644 --- a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go +++ b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go @@ -537,6 +537,8 @@ type ClusterExtensionInstallStatus struct { Bundle BundleMetadata `json:"bundle"` } +// +genclient +// +genclient:nonNamespaced // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster // +kubebuilder:subresource:status diff --git a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextensionrevision_types.go b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextensionrevision_types.go index 389e4a5b3..f7e90db89 100644 --- a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextensionrevision_types.go +++ b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextensionrevision_types.go @@ -252,6 +252,8 @@ type ClusterExtensionRevisionStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } +// +genclient +// +genclient:nonNamespaced // +kubebuilder:object:root=true // +kubebuilder:resource:scope=Cluster // +kubebuilder:subresource:status diff --git a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/groupversion_info.go b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/groupversion_info.go index f2e8582ee..39efbee0d 100644 --- a/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/groupversion_info.go +++ b/openshift/tests-extension/vendor/github.com/operator-framework/operator-controller/api/v1/groupversion_info.go @@ -17,6 +17,8 @@ limitations under the License. // Package v1 contains API Schema definitions for the olm v1 API group // +kubebuilder:object:generate=true // +groupName=olm.operatorframework.io +// +kubebuilder:ac:generate=true +// +kubebuilder:ac:output:package=../../applyconfigurations package v1 import ( @@ -28,6 +30,10 @@ var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "olm.operatorframework.io", Version: "v1"} + // SchemeGroupVersion is an alias for GroupVersion, required by the + // generated apply configuration code. + SchemeGroupVersion = GroupVersion + // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/openshift/tests-extension/vendor/github.com/tidwall/match/README.md b/openshift/tests-extension/vendor/github.com/tidwall/match/README.md index 9134079ed..5fdd4cf63 100644 --- a/openshift/tests-extension/vendor/github.com/tidwall/match/README.md +++ b/openshift/tests-extension/vendor/github.com/tidwall/match/README.md @@ -26,4 +26,4 @@ Josh Baker [@tidwall](http://twitter.com/tidwall) ## License -Match source code is available under the MIT [License](/LICENSE). +Redcon source code is available under the MIT [License](/LICENSE). diff --git a/openshift/tests-extension/vendor/github.com/tidwall/match/match.go b/openshift/tests-extension/vendor/github.com/tidwall/match/match.go index d855a03fc..11da28f1b 100644 --- a/openshift/tests-extension/vendor/github.com/tidwall/match/match.go +++ b/openshift/tests-extension/vendor/github.com/tidwall/match/match.go @@ -10,30 +10,18 @@ import ( // and '?' matches on any one character. // // pattern: -// -// { term } -// +// { term } // term: +// '*' matches any sequence of non-Separator characters +// '?' matches any single non-Separator character +// c matches character c (c != '*', '?', '\\') +// '\\' c matches character c // -// '*' matches any sequence of non-Separator characters -// '?' matches any single non-Separator character -// c matches character c (c != '*', '?', '\\') -// '\\' c matches character c func Match(str, pattern string) bool { - return match0(str, pattern, false) -} - -// MatchNoCase is the same as Match but performs a case-insensitive match. -// Such that string "Hello World" with match with lower case pattern "hello*" -func MatchNoCase(str, pattern string) bool { - return match0(str, pattern, true) -} - -func match0(str, pattern string, nocase bool) bool { if pattern == "*" { return true } - return match(str, pattern, 0, nil, -1, nocase) == rMatch + return match(str, pattern, 0, nil, -1) == rMatch } // MatchLimit is the same as Match but will limit the complexity of the match @@ -46,21 +34,11 @@ func match0(str, pattern string, nocase bool) bool { // Everytime it calls itself a counter is incremented. // The operation is stopped when counter > maxcomp*len(str). func MatchLimit(str, pattern string, maxcomp int) (matched, stopped bool) { - return matchLimit0(str, pattern, maxcomp, false) -} - -func MatchLimitNoCase(str, pattern string, maxcomp int, -) (matched, stopped bool) { - return matchLimit0(str, pattern, maxcomp, true) -} - -func matchLimit0(str, pattern string, maxcomp int, nocase bool, -) (matched, stopped bool) { if pattern == "*" { return true, false } counter := 0 - r := match(str, pattern, len(str), &counter, maxcomp, nocase) + r := match(str, pattern, len(str), &counter, maxcomp) if r == rStop { return false, true } @@ -75,15 +53,7 @@ const ( rStop ) -func tolower(r rune) rune { - if r >= 'A' && r <= 'Z' { - return r + 32 - } - return r -} - -func match(str, pat string, slen int, counter *int, maxcomp int, nocase bool, -) result { +func match(str, pat string, slen int, counter *int, maxcomp int) result { // check complexity limit if maxcomp > -1 { if *counter > slen*maxcomp { @@ -124,7 +94,7 @@ func match(str, pat string, slen int, counter *int, maxcomp int, nocase bool, // Match and trim any non-wildcard suffix characters. var ok bool - str, pat, ok = matchTrimSuffix(str, pat, nocase) + str, pat, ok = matchTrimSuffix(str, pat) if !ok { return rNoMatch } @@ -135,7 +105,7 @@ func match(str, pat string, slen int, counter *int, maxcomp int, nocase bool, } // Perform recursive wildcard search. - r := match(str, pat[1:], slen, counter, maxcomp, nocase) + r := match(str, pat[1:], slen, counter, maxcomp) if r != rNoMatch { return r } @@ -154,9 +124,6 @@ func match(str, pat string, slen int, counter *int, maxcomp int, nocase bool, return rNoMatch } } - if nocase { - sc, pc = tolower(sc), tolower(pc) - } if sc != pc { return rNoMatch } @@ -183,7 +150,7 @@ func match(str, pat string, slen int, counter *int, maxcomp int, nocase bool, // // Any matched characters will be trimmed from both the target // string and the pattern. -func matchTrimSuffix(str, pat string, nocase bool) (string, string, bool) { +func matchTrimSuffix(str, pat string) (string, string, bool) { // It's expected that the pattern has at least two bytes and the first byte // is a wildcard star '*' match := true @@ -204,9 +171,6 @@ func matchTrimSuffix(str, pat string, nocase bool) (string, string, bool) { break } sc, ss := utf8.DecodeLastRuneInString(str) - if nocase { - pc, sc = tolower(pc), tolower(sc) - } if !((pc == '?' && !esc) || pc == sc) { match = false break diff --git a/openshift/tests-extension/vendor/golang.org/x/net/html/iter.go b/openshift/tests-extension/vendor/golang.org/x/net/html/iter.go index 349ef73e6..54be8fd30 100644 --- a/openshift/tests-extension/vendor/golang.org/x/net/html/iter.go +++ b/openshift/tests-extension/vendor/golang.org/x/net/html/iter.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.23 + package html import "iter" diff --git a/openshift/tests-extension/vendor/golang.org/x/net/http2/frame.go b/openshift/tests-extension/vendor/golang.org/x/net/http2/frame.go index be75badcc..a26039c13 100644 --- a/openshift/tests-extension/vendor/golang.org/x/net/http2/frame.go +++ b/openshift/tests-extension/vendor/golang.org/x/net/http2/frame.go @@ -145,9 +145,7 @@ var frameParsers = [...]frameParser{ func typeFrameParser(t FrameType) frameParser { if int(t) < len(frameParsers) { - if f := frameParsers[t]; f != nil { - return f - } + return frameParsers[t] } return parseUnknownFrame } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/balancer.go b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/balancer.go index d08b7ad63..b1264017d 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/balancer.go @@ -75,6 +75,8 @@ func unregisterForTesting(name string) { func init() { internal.BalancerUnregister = unregisterForTesting + internal.ConnectedAddress = connectedAddress + internal.SetConnectedAddress = setConnectedAddress } // Get returns the resolver builder registered with the given name. diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go index cc902a4de..7d66cb491 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go @@ -26,8 +26,6 @@ import ( var ( // RandShuffle pseudo-randomizes the order of addresses. RandShuffle = rand.Shuffle - // RandFloat64 returns, as a float64, a pseudo-random number in [0.0,1.0). - RandFloat64 = rand.Float64 // TimeAfterFunc allows mocking the timer for testing connection delay // related functionality. TimeAfterFunc = func(d time.Duration, f func()) func() { diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go index dccd9f0bf..b4bc3a2bf 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go @@ -21,14 +21,11 @@ package pickfirst import ( - "cmp" "encoding/json" "errors" "fmt" - "math" "net" "net/netip" - "slices" "sync" "time" @@ -37,8 +34,6 @@ import ( "google.golang.org/grpc/connectivity" expstats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/internal/balancer/weight" - "google.golang.org/grpc/internal/envconfig" internalgrpclog "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/resolver" @@ -263,42 +258,8 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState // will change the order of endpoints but not touch the order of the // addresses within each endpoint. - A61 if cfg.ShuffleAddressList { - if envconfig.PickFirstWeightedShuffling { - type weightedEndpoint struct { - endpoint resolver.Endpoint - weight float64 - } - - // For each endpoint, compute a key as described in A113 and - // https://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf: - var weightedEndpoints []weightedEndpoint - for _, endpoint := range endpoints { - u := internal.RandFloat64() // Random number in [0.0, 1.0) - weight := weightAttribute(endpoint) - weightedEndpoints = append(weightedEndpoints, weightedEndpoint{ - endpoint: endpoint, - weight: math.Pow(u, 1.0/float64(weight)), - }) - } - // Sort endpoints by key in descending order and reconstruct the - // endpoints slice. - slices.SortFunc(weightedEndpoints, func(a, b weightedEndpoint) int { - return cmp.Compare(b.weight, a.weight) - }) - - // Here, and in the "else" block below, we clone the endpoints - // slice to avoid mutating the resolver state. Doing the latter - // would lead to data races if the caller is accessing the same - // slice concurrently. - sortedEndpoints := make([]resolver.Endpoint, len(endpoints)) - for i, we := range weightedEndpoints { - sortedEndpoints[i] = we.endpoint - } - endpoints = sortedEndpoints - } else { - endpoints = slices.Clone(endpoints) - internal.RandShuffle(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] }) - } + endpoints = append([]resolver.Endpoint{}, endpoints...) + internal.RandShuffle(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] }) } // "Flatten the list by concatenating the ordered list of addresses for @@ -945,17 +906,3 @@ func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool { return a.Addr == b.Addr && a.ServerName == b.ServerName && a.Attributes.Equal(b.Attributes) } - -// weightAttribute is a convenience function which returns the value of the -// weight endpoint Attribute. -// -// When used in the xDS context, the weight attribute is guaranteed to be -// non-zero. But, when used in a non-xDS context, the weight attribute could be -// unset. A Default of 1 is used in the latter case. -func weightAttribute(e resolver.Endpoint) uint32 { - w := weight.FromEndpoint(e).Weight - if w == 0 { - return 1 - } - return w -} diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/subconn.go b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/subconn.go index c1ca7c92e..9ee44d4af 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/subconn.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer/subconn.go @@ -111,6 +111,20 @@ type SubConnState struct { // ConnectionError is set if the ConnectivityState is TransientFailure, // describing the reason the SubConn failed. Otherwise, it is nil. ConnectionError error + // connectedAddr contains the connected address when ConnectivityState is + // Ready. Otherwise, it is indeterminate. + connectedAddress resolver.Address +} + +// connectedAddress returns the connected address for a SubConnState. The +// address is only valid if the state is READY. +func connectedAddress(scs SubConnState) resolver.Address { + return scs.connectedAddress +} + +// setConnectedAddress sets the connected address for a SubConnState. +func setConnectedAddress(scs *SubConnState, addr resolver.Address) { + scs.connectedAddress = addr } // A Producer is a type shared among potentially many consumers. It is diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer_wrapper.go b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer_wrapper.go index a1e56a389..2c760e623 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/balancer_wrapper.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/balancer_wrapper.go @@ -36,6 +36,7 @@ import ( ) var ( + setConnectedAddress = internal.SetConnectedAddress.(func(*balancer.SubConnState, resolver.Address)) // noOpRegisterHealthListenerFn is used when client side health checking is // disabled. It sends a single READY update on the registered listener. noOpRegisterHealthListenerFn = func(_ context.Context, listener func(balancer.SubConnState)) func() { @@ -304,7 +305,7 @@ func newHealthData(s connectivity.State) *healthData { // updateState is invoked by grpc to push a subConn state update to the // underlying balancer. -func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) { +func (acbw *acBalancerWrapper) updateState(s connectivity.State, curAddr resolver.Address, err error) { acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return @@ -316,6 +317,9 @@ func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) { // opts.StateListener is set, so this cannot ever be nil. // TODO: delete this comment when UpdateSubConnState is removed. scs := balancer.SubConnState{ConnectivityState: s, ConnectionError: err} + if s == connectivity.Ready { + setConnectedAddress(&scs, curAddr) + } // Invalidate the health listener by updating the healthData. acbw.healthMu.Lock() // A race may occur if a health listener is registered soon after the diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/clientconn.go b/openshift/tests-extension/vendor/google.golang.org/grpc/clientconn.go index 5dec2dacc..b767d3e33 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/clientconn.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/clientconn.go @@ -977,24 +977,25 @@ func (cc *ClientConn) incrCallsFailed() { // connect starts creating a transport. // It does nothing if the ac is not IDLE. // TODO(bar) Move this to the addrConn section. -func (ac *addrConn) connect() { +func (ac *addrConn) connect() error { ac.mu.Lock() if ac.state == connectivity.Shutdown { if logger.V(2) { logger.Infof("connect called on shutdown addrConn; ignoring.") } ac.mu.Unlock() - return + return errConnClosing } if ac.state != connectivity.Idle { if logger.V(2) { logger.Infof("connect called on addrConn in non-idle state (%v); ignoring.", ac.state) } ac.mu.Unlock() - return + return nil } ac.resetTransportAndUnlock() + return nil } // equalAddressIgnoringBalAttributes returns true is a and b are considered equal. @@ -1296,7 +1297,7 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) } else { channelz.Infof(logger, ac.channelz, "Subchannel Connectivity change to %v, last error: %s", s, lastErr) } - ac.acbw.updateState(s, lastErr) + ac.acbw.updateState(s, ac.curAddr, lastErr) } // adjustParams updates parameters used to create transports upon @@ -1527,26 +1528,25 @@ func (ac *addrConn) createTransport(ctx context.Context, addr resolver.Address, } ac.mu.Lock() + defer ac.mu.Unlock() if ctx.Err() != nil { // This can happen if the subConn was removed while in `Connecting` // state. tearDown() would have set the state to `Shutdown`, but // would not have closed the transport since ac.transport would not // have been set at that point. - - // We unlock ac.mu because newTr.Close() calls onClose() + // + // We run this in a goroutine because newTr.Close() calls onClose() // inline, which requires locking ac.mu. - ac.mu.Unlock() - + // // The error we pass to Close() is immaterial since there are no open // streams at this point, so no trailers with error details will be sent // out. We just need to pass a non-nil error. // // This can also happen when updateAddrs is called during a connection // attempt. - newTr.Close(transport.ErrConnClosing) + go newTr.Close(transport.ErrConnClosing) return nil } - defer ac.mu.Unlock() if hctx.Err() != nil { // onClose was already called for this connection, but the connection // was successfully established first. Consider it a success and set diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/credentials/tls.go b/openshift/tests-extension/vendor/google.golang.org/grpc/credentials/tls.go index 0bcd16dbb..8277be7d6 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/credentials/tls.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/credentials/tls.go @@ -56,13 +56,9 @@ func (t TLSInfo) AuthType() string { // non-nil error if the validation fails. func (t TLSInfo) ValidateAuthority(authority string) error { var errs []error - host, _, err := net.SplitHostPort(authority) - if err != nil { - host = authority - } for _, cert := range t.State.PeerCertificates { var err error - if err = cert.VerifyHostname(host); err == nil { + if err = cert.VerifyHostname(authority); err == nil { return nil } errs = append(errs, err) diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/encoding.go b/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/encoding.go index 296f38c3a..dadd21e40 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/encoding.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/encoding.go @@ -58,6 +58,10 @@ func init() { // Compressor is used for compressing and decompressing when sending or // receiving messages. +// +// If a Compressor implements `DecompressedSize(compressedBytes []byte) int`, +// gRPC will invoke it to determine the size of the buffer allocated for the +// result of decompression. A return value of -1 indicates unknown size. type Compressor interface { // Compress writes the data written to wc to w after compressing it. If an // error occurs while initializing the compressor, that error is returned diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/gzip/gzip.go b/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/gzip/gzip.go index 153e4dbfb..6306e8bb0 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/gzip/gzip.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/encoding/gzip/gzip.go @@ -27,6 +27,7 @@ package gzip import ( "compress/gzip" + "encoding/binary" "fmt" "io" "sync" @@ -110,6 +111,17 @@ func (z *reader) Read(p []byte) (n int, err error) { return n, err } +// RFC1952 specifies that the last four bytes "contains the size of +// the original (uncompressed) input data modulo 2^32." +// gRPC has a max message size of 2GB so we don't need to worry about wraparound. +func (c *compressor) DecompressedSize(buf []byte) int { + last := len(buf) + if last < 4 { + return -1 + } + return int(binary.LittleEndian.Uint32(buf[last-4 : last])) +} + func (c *compressor) Name() string { return Name } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/experimental/stats/metrics.go b/openshift/tests-extension/vendor/google.golang.org/grpc/experimental/stats/metrics.go index 88742724a..d7d404cbe 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/experimental/stats/metrics.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/experimental/stats/metrics.go @@ -19,13 +19,9 @@ // Package stats contains experimental metrics/stats API's. package stats -import ( - "google.golang.org/grpc/internal" - "google.golang.org/grpc/stats" -) +import "google.golang.org/grpc/stats" // MetricsRecorder records on metrics derived from metric registry. -// Implementors must embed UnimplementedMetricsRecorder. type MetricsRecorder interface { // RecordInt64Count records the measurement alongside labels on the int // count associated with the provided handle. @@ -45,39 +41,6 @@ type MetricsRecorder interface { // RecordInt64UpDownCounter records the measurement alongside labels on the int // count associated with the provided handle. RecordInt64UpDownCount(handle *Int64UpDownCountHandle, incr int64, labels ...string) - // RegisterAsyncReporter registers a reporter to produce metric values for - // only the listed descriptors. The returned function must be called when - // the metrics are no longer needed, which will remove the reporter. The - // returned method needs to be idempotent and concurrent safe. - RegisterAsyncReporter(reporter AsyncMetricReporter, descriptors ...AsyncMetric) func() - - // EnforceMetricsRecorderEmbedding is included to force implementers to embed - // another implementation of this interface, allowing gRPC to add methods - // without breaking users. - internal.EnforceMetricsRecorderEmbedding -} - -// AsyncMetricReporter is an interface for types that record metrics asynchronously -// for the set of descriptors they are registered with. The AsyncMetricsRecorder -// parameter is used to record values for these metrics. -// -// Implementations must make unique recordings across all registered -// AsyncMetricReporters. Meaning, they should not report values for a metric with -// the same attributes as another AsyncMetricReporter will report. -// -// Implementations must be concurrent-safe. -type AsyncMetricReporter interface { - // Report records metric values using the provided recorder. - Report(AsyncMetricsRecorder) error -} - -// AsyncMetricReporterFunc is an adapter to allow the use of ordinary functions as -// AsyncMetricReporters. -type AsyncMetricReporterFunc func(AsyncMetricsRecorder) error - -// Report calls f(r). -func (f AsyncMetricReporterFunc) Report(r AsyncMetricsRecorder) error { - return f(r) } // AsyncMetricsRecorder records on asynchronous metrics derived from metric registry. @@ -99,33 +62,3 @@ type Metric = string func NewMetrics(metrics ...Metric) *Metrics { return stats.NewMetricSet(metrics...) } - -// UnimplementedMetricsRecorder must be embedded to have forward compatible implementations. -type UnimplementedMetricsRecorder struct { - internal.EnforceMetricsRecorderEmbedding -} - -// RecordInt64Count provides a no-op implementation. -func (UnimplementedMetricsRecorder) RecordInt64Count(*Int64CountHandle, int64, ...string) {} - -// RecordFloat64Count provides a no-op implementation. -func (UnimplementedMetricsRecorder) RecordFloat64Count(*Float64CountHandle, float64, ...string) {} - -// RecordInt64Histo provides a no-op implementation. -func (UnimplementedMetricsRecorder) RecordInt64Histo(*Int64HistoHandle, int64, ...string) {} - -// RecordFloat64Histo provides a no-op implementation. -func (UnimplementedMetricsRecorder) RecordFloat64Histo(*Float64HistoHandle, float64, ...string) {} - -// RecordInt64Gauge provides a no-op implementation. -func (UnimplementedMetricsRecorder) RecordInt64Gauge(*Int64GaugeHandle, int64, ...string) {} - -// RecordInt64UpDownCount provides a no-op implementation. -func (UnimplementedMetricsRecorder) RecordInt64UpDownCount(*Int64UpDownCountHandle, int64, ...string) { -} - -// RegisterAsyncReporter provides a no-op implementation. -func (UnimplementedMetricsRecorder) RegisterAsyncReporter(AsyncMetricReporter, ...AsyncMetric) func() { - // No-op: Return an empty function to ensure caller doesn't panic on nil function call - return func() {} -} diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/interceptor.go b/openshift/tests-extension/vendor/google.golang.org/grpc/interceptor.go index 099e3d093..877d78fc3 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/interceptor.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/interceptor.go @@ -97,12 +97,8 @@ type StreamServerInfo struct { IsServerStream bool } -// StreamServerInterceptor provides a hook to intercept the execution of a -// streaming RPC on the server. -// -// srv is the service implementation on which the RPC was invoked, and needs to -// be passed to handler, and not used otherwise. ss is the server side of the -// stream. info contains all the information of this RPC the interceptor can -// operate on. And handler is the service method implementation. It is the -// responsibility of the interceptor to invoke handler to complete the RPC. +// StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server. +// info contains all the information of this RPC the interceptor can operate on. And handler is the +// service method implementation. It is the responsibility of the interceptor to invoke handler to +// complete the RPC. type StreamServerInterceptor func(srv any, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/balancer/weight/weight.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/balancer/weight/weight.go deleted file mode 100644 index 11beb07d1..000000000 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/balancer/weight/weight.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Copyright 2025 gRPC 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 weight contains utilities to manage endpoint weights. Weights are -// used by LB policies such as ringhash to distribute load across multiple -// endpoints. -package weight - -import ( - "fmt" - - "google.golang.org/grpc/resolver" -) - -// attributeKey is the type used as the key to store EndpointInfo in the -// Attributes field of resolver.Endpoint. -type attributeKey struct{} - -// EndpointInfo will be stored in the Attributes field of Endpoints in order to -// use the ringhash balancer. -type EndpointInfo struct { - Weight uint32 -} - -// Equal allows the values to be compared by Attributes.Equal. -func (a EndpointInfo) Equal(o any) bool { - oa, ok := o.(EndpointInfo) - return ok && oa.Weight == a.Weight -} - -// Set returns a copy of endpoint in which the Attributes field is updated with -// EndpointInfo. -func Set(endpoint resolver.Endpoint, epInfo EndpointInfo) resolver.Endpoint { - endpoint.Attributes = endpoint.Attributes.WithValue(attributeKey{}, epInfo) - return endpoint -} - -// String returns a human-readable representation of EndpointInfo. -// This method is intended for logging, testing, and debugging purposes only. -// Do not rely on the output format, as it is not guaranteed to remain stable. -func (a EndpointInfo) String() string { - return fmt.Sprintf("Weight: %d", a.Weight) -} - -// FromEndpoint returns the EndpointInfo stored in the Attributes field of an -// endpoint. It returns an empty EndpointInfo if attribute is not found. -func FromEndpoint(endpoint resolver.Endpoint) EndpointInfo { - v := endpoint.Attributes.Value(attributeKey{}) - ei, _ := v.(EndpointInfo) - return ei -} diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index e8dc79129..6414ee4bb 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -82,12 +82,6 @@ var ( // This feature is defined in gRFC A81 and is enabled by setting the // environment variable GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE to "true". XDSAuthorityRewrite = boolFromEnv("GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE", false) - - // PickFirstWeightedShuffling indicates whether weighted endpoint shuffling - // is enabled in the pick_first LB policy, as defined in gRFC A113. This - // feature can be disabled by setting the environment variable - // GRPC_EXPERIMENTAL_PF_WEIGHTED_SHUFFLING to "false". - PickFirstWeightedShuffling = boolFromEnv("GRPC_EXPERIMENTAL_PF_WEIGHTED_SHUFFLING", true) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/experimental.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/experimental.go index 8a999917d..c90cc51bd 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/experimental.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/experimental.go @@ -26,9 +26,6 @@ var ( // option to configure a shared buffer pool for a grpc.Server. BufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption - // SetDefaultBufferPool updates the default buffer pool. - SetDefaultBufferPool any // func(mem.BufferPool) - // AcceptCompressors is implemented by the grpc package and returns // a call option that restricts the grpc-accept-encoding header for a call. AcceptCompressors any // func(...string) grpc.CallOption diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/internal.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/internal.go index 4b3d563f8..27bef83d9 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/internal.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/internal.go @@ -211,11 +211,22 @@ var ( // default resolver scheme. UserSetDefaultScheme = false + // ConnectedAddress returns the connected address for a SubConnState. The + // address is only valid if the state is READY. + ConnectedAddress any // func (scs SubConnState) resolver.Address + + // SetConnectedAddress sets the connected address for a SubConnState. + SetConnectedAddress any // func(scs *SubConnState, addr resolver.Address) + // SnapshotMetricRegistryForTesting snapshots the global data of the metric // registry. Returns a cleanup function that sets the metric registry to its // original state. Only called in testing functions. SnapshotMetricRegistryForTesting func() func() + // SetDefaultBufferPoolForTesting updates the default buffer pool, for + // testing purposes. + SetDefaultBufferPoolForTesting any // func(mem.BufferPool) + // SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for // testing purposes. SetBufferPoolingThresholdForTesting any // func(int) @@ -237,14 +248,6 @@ var ( // AddressToTelemetryLabels is an xDS-provided function to extract telemetry // labels from a resolver.Address. Callers must assert its type before calling. AddressToTelemetryLabels any // func(addr resolver.Address) map[string]string - - // AsyncReporterCleanupDelegate is initialized to a pass-through function by - // default (production behavior), allowing tests to swap it with an - // implementation which tracks registration of async reporter and its - // corresponding cleanup. - AsyncReporterCleanupDelegate = func(cleanup func()) func() { - return cleanup - } ) // HealthChecker defines the signature of the client-side LB channel health @@ -292,9 +295,3 @@ type EnforceClientConnEmbedding interface { type Timer interface { Stop() bool } - -// EnforceMetricsRecorderEmbedding is used to enforce proper MetricsRecorder -// implementation embedding. -type EnforceMetricsRecorderEmbedding interface { - enforceMetricsRecorderEmbedding() -} diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go index 70b89e4d7..ada5251cf 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -125,10 +125,7 @@ func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts // IP address. if ipAddr, err := formatIP(host); err == nil { addr := []resolver.Address{{Addr: ipAddr + ":" + port}} - cc.UpdateState(resolver.State{ - Addresses: addr, - Endpoints: []resolver.Endpoint{{Addresses: addr}}, - }) + cc.UpdateState(resolver.State{Addresses: addr}) return deadResolver{}, nil } @@ -345,15 +342,7 @@ func (d *dnsResolver) lookup() (*resolver.State, error) { return nil, hostErr } - eps := make([]resolver.Endpoint, 0, len(addrs)) - for _, addr := range addrs { - eps = append(eps, resolver.Endpoint{Addresses: []resolver.Address{addr}}) - } - - state := resolver.State{ - Addresses: addrs, - Endpoints: eps, - } + state := resolver.State{Addresses: addrs} if len(srv) > 0 { state = grpclbstate.Set(state, &grpclbstate.State{BalancerAddresses: srv}) } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go index 1c8c2ab30..d5f7e4d62 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go @@ -20,7 +20,6 @@ import ( "fmt" estats "google.golang.org/grpc/experimental/stats" - "google.golang.org/grpc/internal" "google.golang.org/grpc/stats" ) @@ -29,7 +28,6 @@ import ( // It eats any record calls where the label values provided do not match the // number of label keys. type MetricsRecorderList struct { - internal.EnforceMetricsRecorderEmbedding // metricsRecorders are the metrics recorders this list will forward to. metricsRecorders []estats.MetricsRecorder } @@ -115,61 +113,3 @@ func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, metricRecorder.RecordInt64Gauge(handle, incr, labels...) } } - -// RegisterAsyncReporter forwards the registration to all underlying metrics -// recorders. -// -// It returns a cleanup function that, when called, invokes the cleanup function -// returned by each underlying recorder, ensuring the reporter is unregistered -// from all of them. -func (l *MetricsRecorderList) RegisterAsyncReporter(reporter estats.AsyncMetricReporter, metrics ...estats.AsyncMetric) func() { - descriptorsMap := make(map[*estats.MetricDescriptor]bool, len(metrics)) - for _, m := range metrics { - descriptorsMap[m.Descriptor()] = true - } - unregisterFns := make([]func(), 0, len(l.metricsRecorders)) - for _, mr := range l.metricsRecorders { - // Wrap the AsyncMetricsRecorder to intercept calls to RecordInt64Gauge - // and validate the labels. - wrappedCallback := func(recorder estats.AsyncMetricsRecorder) error { - wrappedRecorder := &asyncRecorderWrapper{ - delegate: recorder, - descriptors: descriptorsMap, - } - return reporter.Report(wrappedRecorder) - } - unregisterFns = append(unregisterFns, mr.RegisterAsyncReporter(estats.AsyncMetricReporterFunc(wrappedCallback), metrics...)) - } - - // Wrap the cleanup function using the internal delegate. - // In production, this returns realCleanup as-is. - // In tests, the leak checker can swap this to track the registration lifetime. - return internal.AsyncReporterCleanupDelegate(defaultCleanUp(unregisterFns)) -} - -func defaultCleanUp(unregisterFns []func()) func() { - return func() { - for _, unregister := range unregisterFns { - unregister() - } - } -} - -type asyncRecorderWrapper struct { - delegate estats.AsyncMetricsRecorder - descriptors map[*estats.MetricDescriptor]bool -} - -// RecordIntAsync64Gauge records the measurement alongside labels on the int -// gauge associated with the provided handle. -func (w *asyncRecorderWrapper) RecordInt64AsyncGauge(handle *estats.Int64AsyncGaugeHandle, value int64, labels ...string) { - // Ensure only metrics for descriptors passed during callback registration - // are emitted. - d := handle.Descriptor() - if _, ok := w.descriptors[d]; !ok { - return - } - // Validate labels and delegate. - verifyLabels(d, labels...) - w.delegate.RecordInt64AsyncGauge(handle, value, labels...) -} diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index 7efa52478..2dcd1e63b 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -24,13 +24,16 @@ import ( "fmt" "net" "runtime" + "strconv" "sync" "sync/atomic" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/mem" + "google.golang.org/grpc/status" ) var updateHeaderTblSize = func(e *hpack.Encoder, v uint32) { @@ -144,9 +147,11 @@ type cleanupStream struct { func (c *cleanupStream) isTransportResponseFrame() bool { return c.rst } // Results in a RST_STREAM type earlyAbortStream struct { - streamID uint32 - rst bool - hf []hpack.HeaderField // Pre-built header fields + httpStatus uint32 + streamID uint32 + contentSubtype string + status *status.Status + rst bool } func (*earlyAbortStream) isTransportResponseFrame() bool { return false } @@ -838,7 +843,18 @@ func (l *loopyWriter) earlyAbortStreamHandler(eas *earlyAbortStream) error { if l.side == clientSide { return errors.New("earlyAbortStream not handled on client") } - if err := l.writeHeader(eas.streamID, true, eas.hf, nil); err != nil { + // In case the caller forgets to set the http status, default to 200. + if eas.httpStatus == 0 { + eas.httpStatus = 200 + } + headerFields := []hpack.HeaderField{ + {Name: ":status", Value: strconv.Itoa(int(eas.httpStatus))}, + {Name: "content-type", Value: grpcutil.ContentType(eas.contentSubtype)}, + {Name: "grpc-status", Value: strconv.Itoa(int(eas.status.Code()))}, + {Name: "grpc-message", Value: encodeGrpcMessage(eas.status.Message())}, + } + + if err := l.writeHeader(eas.streamID, true, headerFields, nil); err != nil { return err } if eas.rst { diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/http2_server.go index a1a14e14f..6f78a6b0c 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -479,7 +479,13 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early: %v", errMsg) } - t.writeEarlyAbort(streamID, s.contentSubtype, status.New(codes.Internal, errMsg), http.StatusBadRequest, !frame.StreamEnded()) + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusBadRequest, + streamID: streamID, + contentSubtype: s.contentSubtype, + status: status.New(codes.Internal, errMsg), + rst: !frame.StreamEnded(), + }) return nil } @@ -493,11 +499,23 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade return nil } if !isGRPC { - t.writeEarlyAbort(streamID, s.contentSubtype, status.Newf(codes.InvalidArgument, "invalid gRPC request content-type %q", contentType), http.StatusUnsupportedMediaType, !frame.StreamEnded()) + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusUnsupportedMediaType, + streamID: streamID, + contentSubtype: s.contentSubtype, + status: status.Newf(codes.InvalidArgument, "invalid gRPC request content-type %q", contentType), + rst: !frame.StreamEnded(), + }) return nil } if headerError != nil { - t.writeEarlyAbort(streamID, s.contentSubtype, headerError, http.StatusBadRequest, !frame.StreamEnded()) + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusBadRequest, + streamID: streamID, + contentSubtype: s.contentSubtype, + status: headerError, + rst: !frame.StreamEnded(), + }) return nil } @@ -551,7 +569,13 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early: %v", errMsg) } - t.writeEarlyAbort(streamID, s.contentSubtype, status.New(codes.Internal, errMsg), http.StatusMethodNotAllowed, !frame.StreamEnded()) + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusMethodNotAllowed, + streamID: streamID, + contentSubtype: s.contentSubtype, + status: status.New(codes.Internal, errMsg), + rst: !frame.StreamEnded(), + }) s.cancel() return nil } @@ -566,16 +590,27 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade if !ok { stat = status.New(codes.PermissionDenied, err.Error()) } - t.writeEarlyAbort(s.id, s.contentSubtype, stat, http.StatusOK, !frame.StreamEnded()) + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusOK, + streamID: s.id, + contentSubtype: s.contentSubtype, + status: stat, + rst: !frame.StreamEnded(), + }) return nil } } if s.ctx.Err() != nil { t.mu.Unlock() - st := status.New(codes.DeadlineExceeded, context.DeadlineExceeded.Error()) // Early abort in case the timeout was zero or so low it already fired. - t.writeEarlyAbort(s.id, s.contentSubtype, st, http.StatusOK, !frame.StreamEnded()) + t.controlBuf.put(&earlyAbortStream{ + httpStatus: http.StatusOK, + streamID: s.id, + contentSubtype: s.contentSubtype, + status: status.New(codes.DeadlineExceeded, context.DeadlineExceeded.Error()), + rst: !frame.StreamEnded(), + }) return nil } @@ -934,12 +969,13 @@ func appendHeaderFieldsFromMD(headerFields []hpack.HeaderField, md metadata.MD) return headerFields } -func (t *http2Server) checkForHeaderListSize(hf []hpack.HeaderField) bool { +func (t *http2Server) checkForHeaderListSize(it any) bool { if t.maxSendHeaderListSize == nil { return true } + hdrFrame := it.(*headerFrame) var sz int64 - for _, f := range hf { + for _, f := range hdrFrame.hf { if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { if t.logger.V(logLevel) { t.logger.Infof("Header list size to send violates the maximum size (%d bytes) set by client", *t.maxSendHeaderListSize) @@ -950,42 +986,6 @@ func (t *http2Server) checkForHeaderListSize(hf []hpack.HeaderField) bool { return true } -// writeEarlyAbort sends an early abort response with the given HTTP status and -// gRPC status. If the header list size exceeds the peer's limit, it sends a -// RST_STREAM instead. -func (t *http2Server) writeEarlyAbort(streamID uint32, contentSubtype string, stat *status.Status, httpStatus uint32, rst bool) { - hf := []hpack.HeaderField{ - {Name: ":status", Value: strconv.Itoa(int(httpStatus))}, - {Name: "content-type", Value: grpcutil.ContentType(contentSubtype)}, - {Name: "grpc-status", Value: strconv.Itoa(int(stat.Code()))}, - {Name: "grpc-message", Value: encodeGrpcMessage(stat.Message())}, - } - if p := istatus.RawStatusProto(stat); len(p.GetDetails()) > 0 { - stBytes, err := proto.Marshal(p) - if err != nil { - t.logger.Errorf("Failed to marshal rpc status: %s, error: %v", pretty.ToJSON(p), err) - } - if err == nil { - hf = append(hf, hpack.HeaderField{Name: grpcStatusDetailsBinHeader, Value: encodeBinHeader(stBytes)}) - } - } - success, _ := t.controlBuf.executeAndPut(func() bool { - return t.checkForHeaderListSize(hf) - }, &earlyAbortStream{ - streamID: streamID, - rst: rst, - hf: hf, - }) - if !success { - t.controlBuf.put(&cleanupStream{ - streamID: streamID, - rst: true, - rstCode: http2.ErrCodeInternal, - onWrite: func() {}, - }) - } -} - func (t *http2Server) streamContextErr(s *ServerStream) error { select { case <-t.done: @@ -1041,7 +1041,7 @@ func (t *http2Server) writeHeaderLocked(s *ServerStream) error { endStream: false, onWrite: t.setResetPingStrikes, } - success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(hf.hf) }, hf) + success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(hf) }, hf) if !success { if err != nil { return err @@ -1111,7 +1111,7 @@ func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { } success, err := t.controlBuf.executeAndPut(func() bool { - return t.checkForHeaderListSize(trailingHeader.hf) + return t.checkForHeaderListSize(trailingHeader) }, nil) if !success { if err != nil { diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/transport.go b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/transport.go index 10b9155f0..6daf1e002 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -378,28 +378,12 @@ func (s *Stream) ReadMessageHeader(header []byte) (err error) { return nil } -// ceil returns the ceil after dividing the numerator and denominator while -// avoiding integer overflows. -func ceil(numerator, denominator int) int { - if numerator == 0 { - return 0 - } - return (numerator-1)/denominator + 1 -} - // Read reads n bytes from the wire for this stream. func (s *Stream) read(n int) (data mem.BufferSlice, err error) { // Don't request a read if there was an error earlier if er := s.trReader.er; er != nil { return nil, er } - // gRPC Go accepts data frames with a maximum length of 16KB. Larger - // messages must be split into multiple frames. We pre-allocate the - // buffer to avoid resizing during the read loop, but cap the initial - // capacity to 128 frames (2MB) to prevent over-allocation or panics - // when reading extremely large streams. - allocCap := min(ceil(n, http2MaxFrameLen), 128) - data = make(mem.BufferSlice, 0, allocCap) s.readRequester.requestRead(n) for n != 0 { buf, err := s.trReader.Read(n) @@ -590,14 +574,9 @@ type CallHdr struct { DoneFunc func() // called when the stream is finished - // Authority is used to explicitly override the `:authority` header. - // - // This value comes from one of two sources: - // 1. The `CallAuthority` call option, if specified by the user. - // 2. An override provided by the LB picker (e.g. xDS authority rewriting). - // - // The `CallAuthority` call option always takes precedence over the LB - // picker override. + // Authority is used to explicitly override the `:authority` header. If set, + // this value takes precedence over the Host field and will be used as the + // value for the `:authority` header. Authority string } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffer_pool.go b/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffer_pool.go index 2ea763a49..e37afdd19 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffer_pool.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffer_pool.go @@ -53,7 +53,7 @@ var defaultBufferPool BufferPool func init() { defaultBufferPool = NewTieredBufferPool(defaultBufferPoolSizes...) - internal.SetDefaultBufferPool = func(pool BufferPool) { + internal.SetDefaultBufferPoolForTesting = func(pool BufferPool) { defaultBufferPool = pool } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffers.go b/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffers.go index db1620e6a..ecbf0b9a7 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffers.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/mem/buffers.go @@ -62,6 +62,7 @@ var ( bufferPoolingThreshold = 1 << 10 bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }} + refObjectPool = sync.Pool{New: func() any { return new(atomic.Int32) }} ) // IsBelowBufferPoolingThreshold returns true if the given size is less than or @@ -72,19 +73,9 @@ func IsBelowBufferPoolingThreshold(size int) bool { } type buffer struct { - refs atomic.Int32 - data []byte - - // rootBuf is the buffer responsible for returning origData to the pool - // once the reference count drops to 0. - // - // When a buffer is split, the new buffer inherits the rootBuf of the - // original and increments the root's reference count. For the - // initial buffer (the root), this field points to itself. - rootBuf *buffer - - // The following fields are only set for root buffers. origData *[]byte + data []byte + refs *atomic.Int32 pool BufferPool } @@ -112,8 +103,8 @@ func NewBuffer(data *[]byte, pool BufferPool) Buffer { b.origData = data b.data = *data b.pool = pool - b.rootBuf = b - b.refs.Store(1) + b.refs = refObjectPool.Get().(*atomic.Int32) + b.refs.Add(1) return b } @@ -136,44 +127,42 @@ func Copy(data []byte, pool BufferPool) Buffer { } func (b *buffer) ReadOnlyData() []byte { - if b.rootBuf == nil { + if b.refs == nil { panic("Cannot read freed buffer") } return b.data } func (b *buffer) Ref() { - if b.refs.Add(1) <= 1 { + if b.refs == nil { panic("Cannot ref freed buffer") } + b.refs.Add(1) } func (b *buffer) Free() { - refs := b.refs.Add(-1) - if refs < 0 { + if b.refs == nil { panic("Cannot free freed buffer") } - if refs > 0 { - return - } - b.data = nil - if b.rootBuf == b { - // This buffer is the owner of the data slice and its ref count reached - // 0, free the slice. + refs := b.refs.Add(-1) + switch { + case refs > 0: + return + case refs == 0: if b.pool != nil { b.pool.Put(b.origData) - b.pool = nil } + + refObjectPool.Put(b.refs) b.origData = nil - } else { - // This buffer doesn't own the data slice, decrement a ref on the root - // buffer. - b.rootBuf.Free() + b.data = nil + b.refs = nil + b.pool = nil + bufferObjectPool.Put(b) + default: + panic("Cannot free freed buffer") } - - b.rootBuf = nil - bufferObjectPool.Put(b) } func (b *buffer) Len() int { @@ -181,14 +170,16 @@ func (b *buffer) Len() int { } func (b *buffer) split(n int) (Buffer, Buffer) { - if b.rootBuf == nil || b.rootBuf.refs.Add(1) <= 1 { + if b.refs == nil { panic("Cannot split freed buffer") } + b.refs.Add(1) split := newBuffer() + split.origData = b.origData split.data = b.data[n:] - split.rootBuf = b.rootBuf - split.refs.Store(1) + split.refs = b.refs + split.pool = b.pool b.data = b.data[:n] @@ -196,7 +187,7 @@ func (b *buffer) split(n int) (Buffer, Buffer) { } func (b *buffer) read(buf []byte) (int, Buffer) { - if b.rootBuf == nil { + if b.refs == nil { panic("Cannot read freed buffer") } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/resolver/resolver.go b/openshift/tests-extension/vendor/google.golang.org/grpc/resolver/resolver.go index 598ed21a2..8e6af9514 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/resolver/resolver.go @@ -182,7 +182,6 @@ type BuildOptions struct { // An Endpoint is one network endpoint, or server, which may have multiple // addresses with which it can be accessed. -// TODO(i/8773) : make resolver.Endpoint and resolver.Address immutable type Endpoint struct { // Addresses contains a list of addresses used to access this endpoint. Addresses []Address diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/server.go b/openshift/tests-extension/vendor/google.golang.org/grpc/server.go index 1b5cefe81..ddd377341 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/server.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/server.go @@ -923,7 +923,9 @@ func (s *Server) Serve(lis net.Listener) error { tempDelay = 5 * time.Millisecond } else { tempDelay *= 2 - tempDelay = min(tempDelay, 1*time.Second) + } + if max := 1 * time.Second; tempDelay > max { + tempDelay = max } s.mu.Lock() s.printf("Accept error: %v; retrying in %v", err, tempDelay) diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/stream.go b/openshift/tests-extension/vendor/google.golang.org/grpc/stream.go index f92102fb4..ec9577b27 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/stream.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/stream.go @@ -52,8 +52,7 @@ import ( var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // StreamHandler defines the handler called by gRPC server to complete the -// execution of a streaming RPC. srv is the service implementation on which the -// RPC was invoked. +// execution of a streaming RPC. // // If a StreamHandler returns an error, it should either be produced by the // status package, or be one of the context errors. Otherwise, gRPC will use @@ -538,16 +537,8 @@ func (a *csAttempt) newStream() error { md, _ := metadata.FromOutgoingContext(a.ctx) md = metadata.Join(md, a.pickResult.Metadata) a.ctx = metadata.NewOutgoingContext(a.ctx, md) - - // If the `CallAuthority` CallOption is not set, check if the LB picker - // has provided an authority override in the PickResult metadata and - // apply it, as specified in gRFC A81. - if cs.callInfo.authority == "" { - if authMD := a.pickResult.Metadata.Get(":authority"); len(authMD) > 0 { - cs.callHdr.Authority = authMD[0] - } - } } + s, err := a.transport.NewStream(a.ctx, cs.callHdr) if err != nil { nse, ok := err.(*transport.NewStreamError) @@ -1350,7 +1341,6 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin codec: c.codec, sendCompressorV0: cp, sendCompressorV1: comp, - decompressorV0: ac.cc.dopts.dc, transport: t, } diff --git a/openshift/tests-extension/vendor/google.golang.org/grpc/version.go b/openshift/tests-extension/vendor/google.golang.org/grpc/version.go index c1225b910..ff7840fd8 100644 --- a/openshift/tests-extension/vendor/google.golang.org/grpc/version.go +++ b/openshift/tests-extension/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.79.1" +const Version = "1.78.0" diff --git a/openshift/tests-extension/vendor/modules.txt b/openshift/tests-extension/vendor/modules.txt index 794524a27..7c331a3b8 100644 --- a/openshift/tests-extension/vendor/modules.txt +++ b/openshift/tests-extension/vendor/modules.txt @@ -138,7 +138,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/pprof v0.0.0-20260202012954-cb029daf43ef +# github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 ## explicit; go 1.24.0 github.com/google/pprof/profile # github.com/google/uuid v1.6.0 @@ -147,7 +147,7 @@ github.com/google/uuid # github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 ## explicit; go 1.20 github.com/gorilla/websocket -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 ## explicit; go 1.24.0 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime @@ -177,7 +177,7 @@ github.com/munnerz/goautoneg # github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f ## explicit github.com/mxk/go-flowrate/flowrate -# github.com/onsi/ginkgo/v2 v2.28.1 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20250416174521-4eb003743b54 +# github.com/onsi/ginkgo/v2 v2.28.0 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20250416174521-4eb003743b54 ## explicit; go 1.22.0 github.com/onsi/ginkgo/v2 github.com/onsi/ginkgo/v2/config @@ -216,7 +216,7 @@ github.com/onsi/gomega/types # github.com/opencontainers/go-digest v1.0.0 ## explicit; go 1.13 github.com/opencontainers/go-digest -# github.com/openshift-eng/openshift-tests-extension v0.0.0-20260127124016-0fed2b824818 +# github.com/openshift-eng/openshift-tests-extension v0.0.0-20251105193959-75a0be5d9bd7 ## explicit; go 1.23.0 github.com/openshift-eng/openshift-tests-extension/pkg/cmd github.com/openshift-eng/openshift-tests-extension/pkg/cmd/cmdimages @@ -232,7 +232,7 @@ github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo github.com/openshift-eng/openshift-tests-extension/pkg/junit github.com/openshift-eng/openshift-tests-extension/pkg/util/sets github.com/openshift-eng/openshift-tests-extension/pkg/version -# github.com/openshift/api v0.0.0-20260226164249-f733385bc39e +# github.com/openshift/api v0.0.0-20260128000234-c16ec2bcf089 ## explicit; go 1.24.0 github.com/openshift/api/build/v1 github.com/openshift/api/config/v1 @@ -247,7 +247,7 @@ github.com/openshift/api/operator/v1 github.com/openshift/api/project/v1 github.com/openshift/api/security/v1 github.com/openshift/api/user/v1 -# github.com/openshift/client-go v0.0.0-20260226152647-d8b2196ff0d9 +# github.com/openshift/client-go v0.0.0-20260108185524-48f4ccfc4e13 ## explicit; go 1.24.0 github.com/openshift/client-go/config/applyconfigurations/config/v1 github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1 @@ -326,7 +326,7 @@ github.com/spf13/pflag # github.com/tidwall/gjson v1.18.0 ## explicit; go 1.12 github.com/tidwall/gjson -# github.com/tidwall/match v1.2.0 +# github.com/tidwall/match v1.1.1 ## explicit; go 1.15 github.com/tidwall/match # github.com/tidwall/pretty v1.2.1 @@ -415,11 +415,11 @@ golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 golang.org/x/crypto/ssh golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -# golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa -## explicit; go 1.25.0 +# golang.org/x/exp v0.0.0-20260209203927-2842357ff358 +## explicit; go 1.24.0 golang.org/x/exp/slices -# golang.org/x/net v0.51.0 -## explicit; go 1.25.0 +# golang.org/x/net v0.50.0 +## explicit; go 1.24.0 golang.org/x/net/context golang.org/x/net/html golang.org/x/net/html/atom @@ -490,15 +490,15 @@ golang.org/x/time/rate golang.org/x/tools/cover golang.org/x/tools/go/ast/edge golang.org/x/tools/go/ast/inspector -# google.golang.org/genproto/googleapis/api v0.0.0-20260223185530-2f722ef697dc -## explicit; go 1.25.0 +# google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 +## explicit; go 1.24.0 google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20260223185530-2f722ef697dc -## explicit; go 1.25.0 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 +## explicit; go 1.24.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.79.1 +# google.golang.org/grpc v1.78.0 ## explicit; go 1.24.0 google.golang.org/grpc google.golang.org/grpc/attributes @@ -527,7 +527,6 @@ google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancer/gracefulswitch -google.golang.org/grpc/internal/balancer/weight google.golang.org/grpc/internal/balancerload google.golang.org/grpc/internal/binarylog google.golang.org/grpc/internal/buffer @@ -620,7 +619,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/api v0.0.0-20251108023427-891f5bb03061 +# k8s.io/api v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/api v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -681,7 +680,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/apiextensions-apiserver v0.0.0-20251108023427-891f5bb03061 +# k8s.io/apiextensions-apiserver v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/apiextensions-apiserver v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 @@ -693,7 +692,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/features -# k8s.io/apimachinery v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/apimachinery v0.0.0-20251108023427-891f5bb03061 +# k8s.io/apimachinery v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/apimachinery v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -763,7 +762,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20251108023427-891f5bb03061 +# k8s.io/apiserver v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/apiserver v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration @@ -815,7 +814,7 @@ k8s.io/apiserver/pkg/util/feature k8s.io/apiserver/pkg/util/webhook k8s.io/apiserver/pkg/util/x509metrics k8s.io/apiserver/pkg/warning -# k8s.io/client-go v1.5.2 => github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20251108023427-891f5bb03061 +# k8s.io/client-go v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/client-go v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -1105,7 +1104,7 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/component-base v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/component-base v0.0.0-20251108023427-891f5bb03061 +# k8s.io/component-base v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/component-base v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/component-base/cli/flag k8s.io/component-base/compatibility @@ -1125,13 +1124,13 @@ k8s.io/component-base/tracing k8s.io/component-base/tracing/api/v1 k8s.io/component-base/version k8s.io/component-base/zpages/features -# k8s.io/component-helpers v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/component-helpers v0.0.0-20251108023427-891f5bb03061 +# k8s.io/component-helpers v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/component-helpers v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/component-helpers/node/util/sysctl k8s.io/component-helpers/resource k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity -# k8s.io/controller-manager v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/controller-manager v0.0.0-20251108023427-891f5bb03061 +# k8s.io/controller-manager v0.33.2 => github.com/openshift/kubernetes/staging/src/k8s.io/controller-manager v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/controller-manager/pkg/features # k8s.io/klog/v2 v2.130.1 @@ -1161,15 +1160,15 @@ k8s.io/kube-openapi/pkg/validation/errors k8s.io/kube-openapi/pkg/validation/spec k8s.io/kube-openapi/pkg/validation/strfmt k8s.io/kube-openapi/pkg/validation/strfmt/bson -# k8s.io/kubectl v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/kubectl v0.0.0-20251108023427-891f5bb03061 +# k8s.io/kubectl v0.35.0 => github.com/openshift/kubernetes/staging/src/k8s.io/kubectl v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/kubectl/pkg/scale k8s.io/kubectl/pkg/util/podutils -# k8s.io/kubelet v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/kubelet v0.0.0-20251108023427-891f5bb03061 +# k8s.io/kubelet v0.31.1 => github.com/openshift/kubernetes/staging/src/k8s.io/kubelet v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/kubelet/pkg/apis k8s.io/kubelet/pkg/apis/stats/v1alpha1 -# k8s.io/kubernetes v1.35.1 => github.com/openshift/kubernetes v0.0.0-20251108023427-891f5bb03061 +# k8s.io/kubernetes v1.35.0 => github.com/openshift/kubernetes v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/service @@ -1215,11 +1214,11 @@ k8s.io/kubernetes/test/utils k8s.io/kubernetes/test/utils/format k8s.io/kubernetes/test/utils/image k8s.io/kubernetes/test/utils/kubeconfig -# k8s.io/pod-security-admission v0.35.1 => github.com/openshift/kubernetes/staging/src/k8s.io/pod-security-admission v0.0.0-20251108023427-891f5bb03061 +# k8s.io/pod-security-admission v0.33.4 => github.com/openshift/kubernetes/staging/src/k8s.io/pod-security-admission v0.0.0-20251108023427-891f5bb03061 ## explicit; go 1.24.0 k8s.io/pod-security-admission/api k8s.io/pod-security-admission/policy -# k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 +# k8s.io/utils v0.0.0-20260108192941-914a6e750570 ## explicit; go 1.23 k8s.io/utils/buffer k8s.io/utils/clock diff --git a/requirements.txt b/requirements.txt index b8191c0f2..d9c3df5c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,9 +19,9 @@ mkdocs-material-extensions==1.3.1 packaging==26.0 paginate==0.5.7 pathspec==1.0.4 -platformdirs==4.6.0 +platformdirs==4.9.2 Pygments==2.19.2 -pymdown-extensions==10.20.1 +pymdown-extensions==10.21 pyquery==2.0.1 python-dateutil==2.9.0.post0 PyYAML==6.0.3 diff --git a/test/e2e/features/install.feature b/test/e2e/features/install.feature index d0541c9f1..ce3fb3430 100644 --- a/test/e2e/features/install.feature +++ b/test/e2e/features/install.feature @@ -500,3 +500,38 @@ Feature: Install ClusterExtension And ClusterExtension is available And ClusterExtensionRevision "${NAME}-1" has label "olm.operatorframework.io/owner-kind" with value "ClusterExtension" And ClusterExtensionRevision "${NAME}-1" has label "olm.operatorframework.io/owner-name" with value "${NAME}" + + @DeploymentConfig + Scenario: deploymentConfig nodeSelector is applied to the operator deployment + When ClusterExtension is applied + """ + apiVersion: olm.operatorframework.io/v1 + kind: ClusterExtension + metadata: + name: ${NAME} + spec: + namespace: ${TEST_NAMESPACE} + serviceAccount: + name: olm-sa + config: + configType: Inline + inline: + deploymentConfig: + nodeSelector: + kubernetes.io/os: linux + source: + sourceType: Catalog + catalog: + packageName: test + selector: + matchLabels: + "olm.operatorframework.io/metadata.name": test-catalog + """ + Then resource "deployment/test-operator" matches + """ + spec: + template: + spec: + nodeSelector: + kubernetes.io/os: linux + """ diff --git a/test/e2e/steps/hooks.go b/test/e2e/steps/hooks.go index 7bea8d230..929138046 100644 --- a/test/e2e/steps/hooks.go +++ b/test/e2e/steps/hooks.go @@ -71,6 +71,7 @@ var ( features.WebhookProviderOpenshiftServiceCA: false, features.HelmChartSupport: false, features.BoxcutterRuntime: false, + features.DeploymentConfig: false, } logger logr.Logger ) diff --git a/vendor/modules.txt b/vendor/modules.txt index bad7ffd47..317a5865e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2043,7 +2043,7 @@ sigs.k8s.io/controller-runtime/pkg/webhook/admission/metrics sigs.k8s.io/controller-runtime/pkg/webhook/conversion sigs.k8s.io/controller-runtime/pkg/webhook/conversion/metrics sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics -# sigs.k8s.io/controller-tools v0.20.0 +# sigs.k8s.io/controller-tools v0.20.1 ## explicit; go 1.25.0 sigs.k8s.io/controller-tools/pkg/crd sigs.k8s.io/controller-tools/pkg/crd/markers