Skip to content

Commit

Permalink
update NB delete if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
amold1 committed Aug 21, 2024
1 parent c9a154a commit edcb049
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controller/linodecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (r *LinodeClusterReconciler) reconcileCreate(ctx context.Context, logger lo
// handle creation for the loadbalancer for the control plane
if clusterScope.LinodeCluster.Spec.Network.LoadBalancerType == "dns" {
r.handleDNS(clusterScope)
} else if clusterScope.LinodeCluster.Spec.Network.LoadBalancerType == "NodeBalancer" || clusterScope.LinodeCluster.Spec.Network.LoadBalancerType == "" {
} else {
if err := r.handleNBCreate(ctx, logger, clusterScope); err != nil {
return err
}
Expand Down Expand Up @@ -305,7 +305,7 @@ func (r *LinodeClusterReconciler) reconcileDelete(ctx context.Context, logger lo
}
conditions.MarkFalse(clusterScope.LinodeCluster, ConditionLoadBalancing, "cleared loadbalancer", clusterv1.ConditionSeverityInfo, "")

if clusterScope.LinodeCluster.Spec.Network.LoadBalancerType == "NodeBalancer" && clusterScope.LinodeCluster.Spec.Network.NodeBalancerID != nil {
if clusterScope.LinodeCluster.Spec.Network.LoadBalancerType != "dns" && clusterScope.LinodeCluster.Spec.Network.NodeBalancerID != nil {
err := clusterScope.LinodeClient.DeleteNodeBalancer(ctx, *clusterScope.LinodeCluster.Spec.Network.NodeBalancerID)
if util.IgnoreLinodeAPIError(err, http.StatusNotFound) != nil {
logger.Error(err, "failed to delete NodeBalancer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,3 @@ spec:
($error): ~
(json_parse($stdout)):
results: 0
catch:
- describe:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
kind: LinodeCluster

0 comments on commit edcb049

Please sign in to comment.