Skip to content

Commit

Permalink
Fix nil pointer when IAM not populated
Browse files Browse the repository at this point in the history
Unlikely to happen outside of tests, but an easy fix.
  • Loading branch information
justinsb committed Jan 30, 2022
1 parent d6cb497 commit fbc5e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion upup/pkg/fi/cloudup/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (tf *TemplateFunctions) GetInstanceGroup(name string) (*kops.InstanceGroup,
// deployOnWorkersIfExternalPermissons should be true if a controller runs on worker nodes when external IAM permissions is enabled for the cluster.
// In this case it is assumed that it can run 2 replicas.
func (tf *TemplateFunctions) ControlPlaneControllerReplicas(deployOnWorkersIfExternalPermissions bool) int {
if deployOnWorkersIfExternalPermissions && fi.BoolValue(tf.Cluster.Spec.IAM.UseServiceAccountExternalPermissions) {
if deployOnWorkersIfExternalPermissions && tf.Cluster.Spec.IAM != nil && fi.BoolValue(tf.Cluster.Spec.IAM.UseServiceAccountExternalPermissions) {
return 2
}
if tf.HasHighlyAvailableControlPlane() {
Expand Down

0 comments on commit fbc5e36

Please sign in to comment.