Skip to content
Open
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
1 change: 0 additions & 1 deletion api/hypershift/v1beta1/hostedcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ type Capabilities struct {
// +optional
// +kubebuilder:validation:MaxItems=25
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="Disabled is immutable. Changes might result in unpredictable and disruptive behavior."
// +kubebuilder:validation:XValidation:rule="!self.exists(cap, cap == 'Ingress') || self.exists(cap, cap == 'Console')",message="Ingress capability can only be disabled if Console capability is also disabled"
Disabled []OptionalCapability `json:"disabled,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ spec:
- message: Disabled is immutable. Changes might result in unpredictable
and disruptive behavior.
rule: self == oldSelf
- message: Ingress capability can only be disabled if Console
capability is also disabled
rule: '!self.exists(cap, cap == ''Ingress'') || self.exists(cap,
cap == ''Console'')'
enabled:
description: |-
enabled when specified, explicitly enables the specified capabilitíes on the hosted cluster.
Expand Down
6 changes: 2 additions & 4 deletions cmd/cluster/core/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,8 @@ func (opts *RawCreateOptions) validateCapabilities() error {
return fmt.Errorf("unknown enabled capability: %s, accepted values are: %v", capability, acceptedValues.List())
}
}
disabledCaps := sets.NewString(opts.DisableClusterCapabilities...)
if disabledCaps.Has(string(hyperv1.IngressCapability)) && !disabledCaps.Has(string(hyperv1.ConsoleCapability)) {
return fmt.Errorf("ingress capability can only be disabled if Console capability is also disabled")
}


if len(opts.KubeAPIServerDNSName) > 0 {
if err := validation.IsDNS1123Subdomain(opts.KubeAPIServerDNSName); len(err) > 0 {
return fmt.Errorf("KubeAPIServerDNSName failed DNS validation: %s", strings.Join(err[:], " "))
Expand Down
8 changes: 4 additions & 4 deletions cmd/cluster/core/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ func TestValidate(t *testing.T) {
expectedErr: "",
},
{
name: "fails when ingress is disabled but console is not disabled",
name: "passes when only ingress is disabled",
rawOpts: &RawCreateOptions{
Name: "test-hc",
Namespace: "test-hc",
PullSecretFile: pullSecretFile,
Arch: "amd64",
DisableClusterCapabilities: []string{"Ingress"},
},
expectedErr: "ingress capability can only be disabled if Console capability is also disabled",
expectedErr: "",
},
{
name: "passes when both ingress and console are disabled",
Expand Down Expand Up @@ -387,15 +387,15 @@ func TestValidate(t *testing.T) {
expectedErr: "",
},
{
name: "fails when ingress is disabled with other capabilities but console is not disabled",
name: "passes when ingress is disabled with other capabilities but console is not disabled",
rawOpts: &RawCreateOptions{
Name: "test-hc",
Namespace: "test-hc",
PullSecretFile: pullSecretFile,
Arch: "amd64",
DisableClusterCapabilities: []string{"Ingress", "ImageRegistry"},
},
expectedErr: "ingress capability can only be disabled if Console capability is also disabled",
expectedErr: "",
},
{
name: "passes when disable-multi-network is used with network-type=Other",
Expand Down
Loading
Loading