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

Fixed HelmRelease delete #229

Closed
wants to merge 1 commit into from

Conversation

slysunkin
Copy link
Contributor

@slysunkin slysunkin commented Aug 26, 2024

Description

Fixing #217

This fix is intended to resolve an issue when deletion of HelmRelease resulted to non-deleted (orphaned) objects.

Initially available objects for helm release:

k get AWScluster -n hmc-system                                                     
k get AWSMachineTemplate -n hmc-system
k get Cluster -n hmc-system
k get K0sControlPlane -n hmc-system
k get K0sWorkerConfigTemplate -n hmc-system
k get MachineDeployment -n hmc-system
NAME            CLUSTER         READY   VPC                     BASTION IP
slava-aws-dev   slava-aws-dev   true    vpc-0605fd415e9e503df  
NAME                      AGE
slava-aws-dev-cp-mt       25m
slava-aws-dev-worker-mt   25m
NAME            CLUSTERCLASS   PHASE         AGE   VERSION
slava-aws-dev                  Provisioned   25m  
NAME               AGE
slava-aws-dev-cp   25m
NAME                           AGE
slava-aws-dev-machine-config   25m
NAME               CLUSTER         REPLICAS   READY   UPDATED   UNAVAILABLE   PHASE     AGE   VERSION
slava-aws-dev-md   slava-aws-dev   1          1       1         0             Running   25m   v1.30.2

Several minutes after make dev-aws-destroy:

k get AWScluster -n hmc-system
k get AWSMachineTemplate -n hmc-system
k get Cluster -n hmc-system
k get K0sControlPlane -n hmc-system
k get K0sWorkerConfigTemplate -n hmc-system
k get MachineDeployment -n hmc-system
No resources found in hmc-system namespace.
No resources found in hmc-system namespace.
No resources found in hmc-system namespace.
No resources found in hmc-system namespace.
No resources found in hmc-system namespace.
No resources found in hmc-system namespace.

P.S. Minor misprint was fixed as well.

@@ -319,6 +319,13 @@ func (r *DeploymentReconciler) Delete(ctx context.Context, l logr.Logger, deploy
}
return ctrl.Result{}, err
}
if !hr.Spec.Suspend {
l.Info("Suspending HelmRelease %s", deployment.Name)
hr.Spec.Suspend = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you make it suspended, flux won't remove the helm release and underlying resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants