Skip to content
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

修改values.yaml文件的tolerations对象后生成模板失败 #25

Closed
welyss opened this issue Oct 17, 2023 · 2 comments
Closed

修改values.yaml文件的tolerations对象后生成模板失败 #25

welyss opened this issue Oct 17, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@welyss
Copy link

welyss commented Oct 17, 2023

版本: polardbx-operator-1.4.1.tar.gz
polardbx-operator/values.yaml:

  nodeSelector: { }
  affinity: { }
  tolerations:
  - key: "dedicated"
    operator: "Equal"
    value: "dba"
    effect: "NoSchedule"

错误日志:

[root@localhost polardb-x]# helm template polardbx-operator --output-dir ./result --debug>aa
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /root/.kube/config
install.go:178: [debug] Original chart version: ""
install.go:195: [debug] CHART PATH: /root/polardb-x/polardbx-operator

Error: YAML parse error on polardbx-operator/templates/controller-manager-deployment.yaml: error converting YAML to JSON: yaml: line 38: did not find expected key
helm.go:84: [debug] error converting YAML to JSON: yaml: line 38: did not find expected key
YAML parse error on polardbx-operator/templates/controller-manager-deployment.yaml
helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:146
helm.sh/helm/v3/pkg/releaseutil.SortManifests
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:106
helm.sh/helm/v3/pkg/action.(*Configuration).renderResources
        helm.sh/helm/v3/pkg/action/action.go:165
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
        helm.sh/helm/v3/pkg/action/install.go:259
main.runInstall
        helm.sh/helm/v3/cmd/helm/install.go:264
main.newTemplateCmd.func2
        helm.sh/helm/v3/cmd/helm/template.go:82
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/cobra@v1.4.0/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/cobra@v1.4.0/command.go:974
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/cobra@v1.4.0/command.go:902
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:255
runtime.goexit
        runtime/asm_amd64.s:1581

生成后错误的yaml(debug):

              fieldPath: metadata.annotations['pause']
      tolerations:
              - effect: NoSchedule
          key: dedicated
          operator: Equal
          value: dba
      containers:

感觉是toYaml函数会带上本行空格导致, 修改controller-manager-deployment.yaml文件中tolerations部分从

      {{- with .Values.controllerManager.tolerations }}
      tolerations:
      {{ toYaml . | indent 8 }}
      {{- end }}

改为

      {{- with .Values.controllerManager.tolerations }}
      tolerations:
{{ toYaml . | indent 6 }}
      {{- end }}

能修复,类似的可能还有nodeSelector, affinity部分(toYaml相关)

@vettalwu vettalwu self-assigned this Oct 17, 2023
@vettalwu
Copy link
Collaborator

@welyss Thanks for your report. This issue will be resolved in the next version.

@vettalwu vettalwu added the bug Something isn't working label Oct 22, 2023
@vettalwu
Copy link
Collaborator

Fixed in 1.5.0-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants