Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Use apiextensions.k8s.io/v1 CustomResourceDefinition, rather than deprecated v1beta1 #128

Merged
merged 1 commit into from Feb 18, 2021

Conversation

jgwest
Copy link
Member

@jgwest jgwest commented Feb 17, 2021

The v1beta1 CRD definition is deprecated since Kubernetes v1.16, and is causing issues with the Helm chart linting, also described here.

This PR:

  • Updates the makefile to generate v1 resources, rather than v1beta1
  • Fixes issue with k8s behaviour in the metadata fields of a template, in generated CRD resource:
    • Since controller-gen intentionally doesn't generate validation for k8s.io/apimachinery/pkg/apis/meta/v1, it is not included in the OpenAPI CRD schema.
    • But, if using apiextensions.k8s.io/v1 then k8s APIServer doesn't recognize this field as a valid metadata field (outside of it's use at the root). When you try to create an ApplicationSet with .spec.template.metadata fields (for example, from kubectl), the APIserver ignores the values.
    • Solution is to split the supported fields into their own ApplicationSet-managed type, rather than relying on ObjectMeta type.

Fixes #127

@jgwest jgwest requested a review from wtam2018 February 17, 2021 15:59
@jgwest jgwest changed the title Use apiextensions.k8s.io/v1 CustomResourceDefinition, rather than deprecated v1beta1 (#127) Use apiextensions.k8s.io/v1 CustomResourceDefinition, rather than deprecated v1beta1 Feb 17, 2021
@jgwest jgwest mentioned this pull request Feb 17, 2021
Copy link
Collaborator

@wtam2018 wtam2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@jgwest thanks.

@jgwest jgwest merged commit a16dc48 into argoproj:master Feb 18, 2021
@jgwest jgwest deleted the update-crd-version-127 branch April 20, 2021 19:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use apiextensions.k8s.io/v1 CustomResourceDefinition, rather than deprecated v1beta1
2 participants