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

All versions of kustomize 4 up to 0.5 bail out on parsing Tekton Pipelines CRD spec (where the same CRD parses fine w/ v3.8.10) #3726

Closed
ghglza opened this issue Mar 15, 2021 · 1 comment

Comments

@ghglza
Copy link

ghglza commented Mar 15, 2021

Describe the bug

When trying to apply a kustomization to the Tekton Pipelines resources.yaml, kustomize bails out with an error message indicating it cannot parse CRD specs.

Files that can reproduce the issue

Try to apply the following kustomization

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-defaults
  namespace: tekton-pipelines
data:
  default-timeout-minutes: '180' # minutes
  default-service-account: 'tekton-buildbot'

as a strategic merge patch to the following snippet from the Tekton Pipelines resource definitions

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: clustertasks.tekton.dev
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
    pipeline.tekton.dev/release: "v0.22.0"
    version: "v0.22.0"
spec:
  group: tekton.dev
  preserveUnknownFields: false
  versions:
    - &version
      name: v1alpha1
      served: true
      storage: false
      schema:
        openAPIV3Schema:
          type: object
          x-kubernetes-preserve-unknown-fields: true
      # Opt into the status subresource so metadata.generation
      # starts to increment
      subresources:
        status: {}
    - !!merge <<: *version
      name: v1beta1
      storage: true
  names:
    kind: ClusterTask
    plural: clustertasks
    categories:
      - tekton
      - tekton-pipelines
  scope: Cluster
  conversion:
    strategy: Webhook
    webhook:
      conversionReviewVersions: ["v1beta1"]
      clientConfig:
        service:
          name: tekton-pipelines-webhook
          namespace: tekton-pipelines

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-defaults
  namespace: tekton-pipelines
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
data:

(where the complete resource set can be downloaded from here)

Expected output
Generated with kustomize v3.8.10:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
    pipeline.tekton.dev/release: v0.22.0
    version: v0.22.0
  name: clustertasks.tekton.dev
spec:
  conversion:
    strategy: Webhook
    webhook:
      clientConfig:
        service:
          name: tekton-pipelines-webhook
          namespace: tekton-pipelines
      conversionReviewVersions:
      - v1beta1
  group: tekton.dev
  names:
    categories:
    - tekton
    - tekton-pipelines
    kind: ClusterTask
    plural: clustertasks
  preserveUnknownFields: false
  scope: Cluster
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        type: object
        x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: false
    subresources:
      status: {}
  - name: v1beta1
    schema:
      openAPIV3Schema:
        type: object
        x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: true
    subresources:
      status: {}
---
apiVersion: v1
data:
  default-service-account: tekton-buildbot
  default-timeout-minutes: "180"
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
  name: config-defaults
  namespace: tekton-pipelines

Actual output

Error: map[string]interface {}{"apiVersion":"apiextensions.k8s.io/v1", "kind":"CustomResourceDefinition", "metadata":map[string]interface {}{"labels":map[string]interface {}{"app.kubernetes.io/instance":"default", "app.kubernetes.io/part-of":"tekton-pipelines", "pipeline.tekton.dev/release":"v0.22.0", "version":"v0.22.0"}, "name":"clustertasks.tekton.dev"}, "spec":map[string]interface {}{"conversion":map[string]interface {}{"strategy":"Webhook", "webhook":map[string]interface {}{"clientConfig":map[string]interface {}{"service":map[string]interface {}{"name":"tekton-pipelines-webhook", "namespace":"tekton-pipelines"}}, "conversionReviewVersions":[]interface {}{"v1beta1"}}}, "group":"tekton.dev", "names":map[string]interface {}{"categories":[]interface {}{"tekton", "tekton-pipelines"}, "kind":"ClusterTask", "plural":"clustertasks"}, "preserveUnknownFields":false, "scope":"Cluster", "versions":[]interface {}{map[string]interface {}{"name":"v1alpha1", "schema":map[string]interface {}{"openAPIV3Schema":map[string]interface {}{"type":"object", "x-kubernetes-preserve-unknown-fields":true}}, "served":true, "storage":false, "subresources":map[string]interface {}{"status":map[string]interface {}{}}}, map[interface {}]interface {}{"name":"v1beta1", "schema":map[string]interface {}{"openAPIV3Schema":map[string]interface {}{"type":"object", "x-kubernetes-preserve-unknown-fields":true}}, "served":true, "storage":true, "subresources":map[string]interface {}{"status":map[string]interface {}{}}}}}}: json: unsupported type: map[interface {}]interface {}

Kustomize version
All versions of kustomize 4 up to 4.0.5

Platform
CentOS 7

@Shell32-Natsu
Copy link
Contributor

Duplicate of #3614

@Shell32-Natsu Shell32-Natsu marked this as a duplicate of #3614 Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants