Kubernetes/삽질

[Helm] Jenkins - coalesce.go:220: warning: cannot overwrite table with non table for

비번변경 2025. 4. 24. 11:26

현상

AWS EKS의 NodeGroup LT 업데이트로 인해 노드 재시작이 발생했는데, Jenkins 서비스가 시작하던 중 플러그인 버전 충돌이 발생해 Jenkins 버전 업그레이드를 진행하려고 한다.

Jenkins Helm Chart(https://charts.jenkins.io)의 4.6.1 버전에서 5.1.0 버전으로 업그레이드를 진행하려고 했는데…… helm upgrade 중 아래와 같이 오류가 발생하면서 업그레이드가 되지 않았다.

원인을 확인하고 문제를 해결해 보자.

 

 

원인

확인해 보니 Chart Templete과 매핑하고자 하는 values.yaml의 데이터 형식 등이 맞지 않을 때, 매핑되지 않는 값을 전달하거나 list를 전달해야 하는데 dictionmary를 전달하는 등의 상황일 때 발생하는 오류인 것 같다.

이 글에서는 Jenkins Chart 버전이 업그레이드되면서 values.yaml 구조에 변경이 있었는데, 4.6.1 버전의 values.yaml을 사용해 업그레이드를 시도한 것이 오류가 발생한 원인인 것 같다.

 

4.6.1 to 5.1.0 차이점 : https://artifacthub.io/packages/helm/jenkinsci/jenkins/5.1.0?modal=values&compare-to=4.6.1 

 

 

 

해결

오류 출력을 보면 매핑이 되지 않는 속성을 확인할 수 있다.

coalesce.go:220: warning: cannot overwrite table with non table for jenkins.helmtest.bats.image (map[registry:docker.io repository:bats/bats tag:v1.10.0])

예로 들어, 위의 내용은 jenkins.helmtest.bats.image 속성에서 문제가 발생했다는 뜻이다. 4.6.1 차트 버전과 5.1.0 버전의 values.yaml을 비교해 보면 다음과 같다.

 

v4.6.1 values.yaml

https://artifacthub.io/packages/helm/jenkinsci/jenkins/4.6.1?modal=values&path=helmtest.bats.image

# Here you can configure unit tests values when executing the helm unittest in the CONTRIBUTING.md
helmtest:
  # A testing framework for bash
  bats:
    # Bash Automated Testing System (BATS)
    image: "bats/bats"
    tag: "1.9.0"

 

v5.1.0 values.yaml

https://artifacthub.io/packages/helm/jenkinsci/jenkins/5.1.0?modal=values&path=helmtest.bats.image

# Here you can configure unit tests values when executing the helm unittest in the CONTRIBUTING.md
helmtest:
  # A testing framework for bash
  bats:
    # Bash Automated Testing System (BATS)
    image:
      # -- Registry of the image used to test the framework
      registry: "docker.io"
      # -- Repository of the image used to test the framework
      repository: "bats/bats"
      # -- Tag of the image to test the framework
      tag: "v1.10.0"

image 항목에 registry, repository, tag 속성이 추가된 것을 확인할 수 있다.

 

이렇게 문제가 발생하는 속성을 최신화하여 배포하면 된다.

또는 업그레이드할 버전의 기본 values.yaml에 사용자 정의가 필요한 값을 수정하여 배포한다. 내 경우에는 기존 차트 버전의 기본 values.yaml과 배포에 사용한 values.yaml을 텍스트 비교하여 사용자 정의가 필요한 값을 확인했다.

 

 

 

참고 문서

https://stackoverflow.com/questions/51723983/helm-cannot-overwrite-table-with-non-table-for-tls

https://github.com/helm/helm/issues/7902

 

728x90