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

Inline yaml comments not preserved in v1.0.6 #261

Closed
ahmetb opened this issue Aug 14, 2018 · 2 comments
Closed

Inline yaml comments not preserved in v1.0.6 #261

ahmetb opened this issue Aug 14, 2018 · 2 comments

Comments

@ahmetb
Copy link
Member

ahmetb commented Aug 14, 2018

Apparently #233 added support for preserving comments.

However with v1.0.6 (017c4ae) I'm not seeing this behavior.

kustomization.yaml:

resources:
- service.yaml

base.yaml:

apiVersion: v1
kind: Service
metadata:
  name: "<name-here>"
  labels:
    app: "<label>"
spec:
  selector:
    app: "<pod-label>"
  ports:
  - protocol: TCP
    port: 80         # port number the Service load balancer will accept traffic
    targetPort: 5000 # port number defined on Pod's containerPort

patch/patch.yaml:

apiVersion: v1
kind: Service
metadata:
  name: "<name-here>"
spec:
  loadBalancerIP: "TYPE.IP.ADDR.HERE" # static IP address reserved for this LB

patch/kustomization.yaml

bases:
- "../"
patches:
- patch.yaml

kustomize build patch/ output (has no comments):

apiVersion: v1
kind: Service
metadata:
  labels:
    app: <label>
  name: <name-here>
spec:
  kind: LoadBalancer
  loadBalancerIP: TYPE.IP.ADDR.HERE
  ports:
  - port: 80
    protocol: TCP
    targetPort: 5000
  selector:
    app: <pod-label>
@Liujingfang1
Copy link
Contributor

@ahmetb I think you misunderstood the scope of that PR. In v1.0.6, preserving comments(not including the inline comment) and order is only for kustomization.yaml and it happens during kustomize edit. We'd also like Kustomize to preserve arbitrary comments, but couldn't support that at this moment. To do that, we need a yaml library being able to preserve all comments. So far we haven't found such library available.

@ahmetb
Copy link
Member Author

ahmetb commented Aug 15, 2018

I see my bad. Feel free to close.

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