Skip to content

Commit b9597b1

Browse files
author
Neil Jerram
committed
Build fixes
1 parent ecfe5e2 commit b9597b1

File tree

7 files changed

+25
-9
lines changed

7 files changed

+25
-9
lines changed

pkg/apis/config/v1alpha4/types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ type Node struct {
142142
// The node-level patches will be applied after the cluster-level patches
143143
// have been applied. (See Cluster.KubeadmConfigPatchesJSON6902)
144144
KubeadmConfigPatchesJSON6902 []PatchJSON6902 `yaml:"kubeadmConfigPatchesJSON6902,omitempty"`
145+
146+
// Docker networks to attach to. Defaults to the Docker default ("bridge").
147+
Networks []string
148+
149+
// Loopback IP.
150+
Loopback string
151+
152+
Routes []string
145153
}
146154

147155
// NodeRole defines possible role for nodes in a Kubernetes cluster managed by `kind`

pkg/cluster/constants/constants.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ package constants
2020
// DefaultClusterName is the default cluster Context name
2121
const DefaultClusterName = "kind"
2222

23-
const NodeLoopbackKey = "io.k8s.sigs.kind.loopback"
24-
const NodeRoutesKey = "io.k8s.sigs.kind.routes"
25-
2623
/* node role value constants */
2724
const (
2825
// ControlPlaneNodeRoleValue identifies a node that hosts a Kubernetes

pkg/cluster/internal/create/actions/loopback/loopback.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ package loopback
1919

2020
import (
2121
"fmt"
22-
"sigs.k8s.io/kind/pkg/errors"
23-
"sigs.k8s.io/kind/pkg/internal/cluster/create/actions"
2422
"strings"
23+
24+
"sigs.k8s.io/kind/pkg/cluster/internal/create/actions"
25+
"sigs.k8s.io/kind/pkg/errors"
2526
)
2627

2728
// kubeadmInitAction implements action for executing the kubadm init

pkg/cluster/internal/providers/docker/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ const clusterLabelKey = "io.x-k8s.kind.cluster"
2222
// nodeRoleLabelKey is applied to each "node" docker container for categorization
2323
// of nodes by role
2424
const nodeRoleLabelKey = "io.x-k8s.kind.role"
25+
const nodeLoopbackKey = "io.x-k8s.kind.loopback"
26+
const nodeRoutesKey = "io.x-k8s.kind.routes"

pkg/cluster/internal/providers/docker/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (n *node) Role() (string, error) {
5252

5353
func (n *node) Loopback() (string, error) {
5454
cmd := exec.Command("docker", "inspect",
55-
"--format", fmt.Sprintf(`{{ index .Config.Labels "%s"}}`, constants.NodeLoopbackKey),
55+
"--format", fmt.Sprintf(`{{ index .Config.Labels "%s"}}`, nodeLoopbackKey),
5656
n.name,
5757
)
5858
lines, err := exec.OutputLines(cmd)
@@ -67,7 +67,7 @@ func (n *node) Loopback() (string, error) {
6767

6868
func (n *node) Routes() (string, error) {
6969
cmd := exec.Command("docker", "inspect",
70-
"--format", fmt.Sprintf(`{{ index .Config.Labels "%s"}}`, constants.NodeRoutesKey),
70+
"--format", fmt.Sprintf(`{{ index .Config.Labels "%s"}}`, nodeRoutesKey),
7171
n.name,
7272
)
7373
lines, err := exec.OutputLines(cmd)

pkg/cluster/internal/providers/docker/provision.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
244244
"--name", name, // ... and set the container name
245245
// label the node with the role ID
246246
"--label", fmt.Sprintf("%s=%s", nodeRoleLabelKey, node.Role),
247-
"--label", fmt.Sprintf("%s=%s", constants.NodeLoopbackKey, node.Loopback),
248-
"--label", fmt.Sprintf("%s=%s", constants.NodeRoutesKey, strings.Join(node.Routes, ",")),
247+
"--label", fmt.Sprintf("%s=%s", nodeLoopbackKey, node.Loopback),
248+
"--label", fmt.Sprintf("%s=%s", nodeRoutesKey, strings.Join(node.Routes, ",")),
249249
// running containers in a container requires privileged
250250
// NOTE: we could try to replicate this with --cap-add, and use less
251251
// privileges, but this flag also changes some mounts that are necessary

pkg/cluster/internal/providers/podman/node.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ func (n *node) Role() (string, error) {
5050
return lines[0], nil
5151
}
5252

53+
func (n *node) Loopback() (string, error) {
54+
return "", errors.New("unimplemented")
55+
}
56+
57+
func (n *node) Routes() (string, error) {
58+
return "", errors.New("unimplemented")
59+
}
60+
5361
func (n *node) IP() (ipv4 string, ipv6 string, err error) {
5462
// retrieve the IP address of the node using podman inspect
5563
cmd := exec.Command("podman", "inspect",

0 commit comments

Comments
 (0)