Skip to content

Commit

Permalink
Using const() defines constants together (part:3)
Browse files Browse the repository at this point in the history
  • Loading branch information
xichengliudui committed Apr 20, 2019
1 parent b1ca7be commit 16ee9c4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
8 changes: 5 additions & 3 deletions cloudmock/aws/mockec2/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ import (
"github.com/golang/glog"
)

// Not (yet?) in aws-sdk-go
const ResourceTypeNatGateway = "nat-gateway"
const ResourceTypeAddress = "elastic-ip"
const (
// Not (yet?) in aws-sdk-go
ResourceTypeNatGateway = "nat-gateway"
ResourceTypeAddress = "elastic-ip"
)

func (m *MockEC2) CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) {
panic("Not implemented")
Expand Down
14 changes: 8 additions & 6 deletions dns-controller/pkg/watchers/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ limitations under the License.

package watchers

// AnnotationNameDNSExternal is used to set up a DNS name for accessing the resource from outside the cluster
// For a service of Type=LoadBalancer, it would map to the external LB hostname or IP
const AnnotationNameDNSExternal = "dns.alpha.kubernetes.io/external"
const (
// AnnotationNameDNSExternal is used to set up a DNS name for accessing the resource from outside the cluster
// For a service of Type=LoadBalancer, it would map to the external LB hostname or IP
AnnotationNameDNSExternal = "dns.alpha.kubernetes.io/external"

// AnnotationNameDNSInternal is used to set up a DNS name for accessing the resource from inside the cluster
// This is only supported on Pods currently, and maps to the Internal address
const AnnotationNameDNSInternal = "dns.alpha.kubernetes.io/internal"
// AnnotationNameDNSInternal is used to set up a DNS name for accessing the resource from inside the cluster
// This is only supported on Pods currently, and maps to the Internal address
AnnotationNameDNSInternal = "dns.alpha.kubernetes.io/internal"
)
12 changes: 7 additions & 5 deletions nodeup/pkg/model/cloudconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ import (
"k8s.io/kops/upup/pkg/fi/nodeup/nodetasks"
)

const CloudConfigFilePath = "/etc/kubernetes/cloud.config"
const (
CloudConfigFilePath = "/etc/kubernetes/cloud.config"

// Required for vSphere CloudProvider
const MinimumVersionForVMUUID = "1.5.3"
// Required for vSphere CloudProvider
MinimumVersionForVMUUID = "1.5.3"

// VM UUID is set by cloud-init
const VM_UUID_FILE_PATH = "/etc/vmware/vm_uuid"
// VM UUID is set by cloud-init
VM_UUID_FILE_PATH = "/etc/vmware/vm_uuid"
)

// CloudConfigBuilder creates the cloud configuration file
type CloudConfigBuilder struct {
Expand Down

0 comments on commit 16ee9c4

Please sign in to comment.