Skip to content

Commit

Permalink
Fixes nil map bug on creation (#1743) (#1746)
Browse files Browse the repository at this point in the history
Co-authored-by: Alena Varkockova <[email protected]>
Signed-off-by: Ken Sipe <[email protected]>
  • Loading branch information
kensipe and alenkacz authored Nov 16, 2020
1 parent f7fa143 commit d902714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/webhook/instance_admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ func validateParameters(ov *kudoapi.OperatorVersion, instance *kudoapi.Instance)
func setImmutableParameterDefaults(ov *kudoapi.OperatorVersion, instance *kudoapi.Instance) {
for _, p := range ov.Spec.Parameters {
if p.IsImmutable() && p.HasDefault() {
if instance.Spec.Parameters == nil {
instance.Spec.Parameters = map[string]string{}
}
if _, ok := instance.Spec.Parameters[p.Name]; !ok {
instance.Spec.Parameters[p.Name] = *p.Default
}
Expand Down
2 changes: 1 addition & 1 deletion test/upgrade/cert-manager-detection/06-install-kudo.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: kudo.dev/v1beta1
kind: TestStep
commands:
- command: sleep 10
- command: sleep 20
- command: kubectl kudo init -v 4 --kudo-image kudobuilder/controller:test --kudo-image-pull-policy IfNotPresent --wait

0 comments on commit d902714

Please sign in to comment.