티스토리 뷰

반응형

helm template 명령어로 확인하려고 했는데 아래와 같이 알수 없는 오류가 발생했다.

결론부터 말하면, range 하위에 include 를 썼는데 이때 영향을 받았던 문제였다.

Error: render error in "...deployment.yaml": template: ...deployment.yaml:81:16: executing "...deployment.yaml" at <include "sample.kerberos" .>: error calling include: template: sample/templates/_helpers.tpl:166:8: executing "sample.kerberos" at <include "is_security_kerberos" .>: error calling include: template: sample/templates/_helpers.tpl:100:25: executing "is_security_kerberos" at <include "sample_config" .>: error calling include: template: sample/templates/_helpers.tpl:67:61: executing "sample_config" at <.Values.profile>: can't evaluate field Values in type string

 

해결방법

우선 range 문을 쓰게되면 . 이 특별한 의미를 같게 된다. 그래서 incldue 하는곳에서 . 을 쓰면 문제가 발생된다.

이를 회피하는방법은 . 을 $ 로 바꿔주면 된다.  예시로 설명하면 아래와 같다.

 

before

{{ range $clusterName, $clusterPrincipal := $clusterDict }}
...
   {{- include "sample.kerberos" . | nindent 12 }}
...
{{- end }}

 

after

{{ range $clusterName, $clusterPrincipal := $clusterDict }}
...
   {{- include "sample.kerberos" $ | nindent 12 }}
...
{{- end }}

 

한참 헤멨는데 이렇게 해결했다. 끝

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함