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

Can not add any comment in .yaml #3778

Closed
Jojoooo1 opened this issue Apr 7, 2021 · 6 comments
Closed

Can not add any comment in .yaml #3778

Jojoooo1 opened this issue Apr 7, 2021 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@Jojoooo1
Copy link

Jojoooo1 commented Apr 7, 2021

Describe the bug
Can not add a comment in my .yaml

Trying to use kustomize with a .yaml using a comment.
Version 3.8.10 works perfectly
Version 3.9.3 throw yaml: invalid trailing UTF-8 octet

Files that can reproduce the issue

kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: default

resources:
  - ingress.yaml

ingress.yaml

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-intelipoint
spec:
  rules:
    - host: # A COMMENT
      http:
        paths:
          - backend:
              serviceName: intelipoint-api
              servicePort: 80

Expected output

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-intelipoint
  namespace: default
spec:
  rules:
    - host:
      http:
        paths:
          - backend:
              serviceName: intelipoint-api
              servicePort: 80

Actual output

Error: map[string]interface {}{"apiVersion":"networking.k8s.io/v1beta1", "kind":"Ingress", "metadata":map[string]interface {}{"annotations":map[string]interface {}{"cert-manager.io/cluster-issuer":"letsencrypt-prod", "kubernetes.io/ingress.class":"nginx", "nginx.ingress.kubernetes.io/force-ssl-redirect":"true"}, "name":"ingress-intelipoint", "namespace":"default"}, "spec":map[string]interface {}{"rules":[]interface {}{map[string]interface {}{"host":interface {}(nil), "http":map[string]interface {}{"paths":[]interface {}{map[string]interface {}{"backend":map[string]interface {}{"serviceName":"intelipoint-api", "servicePort":80}}}}}}}}: yaml: invalid trailing UTF-8 octet

Kustomize version

{Version:kustomize/v3.9.3 GitCommit:1ae8303bdc9372bc7c15942df6e9cf5d67fdba1a BuildDate:2021-02-07T17:02:13Z GoOs:linux GoArch:amd64}

Platform

Ubuntu 18.04.5 LTS

Edit: work by using kustomize build . --enable_kyaml=false

@Jojoooo1 Jojoooo1 added the kind/bug Categorizes issue or PR as related to a bug. label Apr 7, 2021
@Shell32-Natsu Shell32-Natsu added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 7, 2021
@cfraenkel
Copy link

I'm hitting the same error, but only when the comment contains a non ascii unicode character like 'ä'.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-intelipoint
spec:
  rules:
    - host: # Ä COMMENT
      http:
        paths:
          - backend:
              serviceName: intelipoint-api
              servicePort: 80

if the unicode char appears in a non-comment there is no similar error:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-intelipoint
spec:
  rules:
    - host: ä # A COMMENT
      http:
        paths:
          - backend:
              serviceName: intelipoint-api
              servicePort: 80

This issue also affects the kustomize bundled in the most recent kubectl 1.21.0

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"}

@Shell32-Natsu
Copy link
Contributor

This issue is in go-yaml library and we need to update it. #3789 does this and this should be fixed after it.

@Shell32-Natsu Shell32-Natsu added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 12, 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 Jul 11, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active 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 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 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 Aug 10, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active 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:

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

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

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active 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:

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

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

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

6 participants