helm / helm/helm-mapkubeapis

Kube mapping value not detected

Open
#107 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

Hi folks 👋

I would like to raise you a recent issue I have with this amazing tool.
Indeed I noticed recently that I wasn't able to update deprecated resource in my helm releases

By looking at the code and making some try I finally came to the conclusion that the comparison between the modifiedManifest and the deprecatedAPI failed every time since the modifiedManifest yaml contains double quotes (") for each values and the map in the config file don't : so the plugin never try to apply the update on the resource 😅

Here is the line of the comparison

Here is a sample of the modifiedManifest when I print it through the code

apiVersion: "networking.k8s.io/v1beta1"
kind: "Ingress"

Also I noticed this is not consistent for all resources, for example we have custom resources called DNSEndpoint (from the external-dns project)

apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint

When I modify the map file and I manually add the escaped double quote, it works:

 - deprecatedAPI: "apiVersion: \"networking.k8s.io/v1beta1\"\nkind: \"Ingress\"\n"
    newAPI: "apiVersion: \"networking.k8s.io/v1\"\nkind: \"Ingress\"\n"
    deprecatedInVersion: "v1.19"
    removedInVersion: "v1.22"

Maybe some kind of sanitization is required here I don't know, let me know 😉

I'm not sure when it starts to do that, so here is my config:

  • kube client v1.26.3
  • kube server v1.23.16
  • helm v3.11.2
  • helm plugin mapkubeapis 0.4.1

Don't hesitate to reach me if you need more details
Cheers 😉

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

Inspect the comparison at pkg/common/common.go#L95 and the mappings in config/Map.yaml. Reproduce the mismatch with the quoted Ingress manifest shown in the issue, then verify that deprecated API mappings are detected consistently for quoted and unquoted YAML values.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, helm, kubernetes
Domain
api, devops, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.