Skip to content

Commit c8dc312

Browse files
authored
chore: Always allocate the StringData map (#1160)
1 parent d6676d5 commit c8dc312

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

api/v1alpha1/amaltheasession_children.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ func (as *AmaltheaSession) Secret() v1.Secret {
757757
Labels: as.childLabels(),
758758
Annotations: as.Spec.Template.Metadata.Annotations,
759759
},
760+
StringData: map[string]string{},
760761
}
761762
// Secret used to secure the tunnel for remote sessions
762763
tunnelSecret := ""
@@ -772,9 +773,7 @@ func (as *AmaltheaSession) Secret() v1.Secret {
772773
// In this case we do not need the 'oidc' configuration in the secret,
773774
// we just return an empty one, or one populated with the tunnel secret.
774775
if tunnelSecret != "" {
775-
secret.StringData = map[string]string{
776-
"WSTUNNEL_SECRET": tunnelSecret,
777-
}
776+
secret.StringData["WSTUNNEL_SECRET"] = tunnelSecret
778777
}
779778
return secret
780779
}
@@ -837,10 +836,9 @@ func (as *AmaltheaSession) Secret() v1.Secret {
837836
panic(err)
838837
}
839838

840-
secret.StringData = map[string]string{
841-
"oauth2-proxy-alpha-config.yaml": string(newConfigStr),
842-
"oauth2-proxy-config.yaml": strings.Join(oldConfigLines, "\n"),
843-
}
839+
secret.StringData["oauth2-proxy-alpha-config.yaml"] = string(newConfigStr)
840+
secret.StringData["oauth2-proxy-config.yaml"] = strings.Join(oldConfigLines, "\n")
841+
844842
if tunnelSecret != "" {
845843
secret.StringData["WSTUNNEL_SECRET"] = tunnelSecret
846844
}

0 commit comments

Comments
 (0)