Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions kwok/scripts/validate-scheduling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ generate_bundle() {
--set "kubeprometheusstack:defaultRules.create=false" \
--set "kubeprometheusstack:alertmanager.enabled=false" \
--set "skyhook-customizations:enabled=false" \
--set "networkoperator:operator.tolerations[2].key=aicr.nvidia.com/kwok-test" \
--set "networkoperator:operator.tolerations[2].operator=Equal" \
--set "networkoperator:operator.tolerations[2].value=true" \
--set "networkoperator:operator.tolerations[2].effect=NoSchedule" \
--set "dynamoplatform:etcd.persistence.enabled=false" \
--set "dynamoplatform:nats.config.jetstream.fileStore.enabled=false" 2>&1); then
log_error "Bundle generation failed"
Expand Down
30 changes: 30 additions & 0 deletions pkg/bundler/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,36 @@ func TestParseValueOverrides(t *testing.T) {
t.Error("ParseValueOverrides() expected error for unsafe path segment, got nil")
}
})

t.Run("helm-style array index rejected", func(t *testing.T) {
// Helm's `foo.bar[N].baz` list-indexing syntax is intentionally
// rejected at parse time. The downstream path walker in
// pkg/component/overrides.go (`getOrCreateNestedMap` / `setMapValueByPath`)
// splits on `.` only and treats `tolerations[2]` as a literal map key
// — so permitting the syntax here would silently produce bundles with
// a stringly-keyed `"tolerations[2]"` field instead of the indexed
// list element the user intended. Rejecting up front fails loudly.
tests := []struct {
name string
input string
}{
{
name: "tolerations index",
input: "networkoperator:operator.tolerations[2].key=aicr.nvidia.com/kwok-test",
},
{
name: "env index",
input: "gpuoperator:driver.env[3].name=CUDA_VISIBLE_DEVICES",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if _, err := ParseValueOverrides([]string{tt.input}); err == nil {
t.Errorf("ParseValueOverrides(%q) should have rejected Helm array index syntax — downstream walker can't interpret it", tt.input)
}
})
}
})
Comment thread
yuanchen8911 marked this conversation as resolved.
Resolved
}

// TestWithDynamicValues verifies the functional option sets dynamic value paths
Expand Down
Loading