Skip to content

Commit

Permalink
Using const() defines constants together (part:4)
Browse files Browse the repository at this point in the history
  • Loading branch information
xichengliudui committed Apr 20, 2019
1 parent f94d499 commit c02802f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
14 changes: 8 additions & 6 deletions nodeup/pkg/model/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,15 @@ func (b *KubeletBuilder) addContainerizedMounter(c *fi.ModelBuilderContext) erro
return nil
}

const RoleLabelName15 = "kubernetes.io/role"
const RoleLabelName16 = "kubernetes.io/role"
const RoleMasterLabelValue15 = "master"
const RoleNodeLabelValue15 = "node"
const (
RoleLabelName15 = "kubernetes.io/role"
RoleLabelName16 = "kubernetes.io/role"
RoleMasterLabelValue15 = "master"
RoleNodeLabelValue15 = "node"

const RoleLabelMaster16 = "node-role.kubernetes.io/master"
const RoleLabelNode16 = "node-role.kubernetes.io/node"
RoleLabelMaster16 = "node-role.kubernetes.io/master"
RoleLabelNode16 = "node-role.kubernetes.io/node"
)

// NodeLabels are defined in the InstanceGroup, but set flags on the kubelet config.
// We have a conflict here: on the one hand we want an easy to use abstract specification
Expand Down
6 changes: 4 additions & 2 deletions pkg/model/alimodel/api_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ import (
"k8s.io/kops/upup/pkg/fi/fitasks"
)

const LoadBalancerListenerStatus = "running"
const LoadBalancerListenerBandwidth = -1
const (
LoadBalancerListenerStatus = "running"
LoadBalancerListenerBandwidth = -1
)

// APILoadBalancerModelBuilder builds a LoadBalancer for accessing the API
type APILoadBalancerModelBuilder struct {
Expand Down
6 changes: 4 additions & 2 deletions pkg/model/alimodel/external_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/alitasks"
)

const IpProtocolTCP = "tcp"
const IpProtocolUDP = "udp"
const (
IpProtocolTCP = "tcp"
IpProtocolUDP = "udp"
)

// ExternalAccessModelBuilder configures security group rules for external access
// (SSHAccess, KubernetesAPIAccess)
Expand Down

0 comments on commit c02802f

Please sign in to comment.