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
46 changes: 45 additions & 1 deletion api/v1alpha2/provider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
)

// ProviderSpec is the desired state of the Provider.
// +kubebuilder:validation:XValidation:rule="!(has(self.manifestPatches) && has(self.patches))",message="Cannot set both 'patches' and 'manifestPatches'"
type ProviderSpec struct {
// Version indicates the provider version.
// +optional
Expand Down Expand Up @@ -79,17 +80,60 @@ type ProviderSpec struct {
// provider manifests. Patches are applied in the order they are specified.
// The `kind` field must match the target object, and
// if `apiVersion` is specified it will only be applied to matching objects.
// This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
// This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396.
// This will be deprecated in future releases in favor of `patches`.
// +optional
ManifestPatches []string `json:"manifestPatches,omitempty"`

// Patches are applied to the rendered provider manifests to customize the
// provider manifests. Pathces support both strategic merge patch and RFC6902 JSON patches.
// Both `patches` and `manifestPatches` cannot be set at the same time.
// +optional
Patches []*Patch `json:"patches,omitempty"`

// AdditionalDeployments is a map of additional deployments that the provider
// should manage. The key is the name of the deployment and the value is the
// DeploymentSpec.
// +optional
AdditionalDeployments map[string]AdditionalDeployments `json:"additionalDeployments,omitempty"`
}

// Patch defines a generic patch to be applied to provider manifests.
type Patch struct {
// Patch is content of the patch to be applied. It should be an inline yaml blob-string.
// +optional
Patch string `json:"patch,omitempty"`
// Target defines the target object to which the patch should be applied.
Target *PatchSelector `json:"target,omitempty"`
}

type PatchSelector struct {
// Group is the API Group of the target object.
// +optional
Group string `json:"group,omitempty"`

// Version is the API version of the target object.
// +optional
Version string `json:"version,omitempty"`

// Kind is the kind of the target object.
// +optional
Kind string `json:"kind,omitempty"`

// Name is the name of the target object.
// +optional
Name string `json:"name,omitempty"`

// Namespace is the namespace of the target object.
// +optional
Namespace string `json:"namespace,omitempty"`

// LabelSelector is a string that follows the label selection expression
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
// +optional
LabelSelector string `json:"labelSelector,omitempty"`
}

// AdditionalDeployments defines the properties that can be enabled on the controller
// manager and deployment for the provider if the provider is managing additional deployments.
type AdditionalDeployments struct {
Expand Down
46 changes: 46 additions & 0 deletions api/v1alpha2/zz_generated.deepcopy.go

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

46 changes: 45 additions & 1 deletion config/crd/bases/operator.cluster.x-k8s.io_addonproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3037,14 +3037,58 @@ spec:
provider manifests. Patches are applied in the order they are specified.
The `kind` field must match the target object, and
if `apiVersion` is specified it will only be applied to matching objects.
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396.
This will be deprecated in future releases in favor of `patches`.
items:
type: string
type: array
patches:
description: |-
Patches are applied to the rendered provider manifests to customize the
provider manifests. Pathces support both strategic merge patch and RFC6902 JSON patches.
Both `patches` and `manifestPatches` cannot be set at the same time.
items:
description: Patch defines a generic patch to be applied to provider
manifests.
properties:
patch:
description: Patch is content of the patch to be applied. It
should be an inline yaml blob-string.
type: string
target:
description: Target defines the target object to which the patch
should be applied.
properties:
group:
description: Group is the API Group of the target object.
type: string
kind:
description: Kind is the kind of the target object.
type: string
labelSelector:
description: |-
LabelSelector is a string that follows the label selection expression
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
type: string
name:
description: Name is the name of the target object.
type: string
namespace:
description: Namespace is the namespace of the target object.
type: string
version:
description: Version is the API version of the target object.
type: string
type: object
type: object
type: array
version:
description: Version indicates the provider version.
type: string
type: object
x-kubernetes-validations:
- message: Cannot set both 'patches' and 'manifestPatches'
rule: '!(has(self.manifestPatches) && has(self.patches))'
status:
description: AddonProviderStatus defines the observed state of AddonProvider.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3037,14 +3037,58 @@ spec:
provider manifests. Patches are applied in the order they are specified.
The `kind` field must match the target object, and
if `apiVersion` is specified it will only be applied to matching objects.
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396.
This will be deprecated in future releases in favor of `patches`.
items:
type: string
type: array
patches:
description: |-
Patches are applied to the rendered provider manifests to customize the
provider manifests. Pathces support both strategic merge patch and RFC6902 JSON patches.
Both `patches` and `manifestPatches` cannot be set at the same time.
items:
description: Patch defines a generic patch to be applied to provider
manifests.
properties:
patch:
description: Patch is content of the patch to be applied. It
should be an inline yaml blob-string.
type: string
target:
description: Target defines the target object to which the patch
should be applied.
properties:
group:
description: Group is the API Group of the target object.
type: string
kind:
description: Kind is the kind of the target object.
type: string
labelSelector:
description: |-
LabelSelector is a string that follows the label selection expression
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
type: string
name:
description: Name is the name of the target object.
type: string
namespace:
description: Namespace is the namespace of the target object.
type: string
version:
description: Version is the API version of the target object.
type: string
type: object
type: object
type: array
version:
description: Version indicates the provider version.
type: string
type: object
x-kubernetes-validations:
- message: Cannot set both 'patches' and 'manifestPatches'
rule: '!(has(self.manifestPatches) && has(self.patches))'
status:
description: BootstrapProviderStatus defines the observed state of BootstrapProvider.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3038,14 +3038,58 @@ spec:
provider manifests. Patches are applied in the order they are specified.
The `kind` field must match the target object, and
if `apiVersion` is specified it will only be applied to matching objects.
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396.
This will be deprecated in future releases in favor of `patches`.
items:
type: string
type: array
patches:
description: |-
Patches are applied to the rendered provider manifests to customize the
provider manifests. Pathces support both strategic merge patch and RFC6902 JSON patches.
Both `patches` and `manifestPatches` cannot be set at the same time.
items:
description: Patch defines a generic patch to be applied to provider
manifests.
properties:
patch:
description: Patch is content of the patch to be applied. It
should be an inline yaml blob-string.
type: string
target:
description: Target defines the target object to which the patch
should be applied.
properties:
group:
description: Group is the API Group of the target object.
type: string
kind:
description: Kind is the kind of the target object.
type: string
labelSelector:
description: |-
LabelSelector is a string that follows the label selection expression
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
type: string
name:
description: Name is the name of the target object.
type: string
namespace:
description: Namespace is the namespace of the target object.
type: string
version:
description: Version is the API version of the target object.
type: string
type: object
type: object
type: array
version:
description: Version indicates the provider version.
type: string
type: object
x-kubernetes-validations:
- message: Cannot set both 'patches' and 'manifestPatches'
rule: '!(has(self.manifestPatches) && has(self.patches))'
status:
description: ControlPlaneProviderStatus defines the observed state of
ControlPlaneProvider.
Expand Down
46 changes: 45 additions & 1 deletion config/crd/bases/operator.cluster.x-k8s.io_coreproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3037,14 +3037,58 @@ spec:
provider manifests. Patches are applied in the order they are specified.
The `kind` field must match the target object, and
if `apiVersion` is specified it will only be applied to matching objects.
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396.
This will be deprecated in future releases in favor of `patches`.
items:
type: string
type: array
patches:
description: |-
Patches are applied to the rendered provider manifests to customize the
provider manifests. Pathces support both strategic merge patch and RFC6902 JSON patches.
Both `patches` and `manifestPatches` cannot be set at the same time.
items:
description: Patch defines a generic patch to be applied to provider
manifests.
properties:
patch:
description: Patch is content of the patch to be applied. It
should be an inline yaml blob-string.
type: string
target:
description: Target defines the target object to which the patch
should be applied.
properties:
group:
description: Group is the API Group of the target object.
type: string
kind:
description: Kind is the kind of the target object.
type: string
labelSelector:
description: |-
LabelSelector is a string that follows the label selection expression
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
type: string
name:
description: Name is the name of the target object.
type: string
namespace:
description: Namespace is the namespace of the target object.
type: string
version:
description: Version is the API version of the target object.
type: string
type: object
type: object
type: array
version:
description: Version indicates the provider version.
type: string
type: object
x-kubernetes-validations:
- message: Cannot set both 'patches' and 'manifestPatches'
rule: '!(has(self.manifestPatches) && has(self.patches))'
status:
description: CoreProviderStatus defines the observed state of CoreProvider.
properties:
Expand Down
Loading