Skip to content

Commit

Permalink
Fix remaining VXLAN naming
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 18, 2018
1 parent 18f9f81 commit 5804c50
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 149 deletions.
8 changes: 4 additions & 4 deletions api/api.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5761,11 +5761,11 @@ file {
json_name: "attachments"
}
field {
name: "vxlanUDPPort"
name: "VXLANUDPPort"
number: 11
label: LABEL_OPTIONAL
type: TYPE_UINT32
json_name: "vxlanUDPPort"
json_name: "VXLANUDPPort"
}
options {
70001 {
Expand Down Expand Up @@ -6292,11 +6292,11 @@ file {
json_name: "subnetSize"
}
field {
name: "vxlanUDPPort"
name: "VXLANUDPPort"
number: 13
label: LABEL_OPTIONAL
type: TYPE_UINT32
json_name: "vxlanUDPPort"
json_name: "VXLANUDPPort"
}
nested_type {
name: "BlacklistedCertificatesEntry"
Expand Down
246 changes: 123 additions & 123 deletions api/objects.pb.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions api/objects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ message Node {
// network, including ingress network, will have an NetworkAttachment.
repeated NetworkAttachment attachments = 10;

// vxlanUDPPort This flag specifies the vxlan udp port for vxlan traffic.
// VXLANUDPPort specifies the UDP port for VXLAN traffic.
// This information is passed from cluster object to individual nodes.
uint32 vxlanUDPPort = 11;
uint32 VXLANUDPPort = 11;
}

message Service {
Expand Down Expand Up @@ -380,8 +380,8 @@ message Cluster {
// the length of the subnet masks for every such network
uint32 subnetSize = 12;

// vxlanUDPPort specifies the vxlan udp port for vxlan traffic.
uint32 vxlanUDPPort = 13;
// VXLANUDPPort specifies the UDP port for VXLAN traffic.
uint32 VXLANUDPPort = 13;
}

// Secret represents a secret that should be passed to a container or a node,
Expand Down
2 changes: 1 addition & 1 deletion ca/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (s *Server) IssueNodeCertificate(ctx context.Context, request *api.IssueNod
Availability: request.Availability,
},
}
node.VxlanUDPPort = clusters[0].VxlanUDPPort
node.VXLANUDPPort = clusters[0].VXLANUDPPort
return store.CreateNode(tx, node)
})
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion manager/allocator/cnmallocator/networkallocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type NetworkConfig struct {
// the default subnet pool
SubnetSize uint32

// VXLANUDPPort specifies VxLAN UDP port number for VxLAN traffic
// VXLANUDPPort specifies the UDP port number for VXLAN traffic
VXLANUDPPort uint32
}

Expand Down
8 changes: 4 additions & 4 deletions manager/controlapi/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
expiredCertGrace = 24 * time.Hour * 7
// inbuilt default subnet size
inbuiltSubnetSize = 24
// VxLan default port
// VXLAN default port
defaultVXLANPort = 4789
)

Expand Down Expand Up @@ -276,16 +276,16 @@ func redactClusters(clusters []*api.Cluster) []*api.Cluster {
BlacklistedCertificates: cluster.BlacklistedCertificates,
DefaultAddressPool: cluster.DefaultAddressPool,
SubnetSize: cluster.SubnetSize,
VxlanUDPPort: cluster.VxlanUDPPort,
VXLANUDPPort: cluster.VXLANUDPPort,
}
if newCluster.DefaultAddressPool == nil {
// This is just for CLI display. Set the inbuilt default pool for
// user reference.
newCluster.DefaultAddressPool = inbuiltDefaultAddressPool
newCluster.SubnetSize = inbuiltSubnetSize
}
if newCluster.VxlanUDPPort == 0 {
newCluster.VxlanUDPPort = defaultVXLANPort
if newCluster.VXLANUDPPort == 0 {
newCluster.VXLANUDPPort = defaultVXLANPort
}
redactedClusters = append(redactedClusters, newCluster)
}
Expand Down
16 changes: 8 additions & 8 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,15 @@ func (m *Manager) becomeLeader(ctx context.Context) {
0)

