Skip to content

Commit

Permalink
fix nil map assignment (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 authored Aug 8, 2024
1 parent fb71afe commit f0cbaf6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/ck8s/config_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ func GenerateInitControlPlaneConfig(cfg InitControlPlaneConfig) (apiv1.Bootstrap

// Since CAPI handles the lifecycle management of Kubernetes nodes, k8s-snap should only focus on
// cleaning up microcluster and files during upgrades.
if _, ok := out.ClusterConfig.Annotations[apiv1.AnnotationSkipCleanupKubernetesNodeOnRemove]; !ok {
out.ClusterConfig.Annotations[apiv1.AnnotationSkipCleanupKubernetesNodeOnRemove] = "true"
if out.ClusterConfig.Annotations != nil {
if _, ok := out.ClusterConfig.Annotations[apiv1.AnnotationSkipCleanupKubernetesNodeOnRemove]; !ok {
out.ClusterConfig.Annotations[apiv1.AnnotationSkipCleanupKubernetesNodeOnRemove] = "true"
}
}

// features
Expand Down

0 comments on commit f0cbaf6

Please sign in to comment.