diff --git a/config/applyconfigurations/config/v1/extramapping.go b/config/applyconfigurations/config/v1/extramapping.go new file mode 100644 index 0000000000..4100ed7ed3 --- /dev/null +++ b/config/applyconfigurations/config/v1/extramapping.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ExtraMappingApplyConfiguration represents a declarative configuration of the ExtraMapping type for use +// with apply. +type ExtraMappingApplyConfiguration struct { + Key *string `json:"key,omitempty"` + ValueExpression *string `json:"valueExpression,omitempty"` +} + +// ExtraMappingApplyConfiguration constructs a declarative configuration of the ExtraMapping type for use with +// apply. +func ExtraMapping() *ExtraMappingApplyConfiguration { + return &ExtraMappingApplyConfiguration{} +} + +// WithKey sets the Key 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 Key field is set to the value of the last call. +func (b *ExtraMappingApplyConfiguration) WithKey(value string) *ExtraMappingApplyConfiguration { + b.Key = &value + return b +} + +// WithValueExpression sets the ValueExpression 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 ValueExpression field is set to the value of the last call. +func (b *ExtraMappingApplyConfiguration) WithValueExpression(value string) *ExtraMappingApplyConfiguration { + b.ValueExpression = &value + return b +} diff --git a/config/applyconfigurations/config/v1/tokenclaimmappings.go b/config/applyconfigurations/config/v1/tokenclaimmappings.go index 9b3b0bb561..c748c31115 100644 --- a/config/applyconfigurations/config/v1/tokenclaimmappings.go +++ b/config/applyconfigurations/config/v1/tokenclaimmappings.go @@ -5,8 +5,10 @@ package v1 // TokenClaimMappingsApplyConfiguration represents a declarative configuration of the TokenClaimMappings type for use // with apply. type TokenClaimMappingsApplyConfiguration struct { - Username *UsernameClaimMappingApplyConfiguration `json:"username,omitempty"` - Groups *PrefixedClaimMappingApplyConfiguration `json:"groups,omitempty"` + Username *UsernameClaimMappingApplyConfiguration `json:"username,omitempty"` + Groups *PrefixedClaimMappingApplyConfiguration `json:"groups,omitempty"` + UID *TokenClaimOrExpressionMappingApplyConfiguration `json:"uid,omitempty"` + Extra []ExtraMappingApplyConfiguration `json:"extra,omitempty"` } // TokenClaimMappingsApplyConfiguration constructs a declarative configuration of the TokenClaimMappings type for use with @@ -30,3 +32,24 @@ func (b *TokenClaimMappingsApplyConfiguration) WithGroups(value *PrefixedClaimMa b.Groups = 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 *TokenClaimMappingsApplyConfiguration) WithUID(value *TokenClaimOrExpressionMappingApplyConfiguration) *TokenClaimMappingsApplyConfiguration { + b.UID = value + return b +} + +// WithExtra adds the given value to the Extra 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 Extra field. +func (b *TokenClaimMappingsApplyConfiguration) WithExtra(values ...*ExtraMappingApplyConfiguration) *TokenClaimMappingsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExtra") + } + b.Extra = append(b.Extra, *values[i]) + } + return b +} diff --git a/config/applyconfigurations/config/v1/tokenclaimorexpressionmapping.go b/config/applyconfigurations/config/v1/tokenclaimorexpressionmapping.go new file mode 100644 index 0000000000..6aab9e0b5d --- /dev/null +++ b/config/applyconfigurations/config/v1/tokenclaimorexpressionmapping.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// TokenClaimOrExpressionMappingApplyConfiguration represents a declarative configuration of the TokenClaimOrExpressionMapping type for use +// with apply. +type TokenClaimOrExpressionMappingApplyConfiguration struct { + Claim *string `json:"claim,omitempty"` + Expression *string `json:"expression,omitempty"` +} + +// TokenClaimOrExpressionMappingApplyConfiguration constructs a declarative configuration of the TokenClaimOrExpressionMapping type for use with +// apply. +func TokenClaimOrExpressionMapping() *TokenClaimOrExpressionMappingApplyConfiguration { + return &TokenClaimOrExpressionMappingApplyConfiguration{} +} + +// WithClaim sets the Claim 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 Claim field is set to the value of the last call. +func (b *TokenClaimOrExpressionMappingApplyConfiguration) WithClaim(value string) *TokenClaimOrExpressionMappingApplyConfiguration { + b.Claim = &value + return b +} + +// 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 *TokenClaimOrExpressionMappingApplyConfiguration) WithExpression(value string) *TokenClaimOrExpressionMappingApplyConfiguration { + b.Expression = &value + return b +} diff --git a/config/applyconfigurations/internal/internal.go b/config/applyconfigurations/internal/internal.go index 636d305052..e578bc152c 100644 --- a/config/applyconfigurations/internal/internal.go +++ b/config/applyconfigurations/internal/internal.go @@ -1175,6 +1175,17 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: com.github.openshift.api.config.v1.CloudControllerManagerStatus default: {} +- name: com.github.openshift.api.config.v1.ExtraMapping + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: valueExpression + type: + scalar: string + default: "" - name: com.github.openshift.api.config.v1.FeatureGate map: fields: @@ -3318,14 +3329,34 @@ var schemaYAML = typed.YAMLObject(`types: - name: com.github.openshift.api.config.v1.TokenClaimMappings map: fields: + - name: extra + type: + list: + elementType: + namedType: com.github.openshift.api.config.v1.ExtraMapping + elementRelationship: associative + keys: + - key - name: groups type: namedType: com.github.openshift.api.config.v1.PrefixedClaimMapping default: {} + - name: uid + type: + namedType: com.github.openshift.api.config.v1.TokenClaimOrExpressionMapping - name: username type: namedType: com.github.openshift.api.config.v1.UsernameClaimMapping default: {} +- name: com.github.openshift.api.config.v1.TokenClaimOrExpressionMapping + map: + fields: + - name: claim + type: + scalar: string + - name: expression + type: + scalar: string - name: com.github.openshift.api.config.v1.TokenClaimValidationRule map: fields: diff --git a/config/applyconfigurations/utils.go b/config/applyconfigurations/utils.go index 18d3cef133..71ed6464c4 100644 --- a/config/applyconfigurations/utils.go +++ b/config/applyconfigurations/utils.go @@ -148,6 +148,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &configv1.ExternalPlatformSpecApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ExternalPlatformStatus"): return &configv1.ExternalPlatformStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ExtraMapping"): + return &configv1.ExtraMappingApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("FeatureGate"): return &configv1.FeatureGateApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("FeatureGateAttributes"): @@ -376,6 +378,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &configv1.TokenClaimMappingApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("TokenClaimMappings"): return &configv1.TokenClaimMappingsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("TokenClaimOrExpressionMapping"): + return &configv1.TokenClaimOrExpressionMappingApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("TokenClaimValidationRule"): return &configv1.TokenClaimValidationRuleApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("TokenConfig"): diff --git a/go.mod b/go.mod index d59a03e5a8..94eb139104 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.0 toolchain go1.23.3 require ( - github.com/openshift/api v0.0.0-20250402094343-3d7abe90f97e + github.com/openshift/api v0.0.0-20250425163235-9b80d67473bc github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660 github.com/spf13/pflag v1.0.5 k8s.io/api v0.32.3 diff --git a/go.sum b/go.sum index 02c99f59ea..db18213d04 100644 --- a/go.sum +++ b/go.sum @@ -61,8 +61,8 @@ github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= -github.com/openshift/api v0.0.0-20250402094343-3d7abe90f97e h1:+nJrGJMAhBH8yhXe7u3z44IWA/kHtzgjmpOAry+aeb4= -github.com/openshift/api v0.0.0-20250402094343-3d7abe90f97e/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw= +github.com/openshift/api v0.0.0-20250425163235-9b80d67473bc h1:BGKjHtYzBweOSu1UwTnNqtPbJZ4VzOTqVFlUDpP+6U8= +github.com/openshift/api v0.0.0-20250425163235-9b80d67473bc/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw= github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660 h1:F0zE2bmdVvaEd18VXuGYQdJJ1FYJu4MIDW9PYZWc9No= github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/machineconfiguration/applyconfigurations/internal/internal.go b/machineconfiguration/applyconfigurations/internal/internal.go index a71b069083..353e64e1ec 100644 --- a/machineconfiguration/applyconfigurations/internal/internal.go +++ b/machineconfiguration/applyconfigurations/internal/internal.go @@ -63,6 +63,16 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: __untyped_deduced_ elementRelationship: separable +- name: com.github.openshift.api.machineconfiguration.v1.MachineConfigNode + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable - name: com.github.openshift.api.machineconfiguration.v1.MachineConfigPool scalar: untyped list: diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignode.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignode.go new file mode 100644 index 0000000000..1f55801861 --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignode.go @@ -0,0 +1,246 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + internal "github.com/openshift/client-go/machineconfiguration/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineConfigNodeApplyConfiguration represents a declarative configuration of the MachineConfigNode type for use +// with apply. +type MachineConfigNodeApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MachineConfigNodeSpecApplyConfiguration `json:"spec,omitempty"` + Status *MachineConfigNodeStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachineConfigNode constructs a declarative configuration of the MachineConfigNode type for use with +// apply. +func MachineConfigNode(name string) *MachineConfigNodeApplyConfiguration { + b := &MachineConfigNodeApplyConfiguration{} + b.WithName(name) + b.WithKind("MachineConfigNode") + b.WithAPIVersion("machineconfiguration.openshift.io/v1") + return b +} + +// ExtractMachineConfigNode extracts the applied configuration owned by fieldManager from +// machineConfigNode. If no managedFields are found in machineConfigNode for fieldManager, a +// MachineConfigNodeApplyConfiguration 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. +// machineConfigNode must be a unmodified MachineConfigNode API object that was retrieved from the Kubernetes API. +// ExtractMachineConfigNode 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 ExtractMachineConfigNode(machineConfigNode *machineconfigurationv1.MachineConfigNode, fieldManager string) (*MachineConfigNodeApplyConfiguration, error) { + return extractMachineConfigNode(machineConfigNode, fieldManager, "") +} + +// ExtractMachineConfigNodeStatus is the same as ExtractMachineConfigNode except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMachineConfigNodeStatus(machineConfigNode *machineconfigurationv1.MachineConfigNode, fieldManager string) (*MachineConfigNodeApplyConfiguration, error) { + return extractMachineConfigNode(machineConfigNode, fieldManager, "status") +} + +func extractMachineConfigNode(machineConfigNode *machineconfigurationv1.MachineConfigNode, fieldManager string, subresource string) (*MachineConfigNodeApplyConfiguration, error) { + b := &MachineConfigNodeApplyConfiguration{} + err := managedfields.ExtractInto(machineConfigNode, internal.Parser().Type("com.github.openshift.api.machineconfiguration.v1.MachineConfigNode"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(machineConfigNode.Name) + + b.WithKind("MachineConfigNode") + b.WithAPIVersion("machineconfiguration.openshift.io/v1") + return b, nil +} + +// 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 *MachineConfigNodeApplyConfiguration) WithKind(value string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithAPIVersion(value string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithName(value string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithGenerateName(value string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithNamespace(value string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithUID(value types.UID) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithResourceVersion(value string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithGeneration(value int64) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithLabels(entries map[string]string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithAnnotations(entries map[string]string) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithFinalizers(values ...string) *MachineConfigNodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *MachineConfigNodeApplyConfiguration) 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 *MachineConfigNodeApplyConfiguration) WithSpec(value *MachineConfigNodeSpecApplyConfiguration) *MachineConfigNodeApplyConfiguration { + 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 *MachineConfigNodeApplyConfiguration) WithStatus(value *MachineConfigNodeStatusApplyConfiguration) *MachineConfigNodeApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineConfigNodeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodespec.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodespec.go new file mode 100644 index 0000000000..d1e04cef84 --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodespec.go @@ -0,0 +1,41 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// MachineConfigNodeSpecApplyConfiguration represents a declarative configuration of the MachineConfigNodeSpec type for use +// with apply. +type MachineConfigNodeSpecApplyConfiguration struct { + Node *MCOObjectReferenceApplyConfiguration `json:"node,omitempty"` + Pool *MCOObjectReferenceApplyConfiguration `json:"pool,omitempty"` + ConfigVersion *MachineConfigNodeSpecMachineConfigVersionApplyConfiguration `json:"configVersion,omitempty"` +} + +// MachineConfigNodeSpecApplyConfiguration constructs a declarative configuration of the MachineConfigNodeSpec type for use with +// apply. +func MachineConfigNodeSpec() *MachineConfigNodeSpecApplyConfiguration { + return &MachineConfigNodeSpecApplyConfiguration{} +} + +// WithNode sets the Node 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 Node field is set to the value of the last call. +func (b *MachineConfigNodeSpecApplyConfiguration) WithNode(value *MCOObjectReferenceApplyConfiguration) *MachineConfigNodeSpecApplyConfiguration { + b.Node = value + return b +} + +// WithPool sets the Pool 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 Pool field is set to the value of the last call. +func (b *MachineConfigNodeSpecApplyConfiguration) WithPool(value *MCOObjectReferenceApplyConfiguration) *MachineConfigNodeSpecApplyConfiguration { + b.Pool = value + return b +} + +// WithConfigVersion sets the ConfigVersion 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 ConfigVersion field is set to the value of the last call. +func (b *MachineConfigNodeSpecApplyConfiguration) WithConfigVersion(value *MachineConfigNodeSpecMachineConfigVersionApplyConfiguration) *MachineConfigNodeSpecApplyConfiguration { + b.ConfigVersion = value + return b +} diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodespecmachineconfigversion.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodespecmachineconfigversion.go new file mode 100644 index 0000000000..3657f3352f --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodespecmachineconfigversion.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// MachineConfigNodeSpecMachineConfigVersionApplyConfiguration represents a declarative configuration of the MachineConfigNodeSpecMachineConfigVersion type for use +// with apply. +type MachineConfigNodeSpecMachineConfigVersionApplyConfiguration struct { + Desired *string `json:"desired,omitempty"` +} + +// MachineConfigNodeSpecMachineConfigVersionApplyConfiguration constructs a declarative configuration of the MachineConfigNodeSpecMachineConfigVersion type for use with +// apply. +func MachineConfigNodeSpecMachineConfigVersion() *MachineConfigNodeSpecMachineConfigVersionApplyConfiguration { + return &MachineConfigNodeSpecMachineConfigVersionApplyConfiguration{} +} + +// WithDesired sets the Desired 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 Desired field is set to the value of the last call. +func (b *MachineConfigNodeSpecMachineConfigVersionApplyConfiguration) WithDesired(value string) *MachineConfigNodeSpecMachineConfigVersionApplyConfiguration { + b.Desired = &value + return b +} diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatus.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatus.go new file mode 100644 index 0000000000..abfc04d09c --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatus.go @@ -0,0 +1,64 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineConfigNodeStatusApplyConfiguration represents a declarative configuration of the MachineConfigNodeStatus type for use +// with apply. +type MachineConfigNodeStatusApplyConfiguration struct { + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + ConfigVersion *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration `json:"configVersion,omitempty"` + PinnedImageSets []MachineConfigNodeStatusPinnedImageSetApplyConfiguration `json:"pinnedImageSets,omitempty"` +} + +// MachineConfigNodeStatusApplyConfiguration constructs a declarative configuration of the MachineConfigNodeStatus type for use with +// apply. +func MachineConfigNodeStatus() *MachineConfigNodeStatusApplyConfiguration { + return &MachineConfigNodeStatusApplyConfiguration{} +} + +// 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 *MachineConfigNodeStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *MachineConfigNodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call. +func (b *MachineConfigNodeStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineConfigNodeStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithConfigVersion sets the ConfigVersion 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 ConfigVersion field is set to the value of the last call. +func (b *MachineConfigNodeStatusApplyConfiguration) WithConfigVersion(value *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration) *MachineConfigNodeStatusApplyConfiguration { + b.ConfigVersion = value + return b +} + +// WithPinnedImageSets adds the given value to the PinnedImageSets 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 PinnedImageSets field. +func (b *MachineConfigNodeStatusApplyConfiguration) WithPinnedImageSets(values ...*MachineConfigNodeStatusPinnedImageSetApplyConfiguration) *MachineConfigNodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPinnedImageSets") + } + b.PinnedImageSets = append(b.PinnedImageSets, *values[i]) + } + return b +} diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatusmachineconfigversion.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatusmachineconfigversion.go new file mode 100644 index 0000000000..1b6276d9a2 --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatusmachineconfigversion.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// MachineConfigNodeStatusMachineConfigVersionApplyConfiguration represents a declarative configuration of the MachineConfigNodeStatusMachineConfigVersion type for use +// with apply. +type MachineConfigNodeStatusMachineConfigVersionApplyConfiguration struct { + Current *string `json:"current,omitempty"` + Desired *string `json:"desired,omitempty"` +} + +// MachineConfigNodeStatusMachineConfigVersionApplyConfiguration constructs a declarative configuration of the MachineConfigNodeStatusMachineConfigVersion type for use with +// apply. +func MachineConfigNodeStatusMachineConfigVersion() *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration { + return &MachineConfigNodeStatusMachineConfigVersionApplyConfiguration{} +} + +// WithCurrent sets the Current 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 Current field is set to the value of the last call. +func (b *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration) WithCurrent(value string) *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration { + b.Current = &value + return b +} + +// WithDesired sets the Desired 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 Desired field is set to the value of the last call. +func (b *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration) WithDesired(value string) *MachineConfigNodeStatusMachineConfigVersionApplyConfiguration { + b.Desired = &value + return b +} diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatuspinnedimageset.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatuspinnedimageset.go new file mode 100644 index 0000000000..35af400461 --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfignodestatuspinnedimageset.go @@ -0,0 +1,59 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// MachineConfigNodeStatusPinnedImageSetApplyConfiguration represents a declarative configuration of the MachineConfigNodeStatusPinnedImageSet type for use +// with apply. +type MachineConfigNodeStatusPinnedImageSetApplyConfiguration struct { + Name *string `json:"name,omitempty"` + CurrentGeneration *int32 `json:"currentGeneration,omitempty"` + DesiredGeneration *int32 `json:"desiredGeneration,omitempty"` + LastFailedGeneration *int32 `json:"lastFailedGeneration,omitempty"` + LastFailedGenerationError *string `json:"lastFailedGenerationError,omitempty"` +} + +// MachineConfigNodeStatusPinnedImageSetApplyConfiguration constructs a declarative configuration of the MachineConfigNodeStatusPinnedImageSet type for use with +// apply. +func MachineConfigNodeStatusPinnedImageSet() *MachineConfigNodeStatusPinnedImageSetApplyConfiguration { + return &MachineConfigNodeStatusPinnedImageSetApplyConfiguration{} +} + +// 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 *MachineConfigNodeStatusPinnedImageSetApplyConfiguration) WithName(value string) *MachineConfigNodeStatusPinnedImageSetApplyConfiguration { + b.Name = &value + return b +} + +// WithCurrentGeneration sets the CurrentGeneration 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 CurrentGeneration field is set to the value of the last call. +func (b *MachineConfigNodeStatusPinnedImageSetApplyConfiguration) WithCurrentGeneration(value int32) *MachineConfigNodeStatusPinnedImageSetApplyConfiguration { + b.CurrentGeneration = &value + return b +} + +// WithDesiredGeneration sets the DesiredGeneration 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 DesiredGeneration field is set to the value of the last call. +func (b *MachineConfigNodeStatusPinnedImageSetApplyConfiguration) WithDesiredGeneration(value int32) *MachineConfigNodeStatusPinnedImageSetApplyConfiguration { + b.DesiredGeneration = &value + return b +} + +// WithLastFailedGeneration sets the LastFailedGeneration 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 LastFailedGeneration field is set to the value of the last call. +func (b *MachineConfigNodeStatusPinnedImageSetApplyConfiguration) WithLastFailedGeneration(value int32) *MachineConfigNodeStatusPinnedImageSetApplyConfiguration { + b.LastFailedGeneration = &value + return b +} + +// WithLastFailedGenerationError sets the LastFailedGenerationError 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 LastFailedGenerationError field is set to the value of the last call. +func (b *MachineConfigNodeStatusPinnedImageSetApplyConfiguration) WithLastFailedGenerationError(value string) *MachineConfigNodeStatusPinnedImageSetApplyConfiguration { + b.LastFailedGenerationError = &value + return b +} diff --git a/machineconfiguration/applyconfigurations/machineconfiguration/v1/mcoobjectreference.go b/machineconfiguration/applyconfigurations/machineconfiguration/v1/mcoobjectreference.go new file mode 100644 index 0000000000..a8101be272 --- /dev/null +++ b/machineconfiguration/applyconfigurations/machineconfiguration/v1/mcoobjectreference.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// MCOObjectReferenceApplyConfiguration represents a declarative configuration of the MCOObjectReference type for use +// with apply. +type MCOObjectReferenceApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// MCOObjectReferenceApplyConfiguration constructs a declarative configuration of the MCOObjectReference type for use with +// apply. +func MCOObjectReference() *MCOObjectReferenceApplyConfiguration { + return &MCOObjectReferenceApplyConfiguration{} +} + +// 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 *MCOObjectReferenceApplyConfiguration) WithName(value string) *MCOObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/machineconfiguration/applyconfigurations/utils.go b/machineconfiguration/applyconfigurations/utils.go index 39a58728ce..8bd1942b5f 100644 --- a/machineconfiguration/applyconfigurations/utils.go +++ b/machineconfiguration/applyconfigurations/utils.go @@ -54,6 +54,18 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &machineconfigurationv1.KubeletConfigStatusApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MachineConfig"): return &machineconfigurationv1.MachineConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MachineConfigNode"): + return &machineconfigurationv1.MachineConfigNodeApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MachineConfigNodeSpec"): + return &machineconfigurationv1.MachineConfigNodeSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MachineConfigNodeSpecMachineConfigVersion"): + return &machineconfigurationv1.MachineConfigNodeSpecMachineConfigVersionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MachineConfigNodeStatus"): + return &machineconfigurationv1.MachineConfigNodeStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MachineConfigNodeStatusMachineConfigVersion"): + return &machineconfigurationv1.MachineConfigNodeStatusMachineConfigVersionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MachineConfigNodeStatusPinnedImageSet"): + return &machineconfigurationv1.MachineConfigNodeStatusPinnedImageSetApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MachineConfigPool"): return &machineconfigurationv1.MachineConfigPoolApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MachineConfigPoolCondition"): @@ -90,6 +102,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &machineconfigurationv1.MachineOSContainerfileApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("MachineOSImageBuilder"): return &machineconfigurationv1.MachineOSImageBuilderApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("MCOObjectReference"): + return &machineconfigurationv1.MCOObjectReferenceApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("NetworkInfo"): return &machineconfigurationv1.NetworkInfoApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ObjectReference"): diff --git a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfignode.go b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfignode.go new file mode 100644 index 0000000000..ec68dee9aa --- /dev/null +++ b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfignode.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/machineconfiguration/v1" + machineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1" + typedmachineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeMachineConfigNodes implements MachineConfigNodeInterface +type fakeMachineConfigNodes struct { + *gentype.FakeClientWithListAndApply[*v1.MachineConfigNode, *v1.MachineConfigNodeList, *machineconfigurationv1.MachineConfigNodeApplyConfiguration] + Fake *FakeMachineconfigurationV1 +} + +func newFakeMachineConfigNodes(fake *FakeMachineconfigurationV1) typedmachineconfigurationv1.MachineConfigNodeInterface { + return &fakeMachineConfigNodes{ + gentype.NewFakeClientWithListAndApply[*v1.MachineConfigNode, *v1.MachineConfigNodeList, *machineconfigurationv1.MachineConfigNodeApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("machineconfignodes"), + v1.SchemeGroupVersion.WithKind("MachineConfigNode"), + func() *v1.MachineConfigNode { return &v1.MachineConfigNode{} }, + func() *v1.MachineConfigNodeList { return &v1.MachineConfigNodeList{} }, + func(dst, src *v1.MachineConfigNodeList) { dst.ListMeta = src.ListMeta }, + func(list *v1.MachineConfigNodeList) []*v1.MachineConfigNode { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.MachineConfigNodeList, items []*v1.MachineConfigNode) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go index b4ff9502ec..b9000d36c8 100644 --- a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go +++ b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/fake/fake_machineconfiguration_client.go @@ -28,6 +28,10 @@ func (c *FakeMachineconfigurationV1) MachineConfigs() v1.MachineConfigInterface return newFakeMachineConfigs(c) } +func (c *FakeMachineconfigurationV1) MachineConfigNodes() v1.MachineConfigNodeInterface { + return newFakeMachineConfigNodes(c) +} + func (c *FakeMachineconfigurationV1) MachineConfigPools() v1.MachineConfigPoolInterface { return newFakeMachineConfigPools(c) } diff --git a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go index 185b67c3d2..c326255951 100644 --- a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go +++ b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/generated_expansion.go @@ -10,6 +10,8 @@ type KubeletConfigExpansion interface{} type MachineConfigExpansion interface{} +type MachineConfigNodeExpansion interface{} + type MachineConfigPoolExpansion interface{} type MachineOSBuildExpansion interface{} diff --git a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfignode.go b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfignode.go new file mode 100644 index 0000000000..72ea1044cb --- /dev/null +++ b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfignode.go @@ -0,0 +1,60 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + applyconfigurationsmachineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1" + scheme "github.com/openshift/client-go/machineconfiguration/clientset/versioned/scheme" + metav1 "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" +) + +// MachineConfigNodesGetter has a method to return a MachineConfigNodeInterface. +// A group's client should implement this interface. +type MachineConfigNodesGetter interface { + MachineConfigNodes() MachineConfigNodeInterface +} + +// MachineConfigNodeInterface has methods to work with MachineConfigNode resources. +type MachineConfigNodeInterface interface { + Create(ctx context.Context, machineConfigNode *machineconfigurationv1.MachineConfigNode, opts metav1.CreateOptions) (*machineconfigurationv1.MachineConfigNode, error) + Update(ctx context.Context, machineConfigNode *machineconfigurationv1.MachineConfigNode, opts metav1.UpdateOptions) (*machineconfigurationv1.MachineConfigNode, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, machineConfigNode *machineconfigurationv1.MachineConfigNode, opts metav1.UpdateOptions) (*machineconfigurationv1.MachineConfigNode, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*machineconfigurationv1.MachineConfigNode, error) + List(ctx context.Context, opts metav1.ListOptions) (*machineconfigurationv1.MachineConfigNodeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *machineconfigurationv1.MachineConfigNode, err error) + Apply(ctx context.Context, machineConfigNode *applyconfigurationsmachineconfigurationv1.MachineConfigNodeApplyConfiguration, opts metav1.ApplyOptions) (result *machineconfigurationv1.MachineConfigNode, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, machineConfigNode *applyconfigurationsmachineconfigurationv1.MachineConfigNodeApplyConfiguration, opts metav1.ApplyOptions) (result *machineconfigurationv1.MachineConfigNode, err error) + MachineConfigNodeExpansion +} + +// machineConfigNodes implements MachineConfigNodeInterface +type machineConfigNodes struct { + *gentype.ClientWithListAndApply[*machineconfigurationv1.MachineConfigNode, *machineconfigurationv1.MachineConfigNodeList, *applyconfigurationsmachineconfigurationv1.MachineConfigNodeApplyConfiguration] +} + +// newMachineConfigNodes returns a MachineConfigNodes +func newMachineConfigNodes(c *MachineconfigurationV1Client) *machineConfigNodes { + return &machineConfigNodes{ + gentype.NewClientWithListAndApply[*machineconfigurationv1.MachineConfigNode, *machineconfigurationv1.MachineConfigNodeList, *applyconfigurationsmachineconfigurationv1.MachineConfigNodeApplyConfiguration]( + "machineconfignodes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *machineconfigurationv1.MachineConfigNode { return &machineconfigurationv1.MachineConfigNode{} }, + func() *machineconfigurationv1.MachineConfigNodeList { + return &machineconfigurationv1.MachineConfigNodeList{} + }, + ), + } +} diff --git a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go index 10a0351753..ca0d13d589 100644 --- a/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go +++ b/machineconfiguration/clientset/versioned/typed/machineconfiguration/v1/machineconfiguration_client.go @@ -16,6 +16,7 @@ type MachineconfigurationV1Interface interface { ControllerConfigsGetter KubeletConfigsGetter MachineConfigsGetter + MachineConfigNodesGetter MachineConfigPoolsGetter MachineOSBuildsGetter MachineOSConfigsGetter @@ -43,6 +44,10 @@ func (c *MachineconfigurationV1Client) MachineConfigs() MachineConfigInterface { return newMachineConfigs(c) } +func (c *MachineconfigurationV1Client) MachineConfigNodes() MachineConfigNodeInterface { + return newMachineConfigNodes(c) +} + func (c *MachineconfigurationV1Client) MachineConfigPools() MachineConfigPoolInterface { return newMachineConfigPools(c) } diff --git a/machineconfiguration/informers/externalversions/generic.go b/machineconfiguration/informers/externalversions/generic.go index 37deff0dc7..e42238de73 100644 --- a/machineconfiguration/informers/externalversions/generic.go +++ b/machineconfiguration/informers/externalversions/generic.go @@ -46,6 +46,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().KubeletConfigs().Informer()}, nil case v1.SchemeGroupVersion.WithResource("machineconfigs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().MachineConfigs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("machineconfignodes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().MachineConfigNodes().Informer()}, nil case v1.SchemeGroupVersion.WithResource("machineconfigpools"): return &genericInformer{resource: resource.GroupResource(), informer: f.Machineconfiguration().V1().MachineConfigPools().Informer()}, nil case v1.SchemeGroupVersion.WithResource("machineosbuilds"): diff --git a/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go b/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go index e579c5d488..37304154e5 100644 --- a/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go +++ b/machineconfiguration/informers/externalversions/machineconfiguration/v1/interface.go @@ -16,6 +16,8 @@ type Interface interface { KubeletConfigs() KubeletConfigInformer // MachineConfigs returns a MachineConfigInformer. MachineConfigs() MachineConfigInformer + // MachineConfigNodes returns a MachineConfigNodeInformer. + MachineConfigNodes() MachineConfigNodeInformer // MachineConfigPools returns a MachineConfigPoolInformer. MachineConfigPools() MachineConfigPoolInformer // MachineOSBuilds returns a MachineOSBuildInformer. @@ -57,6 +59,11 @@ func (v *version) MachineConfigs() MachineConfigInformer { return &machineConfigInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// MachineConfigNodes returns a MachineConfigNodeInformer. +func (v *version) MachineConfigNodes() MachineConfigNodeInformer { + return &machineConfigNodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // MachineConfigPools returns a MachineConfigPoolInformer. func (v *version) MachineConfigPools() MachineConfigPoolInformer { return &machineConfigPoolInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/machineconfiguration/informers/externalversions/machineconfiguration/v1/machineconfignode.go b/machineconfiguration/informers/externalversions/machineconfiguration/v1/machineconfignode.go new file mode 100644 index 0000000000..8cf5556ad1 --- /dev/null +++ b/machineconfiguration/informers/externalversions/machineconfiguration/v1/machineconfignode.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apimachineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + versioned "github.com/openshift/client-go/machineconfiguration/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machineconfiguration/informers/externalversions/internalinterfaces" + machineconfigurationv1 "github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MachineConfigNodeInformer provides access to a shared informer and lister for +// MachineConfigNodes. +type MachineConfigNodeInformer interface { + Informer() cache.SharedIndexInformer + Lister() machineconfigurationv1.MachineConfigNodeLister +} + +type machineConfigNodeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewMachineConfigNodeInformer constructs a new informer for MachineConfigNode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMachineConfigNodeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineConfigNodeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineConfigNodeInformer constructs a new informer for MachineConfigNode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMachineConfigNodeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineconfigurationV1().MachineConfigNodes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineconfigurationV1().MachineConfigNodes().Watch(context.TODO(), options) + }, + }, + &apimachineconfigurationv1.MachineConfigNode{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineConfigNodeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineConfigNodeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineConfigNodeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apimachineconfigurationv1.MachineConfigNode{}, f.defaultInformer) +} + +func (f *machineConfigNodeInformer) Lister() machineconfigurationv1.MachineConfigNodeLister { + return machineconfigurationv1.NewMachineConfigNodeLister(f.Informer().GetIndexer()) +} diff --git a/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go b/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go index 030325498b..7198dc96be 100644 --- a/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go +++ b/machineconfiguration/listers/machineconfiguration/v1/expansion_generated.go @@ -18,6 +18,10 @@ type KubeletConfigListerExpansion interface{} // MachineConfigLister. type MachineConfigListerExpansion interface{} +// MachineConfigNodeListerExpansion allows custom methods to be added to +// MachineConfigNodeLister. +type MachineConfigNodeListerExpansion interface{} + // MachineConfigPoolListerExpansion allows custom methods to be added to // MachineConfigPoolLister. type MachineConfigPoolListerExpansion interface{} diff --git a/machineconfiguration/listers/machineconfiguration/v1/machineconfignode.go b/machineconfiguration/listers/machineconfiguration/v1/machineconfignode.go new file mode 100644 index 0000000000..79de86fb71 --- /dev/null +++ b/machineconfiguration/listers/machineconfiguration/v1/machineconfignode.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + machineconfigurationv1 "github.com/openshift/api/machineconfiguration/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// MachineConfigNodeLister helps list MachineConfigNodes. +// All objects returned here must be treated as read-only. +type MachineConfigNodeLister interface { + // List lists all MachineConfigNodes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*machineconfigurationv1.MachineConfigNode, err error) + // Get retrieves the MachineConfigNode from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*machineconfigurationv1.MachineConfigNode, error) + MachineConfigNodeListerExpansion +} + +// machineConfigNodeLister implements the MachineConfigNodeLister interface. +type machineConfigNodeLister struct { + listers.ResourceIndexer[*machineconfigurationv1.MachineConfigNode] +} + +// NewMachineConfigNodeLister returns a new MachineConfigNodeLister. +func NewMachineConfigNodeLister(indexer cache.Indexer) MachineConfigNodeLister { + return &machineConfigNodeLister{listers.New[*machineconfigurationv1.MachineConfigNode](indexer, machineconfigurationv1.Resource("machineconfignode"))} +} diff --git a/vendor/github.com/openshift/api/config/v1/types_authentication.go b/vendor/github.com/openshift/api/config/v1/types_authentication.go index a2af4d6544..651d8a2101 100644 --- a/vendor/github.com/openshift/api/config/v1/types_authentication.go +++ b/vendor/github.com/openshift/api/config/v1/types_authentication.go @@ -5,7 +5,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC,rule="!has(self.spec.oidcProviders) || self.spec.oidcProviders.all(p, !has(p.oidcClients) || p.oidcClients.all(specC, self.status.oidcClients.exists(statusC, statusC.componentNamespace == specC.componentNamespace && statusC.componentName == specC.componentName) || (has(oldSelf.spec.oidcProviders) && oldSelf.spec.oidcProviders.exists(oldP, oldP.name == p.name && has(oldP.oidcClients) && oldP.oidcClients.exists(oldC, oldC.componentNamespace == specC.componentNamespace && oldC.componentName == specC.componentName)))))",message="all oidcClients in the oidcProviders must match their componentName and componentNamespace to either a previously configured oidcClient or they must exist in the status.oidcClients" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC;ExternalOIDCWithUIDAndExtraClaimMappings,rule="!has(self.spec.oidcProviders) || self.spec.oidcProviders.all(p, !has(p.oidcClients) || p.oidcClients.all(specC, self.status.oidcClients.exists(statusC, statusC.componentNamespace == specC.componentNamespace && statusC.componentName == specC.componentName) || (has(oldSelf.spec.oidcProviders) && oldSelf.spec.oidcProviders.exists(oldP, oldP.name == p.name && has(oldP.oidcClients) && oldP.oidcClients.exists(oldC, oldC.componentNamespace == specC.componentNamespace && oldC.componentName == specC.componentName)))))",message="all oidcClients in the oidcProviders must match their componentName and componentNamespace to either a previously configured oidcClient or they must exist in the status.oidcClients" // Authentication specifies cluster-wide settings for authentication (like OAuth and // webhook token authenticators). The canonical name of an instance is `cluster`. @@ -90,6 +90,7 @@ type AuthenticationSpec struct { // +listMapKey=name // +kubebuilder:validation:MaxItems=1 // +openshift:enable:FeatureGate=ExternalOIDC + // +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings OIDCProviders []OIDCProvider `json:"oidcProviders,omitempty"` } @@ -117,6 +118,7 @@ type AuthenticationStatus struct { // +listMapKey=componentName // +kubebuilder:validation:MaxItems=20 // +openshift:enable:FeatureGate=ExternalOIDC + // +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings OIDCClients []OIDCClientStatus `json:"oidcClients"` } @@ -135,7 +137,7 @@ type AuthenticationList struct { } // +openshift:validation:FeatureGateAwareEnum:featureGate="",enum="";None;IntegratedOAuth -// +openshift:validation:FeatureGateAwareEnum:featureGate=ExternalOIDC,enum="";None;IntegratedOAuth;OIDC +// +openshift:validation:FeatureGateAwareEnum:featureGate=ExternalOIDC;ExternalOIDCWithUIDAndExtraClaimMappings,enum="";None;IntegratedOAuth;OIDC type AuthenticationType string const ( @@ -262,6 +264,33 @@ type TokenClaimMappings struct { // groups for the cluster identity. // The referenced claim must use array of strings values. Groups PrefixedClaimMapping `json:"groups,omitempty"` + + // uid is an optional field for configuring the claim mapping + // used to construct the uid for the cluster identity. + // + // When using uid.claim to specify the claim it must be a single string value. + // When using uid.expression the expression must result in a single string value. + // + // When omitted, this means the user has no opinion and the platform + // is left to choose a default, which is subject to change over time. + // The current default is to use the 'sub' claim. + // + // +optional + // +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings + UID *TokenClaimOrExpressionMapping `json:"uid,omitempty"` + + // extra is an optional field for configuring the mappings + // used to construct the extra attribute for the cluster identity. + // When omitted, no extra attributes will be present on the cluster identity. + // key values for extra mappings must be unique. + // A maximum of 64 extra attribute mappings may be provided. + // + // +optional + // +kubebuilder:validation:MaxItems=64 + // +listType=map + // +listMapKey=key + // +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings + Extra []ExtraMapping `json:"extra,omitempty"` } type TokenClaimMapping struct { @@ -271,6 +300,110 @@ type TokenClaimMapping struct { Claim string `json:"claim"` } +// TokenClaimOrExpressionMapping allows specifying either a JWT +// token claim or CEL expression to be used when mapping claims +// from an authentication token to cluster identities. +// +kubebuilder:validation:XValidation:rule="has(self.claim) ? !has(self.expression) : has(self.expression)",message="precisely one of claim or expression must be set" +type TokenClaimOrExpressionMapping struct { + // claim is an optional field for specifying the + // JWT token claim that is used in the mapping. + // The value of this claim will be assigned to + // the field in which this mapping is associated. + // + // Precisely one of claim or expression must be set. + // claim must not be specified when expression is set. + // When specified, claim must be at least 1 character in length + // and must not exceed 256 characters in length. + // + // +optional + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:MinLength=1 + Claim string `json:"claim,omitempty"` + + // expression is an optional field for specifying a + // CEL expression that produces a string value from + // JWT token claims. + // + // CEL expressions have access to the token claims + // through a CEL variable, 'claims'. + // 'claims' is a map of claim names to claim values. + // For example, the 'sub' claim value can be accessed as 'claims.sub'. + // Nested claims can be accessed using dot notation ('claims.foo.bar'). + // + // Precisely one of claim or expression must be set. + // expression must not be specified when claim is set. + // When specified, expression must be at least 1 character in length + // and must not exceed 4096 characters in length. + // + // +optional + // +kubebuilder:validation:MaxLength=4096 + // +kubebuilder:validation:MinLength=1 + Expression string `json:"expression,omitempty"` +} + +// ExtraMapping allows specifying a key and CEL expression +// to evaluate the keys' value. It is used to create additional +// mappings and attributes added to a cluster identity from +// a provided authentication token. +type ExtraMapping struct { + // key is a required field that specifies the string + // to use as the extra attribute key. + // + // key must be a domain-prefix path (e.g 'example.org/foo'). + // key must not exceed 510 characters in length. + // key must contain the '/' character, separating the domain and path characters. + // key must not be empty. + // + // The domain portion of the key (string of characters prior to the '/') must be a valid RFC1123 subdomain. + // It must not exceed 253 characters in length. + // It must start and end with an alphanumeric character. + // It must only contain lower case alphanumeric characters and '-' or '.'. + // It must not use the reserved domains, or be subdomains of, "kubernetes.io", "k8s.io", and "openshift.io". + // + // The path portion of the key (string of characters after the '/') must not be empty and must consist of at least one + // alphanumeric character, percent-encoded octets, '-', '.', '_', '~', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', '=', and ':'. + // It must not exceed 256 characters in length. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=510 + // +kubebuilder:validation:XValidation:rule="self.contains('/')",message="key must contain the '/' character" + // + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[0].matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="the domain of the key must consist of only lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character" + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[0].size() <= 253",message="the domain of the key must not exceed 253 characters in length" + // + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[0] != 'kubernetes.io'",message="the domain 'kubernetes.io' is reserved for Kubernetes use" + // +kubebuilder:validation:XValidation:rule="!self.split('/', 2)[0].endsWith('.kubernetes.io')",message="the subdomains '*.kubernetes.io' are reserved for Kubernetes use" + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[0] != 'k8s.io'",message="the domain 'k8s.io' is reserved for Kubernetes use" + // +kubebuilder:validation:XValidation:rule="!self.split('/', 2)[0].endsWith('.k8s.io')",message="the subdomains '*.k8s.io' are reserved for Kubernetes use" + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[0] != 'openshift.io'",message="the domain 'openshift.io' is reserved for OpenShift use" + // +kubebuilder:validation:XValidation:rule="!self.split('/', 2)[0].endsWith('.openshift.io')",message="the subdomains '*.openshift.io' are reserved for OpenShift use" + // + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[1].matches('[A-Za-z0-9/\\\\-._~%!$&\\'()*+;=:]+')",message="the path of the key must not be empty and must consist of at least one alphanumeric character, percent-encoded octets, apostrophe, '-', '.', '_', '~', '!', '$', '&', '(', ')', '*', '+', ',', ';', '=', and ':'" + // +kubebuilder:validation:XValidation:rule="self.split('/', 2)[1].size() <= 256",message="the path of the key must not exceed 256 characters in length" + Key string `json:"key"` + + // valueExpression is a required field to specify the CEL expression to extract + // the extra attribute value from a JWT token's claims. + // valueExpression must produce a string or string array value. + // "", [], and null are treated as the extra mapping not being present. + // Empty string values within an array are filtered out. + // + // CEL expressions have access to the token claims + // through a CEL variable, 'claims'. + // 'claims' is a map of claim names to claim values. + // For example, the 'sub' claim value can be accessed as 'claims.sub'. + // Nested claims can be accessed using dot notation ('claims.foo.bar'). + // + // valueExpression must not exceed 4096 characters in length. + // valueExpression must not be empty. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + ValueExpression string `json:"valueExpression"` +} + type OIDCClientConfig struct { // componentName is the name of the component that is supposed to consume this // client configuration diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go index f10ccb8557..8140f54973 100644 --- a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go +++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -99,7 +99,9 @@ type InfrastructureStatus struct { // its components are not visible within the cluster. // +kubebuilder:default=HighlyAvailable // +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External - // +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External + // +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External + // +openshift:validation:FeatureGateAwareEnum:featureGate=DualReplica,enum=HighlyAvailable;SingleReplica;DualReplica;External + // +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"` // infrastructureTopology expresses the expectations for infrastructure services that do not run on control @@ -1390,7 +1392,6 @@ type VSpherePlatformTopology struct { // VSpherePlatformFailureDomainSpec. // For example, for zone=zonea, region=region1, and infrastructure name=test, // the template path would be calculated as //vm/test-rhcos-region1-zonea. - // +openshift:enable:FeatureGate=VSphereControlPlaneMachineSet // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=2048 // +kubebuilder:validation:Pattern=`^/.*?/vm/.*?` diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go index 22bd77fc5b..38aa2f6f33 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go @@ -2021,6 +2021,22 @@ func (in *ExternalPlatformStatus) DeepCopy() *ExternalPlatformStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExtraMapping) DeepCopyInto(out *ExtraMapping) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraMapping. +func (in *ExtraMapping) DeepCopy() *ExtraMapping { + if in == nil { + return nil + } + out := new(ExtraMapping) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FeatureGate) DeepCopyInto(out *FeatureGate) { *out = *in @@ -5727,6 +5743,16 @@ func (in *TokenClaimMappings) DeepCopyInto(out *TokenClaimMappings) { *out = *in in.Username.DeepCopyInto(&out.Username) out.Groups = in.Groups + if in.UID != nil { + in, out := &in.UID, &out.UID + *out = new(TokenClaimOrExpressionMapping) + **out = **in + } + if in.Extra != nil { + in, out := &in.Extra, &out.Extra + *out = make([]ExtraMapping, len(*in)) + copy(*out, *in) + } return } @@ -5740,6 +5766,22 @@ func (in *TokenClaimMappings) DeepCopy() *TokenClaimMappings { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenClaimOrExpressionMapping) DeepCopyInto(out *TokenClaimOrExpressionMapping) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenClaimOrExpressionMapping. +func (in *TokenClaimOrExpressionMapping) DeepCopy() *TokenClaimOrExpressionMapping { + if in == nil { + return nil + } + out := new(TokenClaimOrExpressionMapping) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenClaimValidationRule) DeepCopyInto(out *TokenClaimValidationRule) { *out = *in diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml index c53b4772e0..d8768ad0c3 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml @@ -30,6 +30,7 @@ authentications.config.openshift.io: Category: "" FeatureGates: - ExternalOIDC + - ExternalOIDCWithUIDAndExtraClaimMappings FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" @@ -320,8 +321,8 @@ infrastructures.config.openshift.io: - GCPCustomAPIEndpoints - GCPLabelsTags - HighlyAvailableArbiter + - HighlyAvailableArbiter+DualReplica - NutanixMultiSubnets - - VSphereControlPlaneMachineSet - VSphereHostVMGroupZonal - VSphereMultiNetworks - VSphereMultiVCenters diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index 83d16f09f0..5f99eedd72 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -396,6 +396,16 @@ func (DeprecatedWebhookTokenAuthenticator) SwaggerDoc() map[string]string { return map_DeprecatedWebhookTokenAuthenticator } +var map_ExtraMapping = map[string]string{ + "": "ExtraMapping allows specifying a key and CEL expression to evaluate the keys' value. It is used to create additional mappings and attributes added to a cluster identity from a provided authentication token.", + "key": "key is a required field that specifies the string to use as the extra attribute key.\n\nkey must be a domain-prefix path (e.g 'example.org/foo'). key must not exceed 510 characters in length. key must contain the '/' character, separating the domain and path characters. key must not be empty.\n\nThe domain portion of the key (string of characters prior to the '/') must be a valid RFC1123 subdomain. It must not exceed 253 characters in length. It must start and end with an alphanumeric character. It must only contain lower case alphanumeric characters and '-' or '.'. It must not use the reserved domains, or be subdomains of, \"kubernetes.io\", \"k8s.io\", and \"openshift.io\".\n\nThe path portion of the key (string of characters after the '/') must not be empty and must consist of at least one alphanumeric character, percent-encoded octets, '-', '.', '_', '~', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', '=', and ':'. It must not exceed 256 characters in length.", + "valueExpression": "valueExpression is a required field to specify the CEL expression to extract the extra attribute value from a JWT token's claims. valueExpression must produce a string or string array value. \"\", [], and null are treated as the extra mapping not being present. Empty string values within an array are filtered out.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'. 'claims' is a map of claim names to claim values. For example, the 'sub' claim value can be accessed as 'claims.sub'. Nested claims can be accessed using dot notation ('claims.foo.bar').\n\nvalueExpression must not exceed 4096 characters in length. valueExpression must not be empty.", +} + +func (ExtraMapping) SwaggerDoc() map[string]string { + return map_ExtraMapping +} + var map_OIDCClientConfig = map[string]string{ "componentName": "componentName is the name of the component that is supposed to consume this client configuration", "componentNamespace": "componentNamespace is the namespace of the component that is supposed to consume this client configuration", @@ -461,12 +471,24 @@ func (TokenClaimMapping) SwaggerDoc() map[string]string { var map_TokenClaimMappings = map[string]string{ "username": "username is a name of the claim that should be used to construct usernames for the cluster identity.\n\nDefault value: \"sub\"", "groups": "groups is a name of the claim that should be used to construct groups for the cluster identity. The referenced claim must use array of strings values.", + "uid": "uid is an optional field for configuring the claim mapping used to construct the uid for the cluster identity.\n\nWhen using uid.claim to specify the claim it must be a single string value. When using uid.expression the expression must result in a single string value.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose a default, which is subject to change over time. The current default is to use the 'sub' claim.", + "extra": "extra is an optional field for configuring the mappings used to construct the extra attribute for the cluster identity. When omitted, no extra attributes will be present on the cluster identity. key values for extra mappings must be unique. A maximum of 64 extra attribute mappings may be provided.", } func (TokenClaimMappings) SwaggerDoc() map[string]string { return map_TokenClaimMappings } +var map_TokenClaimOrExpressionMapping = map[string]string{ + "": "TokenClaimOrExpressionMapping allows specifying either a JWT token claim or CEL expression to be used when mapping claims from an authentication token to cluster identities.", + "claim": "claim is an optional field for specifying the JWT token claim that is used in the mapping. The value of this claim will be assigned to the field in which this mapping is associated.\n\nPrecisely one of claim or expression must be set. claim must not be specified when expression is set. When specified, claim must be at least 1 character in length and must not exceed 256 characters in length.", + "expression": "expression is an optional field for specifying a CEL expression that produces a string value from JWT token claims.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'. 'claims' is a map of claim names to claim values. For example, the 'sub' claim value can be accessed as 'claims.sub'. Nested claims can be accessed using dot notation ('claims.foo.bar').\n\nPrecisely one of claim or expression must be set. expression must not be specified when claim is set. When specified, expression must be at least 1 character in length and must not exceed 4096 characters in length.", +} + +func (TokenClaimOrExpressionMapping) SwaggerDoc() map[string]string { + return map_TokenClaimOrExpressionMapping +} + var map_TokenClaimValidationRule = map[string]string{ "type": "type sets the type of the validation rule", "requiredClaim": "requiredClaim allows configuring a required claim name and its expected value", diff --git a/vendor/github.com/openshift/api/image/v1/generated.proto b/vendor/github.com/openshift/api/image/v1/generated.proto index dabdc6d84a..75ca44f479 100644 --- a/vendor/github.com/openshift/api/image/v1/generated.proto +++ b/vendor/github.com/openshift/api/image/v1/generated.proto @@ -31,11 +31,11 @@ message DockerImageReference { optional string iD = 5; } -// Image is an immutable representation of a container image and metadata at a point in time. +// Image is an immutable representation of a container image and its metadata at a point in time. // Images are named by taking a hash of their contents (metadata and content) and any change // in format, content, or metadata results in a new name. The images resource is primarily // for use by cluster administrators and integrations like the cluster image registry - end -// users instead access images via the imagestreamtags or imagestreamimages resources. While +// users, instead, access images via the imagestreamtags or imagestreamimages resources. While // image metadata is stored in the API, any integration that implements the container image // registry API must provide its own storage for the raw manifest data, image config, and // layer contents. @@ -504,7 +504,7 @@ message ImageStreamTagList { // the status history, and the currently referenced image (if any) of the provided // tag. This type replaces the ImageStreamTag by providing a full view of the tag. // ImageTags are returned for every spec or status tag present on the image stream. -// If no tag exists in either form a not found error will be returned by the API. +// If no tag exists in either form, a not found error will be returned by the API. // A create operation will succeed if no spec tag has already been defined and the // spec field is set. Delete will remove both spec and status elements from the // image stream. diff --git a/vendor/github.com/openshift/api/image/v1/types.go b/vendor/github.com/openshift/api/image/v1/types.go index d4ee4bff69..ffde2d1245 100644 --- a/vendor/github.com/openshift/api/image/v1/types.go +++ b/vendor/github.com/openshift/api/image/v1/types.go @@ -27,11 +27,11 @@ type ImageList struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// Image is an immutable representation of a container image and metadata at a point in time. +// Image is an immutable representation of a container image and its metadata at a point in time. // Images are named by taking a hash of their contents (metadata and content) and any change // in format, content, or metadata results in a new name. The images resource is primarily // for use by cluster administrators and integrations like the cluster image registry - end -// users instead access images via the imagestreamtags or imagestreamimages resources. While +// users, instead, access images via the imagestreamtags or imagestreamimages resources. While // image metadata is stored in the API, any integration that implements the container image // registry API must provide its own storage for the raw manifest data, image config, and // layer contents. @@ -512,7 +512,7 @@ type ImageStreamTagList struct { // the status history, and the currently referenced image (if any) of the provided // tag. This type replaces the ImageStreamTag by providing a full view of the tag. // ImageTags are returned for every spec or status tag present on the image stream. -// If no tag exists in either form a not found error will be returned by the API. +// If no tag exists in either form, a not found error will be returned by the API. // A create operation will succeed if no spec tag has already been defined and the // spec field is set. Delete will remove both spec and status elements from the // image stream. diff --git a/vendor/github.com/openshift/api/image/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/image/v1/zz_generated.swagger_doc_generated.go index e0720bec77..9671768f6e 100644 --- a/vendor/github.com/openshift/api/image/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/image/v1/zz_generated.swagger_doc_generated.go @@ -25,7 +25,7 @@ func (DockerImageReference) SwaggerDoc() map[string]string { } var map_Image = map[string]string{ - "": "Image is an immutable representation of a container image and metadata at a point in time. Images are named by taking a hash of their contents (metadata and content) and any change in format, content, or metadata results in a new name. The images resource is primarily for use by cluster administrators and integrations like the cluster image registry - end users instead access images via the imagestreamtags or imagestreamimages resources. While image metadata is stored in the API, any integration that implements the container image registry API must provide its own storage for the raw manifest data, image config, and layer contents.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "": "Image is an immutable representation of a container image and its metadata at a point in time. Images are named by taking a hash of their contents (metadata and content) and any change in format, content, or metadata results in a new name. The images resource is primarily for use by cluster administrators and integrations like the cluster image registry - end users, instead, access images via the imagestreamtags or imagestreamimages resources. While image metadata is stored in the API, any integration that implements the container image registry API must provide its own storage for the raw manifest data, image config, and layer contents.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "dockerImageReference": "dockerImageReference is the string that can be used to pull this image.", "dockerImageMetadata": "dockerImageMetadata contains metadata about this image", @@ -284,7 +284,7 @@ func (ImageStreamTagList) SwaggerDoc() map[string]string { } var map_ImageTag = map[string]string{ - "": "ImageTag represents a single tag within an image stream and includes the spec, the status history, and the currently referenced image (if any) of the provided tag. This type replaces the ImageStreamTag by providing a full view of the tag. ImageTags are returned for every spec or status tag present on the image stream. If no tag exists in either form a not found error will be returned by the API. A create operation will succeed if no spec tag has already been defined and the spec field is set. Delete will remove both spec and status elements from the image stream.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "": "ImageTag represents a single tag within an image stream and includes the spec, the status history, and the currently referenced image (if any) of the provided tag. This type replaces the ImageStreamTag by providing a full view of the tag. ImageTags are returned for every spec or status tag present on the image stream. If no tag exists in either form, a not found error will be returned by the API. A create operation will succeed if no spec tag has already been defined and the spec field is set. Delete will remove both spec and status elements from the image stream.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "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 is the spec tag associated with this image stream tag, and it may be null if only pushes have occurred to this image stream.", "status": "status is the status tag details associated with this image stream tag, and it may be null if no push or import has been performed.", diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/register.go b/vendor/github.com/openshift/api/machineconfiguration/v1/register.go index 46cf07a95d..d0a88324f7 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/register.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/register.go @@ -40,6 +40,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &MachineOSBuildList{}, &PinnedImageSet{}, &PinnedImageSetList{}, + &MachineConfigNode{}, + &MachineConfigNodeList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/types_machineconfignode.go b/vendor/github.com/openshift/api/machineconfiguration/v1/types_machineconfignode.go new file mode 100644 index 0000000000..a1d37f0c9a --- /dev/null +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/types_machineconfignode.go @@ -0,0 +1,245 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machineconfignodes,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2255 +// +openshift:file-pattern=cvoRunLevel=0000_80,operatorName=machine-config,operatorOrdering=01 +// +openshift:enable:FeatureGate=MachineConfigNodes +// +kubebuilder:printcolumn:name="PoolName",type="string",JSONPath=.spec.pool.name,priority=0 +// +kubebuilder:printcolumn:name="DesiredConfig",type="string",JSONPath=.spec.configVersion.desired,priority=0 +// +kubebuilder:printcolumn:name="CurrentConfig",type="string",JSONPath=.status.configVersion.current,priority=0 +// +kubebuilder:printcolumn:name="Updated",type="string",JSONPath=.status.conditions[?(@.type=="Updated")].status,priority=0 +// +kubebuilder:printcolumn:name="UpdatePrepared",type="string",JSONPath=.status.conditions[?(@.type=="UpdatePrepared")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdateExecuted",type="string",JSONPath=.status.conditions[?(@.type=="UpdateExecuted")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdatePostActionComplete",type="string",JSONPath=.status.conditions[?(@.type=="UpdatePostActionComplete")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdateComplete",type="string",JSONPath=.status.conditions[?(@.type=="UpdateComplete")].status,priority=1 +// +kubebuilder:printcolumn:name="Resumed",type="string",JSONPath=.status.conditions[?(@.type=="Resumed")].status,priority=1 +// +kubebuilder:printcolumn:name="UpdatedFilesAndOS",type="string",JSONPath=.status.conditions[?(@.type=="AppliedFilesAndOS")].status,priority=1 +// +kubebuilder:printcolumn:name="CordonedNode",type="string",JSONPath=.status.conditions[?(@.type=="Cordoned")].status,priority=1 +// +kubebuilder:printcolumn:name="DrainedNode",type="string",JSONPath=.status.conditions[?(@.type=="Drained")].status,priority=1 +// +kubebuilder:printcolumn:name="RebootedNode",type="string",JSONPath=.status.conditions[?(@.type=="RebootedNode")].status,priority=1 +// +kubebuilder:printcolumn:name="UncordonedNode",type="string",JSONPath=.status.conditions[?(@.type=="Uncordoned")].status,priority=1 +// +kubebuilder:metadata:labels=openshift.io/operator-managed= + +// MachineConfigNode describes the health of the Machines on the system +// 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 +// +kubebuilder:validation:XValidation:rule="self.metadata.name == self.spec.node.name",message="spec.node.name should match metadata.name" +type MachineConfigNode struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec describes the configuration of the machine config node. + // +required + Spec MachineConfigNodeSpec `json:"spec"` + + // status describes the last observed state of this machine config node. + // +optional + Status MachineConfigNodeStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineConfigNodeList describes all of the MachinesStates on the system +// +// 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 +type MachineConfigNodeList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list metadata. + // +optional + metav1.ListMeta `json:"metadata"` + + // items contains a collection of MachineConfigNode resources. + // +kubebuilder:validation:MaxItems=100 + // +optional + Items []MachineConfigNode `json:"items"` +} + +// MCOObjectReference holds information about an object the MCO either owns +// or modifies in some way +type MCOObjectReference struct { + // name is the name of the object being referenced. For example, this can represent a machine + // config pool or node name. + // Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +required + Name string `json:"name"` +} + +// MachineConfigNodeSpec describes the MachineConfigNode we are managing. +type MachineConfigNodeSpec struct { + // node contains a reference to the node for this machine config node. + // +required + Node MCOObjectReference `json:"node"` + + // pool contains a reference to the machine config pool that this machine config node's + // referenced node belongs to. + // +required + Pool MCOObjectReference `json:"pool"` + + // configVersion holds the desired config version for the node targeted by this machine config node resource. + // The desired version represents the machine config the node will attempt to update to and gets set before the machine config operator validates + // the new machine config against the current machine config. + // +required + ConfigVersion MachineConfigNodeSpecMachineConfigVersion `json:"configVersion"` +} + +// MachineConfigNodeStatus holds the reported information on a particular machine config node. +type MachineConfigNodeStatus struct { + // conditions represent the observations of a machine config node's current state. Valid types are: + // UpdatePrepared, UpdateExecuted, UpdatePostActionComplete, UpdateComplete, Updated, Resumed, + // Drained, AppliedFilesAndOS, Cordoned, Uncordoned, RebootedNode, NodeDegraded, PinnedImageSetsProgressing, + // and PinnedImageSetsDegraded. + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=20 + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty"` + // observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. + // This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec. + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="observedGeneration must not decrease" + // +kubebuilder:validation:Minimum=1 + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // configVersion describes the current and desired machine config version for this node. + // +optional + ConfigVersion *MachineConfigNodeStatusMachineConfigVersion `json:"configVersion,omitempty"` + // pinnedImageSets describes the current and desired pinned image sets for this node. + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=100 + // +optional + PinnedImageSets []MachineConfigNodeStatusPinnedImageSet `json:"pinnedImageSets,omitempty"` +} + +// MachineConfigNodeStatusPinnedImageSet holds information about the current, desired, and failed pinned image sets for the observed machine config node. +// +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true",message="desired generation must be greater than or equal to the current generation" +// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than or equal to the last failed generation" +// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) ? has(self.lastFailedGenerationError) : true",message="last failed generation error must be defined on image pull and pin failure" +type MachineConfigNodeStatusPinnedImageSet struct { + // name is the name of the pinned image set. + // Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +required + Name string `json:"name"` + // currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node. + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="currentGeneration must not decrease" + // +kubebuilder:validation:Minimum=1 + // +optional + CurrentGeneration int32 `json:"currentGeneration,omitempty"` + // desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node. + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="desiredGeneration must not decrease" + // +kubebuilder:validation:Minimum=1 + // +optional + DesiredGeneration int32 `json:"desiredGeneration,omitempty"` + // lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node. + // +kubebuilder:validation:XValidation:rule="self >= oldSelf", message="lastFailedGeneration must not decrease" + // +kubebuilder:validation:Minimum=1 + // +optional + LastFailedGeneration int32 `json:"lastFailedGeneration,omitempty"` + // lastFailedGenerationError is the error explaining why the desired images failed to be pulled and pinned. + // The error is an empty string if the image pull and pin is successful. + // +kubebuilder:validation:MaxLength=32768 + // +optional + LastFailedGenerationError string `json:"lastFailedGenerationError,omitempty"` +} + +// MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. +// When the current and desired versions do not match, the machine config pool is processing an upgrade and the machine config node will +// monitor the upgrade process. +// When the current and desired versions do match, the machine config node will ignore these events given that certain operations +// happen both during the MCO's upgrade mode and the daily operations mode. +type MachineConfigNodeStatusMachineConfigVersion struct { + // current is the name of the machine config currently in use on the node. + // This value is updated once the machine config daemon has completed the update of the configuration for the node. + // This value should match the desired version unless an upgrade is in progress. + // Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +optional + Current string `json:"current"` + // desired is the MachineConfig the node wants to upgrade to. + // This value gets set in the machine config node status once the machine config has been validated + // against the current machine config. + // Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +required + Desired string `json:"desired"` +} + +// MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. +// When Current is not equal to Desired, the MachineConfigOperator is in an upgrade phase and the machine config node will +// take account of upgrade related events. Otherwise, they will be ignored given that certain operations +// happen both during the MCO's upgrade mode and the daily operations mode. +type MachineConfigNodeSpecMachineConfigVersion struct { + // desired is the name of the machine config that the the node should be upgraded to. + // This value is set when the machine config pool generates a new version of its rendered configuration. + // When this value is changed, the machine config daemon starts the node upgrade process. + // This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. + // Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting + // of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end + // with an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MaxLength:=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +required + Desired string `json:"desired"` +} + +// StateProgress is each possible state for each possible MachineConfigNodeType +// +enum +type StateProgress string + +const ( + // MachineConfigNodeUpdatePrepared describes a machine that is preparing in the daemon to trigger an update + MachineConfigNodeUpdatePrepared StateProgress = "UpdatePrepared" + // MachineConfigNodeUpdateExecuted describes a machine that has executed the body of the upgrade + MachineConfigNodeUpdateExecuted StateProgress = "UpdateExecuted" + // MachineConfigNodeUpdatePostActionComplete describes a machine that has executed its post update action + MachineConfigNodeUpdatePostActionComplete StateProgress = "UpdatePostActionComplete" + // MachineConfigNodeUpdateComplete describes a machine that has completed the core parts of an upgrade + MachineConfigNodeUpdateComplete StateProgress = "UpdateComplete" + // MachineConfigNodeUpdated describes a machine that is fully updated and has a matching desired and current config + MachineConfigNodeUpdated StateProgress = "Updated" + // MachineConfigNodeUpdateResumed describes a machine that has resumed normal processes + MachineConfigNodeResumed StateProgress = "Resumed" + // MachineConfigNodeUpdateDrained describes the part of the in progress phase where the node drains + MachineConfigNodeUpdateDrained StateProgress = "Drained" + // MachineConfigNodeUpdateFilesAndOS describes the part of the in progress phase where the nodes files and OS config change + MachineConfigNodeUpdateFilesAndOS StateProgress = "AppliedFilesAndOS" + // MachineConfigNodeUpdateCordoned describes the part of the in progress phase where the node cordons + MachineConfigNodeUpdateCordoned StateProgress = "Cordoned" + // MachineConfigNodeUpdateUncordoned describes the part of the completing phase where the node uncordons + MachineConfigNodeUpdateUncordoned StateProgress = "Uncordoned" + // MachineConfigNodeUpdateRebooted describes the part of the post action phase where the node reboots itself + MachineConfigNodeUpdateRebooted StateProgress = "RebootedNode" + // MachineConfigNodeNodeDegraded describes a machine that has failed to update to the desired machine config and is in a degraded state + MachineConfigNodeNodeDegraded StateProgress = "NodeDegraded" + // MachineConfigNodePinnedImageSetsProgressing describes a machine currently progressing to the desired pinned image sets + MachineConfigNodePinnedImageSetsProgressing StateProgress = "PinnedImageSetsProgressing" + // MachineConfigNodePinnedImageSetsDegraded describes a machine that has failed to progress to the desired pinned image sets + MachineConfigNodePinnedImageSetsDegraded StateProgress = "PinnedImageSetsDegraded" +) diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go index 36d4fb0c97..f153cc0237 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.deepcopy.go @@ -589,6 +589,22 @@ func (in *KubeletConfigStatus) DeepCopy() *KubeletConfigStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MCOObjectReference) DeepCopyInto(out *MCOObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MCOObjectReference. +func (in *MCOObjectReference) DeepCopy() *MCOObjectReference { + if in == nil { + return nil + } + out := new(MCOObjectReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfig) DeepCopyInto(out *MachineConfig) { *out = *in @@ -649,6 +665,167 @@ func (in *MachineConfigList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNode) DeepCopyInto(out *MachineConfigNode) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNode. +func (in *MachineConfigNode) DeepCopy() *MachineConfigNode { + if in == nil { + return nil + } + out := new(MachineConfigNode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineConfigNode) 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 *MachineConfigNodeList) DeepCopyInto(out *MachineConfigNodeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineConfigNode, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeList. +func (in *MachineConfigNodeList) DeepCopy() *MachineConfigNodeList { + if in == nil { + return nil + } + out := new(MachineConfigNodeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineConfigNodeList) 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 *MachineConfigNodeSpec) DeepCopyInto(out *MachineConfigNodeSpec) { + *out = *in + out.Node = in.Node + out.Pool = in.Pool + out.ConfigVersion = in.ConfigVersion + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeSpec. +func (in *MachineConfigNodeSpec) DeepCopy() *MachineConfigNodeSpec { + if in == nil { + return nil + } + out := new(MachineConfigNodeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeSpecMachineConfigVersion) DeepCopyInto(out *MachineConfigNodeSpecMachineConfigVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeSpecMachineConfigVersion. +func (in *MachineConfigNodeSpecMachineConfigVersion) DeepCopy() *MachineConfigNodeSpecMachineConfigVersion { + if in == nil { + return nil + } + out := new(MachineConfigNodeSpecMachineConfigVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatus) DeepCopyInto(out *MachineConfigNodeStatus) { + *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]) + } + } + if in.ConfigVersion != nil { + in, out := &in.ConfigVersion, &out.ConfigVersion + *out = new(MachineConfigNodeStatusMachineConfigVersion) + **out = **in + } + if in.PinnedImageSets != nil { + in, out := &in.PinnedImageSets, &out.PinnedImageSets + *out = make([]MachineConfigNodeStatusPinnedImageSet, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatus. +func (in *MachineConfigNodeStatus) DeepCopy() *MachineConfigNodeStatus { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatusMachineConfigVersion) DeepCopyInto(out *MachineConfigNodeStatusMachineConfigVersion) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatusMachineConfigVersion. +func (in *MachineConfigNodeStatusMachineConfigVersion) DeepCopy() *MachineConfigNodeStatusMachineConfigVersion { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatusMachineConfigVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopyInto(out *MachineConfigNodeStatusPinnedImageSet) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineConfigNodeStatusPinnedImageSet. +func (in *MachineConfigNodeStatusPinnedImageSet) DeepCopy() *MachineConfigNodeStatusPinnedImageSet { + if in == nil { + return nil + } + out := new(MachineConfigNodeStatusPinnedImageSet) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineConfigPool) DeepCopyInto(out *MachineConfigPool) { *out = *in diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml index de45be4c72..72289b00a3 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml @@ -36,8 +36,8 @@ controllerconfigs.machineconfiguration.openshift.io: - GCPCustomAPIEndpoints - GCPLabelsTags - HighlyAvailableArbiter + - HighlyAvailableArbiter+DualReplica - NutanixMultiSubnets - - VSphereControlPlaneMachineSet - VSphereMultiNetworks - VSphereMultiVCenters FilenameOperatorName: machine-config @@ -112,6 +112,82 @@ machineconfigs.machineconfiguration.openshift.io: TopLevelFeatureGates: [] Version: v1 +machineconfignodes.machineconfiguration.openshift.io: + Annotations: {} + ApprovedPRNumber: https://github.com/openshift/api/pull/2255 + CRDName: machineconfignodes.machineconfiguration.openshift.io + Capability: "" + Category: "" + FeatureGates: + - MachineConfigNodes + FilenameOperatorName: machine-config + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_80" + GroupName: machineconfiguration.openshift.io + HasStatus: true + KindName: MachineConfigNode + Labels: + openshift.io/operator-managed: "" + PluralName: machineconfignodes + PrinterColumns: + - jsonPath: .spec.pool.name + name: PoolName + type: string + - jsonPath: .spec.configVersion.desired + name: DesiredConfig + type: string + - jsonPath: .status.configVersion.current + name: CurrentConfig + type: string + - jsonPath: .status.conditions[?(@.type=="Updated")].status + name: Updated + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePrepared")].status + name: UpdatePrepared + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateExecuted")].status + name: UpdateExecuted + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdatePostActionComplete")].status + name: UpdatePostActionComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="UpdateComplete")].status + name: UpdateComplete + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Resumed")].status + name: Resumed + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="AppliedFilesAndOS")].status + name: UpdatedFilesAndOS + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Cordoned")].status + name: CordonedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Drained")].status + name: DrainedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="RebootedNode")].status + name: RebootedNode + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Uncordoned")].status + name: UncordonedNode + priority: 1 + type: string + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - MachineConfigNodes + Version: v1 + machineconfigpools.machineconfiguration.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/1453 diff --git a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go index a5d9ff6f23..8a92be70f4 100644 --- a/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/machineconfiguration/v1/zz_generated.swagger_doc_generated.go @@ -368,6 +368,91 @@ func (PoolSynchronizerStatus) SwaggerDoc() map[string]string { return map_PoolSynchronizerStatus } +var map_MCOObjectReference = map[string]string{ + "": "MCOObjectReference holds information about an object the MCO either owns or modifies in some way", + "name": "name is the name of the object being referenced. For example, this can represent a machine config pool or node name. Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end with an alphanumeric character, and be at most 253 characters in length.", +} + +func (MCOObjectReference) SwaggerDoc() map[string]string { + return map_MCOObjectReference +} + +var map_MachineConfigNode = map[string]string{ + "": "MachineConfigNode describes the health of the Machines on the system Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard object metadata.", + "spec": "spec describes the configuration of the machine config node.", + "status": "status describes the last observed state of this machine config node.", +} + +func (MachineConfigNode) SwaggerDoc() map[string]string { + return map_MachineConfigNode +} + +var map_MachineConfigNodeList = map[string]string{ + "": "MachineConfigNodeList describes all of the MachinesStates on the system\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard list metadata.", + "items": "items contains a collection of MachineConfigNode resources.", +} + +func (MachineConfigNodeList) SwaggerDoc() map[string]string { + return map_MachineConfigNodeList +} + +var map_MachineConfigNodeSpec = map[string]string{ + "": "MachineConfigNodeSpec describes the MachineConfigNode we are managing.", + "node": "node contains a reference to the node for this machine config node.", + "pool": "pool contains a reference to the machine config pool that this machine config node's referenced node belongs to.", + "configVersion": "configVersion holds the desired config version for the node targeted by this machine config node resource. The desired version represents the machine config the node will attempt to update to and gets set before the machine config operator validates the new machine config against the current machine config.", +} + +func (MachineConfigNodeSpec) SwaggerDoc() map[string]string { + return map_MachineConfigNodeSpec +} + +var map_MachineConfigNodeSpecMachineConfigVersion = map[string]string{ + "": "MachineConfigNodeSpecMachineConfigVersion holds the desired config version for the current observed machine config node. When Current is not equal to Desired, the MachineConfigOperator is in an upgrade phase and the machine config node will take account of upgrade related events. Otherwise, they will be ignored given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "desired": "desired is the name of the machine config that the the node should be upgraded to. This value is set when the machine config pool generates a new version of its rendered configuration. When this value is changed, the machine config daemon starts the node upgrade process. This value gets set in the machine config node spec once the machine config has been targeted for upgrade and before it is validated. Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end with an alphanumeric character, and be at most 253 characters in length.", +} + +func (MachineConfigNodeSpecMachineConfigVersion) SwaggerDoc() map[string]string { + return map_MachineConfigNodeSpecMachineConfigVersion +} + +var map_MachineConfigNodeStatus = map[string]string{ + "": "MachineConfigNodeStatus holds the reported information on a particular machine config node.", + "conditions": "conditions represent the observations of a machine config node's current state. Valid types are: UpdatePrepared, UpdateExecuted, UpdatePostActionComplete, UpdateComplete, Updated, Resumed, Drained, AppliedFilesAndOS, Cordoned, Uncordoned, RebootedNode, NodeDegraded, PinnedImageSetsProgressing, and PinnedImageSetsDegraded.", + "observedGeneration": "observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller. This field is updated when the controller observes a change to the desiredConfig in the configVersion of the machine config node spec.", + "configVersion": "configVersion describes the current and desired machine config version for this node.", + "pinnedImageSets": "pinnedImageSets describes the current and desired pinned image sets for this node.", +} + +func (MachineConfigNodeStatus) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatus +} + +var map_MachineConfigNodeStatusMachineConfigVersion = map[string]string{ + "": "MachineConfigNodeStatusMachineConfigVersion holds the current and desired config versions as last updated in the MCN status. When the current and desired versions do not match, the machine config pool is processing an upgrade and the machine config node will monitor the upgrade process. When the current and desired versions do match, the machine config node will ignore these events given that certain operations happen both during the MCO's upgrade mode and the daily operations mode.", + "current": "current is the name of the machine config currently in use on the node. This value is updated once the machine config daemon has completed the update of the configuration for the node. This value should match the desired version unless an upgrade is in progress. Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end with an alphanumeric character, and be at most 253 characters in length.", + "desired": "desired is the MachineConfig the node wants to upgrade to. This value gets set in the machine config node status once the machine config has been validated against the current machine config. Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end with an alphanumeric character, and be at most 253 characters in length.", +} + +func (MachineConfigNodeStatusMachineConfigVersion) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatusMachineConfigVersion +} + +var map_MachineConfigNodeStatusPinnedImageSet = map[string]string{ + "": "MachineConfigNodeStatusPinnedImageSet holds information about the current, desired, and failed pinned image sets for the observed machine config node.", + "name": "name is the name of the pinned image set. Must be a lowercase RFC-1123 subdomain name (https://tools.ietf.org/html/rfc1123) consisting of only lowercase alphanumeric characters, hyphens (-), and periods (.), and must start and end with an alphanumeric character, and be at most 253 characters in length.", + "currentGeneration": "currentGeneration is the generation of the pinned image set that has most recently been successfully pulled and pinned on this node.", + "desiredGeneration": "desiredGeneration is the generation of the pinned image set that is targeted to be pulled and pinned on this node.", + "lastFailedGeneration": "lastFailedGeneration is the generation of the most recent pinned image set that failed to be pulled and pinned on this node.", + "lastFailedGenerationError": "lastFailedGenerationError is the error explaining why the desired images failed to be pulled and pinned. The error is an empty string if the image pull and pin is successful.", +} + +func (MachineConfigNodeStatusPinnedImageSet) SwaggerDoc() map[string]string { + return map_MachineConfigNodeStatusPinnedImageSet +} + var map_MachineConfigReference = map[string]string{ "": "Refers to the name of a rendered MachineConfig (e.g., \"rendered-worker-ec40d2965ff81bce7cd7a7e82a680739\", etc.): the build targets this MachineConfig, this is often used to tell us whether we need an update.", "name": "name is the name of the rendered MachineConfig object. This value should be between 10 and 253 characters, and must contain only lowercase alphanumeric characters, hyphens and periods, and should start and end with an alphanumeric character.", diff --git a/vendor/github.com/openshift/api/openapi/openapi.json b/vendor/github.com/openshift/api/openapi/openapi.json index a521a8bcfe..6369a9bc82 100644 --- a/vendor/github.com/openshift/api/openapi/openapi.json +++ b/vendor/github.com/openshift/api/openapi/openapi.json @@ -6229,6 +6229,26 @@ } } }, + "com.github.openshift.api.config.v1.ExtraMapping": { + "description": "ExtraMapping allows specifying a key and CEL expression to evaluate the keys' value. It is used to create additional mappings and attributes added to a cluster identity from a provided authentication token.", + "type": "object", + "required": [ + "key", + "valueExpression" + ], + "properties": { + "key": { + "description": "key is a required field that specifies the string to use as the extra attribute key.\n\nkey must be a domain-prefix path (e.g 'example.org/foo'). key must not exceed 510 characters in length. key must contain the '/' character, separating the domain and path characters. key must not be empty.\n\nThe domain portion of the key (string of characters prior to the '/') must be a valid RFC1123 subdomain. It must not exceed 253 characters in length. It must start and end with an alphanumeric character. It must only contain lower case alphanumeric characters and '-' or '.'. It must not use the reserved domains, or be subdomains of, \"kubernetes.io\", \"k8s.io\", and \"openshift.io\".\n\nThe path portion of the key (string of characters after the '/') must not be empty and must consist of at least one alphanumeric character, percent-encoded octets, '-', '.', '_', '~', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', '=', and ':'. It must not exceed 256 characters in length.", + "type": "string", + "default": "" + }, + "valueExpression": { + "description": "valueExpression is a required field to specify the CEL expression to extract the extra attribute value from a JWT token's claims. valueExpression must produce a string or string array value. \"\", [], and null are treated as the extra mapping not being present. Empty string values within an array are filtered out.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'. 'claims' is a map of claim names to claim values. For example, the 'sub' claim value can be accessed as 'claims.sub'. Nested claims can be accessed using dot notation ('claims.foo.bar').\n\nvalueExpression must not exceed 4096 characters in length. valueExpression must not be empty.", + "type": "string", + "default": "" + } + } + }, "com.github.openshift.api.config.v1.FeatureGate": { "description": "Feature holds cluster-wide information about feature gates. The canonical name is `cluster`\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "type": "object", @@ -10471,11 +10491,27 @@ "com.github.openshift.api.config.v1.TokenClaimMappings": { "type": "object", "properties": { + "extra": { + "description": "extra is an optional field for configuring the mappings used to construct the extra attribute for the cluster identity. When omitted, no extra attributes will be present on the cluster identity. key values for extra mappings must be unique. A maximum of 64 extra attribute mappings may be provided.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.config.v1.ExtraMapping" + }, + "x-kubernetes-list-map-keys": [ + "key" + ], + "x-kubernetes-list-type": "map" + }, "groups": { "description": "groups is a name of the claim that should be used to construct groups for the cluster identity. The referenced claim must use array of strings values.", "default": {}, "$ref": "#/definitions/com.github.openshift.api.config.v1.PrefixedClaimMapping" }, + "uid": { + "description": "uid is an optional field for configuring the claim mapping used to construct the uid for the cluster identity.\n\nWhen using uid.claim to specify the claim it must be a single string value. When using uid.expression the expression must result in a single string value.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose a default, which is subject to change over time. The current default is to use the 'sub' claim.", + "$ref": "#/definitions/com.github.openshift.api.config.v1.TokenClaimOrExpressionMapping" + }, "username": { "description": "username is a name of the claim that should be used to construct usernames for the cluster identity.\n\nDefault value: \"sub\"", "default": {}, @@ -10483,6 +10519,20 @@ } } }, + "com.github.openshift.api.config.v1.TokenClaimOrExpressionMapping": { + "description": "TokenClaimOrExpressionMapping allows specifying either a JWT token claim or CEL expression to be used when mapping claims from an authentication token to cluster identities.", + "type": "object", + "properties": { + "claim": { + "description": "claim is an optional field for specifying the JWT token claim that is used in the mapping. The value of this claim will be assigned to the field in which this mapping is associated.\n\nPrecisely one of claim or expression must be set. claim must not be specified when expression is set. When specified, claim must be at least 1 character in length and must not exceed 256 characters in length.", + "type": "string" + }, + "expression": { + "description": "expression is an optional field for specifying a CEL expression that produces a string value from JWT token claims.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'. 'claims' is a map of claim names to claim values. For example, the 'sub' claim value can be accessed as 'claims.sub'. Nested claims can be accessed using dot notation ('claims.foo.bar').\n\nPrecisely one of claim or expression must be set. expression must not be specified when claim is set. When specified, expression must be at least 1 character in length and must not exceed 4096 characters in length.", + "type": "string" + } + } + }, "com.github.openshift.api.config.v1.TokenClaimValidationRule": { "type": "object", "required": [ @@ -13941,7 +13991,7 @@ } }, "com.github.openshift.api.image.v1.Image": { - "description": "Image is an immutable representation of a container image and metadata at a point in time. Images are named by taking a hash of their contents (metadata and content) and any change in format, content, or metadata results in a new name. The images resource is primarily for use by cluster administrators and integrations like the cluster image registry - end users instead access images via the imagestreamtags or imagestreamimages resources. While image metadata is stored in the API, any integration that implements the container image registry API must provide its own storage for the raw manifest data, image config, and layer contents.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "description": "Image is an immutable representation of a container image and its metadata at a point in time. Images are named by taking a hash of their contents (metadata and content) and any change in format, content, or metadata results in a new name. The images resource is primarily for use by cluster administrators and integrations like the cluster image registry - end users, instead, access images via the imagestreamtags or imagestreamimages resources. While image metadata is stored in the API, any integration that implements the container image registry API must provide its own storage for the raw manifest data, image config, and layer contents.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "type": "object", "properties": { "apiVersion": { @@ -14688,7 +14738,7 @@ } }, "com.github.openshift.api.image.v1.ImageTag": { - "description": "ImageTag represents a single tag within an image stream and includes the spec, the status history, and the currently referenced image (if any) of the provided tag. This type replaces the ImageStreamTag by providing a full view of the tag. ImageTags are returned for every spec or status tag present on the image stream. If no tag exists in either form a not found error will be returned by the API. A create operation will succeed if no spec tag has already been defined and the spec field is set. Delete will remove both spec and status elements from the image stream.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "description": "ImageTag represents a single tag within an image stream and includes the spec, the status history, and the currently referenced image (if any) of the provided tag. This type replaces the ImageStreamTag by providing a full view of the tag. ImageTags are returned for every spec or status tag present on the image stream. If no tag exists in either form, a not found error will be returned by the API. A create operation will succeed if no spec tag has already been defined and the spec field is set. Delete will remove both spec and status elements from the image stream.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "type": "object", "required": [ "spec", diff --git a/vendor/modules.txt b/vendor/modules.txt index 5c38022717..624958a7dd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -73,7 +73,7 @@ github.com/modern-go/reflect2 # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg -# github.com/openshift/api v0.0.0-20250402094343-3d7abe90f97e +# github.com/openshift/api v0.0.0-20250425163235-9b80d67473bc ## explicit; go 1.23.0 github.com/openshift/api/apiserver/v1 github.com/openshift/api/apps/v1