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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ tests:
kms:
type: Vault
vault:
kmsPluginImage: registry.example.com/vault-plugin@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
vaultAddress: https://vault.example.com:8200
authentication:
type: AppRole
Expand Down
222 changes: 0 additions & 222 deletions config/v1/tests/apiservers.config.openshift.io/VaultKMS.yaml

Large diffs are not rendered by default.

41 changes: 17 additions & 24 deletions config/v1/types_kmsencryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,6 @@ type VaultAppRoleAuthentication struct {

// VaultKMSPluginConfig defines the KMS plugin configuration specific to Vault KMS
type VaultKMSPluginConfig struct {
// kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.
//
// The image must be a fully qualified OCI image pull spec with a SHA256 digest.
// The format is: host[:port][/namespace]/name@sha256:<digest>
// where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
// The total length must be between 75 and 447 characters.
//
// Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
// The registry hostname must be included and must contain at least one dot.
// Image tags (e.g., ":latest", ":v1.0.0") are not allowed.
//
// Consult the OpenShift documentation for compatible plugin versions with your cluster version,
// then obtain the image digest for that version from HashiCorp's container registry.
//
// For disconnected environments, mirror the plugin image to an accessible registry
// and reference the mirrored location with its digest.
//
// +kubebuilder:validation:MinLength=75
// +kubebuilder:validation:MaxLength=447
// +kubebuilder:validation:XValidation:rule=`(self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:<digest>' suffix, where '<digest>' is 64 characters long"
// +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme. Short names are not allowed, the registry hostname must be included."
// +required
KMSPluginImage string `json:"kmsPluginImage,omitempty"`

// vaultAddress specifies the address of the HashiCorp Vault instance.
// The value must be a valid HTTPS URL containing only scheme, host, and optional port.
// Paths, user info, query parameters, and fragments are not allowed.
Expand Down Expand Up @@ -264,6 +240,23 @@ type VaultKMSPluginConfig struct {
// +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9._-]+$')",message="transitKey must only contain alphanumeric characters, hyphens, periods, and underscores"
// +required
// TransitKey string `json:"transitKey,omitempty"`

// --- TOMBSTONE ---
// kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.
// Image sourcing has moved to the platform, which resolves the plugin image from the
// KMS plugin provider ConfigMap rather than from this resource (openshift/enhancements#2082).
// The field name is reserved to prevent reuse.
//
// The image had to be a fully qualified OCI image pull spec with a SHA256 digest,
// in the format host[:port][/namespace]/name@sha256:<digest>, between 75 and 447
// characters. Short names and image tags were not allowed.
//
// +kubebuilder:validation:MinLength=75
// +kubebuilder:validation:MaxLength=447
// +kubebuilder:validation:XValidation:rule=`(self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:<digest>' suffix, where '<digest>' is 64 characters long"
// +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme. Short names are not allowed, the registry hostname must be included."
// +required
// KMSPluginImage string `json:"kmsPluginImage,omitempty"`
}

// VaultTLSConfig contains TLS configuration for connecting to Vault.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,37 +235,6 @@ spec:
type is AppRole, and forbidden otherwise
rule: 'self.type == ''AppRole'' ? has(self.appRole)
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,7 +406,6 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,37 +235,6 @@ spec:
type is AppRole, and forbidden otherwise
rule: 'self.type == ''AppRole'' ? has(self.appRole)
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,7 +406,6 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,37 +235,6 @@ spec:
type is AppRole, and forbidden otherwise
rule: 'self.type == ''AppRole'' ? has(self.appRole)
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,7 +406,6 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,37 +235,6 @@ spec:
type is AppRole, and forbidden otherwise
rule: 'self.type == ''AppRole'' ? has(self.appRole)
: !has(self.appRole)'
kmsPluginImage:
description: |-
kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.

The image must be a fully qualified OCI image pull spec with a SHA256 digest.
The format is: host[:port][/namespace]/name@sha256:<digest>
where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9.
The total length must be between 75 and 447 characters.

Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed.
The registry hostname must be included and must contain at least one dot.
Image tags (e.g., ":latest", ":v1.0.0") are not allowed.

Consult the OpenShift documentation for compatible plugin versions with your cluster version,
then obtain the image digest for that version from HashiCorp's container registry.

For disconnected environments, mirror the plugin image to an accessible registry
and reference the mirrored location with its digest.
maxLength: 447
minLength: 75
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid
'@sha256:<digest>' suffix, where '<digest>' is 64
characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme.
Short names are not allowed, the registry hostname
must be included.
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))
tls:
description: |-
tls contains the TLS configuration for connecting to the Vault server.
Expand Down Expand Up @@ -437,7 +406,6 @@ spec:
''cubbyhole'', ''identity''])'
required:
- authentication
- kmsPluginImage
- vaultAddress
- vaultKeyPath
type: object
Expand Down
1 change: 0 additions & 1 deletion config/v1/zz_generated.swagger_doc_generated.go

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

Loading