Skip to content

Commit

Permalink
config: Change kube-proxy Mode postfix to ProxyMode
Browse files Browse the repository at this point in the history
This changes {IPTables,IPVS,None}Mode => {IPTables,IPVS,None}ProxyMode
for the sake of readability.

Suggested-by: Benjamin Elder <[email protected]>
Signed-off-by: Martynas Pumputis <[email protected]>
  • Loading branch information
brb committed Feb 25, 2021
1 parent 6cfdd79 commit abf42e2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/config/v1alpha4/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func SetDefaultsCluster(obj *Cluster) {
}
// default the KubeProxyMode using iptables as it's already the default
if obj.Networking.KubeProxyMode == "" {
obj.Networking.KubeProxyMode = IPTablesMode
obj.Networking.KubeProxyMode = IPTablesProxyMode
}
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/apis/config/v1alpha4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ const (
type ProxyMode string

const (
// IPTablesMode sets ProxyMode to iptables
IPTablesMode ProxyMode = "iptables"
// IPVSMode sets ProxyMode to iptables
IPVSMode ProxyMode = "ipvs"
// IPTablesProxyMode sets ProxyMode to iptables
IPTablesProxyMode ProxyMode = "iptables"
// IPVSProxyMode sets ProxyMode to iptables
IPVSProxyMode ProxyMode = "ipvs"
)

// PatchJSON6902 represents an inline kustomize json 6902 patch
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/internal/create/actions/kubeadminit/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type action struct {

// NewAction returns a new action for kubeadm init
func NewAction(cfg *config.Cluster) actions.Action {
return &action{skipKubeProxy: cfg.Networking.KubeProxyMode == config.NoneMode}
return &action{skipKubeProxy: cfg.Networking.KubeProxyMode == config.NoneProxyMode}
}

// Execute runs the action
Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/apis/config/default.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pkg/internal/apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ const (
type ProxyMode string

const (
// IPTablesMode sets ProxyMode to iptables
IPTablesMode ProxyMode = "iptables"
// IPVSMode sets ProxyMode to iptables
IPVSMode ProxyMode = "ipvs"
// NoneMode disables kube-proxy
NoneMode ProxyMode = "none"
// IPTablesProxyMode sets ProxyMode to iptables
IPTablesProxyMode ProxyMode = "iptables"
// IPVSProxyMode sets ProxyMode to iptables
IPVSProxyMode ProxyMode = "ipvs"
// NoneProxyMode disables kube-proxy
NoneProxyMode ProxyMode = "none"
)

// PatchJSON6902 represents an inline kustomize json 6902 patch
Expand Down
4 changes: 2 additions & 2 deletions pkg/internal/apis/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func (c *Cluster) Validate() error {
}

// KubeProxyMode should be iptables or ipvs
if c.Networking.KubeProxyMode != IPTablesMode && c.Networking.KubeProxyMode != IPVSMode &&
c.Networking.KubeProxyMode != NoneMode {
if c.Networking.KubeProxyMode != IPTablesProxyMode && c.Networking.KubeProxyMode != IPVSProxyMode &&
c.Networking.KubeProxyMode != NoneProxyMode {
errs = append(errs, errors.Errorf("invalid kubeProxyMode: %s", c.Networking.KubeProxyMode))
}

Expand Down

0 comments on commit abf42e2

Please sign in to comment.