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

kustomize build: could not find expected ':' #3626

Closed
zhouhaibing089 opened this issue Feb 24, 2021 · 7 comments
Closed

kustomize build: could not find expected ':' #3626

zhouhaibing089 opened this issue Feb 24, 2021 · 7 comments
Labels
area/kyaml issues for kyaml kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@zhouhaibing089
Copy link
Contributor

zhouhaibing089 commented Feb 24, 2021

kustomize build complains invalid YAML even though the YAML is well formatted(for e.g, yamllint reports no error ).

kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- resources.yaml

resources.yaml

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: tekton-pipelines-leader-election
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
rules:
- # We uses leases for leaderelection
  apiGroups: ["coordination.k8s.io"]
  resources: ["leases"]
  verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]

Expected output

$ kustomize build
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
  name: tekton-pipelines-leader-election
rules:
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - list
  - create
  - update
  - delete
  - patch
  - watch

Actual output

$ kustomize build
Error: map[string]interface {}{"apiVersion":"rbac.authorization.k8s.io/v1", "kind":"ClusterRole", "metadata":map[string]interface {}{"labels":map[string]interface {}{"app.kubernetes.io/instance":"default", "app.kubernetes.io/part-of":"tekton-pipelines"}, "name":"tekton-pipelines-leader-election"}, "rules":[]interface {}{map[string]interface {}{"apiGroups":[]interface {}{"coordination.k8s.io"}, "resources":[]interface {}{"leases"}, "verbs":[]interface {}{"get", "list", "create", "update", "delete", "patch", "watch"}}}}: yaml: line 11: could not find expected ':'

Kustomize version

$ kustomize version
{Version:kustomize/v4.0.1 GitCommit:516ff1fa56040adc0173ff6ece66350eb4ed78a9 BuildDate:2021-02-14T05:00:02+00:00 GoOs:darwin GoArch:amd64}

Platform

macOS

Additional context

kustomize build works when I change the resources.yaml to be:

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: tekton-pipelines-leader-election
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
rules:
# We uses leases for leaderelection
- apiGroups: ["coordination.k8s.io"]
  resources: ["leases"]
  verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]

See the difference of wherer # We uses leases for leaderelection is positioned.

By the way, kustomize v2.0.3 works fine and we see this issue when we upgrade to the latest version.

@zhouhaibing089
Copy link
Contributor Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 24, 2021
@Shell32-Natsu Shell32-Natsu added the area/kyaml issues for kyaml label Feb 24, 2021
@Shell32-Natsu
Copy link
Contributor

Similar with #3614. This should be fixed after #3271.

@Shell32-Natsu Shell32-Natsu added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Feb 26, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 27, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 26, 2021
@zhouhaibing089
Copy link
Contributor Author

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 2, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 30, 2021
@zhouhaibing089
Copy link
Contributor Author

zhouhaibing089 commented Oct 4, 2021

To clarify, this issue was fixed starting from kustomize v4.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kyaml issues for kyaml kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants