-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix Helm deployment check to only retrieve deployed YAML #5723
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5723 +/- ##
==========================================
- Coverage 70.82% 70.81% -0.01%
==========================================
Files 421 421
Lines 16043 16045 +2
==========================================
Hits 11363 11363
- Misses 3846 3847 +1
- Partials 834 835 +1
Continue to review full report at Codecov.
|
Thanks Manually verified by adding Example Last Helm release record (`helm get all skaffold-helm-default`)# Source: skaffold-helm/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: skaffold-helm
labels:
app: skaffold-helm
chart: skaffold-helm-0.1.0
release: skaffold-helm
heritage: Helm
spec:
selector:
matchLabels:
app: skaffold-helm
release: skaffold-helm
replicas: 1
template:
metadata:
labels:
app: skaffold-helm
release: skaffold-helm
spec:
volumes:
- name: static-assets
configMap:
name: skaffold-helm
defaultMode: 420
containers:
- name: skaffold-helm
image: gcr.io/tejal-gke1/skaffold-helm:latest@sha256:9dc6c65944f0970ffd6ffc3c80e4c4d5e01e683e8acf75a2b4ee0350fb62fc76
imagePullPolicy:
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html/
name: static-assets
resources:
{}
NOTES:
Thank you for installing skaffold-helm.
Your release is named skaffold-helm. vs Example Last Helm release record (`helm get all skaffold-helm-default --template '{{.Release.Manifest}}'`)# Source: skaffold-helm/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: skaffold-helm
labels:
app: skaffold-helm
chart: skaffold-helm-0.1.0
release: skaffold-helm
heritage: Helm
spec:
selector:
matchLabels:
app: skaffold-helm
release: skaffold-helm
replicas: 1
template:
metadata:
labels:
app: skaffold-helm
release: skaffold-helm
spec:
volumes:
- name: static-assets
configMap:
name: skaffold-helm
defaultMode: 420
containers:
- name: skaffold-helm
image: gcr.io/tejal-gke1/skaffold-helm:latest@sha256:9dc6c65944f0970ffd6ffc3c80e4c4d5e01e683e8acf75a2b4ee0350fb62fc76
imagePullPolicy:
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html/
name: static-assets
resources:
{} |
Fixes: #5484
Description
The Helm deployer calls
helm get all <chart>
to get the release record for the deployed chart and then parses these release record to get the Kubernetes YAML.Example Helm release record (`helm get all skaffold-helm-default`)
We try parsing YAML documents from this record, but this is a semi-structured format at best. But since the Kubernetes YAML is the last item reported, and is always preceded with an YAML end-doc (
---
), our parsing usually works without incident.But a
NOTES.txt
changes the output such that theNOTES.txt
content comes after the Kubernetes YAML.Since Helm does not add an end-doc
---
, the last YAML doc fails to parse and we emit an error. We use this release record primarily to extract the deployed namespaces from the Kubernetes YAML; since most projects deploy to a single namespace or have multiple objects across namespaces, this error is usually of no consequence.This PR changes the code to request only the deployed Kubernetes YAML using
helm get all <chart> --template '{{.Release.Manifest}}'
which is supported back to Helm 3.0. From the tests, this seems to have been the expected output 🤷