diff --git a/pkg/model/bastion.go b/pkg/model/bastion.go index c054d2bd4d..f0afaa50a8 100644 --- a/pkg/model/bastion.go +++ b/pkg/model/bastion.go @@ -26,8 +26,10 @@ import ( "k8s.io/kops/upup/pkg/fi/cloudup/awstasks" ) -const BastionELBSecurityGroupPrefix = "bastion" -const BastionELBDefaultIdleTimeout = 5 * time.Minute +const ( + BastionELBSecurityGroupPrefix = "bastion" + BastionELBDefaultIdleTimeout = 5 * time.Minute +) // BastionModelBuilder adds model objects to support bastions // diff --git a/protokube/pkg/gossip/dns/hosts/hosts.go b/protokube/pkg/gossip/dns/hosts/hosts.go index 8b1a530d68..8106b865da 100644 --- a/protokube/pkg/gossip/dns/hosts/hosts.go +++ b/protokube/pkg/gossip/dns/hosts/hosts.go @@ -27,8 +27,10 @@ import ( "github.com/golang/glog" ) -const GUARD_BEGIN = "# Begin host entries managed by kops - do not edit" -const GUARD_END = "# End host entries managed by kops" +const ( + GUARD_BEGIN = "# Begin host entries managed by kops - do not edit" + GUARD_END = "# End host entries managed by kops" +) func UpdateHostsFileWithRecords(p string, addrToHosts map[string][]string) error { stat, err := os.Stat(p) diff --git a/protokube/pkg/protokube/vsphere_volume.go b/protokube/pkg/protokube/vsphere_volume.go index 74e92bdb65..bc4a751aed 100644 --- a/protokube/pkg/protokube/vsphere_volume.go +++ b/protokube/pkg/protokube/vsphere_volume.go @@ -33,8 +33,10 @@ import ( "k8s.io/kops/upup/pkg/fi/cloudup/vsphere" ) -const VolumeMetaDataFile = "/vol-metadata/metadata.json" -const VolStatusValue = "attached" +const ( + VolumeMetaDataFile = "/vol-metadata/metadata.json" + VolStatusValue = "attached" +) // VSphereVolumes represents vSphere volume and implements Volumes interface. type VSphereVolumes struct{} diff --git a/upup/pkg/fi/cloudup/aliup/ali_cloud.go b/upup/pkg/fi/cloudup/aliup/ali_cloud.go index 1067b5b27c..2e07650196 100644 --- a/upup/pkg/fi/cloudup/aliup/ali_cloud.go +++ b/upup/pkg/fi/cloudup/aliup/ali_cloud.go @@ -36,10 +36,12 @@ import ( "k8s.io/kops/upup/pkg/fi" ) -const TagClusterName = "KubernetesCluster" -const TagNameRolePrefix = "k8s.io/role/" -const TagNameEtcdClusterPrefix = "k8s.io/etcd/" -const TagRoleMaster = "master" +const ( + TagClusterName = "KubernetesCluster" + TagNameRolePrefix = "k8s.io/role/" + TagNameEtcdClusterPrefix = "k8s.io/etcd/" + TagRoleMaster = "master" +) // This is for statistic purpose. var KubernetesKopsIdentity = fmt.Sprintf("Kubernetes.Kops/%s", prj.Version) diff --git a/upup/pkg/fi/cloudup/gce/labels.go b/upup/pkg/fi/cloudup/gce/labels.go index c6548504ba..253e9331de 100644 --- a/upup/pkg/fi/cloudup/gce/labels.go +++ b/upup/pkg/fi/cloudup/gce/labels.go @@ -23,11 +23,13 @@ import ( "strings" ) -// The tag name we use to differentiate multiple logically independent clusters running in the same region -const GceLabelNameKubernetesCluster = "k8s-io-cluster-name" +const ( + // The tag name we use to differentiate multiple logically independent clusters running in the same region + GceLabelNameKubernetesCluster = "k8s-io-cluster-name" -const GceLabelNameRolePrefix = "k8s-io-role-" -const GceLabelNameEtcdClusterPrefix = "k8s-io-etcd-" + GceLabelNameRolePrefix = "k8s-io-role-" + GceLabelNameEtcdClusterPrefix = "k8s-io-etcd-" +) // EncodeGCELabel encodes a string into an RFC1035 compatible value, suitable for use as GCE label key or value // We use a URI inspired escaping, but with - instead of %. diff --git a/upup/pkg/fi/cloudup/openstack/cloud.go b/upup/pkg/fi/cloudup/openstack/cloud.go index 4586f2ef17..ecc68b2261 100644 --- a/upup/pkg/fi/cloudup/openstack/cloud.go +++ b/upup/pkg/fi/cloudup/openstack/cloud.go @@ -57,10 +57,12 @@ import ( "k8s.io/kops/util/pkg/vfs" ) -const TagNameEtcdClusterPrefix = "k8s.io/etcd/" -const TagNameRolePrefix = "k8s.io/role/" -const TagClusterName = "KubernetesCluster" -const TagRoleMaster = "master" +const ( + TagNameEtcdClusterPrefix = "k8s.io/etcd/" + TagNameRolePrefix = "k8s.io/role/" + TagClusterName = "KubernetesCluster" + TagRoleMaster = "master" +) // ErrNotFound is used to inform that the object is not found var ErrNotFound = "Resource not found" diff --git a/upup/pkg/fi/cloudup/urls.go b/upup/pkg/fi/cloudup/urls.go index 5c4ed6bbdd..fa8dfd1d1f 100644 --- a/upup/pkg/fi/cloudup/urls.go +++ b/upup/pkg/fi/cloudup/urls.go @@ -29,10 +29,12 @@ import ( "k8s.io/kops/util/pkg/hashing" ) -const defaultKopsBaseUrl = "https://kubeupv2.s3.amazonaws.com/kops/%s/" +const ( + defaultKopsBaseUrl = "https://kubeupv2.s3.amazonaws.com/kops/%s/" -// defaultKopsMirrorBase will be detected and automatically set to pull from the defaultKopsMirrors -const defaultKopsMirrorBase = "https://kubeupv2.s3.amazonaws.com/kops/%s/" + // defaultKopsMirrorBase will be detected and automatically set to pull from the defaultKopsMirrors + defaultKopsMirrorBase = "https://kubeupv2.s3.amazonaws.com/kops/%s/" +) // mirror holds the configuration for a mirror type mirror struct { diff --git a/util/pkg/vfs/vfssync.go b/util/pkg/vfs/vfssync.go index c85bf19d41..592d0158a2 100644 --- a/util/pkg/vfs/vfssync.go +++ b/util/pkg/vfs/vfssync.go @@ -37,9 +37,11 @@ func NewVFSScan(base Path) *VFSScan { type ChangeType string -const ChangeType_Added ChangeType = "ADDED" -const ChangeType_Removed ChangeType = "REMOVED" -const ChangeType_Modified ChangeType = "MODIFIED" +const ( + ChangeType_Added ChangeType = "ADDED" + ChangeType_Removed ChangeType = "REMOVED" + ChangeType_Modified ChangeType = "MODIFIED" +) type Change struct { ChangeType ChangeType