Skip to content

Helm handles custom resources and native resources differently, resulting in custom resources being unable to be updated #2805

@TIEDPAG

Description

@TIEDPAG

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have an application that is being migrated to fleet. The original platform does not use helm. During the first migration, the two resources in the release, one is a native resource and the other is a custom resource. The native resource can be updated normally, but the custom resource cannot be updated. I think this is a problem with helm. I looked up some issues in helm and it seems to be related to this helm/helm#12827.
Then I set helm.force to true in fleet.yaml, hoping to update the resource using the replace method, but I found that fleet does not pass in the force parameter when installing, which makes it ineffective.But when updating, force is allowed.
This is the fleet code I saw

u := action.NewInstall(&cfg)
u.ClientOnly = h.template || dryRun
if cfg.Capabilities != nil {
if cfg.Capabilities.KubeVersion.Version != "" {
u.KubeVersion = &cfg.Capabilities.KubeVersion
}
if cfg.Capabilities.APIVersions != nil {
u.APIVersions = cfg.Capabilities.APIVersions
}
}
u.TakeOwnership = options.Helm.TakeOwnership
u.EnableDNS = !options.Helm.DisableDNS
u.Replace = true
u.ReleaseName = releaseName
u.CreateNamespace = true
u.Namespace = defaultNamespace
u.Timeout = timeout
u.DryRun = dryRun
u.PostRenderer = pr
u.WaitForJobs = options.Helm.WaitForJobs
if u.Timeout > 0 {
u.Wait = true
}
if !dryRun {
logger.Info("Installing helm release")
}
return u.Run(chart, values)

u := action.NewUpgrade(&cfg)
u.TakeOwnership = true
u.EnableDNS = !options.Helm.DisableDNS
u.Force = options.Helm.Force
u.Atomic = options.Helm.Atomic
u.MaxHistory = options.Helm.MaxHistory
if u.MaxHistory == 0 {
u.MaxHistory = MaxHelmHistory
}
u.Namespace = defaultNamespace
u.Timeout = timeout
u.DryRun = dryRun
u.DisableOpenAPIValidation = h.template || dryRun
u.PostRenderer = pr
u.WaitForJobs = options.Helm.WaitForJobs
if u.Timeout > 0 {
u.Wait = true
}
if !dryRun {
logger.Info("Upgrading helm release")
}
rel, err := u.Run(releaseName, chart, values)

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- Architecture: amd64
- Fleet Version: v0.10.1
- Cluster:
  - Provider: ACK
  - Kubernetes Version: 1.30

Logs

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions