Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
TIEDPAG opened this issue Sep 5, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@TIEDPAG
Copy link

TIEDPAG commented Sep 5, 2024

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

@manno
Copy link
Member

manno commented Oct 23, 2024

Cleaning up the backlog, closing this a duplicate of #2134

@manno manno closed this as completed Oct 23, 2024
@github-project-automation github-project-automation bot moved this from To Triage to ✅ Done in Fleet Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants