Skip to content

Commit

Permalink
feat(manager/kubernetes): strip go templates before parsing (#28816)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice authored May 3, 2024
1 parent 7d41ab3 commit 1976b57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/modules/manager/kubernetes/__fixtures__/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{- if .Values.configMap.enabled | default false }
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
labels:
app: nginx
data: {}
{- end }
5 changes: 4 additions & 1 deletion lib/modules/manager/kubernetes/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ function extractApis(

try {
// TODO: use schema (#9610)
doc = parseYaml(content);
doc = parseYaml(content, null, {
filename: packageFile,
removeTemplates: true,
});
} catch (err) {
logger.debug({ err, packageFile }, 'Failed to parse Kubernetes manifest.');
return [];
Expand Down

0 comments on commit 1976b57

Please sign in to comment.