Skip to content

helm: Do not parse initial 'helm get' section as a manifest#4244

Closed
tstromberg wants to merge 1 commit intoGoogleContainerTools:masterfrom
tstromberg:quiet-helm-yaml-warning
Closed

helm: Do not parse initial 'helm get' section as a manifest#4244
tstromberg wants to merge 1 commit intoGoogleContainerTools:masterfrom
tstromberg:quiet-helm-yaml-warning

Conversation

@tstromberg
Copy link

@tstromberg tstromberg commented May 21, 2020

This removes the scary error decoding parsed yaml: Object 'Kind' is missing in message that appears with every Helm deployment.

This log message is caused due to skaffold parsing the front-matter of helm get output as if it was a Kubernetes manifest. This PR skips the initial section for object parsing, and raises the warning level for subsequent sections from info to error.

Fixes #3642

Using examples/helm-deployment with skaffold run -v info, you can see the difference:

At head

INFO[0030] Building helm dependencies...                
NAME: skaffold-helm
LAST DEPLOYED: Thu May 21 11:44:36 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
INFO[0031] error decoding parsed yaml: Object 'Kind' is missing in 'NAME: skaffold-helm
LAST DEPLOYED: Thu May 21 11:44:36 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
USER-SUPPLIED VALUES:
image: skaffold-helm:9eeb2cd8a4cb941fc16f4fc1796d713da20308e5f391cd10a35b1aa4bb8f6e2a

COMPUTED VALUES:
image: skaffold-helm:9eeb2cd8a4cb941fc16f4fc1796d713da20308e5f391cd10a35b1aa4bb8f6e2a
ingress:
  annotations: null
  enabled: true
  hosts: null
  tls: null
replicaCount: 1
resources: {}
service:
  externalPort: 80
  internalPort: 80
  name: nginx
  type: NodePort

HOOKS:
MANIFEST:
' 
INFO[0031] Deploy complete in 1.403286918s              
Waiting for deployments to stabilize...

With this PR

INFO[0000] Building helm dependencies...                
NAME: skaffold-helm
LAST DEPLOYED: Thu May 21 11:41:40 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
INFO[0001] Deploy complete in 1.149852761s              
Waiting for deployments to stabilize...

@tstromberg tstromberg changed the title helm: Don't try to parse initial 'get' section as Kubernetes manifest helm: Don't parse initial 'get' section as a Kubernetes manifest May 21, 2020
@tstromberg tstromberg changed the title helm: Don't parse initial 'get' section as a Kubernetes manifest helm: Do not parse initial 'helm get' section as a Kubernetes manifest May 21, 2020
@tstromberg tstromberg changed the title helm: Do not parse initial 'helm get' section as a Kubernetes manifest helm: Do not parse initial 'helm get' section as a manifest May 21, 2020

// The initial section of "helm get" is not a Kubernetes manifest
if i == 1 {
continue
Copy link
Member

Choose a reason for hiding this comment

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

Is there any value in logging that section header?

I'm (very mildly) worried that Helm 4 or 5 might starting emitting valid k8s manifests and we'll throw this first element away. Would it make sense to instead try parsing it and instead ignore the error if it's the first object?

@briandealwis
Copy link
Member

@tstromberg were you still interested in getting this in?

@nkubala
Copy link
Contributor

nkubala commented Jun 22, 2020

@tstromberg this is starting to get stale, could you have a look at the failing unit tests?

@gsquared94
Copy link
Contributor

@tstromberg this is starting to get stale, could you have a look at the failing unit tests?

@tstromberg ping

@briandealwis
Copy link
Member

I have a simpler implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

helm: error decoding parsed yaml: Object 'Kind'...

5 participants