saltstack / saltstack/salt

[BUG] helm.release_present broken

Open
#66,038 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
helm.release_present should have the "ensure" semantics, yet underlying helm.status doesn't accept global flags from kvflags which makes this state useless when passing kubeconfig helm flag.

If this state is to accept KUBECONFIG somehow differenltly - please let me know?

Setup
Sample state (have helm available upfront)

kubernetes_cni_release:
  helm.release_present:
    - name: cilium
    - namespace: cilium
    - chart: cilium/cilium
    - version: 1.14.6
    - set: []
    - flags:
      - "create-namespace"
      - "wait"
    - kvflags:
        kubeconfig: /etc/rancher/k3s/k3s.yaml

The minion must have the KUBECONFIG on non standard location

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior
Run sls from setup section

          ID: kubernetes_cni_release                                                                                                                                                                                                                                                                                        
    Function: helm.release_present                                                                                                                                                                                                                                                                                          
        Name: cilium                                                                                                                                                                                                                                                                                                        
      Result: False                                                                                                                                                                                                                                                                                                         
     Comment: Error: INSTALLATION FAILED: cannot re-use a name that is still in use                                                                                                                                                                                                                                         
     Started: 16:13:42.552550                                                                                                                                                                                                                                                                                               
    Duration: 621.304 ms                                                                                                                                                                                                                                                                                                    
     Changes:         

This happens because helm.status cannot connect to k8s

Expected behavior
Helm Chart release properly detected and upgraded/installed accordingly

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.5
 
Python Version:
        Python: 3.10.13 (main, Nov 15 2023, 04:34:27) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: 5.0.3
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: 1.5.0
  looseversion: 1.0.2
      M2Crypto: 0.38.0
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: 1.10.1
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.14.2
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 12 bookworm
        locale: utf-8
       machine: x86_64
       release: 6.5.0-0.deb12.4-amd64
        system: Linux
       version: Debian GNU/Linux 12 bookworm

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the helm.release_present state and follow its helm.status path, focusing on how flags and kvflags are passed. Reproduce the supplied cilium state with the kubeconfig flag, then verify that an existing release is detected and upgraded or installed instead of failing with a name-in-use error.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes, python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.