Documentation
¶
Index ¶
- Constants
- Variables
- func APIVersionOption(version APIVersion) string
- func ClusterNameFromResourceID(resourceID *azcorearm.ResourceID) string
- func DeleteNilsFromPtrSlice[S ~[]*E, E any](s S) S
- func Deref[T any](p *T) T
- func MergeStringPtrMapIntoResourceIDMap(fldPath *field.Path, src map[string]*string, ...) field.ErrorList
- func Must[T any](v T, err error) T
- func NextMinorReleaseLine(v semver.Version) semver.Version
- func NonNilSliceValues[E any](a []*E) iter.Seq2[int, *E]
- func NonNilValues[K any, V any](seq iter.Seq2[K, *V]) iter.Seq2[K, *V]
- func Ptr[T any](p T) *T
- func PtrOrNil[T any](p T) *T
- func ResourceIDMapToStringPtrMap(m map[string]*azcorearm.ResourceID) map[string]*string
- func ResourceIDToStringPtr(resourceID *azcorearm.ResourceID) *string
- func ResourceTypeEqual(lhs, rhs azcorearm.ResourceType) bool
- func ResourceTypeStringEqual(s string, rt azcorearm.ResourceType) bool
- func StringMapToStringPtrMap(m map[string]string) map[string]*string
- func StringPtrMapToStringMap(m map[string]*string) map[string]string
- func StringPtrSliceToStringSlice(s []*string) []string
- func StringSliceToStringPtrSlice(s []string) []*string
- func TrimStringSlice(s []string) []string
- type APIVersion
- type ClusterImageRegistryState
- type CryptoRestrictions
- type CustomerManagedEncryptionType
- type DiskStorageAccountType
- type Effect
- type EtcdDataEncryptionKeyManagementModeType
- type ExternalAuthClientType
- type IngressType
- type InternalID
- func (id *InternalID) ClusterID() string
- func (in *InternalID) DeepCopy() *InternalID
- func (in *InternalID) DeepCopyInto(out *InternalID)
- func (id *InternalID) ID() string
- func (id *InternalID) Kind() string
- func (id InternalID) MarshalText() ([]byte, error)
- func (id *InternalID) Path() string
- func (id *InternalID) String() string
- func (id *InternalID) UnmarshalText(text []byte) error
- type KeyVaultVisibility
- type MirrorSourcePolicy
- type NetworkType
- type ObjectMetadata
- type OsDiskType
- type OutboundType
- type TokenValidationRuleType
- type UsernameClaimPrefixPolicy
- type Visibility
Constants ¶
const ( // FeatureExperimentalReleaseFeatures is the subscription-level AFEC that gates all // tag-based experimental features. When registered, per-resource tags in the // "aro-hcp.experimental.*" namespace are honored. Without this AFEC, experimental // tags are ignored. FeatureExperimentalReleaseFeatures = "microsoft.redhatopenshift/experimentalreleasefeatures" // ExperimentalClusterTagPrefix is the prefix for all experimental cluster // tags. Tags with this prefix are only honored when the // ExperimentalReleaseFeatures AFEC is registered. Unrecognized tags // with this prefix are rejected. // // Azure ARM tag names must not contain: < > % & \ ? / // The Azure Portal additionally rejects: * : + // Tags starting with "microsoft", "azure", "windows", or "hidden-" // are reserved. Names are limited to 512 characters (128 for storage // accounts). See https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources ExperimentalClusterTagPrefix = "aro-hcp.experimental.cluster." // TagClusterSingleReplica is the ARM resource tag that enables // single-replica control plane components when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. TagClusterSingleReplica = ExperimentalClusterTagPrefix + "single-replica" // TagClusterSizeOverride is the ARM resource tag that enables the // ClusterSizeOverride annotation for reduced resource requests when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. TagClusterSizeOverride = ExperimentalClusterTagPrefix + "size-override" // TagClusterCPOImageOverride is the ARM resource tag that overrides // the control plane operator image for a HostedCluster when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. TagClusterCPOImageOverride = ExperimentalClusterTagPrefix + "control-plane-operator-image-override" // TagClusterControlPlaneExactVersion is the ARM resource tag that pins the // control plane to an exact OpenShift release (e.g. "4.17.3") when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. When // set, the desired control plane version controllers use the exact version // directly and skip Cincinnati/gateway version resolution. The value may be // a full semantic version; alternatively the tag may be present while the // exact version is supplied through the cluster's version.id, in which case // admission relocates the patch version here and reduces version.id to its // "<major>.<minor>" release line. TagClusterControlPlaneExactVersion = ExperimentalClusterTagPrefix + "control-plane-exact-version" // TagClusterMaxCreationDuration is the ARM resource tag that overrides // the default cluster creation deadline (60 minutes) when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. // The value must be a valid Go time.Duration string (e.g. "19m", "30m"). TagClusterMaxCreationDuration = ExperimentalClusterTagPrefix + "max-creation-duration" // TagClusterMaxDeletionDuration is the ARM resource tag that overrides // the default cluster deletion deadline (60 minutes) when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. // The value must be a valid Go time.Duration string (e.g. "24m", "30m"). // The tag is set at cluster creation time but consumed at deletion time. TagClusterMaxDeletionDuration = ExperimentalClusterTagPrefix + "max-deletion-duration" // ExperimentalNodePoolTagPrefix is the prefix for all experimental node pool // tags. Tags with this prefix are only honored when the // ExperimentalReleaseFeatures AFEC is registered. Unrecognized tags // with this prefix are rejected. ExperimentalNodePoolTagPrefix = "aro-hcp.experimental.nodepool." // TagNodePoolMaxCreationDuration is the ARM resource tag that overrides // the default node pool creation deadline (60 minutes) when the // ExperimentalReleaseFeatures AFEC is registered on the subscription. // The value must be a valid Go time.Duration string (e.g. "19m", "30m"). TagNodePoolMaxCreationDuration = ExperimentalNodePoolTagPrefix + "max-creation-duration" )
ARM handles feature names as case insensitive. Normalize the names using lowercase
const (
OpenShiftVersionPrefix = "openshift-v"
)
Variables ¶
var AllowControlPlaneNodePoolMajorVersionSkew = map[string][]string{
"4.21": {"5.0"},
"4.22": {"5.0", "5.1"},
"4.23": {"5.1", "5.2"},
}
AllowControlPlaneNodePoolMajorVersionSkew maps node pool OpenShift minor release lines (x.y) to allowed control-plane minor release lines when the node pool major differs from the cluster major. Values are sorted from strictest to most permissive allowed skew. See the HyperShift control plane version status enhancement for node pool skews against cluster version: https://github.com/openshift/enhancements/blob/master/enhancements/hypershift/hypershift-control-plane-version-status.md
var AllowMajorUpgradePaths = map[string]string{
"4.22": "5.0",
"4.23": "5.1",
}
AllowedMajorUpgrades is for OpenShift cross-major upgrades (one major at a time, e.g. 4 to 5). Keys and values are major.minor lines ("x.y"): the key is the current version's line, the value is the only allowed line for the desired version. Used when validating version on clusters and node pools. Add entries when new cross-major paths are supported.
var AllowedChannelGroups = sets.New("stable", "fast")
AllowedChannelGroups is the set ARO-HCP allows to use for customer purposes
var AllowedChannelGroupsWithExperimentalFlag = sets.New("stable", "fast", "candidate", "nightly")
AllowedChannelGroupsWithExperimentalFlag is the set the service allows to use when using the Experimental Feature AFEC flag
var ( ValidClusterImageRegistryStates = sets.New[ClusterImageRegistryState]( ClusterImageRegistryStateDisabled, ClusterImageRegistryStateEnabled, ) )
var ( ValidCryptoRestrictions = sets.New[CryptoRestrictions]( CryptoRestrictionsNone, CryptoRestrictionsFIPS, ) )
var ( ValidCustomerManagedEncryptionType = sets.New[CustomerManagedEncryptionType]( CustomerManagedEncryptionTypeKMS, ) )
var ( ValidDiskStorageAccountTypes = sets.New[DiskStorageAccountType]( DiskStorageAccountTypePremium_LRS, DiskStorageAccountTypeStandardSSD_LRS, DiskStorageAccountTypeStandard_LRS, ) )
var ( ValidEffects = sets.New[Effect]( EffectNoExecute, EffectNoSchedule, EffectPreferNoSchedule, ) )
var ( ValidEtcdDataEncryptionKeyManagementModeType = sets.New[EtcdDataEncryptionKeyManagementModeType]( EtcdDataEncryptionKeyManagementModeTypeCustomerManaged, ) )
var ( ValidExternalAuthClientTypes = sets.New[ExternalAuthClientType]( ExternalAuthClientTypeConfidential, ExternalAuthClientTypePublic, ) )
var ( // ValidIngressTypes contains ingress types that are currently supported. // Disabled is defined in the API but not yet supported. ValidIngressTypes = sets.New[IngressType]( IngressTypePublic, IngressTypePrivate, ) )
var ( ValidKeyVaultVisibility = sets.New[KeyVaultVisibility]( KeyVaultVisibilityPublic, KeyVaultVisibilityPrivate, ) )
var ( ValidMirrorSourcePolicies = sets.New[MirrorSourcePolicy]( MirrorSourcePolicyAllowContactingSource, ) )
var ( ValidNetworkTypes = sets.New[NetworkType]( NetworkTypeOVNKubernetes, NetworkTypeOther, ) )
var ( ValidOsDiskTypes = sets.New[OsDiskType]( OsDiskTypeManaged, OsDiskTypeEphemeral, ) )
var ( ValidOutboundTypes = sets.New[OutboundType]( OutboundTypeLoadBalancer, ) )
var ( ValidTokenValidationRuleTypes = sets.New[TokenValidationRuleType]( TokenValidationRuleTypeRequiredClaim, ) )
var ( ValidUsernameClaimPrefixPolicies = sets.New[UsernameClaimPrefixPolicy]( UsernameClaimPrefixPolicyPrefix, UsernameClaimPrefixPolicyNoPrefix, UsernameClaimPrefixPolicyNone, ) )
var ( ValidVisibility = sets.New[Visibility]( VisibilityPublic, VisibilityPrivate, ) )
Functions ¶
func APIVersionOption ¶
func APIVersionOption(version APIVersion) string
APIVersionOption returns the operation option string for an API version, suitable for inclusion in operation.Operation.Options.
func ClusterNameFromResourceID ¶
func ClusterNameFromResourceID(resourceID *azcorearm.ResourceID) string
ClusterNameFromResourceID walks up the resource ID parent chain to find an HCP cluster ancestor. It returns the cluster's resource ID string if found, or the empty string otherwise. The provider namespace and cluster resource type are compared as string literals to avoid an import cycle with the coreapi package that defines those constants (coreapi imports metadataapi).
func DeleteNilsFromPtrSlice ¶
func DeleteNilsFromPtrSlice[S ~[]*E, E any](s S) S
DeleteNilsFromPtrSlice returns a slice with nil pointers removed.
func Deref ¶
func Deref[T any](p *T) T
Deref returns the value pointed to by p, or the zero value if p is nil.
func MergeStringPtrMapIntoResourceIDMap ¶
func MergeStringPtrMapIntoResourceIDMap(fldPath *field.Path, src map[string]*string, dst *map[string]*azcorearm.ResourceID) field.ErrorList
MergeStringPtrMap merges a map of string pointers into a map of strings following the rules of JSON merge-patch (RFC 7396). In particular, if a key in src has a nil value, that entry is deleted from dst. The function takes a pointer to the dst map in case the dst map is nil and needs to be initialized.
func Must ¶
Must is a helper function that takes a value and error, returns the value if no error occurred, or panics if an error occurred. This is useful for test setup where we don't expect errors.
func NextMinorReleaseLine ¶
NextMinorReleaseLine returns the next OpenShift minor release line after v as major.minor.0 (patch and pre-release metadata cleared).
Within a major, that is major.(minor+1).0. At major boundaries that do not continue as major.(minor+1), a bridged next-major line is returned instead (for example 4.23.x → 5.1.0).
func NonNilSliceValues ¶
NonNilSliceValues returns an iterator over index-value pairs in a slice of pointers in the usual order, but skipping over nils.
func NonNilValues ¶
NonNilValues returns an iterator over a sequence of pairs of values that skips pairs where the second value in the pair is nil.
func PtrOrNil ¶
func PtrOrNil[T any](p T) *T
PtrOrNil returns a pointer to p or nil if p is an empty value as would be determined by the "omitempty" option in json.Marshal.
func ResourceIDMapToStringPtrMap ¶
func ResourceIDMapToStringPtrMap(m map[string]*azcorearm.ResourceID) map[string]*string
func ResourceIDToStringPtr ¶
func ResourceIDToStringPtr(resourceID *azcorearm.ResourceID) *string
func ResourceTypeEqual ¶
func ResourceTypeEqual(lhs, rhs azcorearm.ResourceType) bool
ResourceTypeEqual reports whether two ARM resource types are equal, case-insensitively.
func ResourceTypeStringEqual ¶
func ResourceTypeStringEqual(s string, rt azcorearm.ResourceType) bool
ResourceTypeStringEqual reports whether a resource-type string equals an ARM resource type, case-insensitively.
func StringMapToStringPtrMap ¶
StringMapToStringPtrMap converts a map of strings to a map of string pointers.
func StringPtrMapToStringMap ¶
StringPtrMapToStringMap converts a map of string pointers to a map of strings.
func StringPtrSliceToStringSlice ¶
StringPtrSliceToStringSlice converts a slice of string pointers to a slice of strings.
func StringSliceToStringPtrSlice ¶
StringSliceToStringPtrSlice converts a slice of strings to a slice of string pointers.
func TrimStringSlice ¶
TrimStringSlice returns a new string slice with all leading and trailing white space removed from each element and omitting any white-space-only elements.
Types ¶
type APIVersion ¶
type APIVersion string
APIVersion represents an Azure ARM API version following the uniform versioning guidelines (https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/uniform-versioning.md).
Format: YYYY-MM-DD[-preview]
Ordering: versions are ordered chronologically by date. The uniform versioning spec requires that each new API version uses a date later than all preceding versions, and that stable and preview versions cannot share the same date (promoting preview to stable requires incrementing the date by at least one day).
The comparison functions (LT, LE, GT, GE) implement semantic ordering that additionally handles the hypothetical case of a same-date stable and preview version by ranking stable after preview. This guards against a violation of the uniform versioning guidelines where the date is not incremented when moving from preview to stable — naive lexicographic comparison would incorrectly place the stable version before the preview version in that scenario.
const ( APIVersionV20240610Preview APIVersion = "2024-06-10-preview" APIVersionV20251223Preview APIVersion = "2025-12-23-preview" APIVersionV20260630Preview APIVersion = "2026-06-30-preview" APIVersionV20260901Preview APIVersion = "2026-09-01-preview" )
func APIVersionFromOptions ¶
func APIVersionFromOptions(options []string) APIVersion
APIVersionFromOptions extracts the API version from operation options. Returns an empty string if no API version option is present.
func (APIVersion) EQ ¶
func (v APIVersion) EQ(other APIVersion) bool
func (APIVersion) GE ¶
func (v APIVersion) GE(other APIVersion) bool
func (APIVersion) GT ¶
func (v APIVersion) GT(other APIVersion) bool
func (APIVersion) LE ¶
func (v APIVersion) LE(other APIVersion) bool
func (APIVersion) LT ¶
func (v APIVersion) LT(other APIVersion) bool
func (APIVersion) NE ¶
func (v APIVersion) NE(other APIVersion) bool
type ClusterImageRegistryState ¶
type ClusterImageRegistryState string
ClusterImageRegistryState - state indicates the desired ImageStream-backed cluster image registry installation mode. This can only be set during cluster creation and cannot be changed after cluster creation. Enabled means the ImageStream-backed image registry will be run as pods on worker nodes in the cluster. Disabled means the ImageStream-backed image registry will not be present in the cluster. The default is Enabled.
const ( ClusterImageRegistryStateDisabled ClusterImageRegistryState = "Disabled" ClusterImageRegistryStateEnabled ClusterImageRegistryState = "Enabled" )
type CryptoRestrictions ¶
type CryptoRestrictions string
CryptoRestrictions represents cryptographic restrictions for a cluster.
const ( // CryptoRestrictionsNone - no cryptographic restrictions will be applied to the cluster CryptoRestrictionsNone CryptoRestrictions = "None" // CryptoRestrictionsFIPS - FIPS cryptographic restrictions will be applied to the cluster CryptoRestrictionsFIPS CryptoRestrictions = "FIPS" )
type CustomerManagedEncryptionType ¶
type CustomerManagedEncryptionType string
const ( // CustomerManagedEncryptionTypeKMS - KMS encryption type. CustomerManagedEncryptionTypeKMS CustomerManagedEncryptionType = "KMS" )
type DiskStorageAccountType ¶
type DiskStorageAccountType string
DiskStorageAccountType represents supported Azure storage account types.
const ( DiskStorageAccountTypePremium_LRS DiskStorageAccountType = "Premium_LRS" DiskStorageAccountTypeStandardSSD_LRS DiskStorageAccountType = "StandardSSD_LRS" DiskStorageAccountTypeStandard_LRS DiskStorageAccountType = "Standard_LRS" )
type EtcdDataEncryptionKeyManagementModeType ¶
type EtcdDataEncryptionKeyManagementModeType string
const ( // EtcdDataEncryptionKeyManagementModeTypeCustomerManaged - Customer managed encryption key management mode type. EtcdDataEncryptionKeyManagementModeTypeCustomerManaged EtcdDataEncryptionKeyManagementModeType = "CustomerManaged" // EtcdDataEncryptionKeyManagementModeTypePlatformManaged - Platform managed encryption key management mode type. // Not currently supported; left defined so EnsureDefaults / Cosmos defaults keep // filling the historic value, but excluded from ValidEtcdDataEncryptionKeyManagementModeType until // platform-managed etcd encryption is supported. EtcdDataEncryptionKeyManagementModeTypePlatformManaged EtcdDataEncryptionKeyManagementModeType = "PlatformManaged" )
type ExternalAuthClientType ¶
type ExternalAuthClientType string
const ( // ExternalAuthClientTypeConfidential - the client is confidential. ExternalAuthClientTypeConfidential ExternalAuthClientType = "Confidential" // ExternalAuthClientTypePublic - the client is public. ExternalAuthClientTypePublic ExternalAuthClientType = "Public" )
type IngressType ¶
type IngressType string
IngressType represents the type of the default cluster ingress.
const ( IngressTypePublic IngressType = "Public" IngressTypePrivate IngressType = "Private" IngressTypeDisabled IngressType = "Disabled" )
type InternalID ¶
type InternalID struct {
// contains filtered or unexported fields
}
InternalID represents a Cluster Service resource.
func NewInternalID ¶
func NewInternalID(path string) (InternalID, error)
NewInternalID attempts to create a new InternalID from a Cluster Service API path, returning an error if the API path is invalid or unsupported.
func (*InternalID) ClusterID ¶
func (id *InternalID) ClusterID() string
ClusterID returns the path element following "clusters", if present.
func (*InternalID) DeepCopy ¶
func (in *InternalID) DeepCopy() *InternalID
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalID.
func (*InternalID) DeepCopyInto ¶
func (in *InternalID) DeepCopyInto(out *InternalID)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*InternalID) ID ¶
func (id *InternalID) ID() string
ID returns the last path element of the resource described by InternalID.
func (*InternalID) Kind ¶
func (id *InternalID) Kind() string
Kind returns the kind of resource described by InternalID, currently limited to "Cluster" and "NodePool".
func (InternalID) MarshalText ¶
func (id InternalID) MarshalText() ([]byte, error)
MarshalText allows an InternalID to be used as an encoding.TextMarshaler.
func (*InternalID) Path ¶
func (id *InternalID) Path() string
Path returns the full API path of the resource.
func (*InternalID) String ¶
func (id *InternalID) String() string
String allows an InternalID to be used as a fmt.Stringer.
func (*InternalID) UnmarshalText ¶
func (id *InternalID) UnmarshalText(text []byte) error
UnmarshalText allows an InternalID to be used as an encoding.TextUnmarshaler.
type KeyVaultVisibility ¶
type KeyVaultVisibility string
KeyVaultVisibility represents the visibility of a KeyVault resource.
const ( KeyVaultVisibilityPublic KeyVaultVisibility = "Public" KeyVaultVisibilityPrivate KeyVaultVisibility = "Private" )
type MirrorSourcePolicy ¶
type MirrorSourcePolicy string
const ( // MirrorSourcePolicyAllowContactingSource - allows falling back to the specified // repository in the pull spec if the image pull from the mirror list fails MirrorSourcePolicyAllowContactingSource MirrorSourcePolicy = "AllowContactingSource" )
type NetworkType ¶
type NetworkType string
NetworkType represents an OpenShift cluster network plugin.
const ( NetworkTypeOVNKubernetes NetworkType = "OVNKubernetes" NetworkTypeOther NetworkType = "Other" )
type ObjectMetadata ¶
type ObjectMetadata struct {
CosmosContainer string `json:"cosmosContainer"`
SubscriptionID string `json:"subscriptionID"`
ResourceGroup string `json:"resourceGroup"`
ResourceType string `json:"resourceType"`
ResourceName string `json:"resourceName"`
ResourceID string `json:"resourceID"`
// ClusterResourceID is the full resource ID of the logical parent HCP cluster.
// It is empty when the resource is not part of an HCP cluster.
ClusterResourceID string `json:"clusterResourceID"`
}
ObjectMetadata provides per-document identity for the cosmosResourceSnapshots Kusto table. It is emitted as a structured log field alongside the document content.
func ObjectMetadataForResourceID ¶
func ObjectMetadataForResourceID(container string, resourceID *azcorearm.ResourceID) ObjectMetadata
ObjectMetadataForResourceID builds ObjectMetadata from an ARM resource ID.
func (*ObjectMetadata) DeepCopy ¶
func (in *ObjectMetadata) DeepCopy() *ObjectMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMetadata.
func (*ObjectMetadata) DeepCopyInto ¶
func (in *ObjectMetadata) DeepCopyInto(out *ObjectMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OsDiskType ¶
type OsDiskType string
OsDiskType represents the type of OS disk.
const ( OsDiskTypeManaged OsDiskType = "Managed" OsDiskTypeEphemeral OsDiskType = "Ephemeral" )
type OutboundType ¶
type OutboundType string
OutboundType represents a routing strategy to provide egress to the Internet.
const (
OutboundTypeLoadBalancer OutboundType = "LoadBalancer"
)
type TokenValidationRuleType ¶
type TokenValidationRuleType string
const ( // TokenValidationRuleTypeRequiredClaim - the Kubernetes API server will be configured to validate that the // incoming JWT contains the required claim and that its value matches the required value. TokenValidationRuleTypeRequiredClaim TokenValidationRuleType = "RequiredClaim" )
type UsernameClaimPrefixPolicy ¶
type UsernameClaimPrefixPolicy string
const ( // UsernameClaimPrefixPolicyPrefix - prefix the JWT claim with the value of Prefix. UsernameClaimPrefixPolicyPrefix UsernameClaimPrefixPolicy = "Prefix" // UsernameClaimPrefixPolicyNoPrefix - do not prefix the JWT claim. UsernameClaimPrefixPolicyNoPrefix UsernameClaimPrefixPolicy = "NoPrefix" // UsernameClaimPrefixPolicyNone - let the platform choose an appropriate prefix. UsernameClaimPrefixPolicyNone UsernameClaimPrefixPolicy = "None" )
type Visibility ¶
type Visibility string
Visibility represents the visibility of an API endpoint.
const ( VisibilityPublic Visibility = "Public" VisibilityPrivate Visibility = "Private" )