Skip to content

Commit

Permalink
provisioner: Use separate flag for each disabled feature (projectcont…
Browse files Browse the repository at this point in the history
…our#6413)

Flags on Contour Deployment should be separate, not comma
separated list

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Saman Mahdanian <saman@mahdanian.xyz>
  • Loading branch information
sunjayBhatia authored and SamMHD committed Sep 8, 2024
1 parent 5b448bd commit dff1d19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion internal/provisioner/objects/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ func DesiredDeployment(contour *model.Contour, image string) *apps_v1.Deployment
}

if contour.Spec.DisabledFeatures != nil && len(contour.Spec.DisabledFeatures) > 0 {
args = append(args, fmt.Sprintf("--disable-feature=%s", strings.Join(model.FeaturesToStrings(contour.Spec.DisabledFeatures), ",")))
for _, f := range contour.Spec.DisabledFeatures {
args = append(args, fmt.Sprintf("--disable-feature=%s", string(f)))
}
}

// Pass the insecure/secure flags to Contour if using non-default ports.
Expand Down
6 changes: 4 additions & 2 deletions internal/provisioner/objects/deployment/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@ func TestDesiredDeploymentWhenSettingDisabledFeature(t *testing.T) {
// Change the Contour watch namespaces flag
deploy := DesiredDeployment(cntr, "ghcr.io/projectcontour/contour:test")
container := checkDeploymentHasContainer(t, deploy, contourContainerName, true)
arg := fmt.Sprintf("--disable-feature=%s", strings.Join(model.FeaturesToStrings(tc.disabledFeatures), ","))
checkContainerHasArg(t, container, arg)
for _, f := range tc.disabledFeatures {
arg := fmt.Sprintf("--disable-feature=%s", string(f))
checkContainerHasArg(t, container, arg)
}
})
}
}

0 comments on commit dff1d19

Please sign in to comment.