Skip to content

Commit

Permalink
Fix WindowsNodeSpec defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
coutinhop committed Sep 14, 2023
1 parent 2c06032 commit 4deda64
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/controller/installation/core_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,20 +552,21 @@ func fillDefaults(instance *operator.Installation) error {
}

// Default Windows dataplane is disabled, unless provider is AKS
winDataplaneDisabled := operator.WindowsDataplaneDisabled
winDataplaneHNS := operator.WindowsDataplaneHNS
if instance.Spec.CalicoNetwork.WindowsDataplane == nil {
winDataplane := operator.WindowsDataplaneDisabled
if instance.Spec.KubernetesProvider == operator.ProviderAKS {
// On AKS, we had the windows upgrade daemonset, which is replaced by the
// calico-node-windows daemonset, so default to HNS dataplane in this case.
winDataplane = operator.WindowsDataplaneHNS
instance.Spec.CalicoNetwork.WindowsDataplane = &winDataplaneHNS
} else {
instance.Spec.CalicoNetwork.WindowsDataplane = &winDataplaneDisabled
}
instance.Spec.CalicoNetwork.WindowsDataplane = &winDataplane
}

// If Windows is enabled, populate CNI bin, config and log dirs with defaults
// per provider if not explicitly configured
winDataplaneDisabled := operator.WindowsDataplaneDisabled
if instance.Spec.CalicoNetwork.WindowsDataplane != &winDataplaneDisabled {
if *instance.Spec.CalicoNetwork.WindowsDataplane != winDataplaneDisabled {
if instance.Spec.WindowsNodes == nil {
instance.Spec.WindowsNodes = &operator.WindowsNodeSpec{}
}
Expand Down

0 comments on commit 4deda64

Please sign in to comment.