Skip to content

adopted resource not replaced when using upgrade --install --force #11585

@ngraef

Description

@ngraef

Setup

Given a cluster with an existing resource not installed by Helm and a chart that contains that resource so Helm can take over release management,

  1. Following the process added in Adopt resources into release with correct instance and managed-by labels #7649, add label and annotations to the existing resource that was not installed by Helm.
  2. Run helm upgrade --install --force <release> <chart>

Expected behavior

Existing resource is adopted into the release (because of the label/annotations) and replaced (because of --force).

Observed behavior

Existing resource is adopted into the release and updated with the default patch strategy.

The install process explicitly sets the force parameter to false when adopting resources:

if _, err := i.cfg.KubeClient.Update(toBeAdopted, resources, false); err != nil {

Environment

Output of helm version:

version.BuildInfo{Version:"v3.10.2", GitCommit:"50f003e5ee8704ec937a756c646870227d7c8b58", GitTreeState:"clean", GoVersion:"go1.19.3"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.4", GitCommit:"95ee5ab382d64cfe6c28967f36b53970b8374491", GitTreeState:"clean", BuildDate:"2022-08-17T18:46:11Z", GoVersion:"go1.19", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.13+k3s1", GitCommit:"66263ac7f0c2c3579f58247718db7df61af92050", GitTreeState:"clean", BuildDate:"2022-10-25T19:05:03Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/arm64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.): Rancher Desktop


Related: #9958

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.in progress

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions