Skip to content

Commit

Permalink
golint: fix warnings for common/addressing/defaults.go
Browse files Browse the repository at this point in the history
Fixes the following warnings

Line 22: warning: comment on exported const DefaultIPv6Prefix should be of the form "DefaultIPv6Prefix ..." (golint)
Line 24: warning: comment on exported const DefaultIPv6PrefixLen should be of the form "DefaultIPv6PrefixLen ..." (golint)
Line 26: warning: comment on exported const DefaultIPv4Prefix should be of the form "DefaultIPv4Prefix ..." (golint)
Line 29: warning: comment on exported const DefaultIPv4PrefixLen should be of the form "DefaultIPv4PrefixLen ..." (golint)
Line 31: warning: comment on exported const DefaultIPv4ClusterPrefixLen should be of the form "DefaultIPv4ClusterPrefixLen ..." (golint)
Line 33: warning: comment on exported const DefaultNAT46Prefix should be of the form "DefaultNAT46Prefix ..." (golint)
Line 52: warning: comment on exported var ContainerIPv6Mask should be of the form "ContainerIPv6Mask ..." (golint)
Line 55: warning: comment on exported var ContainerIPv4Mask should be of the form "ContainerIPv4Mask ..." (golint)
Line 59: warning: exported var IPv6DefaultRoute should have comment or be unexported (golint)

Related-to: #153 (Resolve golint warnings)
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
  • Loading branch information
aalemayhu authored and tgraf committed Mar 23, 2017
1 parent a4aac42 commit 542198d
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions common/addressing/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ import (
)

const (
// Default prefix for all IPv6 addresses.
// DefaultIPv6Prefix is the prefix for all the IPv6 addresses.
DefaultIPv6Prefix = "f00d::"
// Prefix length to allocate container IPv6 addresses from
// DefaultIPv6PrefixLen is the length used to allocate container IPv6 addresses from.
DefaultIPv6PrefixLen = 112
// Default prefix for all IPv4 addresses. %d is substituted with the
// last byte of first global IPv4 address configured on the system.
// DefaultIPv4Prefix is the prefix for all the IPv4 addresses.
// %d is substituted with the last byte of first global IPv4 address
// configured on the system.
DefaultIPv4Prefix = "10.%d.0.1"
// Prefix length to allocate container IPv4 addresses from
// DefaultIPv4PrefixLen is the length used to allocate container IPv4 addresses from.
DefaultIPv4PrefixLen = 16
// Default IPv4 prefix length of entire cluster
// DefaultIPv4ClusterPrefixLen is the IPv4 prefix length of the entire cluster.
DefaultIPv4ClusterPrefixLen = 8
// Default IPv6 prefix to represent NATed IPv4 addresses
// DefaultNAT46Prefix is the IPv6 prefix to represent NATed IPv4 addresses.
DefaultNAT46Prefix = "0:0:0:0:0:FFFF::/96"
)

Expand All @@ -42,20 +43,22 @@ var (
// state: beef:beef:beef:beef:<node>:<node>:<state>:/112
// lxc: beef:beef:beef:beef:<node>:<node>:<state>:<lxc>/128

// ClusterIPv6Mask represents the CIDR Mask for an entire cluster
// ClusterIPv6Mask represents the CIDR Mask for an entire cluster.
ClusterIPv6Mask = net.CIDRMask(64, 128)
// NodeIPv6Mask represents the CIDR Mask for the cilium node.
NodeIPv6Mask = net.CIDRMask(96, 128)
// StateIPv6Mask represents the CIDR Mask for the state position.
StateIPv6Mask = net.CIDRMask(112, 128)

// IPv6 prefix length for address assigned to container. The default is
// L3 only and thus /128.
// ContainerIPv6Mask is the IPv6 prefix length for address assigned to
// container. The default is L3 only and thus /128.
ContainerIPv6Mask = net.CIDRMask(128, 128)
// IPv4 prefix length for address assigned to container. The default is
// L3 only and thus /32
// ContainerIPv4Mask is the IPv4 prefix length for address assigned to
// container. The default is L3 only and thus /32.
ContainerIPv4Mask = net.CIDRMask(32, 32)

// IPv6DefaultRoute is the default IPv6 route.
IPv6DefaultRoute = net.IPNet{IP: net.IPv6zero, Mask: net.CIDRMask(0, 128)}
// IPv4DefaultRoute is the default IPv4 route.
IPv4DefaultRoute = net.IPNet{IP: net.IPv4zero, Mask: net.CIDRMask(0, 32)}
)

0 comments on commit 542198d

Please sign in to comment.