Skip to content

Commit db4106b

Browse files
Add OCI source for provider ConfigMap preparation
Signed-off-by: Danil-Grigorev <[email protected]>
1 parent 7d39b00 commit db4106b

19 files changed

+377
-20
lines changed

api/v1alpha1/provider_conversion.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (src *BootstrapProvider) ConvertTo(dstRaw conversion.Hub) error {
4646

4747
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
4848
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments
49+
dst.Spec.FetchConfig.OCI = restored.Spec.FetchConfig.OCI
4950

5051
return nil
5152
}
@@ -495,6 +496,10 @@ func Convert_v1alpha2_ContainerSpec_To_v1alpha1_ContainerSpec(in *operatorv1.Con
495496
return nil
496497
}
497498

499+
func Convert_v1alpha2_FetchConfiguration_To_v1alpha1_FetchConfiguration(in *operatorv1.FetchConfiguration, out *FetchConfiguration, s apimachineryconversion.Scope) error {
500+
return autoConvert_v1alpha2_FetchConfiguration_To_v1alpha1_FetchConfiguration(in, out, s)
501+
}
502+
498503
func toImageMeta(imageURL string) *ImageMeta {
499504
im := ImageMeta{}
500505

api/v1alpha1/zz_generated.conversion.go

Lines changed: 24 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha2/provider_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ type FetchConfiguration struct {
218218
// +optional
219219
URL string `json:"url,omitempty"`
220220

221+
// OCI to be used for fetching the provider’s components and metadata from an OCI artifact.
222+
// +optional
223+
OCI *OCI `json:"oci,omitempty"`
224+
221225
// Selector to be used for fetching provider’s components and metadata from
222226
// ConfigMaps stored inside the cluster. Each ConfigMap is expected to contain
223227
// components and metadata for a specific version only.
@@ -227,6 +231,14 @@ type FetchConfiguration struct {
227231
Selector *metav1.LabelSelector `json:"selector,omitempty"`
228232
}
229233

234+
type OCI struct {
235+
// URL to be used for fetching the provider’s components and metadata from an OCI artifact.
236+
// You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
237+
// If the providerSpec.Version is missing, latest provider version from registry is used.
238+
// +optional
239+
URL string `json:"url,omitempty"`
240+
}
241+
230242
// ProviderStatus defines the observed state of the Provider.
231243
type ProviderStatus struct {
232244
// Contract will contain the core provider contract that the provider is

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/operator.cluster.x-k8s.io_addonproviders.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,6 +2750,17 @@ spec:
27502750
For example, the infrastructure name `aws` will fetch artifacts from
27512751
https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases.
27522752
properties:
2753+
oci:
2754+
description: OCI to be used for fetching the provider’s components
2755+
and metadata from an OCI artifact.
2756+
properties:
2757+
url:
2758+
description: |-
2759+
URL to be used for fetching the provider’s components and metadata from an OCI artifact.
2760+
You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
2761+
If the providerSpec.Version is missing, latest provider version from registry is used.
2762+
type: string
2763+
type: object
27532764
selector:
27542765
description: |-
27552766
Selector to be used for fetching provider’s components and metadata from

config/crd/bases/operator.cluster.x-k8s.io_bootstrapproviders.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4380,6 +4380,17 @@ spec:
43804380
For example, the infrastructure name `aws` will fetch artifacts from
43814381
https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases.
43824382
properties:
4383+
oci:
4384+
description: OCI to be used for fetching the provider’s components
4385+
and metadata from an OCI artifact.
4386+
properties:
4387+
url:
4388+
description: |-
4389+
URL to be used for fetching the provider’s components and metadata from an OCI artifact.
4390+
You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
4391+
If the providerSpec.Version is missing, latest provider version from registry is used.
4392+
type: string
4393+
type: object
43834394
selector:
43844395
description: |-
43854396
Selector to be used for fetching provider’s components and metadata from

config/crd/bases/operator.cluster.x-k8s.io_controlplaneproviders.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,6 +4382,17 @@ spec:
43824382
For example, the infrastructure name `aws` will fetch artifacts from
43834383
https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases.
43844384
properties:
4385+
oci:
4386+
description: OCI to be used for fetching the provider’s components
4387+
and metadata from an OCI artifact.
4388+
properties:
4389+
url:
4390+
description: |-
4391+
URL to be used for fetching the provider’s components and metadata from an OCI artifact.
4392+
You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
4393+
If the providerSpec.Version is missing, latest provider version from registry is used.
4394+
type: string
4395+
type: object
43854396
selector:
43864397
description: |-
43874398
Selector to be used for fetching provider’s components and metadata from

config/crd/bases/operator.cluster.x-k8s.io_coreproviders.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4380,6 +4380,17 @@ spec:
43804380
For example, the infrastructure name `aws` will fetch artifacts from
43814381
https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases.
43824382
properties:
4383+
oci:
4384+
description: OCI to be used for fetching the provider’s components
4385+
and metadata from an OCI artifact.
4386+
properties:
4387+
url:
4388+
description: |-
4389+
URL to be used for fetching the provider’s components and metadata from an OCI artifact.
4390+
You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
4391+
If the providerSpec.Version is missing, latest provider version from registry is used.
4392+
type: string
4393+
type: object
43834394
selector:
43844395
description: |-
43854396
Selector to be used for fetching provider’s components and metadata from

config/crd/bases/operator.cluster.x-k8s.io_infrastructureproviders.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,6 +4382,17 @@ spec:
43824382
For example, the infrastructure name `aws` will fetch artifacts from
43834383
https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases.
43844384
properties:
4385+
oci:
4386+
description: OCI to be used for fetching the provider’s components
4387+
and metadata from an OCI artifact.
4388+
properties:
4389+
url:
4390+
description: |-
4391+
URL to be used for fetching the provider’s components and metadata from an OCI artifact.
4392+
You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
4393+
If the providerSpec.Version is missing, latest provider version from registry is used.
4394+
type: string
4395+
type: object
43854396
selector:
43864397
description: |-
43874398
Selector to be used for fetching provider’s components and metadata from

config/crd/bases/operator.cluster.x-k8s.io_ipamproviders.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,6 +2750,17 @@ spec:
27502750
For example, the infrastructure name `aws` will fetch artifacts from
27512751
https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases.
27522752
properties:
2753+
oci:
2754+
description: OCI to be used for fetching the provider’s components
2755+
and metadata from an OCI artifact.
2756+
properties:
2757+
url:
2758+
description: |-
2759+
URL to be used for fetching the provider’s components and metadata from an OCI artifact.
2760+
You must set `providerSpec.Version` field for operator to pick up desired version of the release from GitHub.
2761+
If the providerSpec.Version is missing, latest provider version from registry is used.
2762+
type: string
2763+
type: object
27532764
selector:
27542765
description: |-
27552766
Selector to be used for fetching provider’s components and metadata from

0 commit comments

Comments
 (0)