Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility: unify providers and base on CAPI contract versions #525

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

zerospiel
Copy link
Member

@zerospiel zerospiel commented Oct 18, 2024

  • removed nested struct with infra/bstrp/cp providers
  • migrated provider/cluster templates on the new annotation
  • unified flat providers structure
  • unified separated capi contracts struct for cluster/provider templates
  • compatibility is now based on CAPI contract versions
  • change semicolon to comma as a separator in the provider templates charts
  • capi contracts status in management status
  • provider templates: validate capi contracts against core capi template
  • cluster templates: validate provider contracts against provider templates contracts in management status
  • renamed k0s -> k0smotron everywhere

In conclusion:

Core CAPI compatibility contracts:

annotations:
  cluster.x-k8s.io/v1beta1: ""
  cluster.x-k8s.io/v1alpha3: ""
  cluster.x-k8s.io/v1alpha4: ""

An example of compatibility attributes annotations along with the new provider annotation in a chart for the ProviderTemplate:

annotations:
  cluster.x-k8s.io/provider: infrastructure-aws
  cluster.x-k8s.io/v1alpha3: v1alpha3
  cluster.x-k8s.io/v1alpha4: v1alpha4
  cluster.x-k8s.io/v1beta1: v1beta1_v1beta2

An example of compatibility attributes annotations along with the new provider annotation in a chart for the ClusterTemplate:

annotations:
  cluster.x-k8s.io/provider: infrastructure-aws, control-plane-k0smotron, bootstrap-k0smotron
  cluster.x-k8s.io/v1beta1: v1beta1_v1beta2

New Management status block:

  status:
    availableProviders: # now deduplicated and sorted
    - bootstrap-k0smotron
    - control-plane-k0smotron
    - infrastructure-aws
    - infrastructure-azure
    - infrastructure-k0smotron
    - infrastructure-vsphere
    capiContracts: # map[<provider-name>]map[<capiContract>]<providerContract>
      infrastructure-aws:
        v1alpha3: v1alpha3
        v1alpha4: v1alpha4
        v1beta1: v1beta1_v1beta2

New ProviderTemplate status in the core-capi:

status:
  capiContracts:
    v1alpha3: ""
    v1alpha4: ""
    v1beta1: ""
  chartRef: # old 
    kind: HelmChart
    name: cluster-api-0-0-2
    namespace: hmc-system

New ProviderTemplate status in some object:

status:
  capiContracts:
    v1alpha3: v1alpha3
    v1alpha4: v1alpha4
    v1beta1: v1beta1_v1beta2
  chartRef:
    kind: HelmChart
    name: cluster-api-provider-aws-0-0-2
    namespace: hmc-system
# ... 
  providers:
  - infrastructure-aws

New ClusterTemplate status in some object:

status:
  capiContracts:
    v1beta1: v1beta1_v1beta2
  chartRef:
    kind: HelmChart
    name: aws-hosted-cp-0-0-2
    namespace: hmc-system
# ... 
  providers:
  - infrastructure-aws
  - control-plane-k0smotron
  - bootstrap-k0smotron

Closes #497 #496

@zerospiel zerospiel force-pushed the providers_alignment branch from 91f2165 to 4f6692c Compare October 18, 2024 11:57
@zerospiel zerospiel marked this pull request as ready for review October 18, 2024 12:06
@zerospiel zerospiel force-pushed the providers_alignment branch 6 times, most recently from 1ff639b to dfc3bc0 Compare October 18, 2024 15:55
@zerospiel zerospiel requested a review from squizzi as a code owner October 18, 2024 16:03
@zerospiel zerospiel changed the title Align provider names with the CAPI labels Compatibility: unify providers and base on CAPI contract versions Oct 18, 2024
@zerospiel zerospiel force-pushed the providers_alignment branch 5 times, most recently from 55e7f21 to 5c0d401 Compare October 21, 2024 09:01
@zerospiel zerospiel force-pushed the providers_alignment branch from 5c0d401 to b03b9b3 Compare October 22, 2024 09:11
api/v1alpha1/providertemplate_types.go Outdated Show resolved Hide resolved
api/v1alpha1/providertemplate_types.go Outdated Show resolved Hide resolved
api/v1alpha1/providertemplate_types.go Outdated Show resolved Hide resolved
api/v1alpha1/templates_common.go Outdated Show resolved Hide resolved
api/v1alpha1/providertemplate_types.go Outdated Show resolved Hide resolved
@zerospiel zerospiel force-pushed the providers_alignment branch from 857f4dd to a1c1bc1 Compare October 23, 2024 13:29
@zerospiel zerospiel requested a review from eromanova October 23, 2024 13:44
* removed nested struct with infra/bstrp/cp
  providers
* removed the corresponding chart annotations
* align all providers into a single struct
  depending on a single annotation
  with regarding prefixes
* migrated provider/cluster templates on the
  new annotation

Closes Mirantis#497
* removed version/constraints from compatibility
  attributes
* compatibility is now based on CAPI contracts
  versions
* unified providers structure
* corresponding adjustments

Closes Mirantis#496
* change semicolon to comma as a separator
  in the provider templates charts
* capi-contract annotation removed
* unified separated capi contracts struct
  for cluster/provider templates
* capi contracts status in management status
* provider templates: validate capi contracts
  against core capi template
* cluster templates: validate provider contracts
  against provider templates contracts in management status
* renamed k0s -> k0smotron everywhere
@zerospiel zerospiel force-pushed the providers_alignment branch from a1c1bc1 to ad9af28 Compare October 24, 2024 06:20
@Kshatrix Kshatrix merged commit 59a0e13 into Mirantis:main Oct 24, 2024
5 checks passed
@zerospiel zerospiel deleted the providers_alignment branch October 24, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
3 participants