cmd/initContainer: Style fix

Use a strings.Builder [1] instance instead of raw string literals for
consistency.

Fallout from 772b66bf3e

[1] https://pkg.go.dev/strings#Builder

https://github.com/containers/toolbox/pull/1636
This commit is contained in:
Debarshi Ray 2025-04-30 16:55:41 +02:00
parent 3017a46c03
commit 02fe08f70e
1 changed files with 9 additions and 8 deletions

View File

@ -551,15 +551,16 @@ func configureKerberos() error {
return nil return nil
} }
kcmConfigString := `# Written by Toolbx var builder strings.Builder
# https://containertoolbx.org/ builder.WriteString("# Written by Toolbx\n")
# builder.WriteString("# https://containertoolbx.org/\n")
# # To disable the KCM credential cache, comment out the following lines. builder.WriteString("#\n")
builder.WriteString("# # To disable the KCM credential cache, comment out the following lines.\n")
[libdefaults] builder.WriteString("\n")
default_ccache_name = KCM: builder.WriteString("[libdefaults]\n")
` builder.WriteString(" default_ccache_name = KCM:\n")
kcmConfigString := builder.String()
kcmConfigBytes := []byte(kcmConfigString) kcmConfigBytes := []byte(kcmConfigString)
if err := ioutil.WriteFile("/etc/krb5.conf.d/kcm_default_ccache", kcmConfigBytes, 0644); err != nil { if err := ioutil.WriteFile("/etc/krb5.conf.d/kcm_default_ccache", kcmConfigBytes, 0644); err != nil {
return errors.New("failed to configure Kerberos to use KCM as the default credential cache") return errors.New("failed to configure Kerberos to use KCM as the default credential cache")