skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Skaffold setValues is getting missing helm values.

Open m18unet opened this issue 3 years ago • 1 comments

Skaffold setValues is getting missing helm values.

Instead of setValues, when I save the relevant values in the values.yml file and use valuesFiles, there is no problem and the rendering is successful.

I guess setValues doesn't recognize nested arrays. Please review the example below.

Why the ingress.tls[0].hosts doesn't exist?

skaffold.yaml

apiVersion: skaffold/v2beta29
kind: Config
build:
  local:
    push: false
  tagPolicy:
    sha256: {}
  artifacts:
  - image: example
    jib: {}
    sync:
      auto: false
deploy:
  helm:
    releases:
    - name: example
      chartPath: backend-app
      artifactOverrides:
        image: example
      imageStrategy:
        helm: {}
      setValues:
        ingress:
          enabled: true
          className: nginx
          hosts:
            - host: example.minikube
              paths:
                - path: /
                  pathType: ImplementationSpecific
          tls:
            - secretName: example-tls
              hosts:
                - example.minikube

skaffold run

skaffold run -v TRACE
# Output
[...]
[...]
[...]
DEBU[0106] Running command: [
helm --kube-context minikube install example backend-app --set-string image.repository=example,image.tag=6ad72230060e482fef963b295c0422e8d2f967183aeaca0229838daa7a1308c3 --set ingress.className=nginx --set --set ingress.enabled=true --set ingress.hosts[0].host=example.minikube --set ingress.hosts[0].paths[0].path=/ --set ingress.hosts[0].paths[0].pathType=ImplementationSpecific --set ingress.tls[0].secretName=example-tls]  subtask=0 task=Deploy
[...]
[...]
[...]

I want to ask again, Why the ingress.tls[0].hosts doesn't exist?

Ingress Manifest

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example
spec:
  ingressClassName: nginx
  tls:
    - hosts:
      secretName: example-tls
  rules:
    - host: "example.minikube"
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: example
                port:
                  number: 80

m18unet avatar Sep 08 '22 12:09 m18unet

I think this code needs to handle the !ok case: https://github.com/GoogleContainerTools/skaffold/blob/e5a846c1efc57f7073b30b6ab010a0d9fe84a115/pkg/skaffold/schema/util/util.go#L119-L124

briandealwis avatar Sep 13 '22 02:09 briandealwis

Thanks! @renzodavid9 @aaron-prindle

m18unet avatar Nov 30 '22 20:11 m18unet