Skip to content

Commit 94c654d

Browse files
change the parameter names in the route generation function to match the oc expose flag name
When the wildcardpolicy flag was changed to wildcard-policy the GeneraterParam was left unchanged this mismatch caused the wildcard-policy to be ignored and always appear as none when using oc expose Bug 1421990
1 parent fbdb78e commit 94c654d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/cmd/cli/cmd/expose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func validate(cmd *cobra.Command, f *clientcmd.Factory, args []string) error {
101101

102102
wildcardpolicy := kcmdutil.GetFlagString(cmd, "wildcard-policy")
103103
if len(wildcardpolicy) > 0 && (wildcardpolicy != "Subdomain" && wildcardpolicy != "None") {
104-
return fmt.Errorf("only \"Subdomain\" or \"None\" are supported for wildcardpolicy")
104+
return fmt.Errorf("only \"Subdomain\" or \"None\" are supported for wildcard-policy")
105105
}
106106

107107
if len(infos) > 1 {

pkg/route/generator/generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (RouteGenerator) ParamNames() []kubectl.GeneratorParam {
2727
{Name: "name", Required: false},
2828
{Name: "hostname", Required: false},
2929
{Name: "path", Required: false},
30-
{Name: "wildcardpolicy", Required: false},
30+
{Name: "wildcard-policy", Required: false},
3131
}
3232
}
3333

@@ -70,7 +70,7 @@ func (RouteGenerator) Generate(genericParams map[string]interface{}) (runtime.Ob
7070
},
7171
Spec: api.RouteSpec{
7272
Host: params["hostname"],
73-
WildcardPolicy: api.WildcardPolicyType(params["wildcardpolicy"]),
73+
WildcardPolicy: api.WildcardPolicyType(params["wildcard-policy"]),
7474
Path: params["path"],
7575
To: api.RouteTargetReference{
7676
Name: params["default-name"],

0 commit comments

Comments
 (0)