You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently have developed a library chart for a certain set of functions which is added as a dependency in another chart. The dependency is updated using the helm dep update <my-chart> command.
The config-pvc.yaml using the library chart is as follows
The library function written under a lib chart under templates/_pvc.tpl is as follows
{{/*
PVC for config
*/}}
{{- define "factory.pvcConfigCommonSpec" -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "factory.name" . }}-config
namespace: {{ .Release.Namespace }}
spec:
{{- end }}
The unit test for the same is written under _test folder with the file configpvc_test.yaml as follows:
---
suite: test config-pvctemplates:
- config-pvc.yamltests:
- it: should use local values when deployed as local chartset:
storage.nfs.accessModes: ReadyWriteManystorage.nfs.configSize: 10Miasserts:
- hasDocuments:
count: 1
- equal:
path: spec.accessModes[0]value: ReadyWriteMany
- equal:
path: spec.resources.requests.storagevalue: 10Mi
- it: should override name and namespaceset:
nameOverride: cms-hellorelease:
namespace: testasserts:
- hasDocuments:
count: 1
- isKind:
of: PersistentVolumeClaim
- isAPIVersion:
of: v1
- equal:
path: metadata.namespacevalue: test
- equal:
path: metadata.namevalue: cms-hello-config
The result of running the test gives the following
Issue:
The lib chart part is not gettting rendered by the unittest plugin and is reporting as null in the sections where its getting checked for values.
The text was updated successfully, but these errors were encountered:
It might be an indentation/newline issue on apiVersion: v1, since it's the first element of the document ?
I usually do a helm template --debug to check the rendered YAML
I recently have developed a library chart for a certain set of functions which is added as a dependency in another chart. The dependency is updated using the
helm dep update <my-chart>
command.The
config-pvc.yaml
using the library chart is as followsThe library function written under a lib chart under
templates/_pvc.tpl
is as followsThe unit test for the same is written under
_test
folder with the fileconfigpvc_test.yaml
as follows:The result of running the test gives the following
![image](https://user-images.githubusercontent.com/21075059/143682709-b2dfc79a-da72-4b32-8ead-f424b21f2865.png)
Issue:
The lib chart part is not gettting rendered by the unittest plugin and is reporting as null in the sections where its getting checked for values.
The text was updated successfully, but these errors were encountered: