Skip to content

Commit fe014ca

Browse files
committed
fix types in packageconfig to allow specifying flags multiple times to k3s
1 parent 42a57d9 commit fe014ca

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

examples/whoami-vars/config.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ variables:
44
- name: traefikDisabled
55
default: "false"
66
---
7-
{{ if eq .Vars.traefikDisabled "true" }}
87
serverConfig:
9-
disable: traefik
10-
{{ end }}
8+
disable:
9+
- local-storage
10+
- metrics-server
11+
{{- if eq .Vars.traefikDisabled "true" }}
12+
- traefik
13+
{{ end }}

pkg/types/package_config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ type PackageConfig struct {
2929
// the package and optionally overwritten by the user at installation. Any long-form flags accepted
3030
// by k3s server without the leading "--" can be used as keys to Flags along with their cooresponding values.
3131
// A list can be provided for the value to signal specifying the flag multiple times.
32-
ServerConfig map[string]string `json:"serverConfig,omitempty" yaml:"serverConfig,omitempty"`
32+
ServerConfig map[string]interface{} `json:"serverConfig,omitempty" yaml:"serverConfig,omitempty"`
3333
// AgentConfig represents configurations to apply to k3s agent nodes. They can be bundled into
3434
// the package and optionally overwritten by the user at installation. Any long-form flags accepted
3535
// by k3s agent without the leading "--" can be used as keys to Flags along with their cooresponding values.
3636
// A list can be provided for the value to signal specifying the flag multiple times.
37-
AgentConfig map[string]string `json:"agentConfig,omitempty" yaml:"agentConfig,omitempty"`
37+
AgentConfig map[string]interface{} `json:"agentConfig,omitempty" yaml:"agentConfig,omitempty"`
3838
// HelmValues is a map of chart names to either a list of filenames containing values for that chart, or a single
3939
// map of inline value declarations.
4040
HelmValues map[string]interface{} `json:"helmValues,omitempty" yaml:"helmValues,omitempty"`
@@ -282,8 +282,8 @@ func flagKeyExists(fields []string, key string) bool {
282282
func (p *PackageConfig) DeepCopy() *PackageConfig {
283283
out := &PackageConfig{
284284
Variables: make([]PackageVariable, len(p.Variables)),
285-
ServerConfig: make(map[string]string),
286-
AgentConfig: make(map[string]string),
285+
ServerConfig: make(map[string]interface{}),
286+
AgentConfig: make(map[string]interface{}),
287287
HelmValues: make(map[string]interface{}),
288288
Raw: make([]byte, len(p.Raw)),
289289
}

0 commit comments

Comments
 (0)