// If defaultAddrPool is valid we update cluster object with new value
// If VxlanUDPPort is not 0 then we call update cluster object with new value
// If VXLANUDPPort is not 0 then we call update cluster object with new value
if m.config.NetworkConfig != nil {
if m.config.NetworkConfig.DefaultAddrPool != nil {
clusterObj.DefaultAddressPool = m.config.NetworkConfig.DefaultAddrPool
clusterObj.SubnetSize = m.config.NetworkConfig.SubnetSize
}

if m.config.NetworkConfig.VXLANUDPPort != 0 {
clusterObj.VxlanUDPPort = m.config.NetworkConfig.VXLANUDPPort
clusterObj.VXLANUDPPort = m.config.NetworkConfig.VXLANUDPPort
}
}
err := store.CreateCluster(tx, clusterObj)
Expand All @@ -965,7 +965,7 @@ func (m *Manager) becomeLeader(ctx context.Context) {

// Add Node entry for ourself, if one
// doesn't exist already.
freshCluster := nil == store.CreateNode(tx, managerNode(nodeID, m.config.Availability, clusterObj.VxlanUDPPort))
freshCluster := nil == store.CreateNode(tx, managerNode(nodeID, m.config.Availability, clusterObj.VXLANUDPPort))

if freshCluster {
// This is a fresh swarm cluster. Add to store now any initial
Expand Down Expand Up @@ -1003,7 +1003,7 @@ func (m *Manager) becomeLeader(ctx context.Context) {

// If DefaultAddrPool is null, Read from store and check if
// DefaultAddrPool info is stored in cluster object
// If VxlanUDPPort is 0, read it from the store - cluster object
// If VXLANUDPPort is 0, read it from the store - cluster object
if m.config.NetworkConfig == nil || m.config.NetworkConfig.DefaultAddrPool == nil || m.config.NetworkConfig.VXLANUDPPort == 0 {
var cluster *api.Cluster
s.View(func(tx store.ReadTx) {
Expand All @@ -1013,8 +1013,8 @@ func (m *Manager) becomeLeader(ctx context.Context) {
m.config.NetworkConfig.DefaultAddrPool = append(m.config.NetworkConfig.DefaultAddrPool, cluster.DefaultAddressPool...)
m.config.NetworkConfig.SubnetSize = cluster.SubnetSize
}
if cluster.VxlanUDPPort != 0 {
m.config.NetworkConfig.VXLANUDPPort = cluster.VxlanUDPPort
if cluster.VXLANUDPPort != 0 {
m.config.NetworkConfig.VXLANUDPPort = cluster.VXLANUDPPort
}
}

Expand Down Expand Up @@ -1178,7 +1178,7 @@ func defaultClusterObject(
FIPS: fips,
DefaultAddressPool: defaultAddressPool,
SubnetSize: subnetSize,
VxlanUDPPort: vxlanUDPPort,
VXLANUDPPort: vxlanUDPPort,
}
}

Expand All @@ -1198,7 +1198,7 @@ func managerNode(nodeID string, availability api.NodeSpec_Availability, vxlanPor
Membership: api.NodeMembershipAccepted,
Availability: availability,
},
VxlanUDPPort: vxlanPort,
VXLANUDPPort: vxlanPort,
}
}

Expand Down
8 changes: 4 additions & 4 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ func (n *Node) currentRole() api.NodeRole {
// configVXLANUDPPort sets vxlan port in libnetwork
func configVXLANUDPPort(ctx context.Context, vxlanUDPPort uint32) {
if err := overlayutils.ConfigVXLANUDPPort(vxlanUDPPort); err != nil {
log.G(ctx).WithError(err).Error("Configuring VxLAN port failed")
log.G(ctx).WithError(err).Error("Configuring VXLAN port failed")
}
logrus.Infof(" Swarm successfully initialized VxLAN UDP Port to %d ", vxlanUDPPort)
logrus.Infof(" Swarm successfully initialized VXLAN UDP Port to %d ", vxlanUDPPort)
}

func (n *Node) run(ctx context.Context) (err error) {
Expand Down Expand Up @@ -368,8 +368,8 @@ func (n *Node) run(ctx context.Context) (err error) {
return
case nodeChanges := <-n.notifyNodeChange:
if nodeChanges.Node != nil {
if nodeChanges.Node.VxlanUDPPort != 0 {
n.vxlanUDPPort = nodeChanges.Node.VxlanUDPPort
if nodeChanges.Node.VXLANUDPPort != 0 {
n.vxlanUDPPort = nodeChanges.Node.VXLANUDPPort
configVXLANUDPPort(ctx, n.vxlanUDPPort)
}
// This is a bit complex to be backward compatible with older CAs that
Expand Down

0 comments on commit 5804c50

Please sign in to comment.