Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Dec 6, 2018
1 parent eb0eb45 commit 5553014
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 32 deletions.
1 change: 1 addition & 0 deletions pkg/cluster/config/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
)

// IsControlPlane returns true if the node hosts a control plane instance
// NB. in single node clusters, control-plane nodes act also as a worker nodes
func (n *Node) IsControlPlane() bool {
return n.Role == ControlPlaneRole
}
Expand Down
14 changes: 1 addition & 13 deletions pkg/cluster/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,14 @@ type Node struct {
// This information is internal to `kind`.
// +k8s:conversion-gen=false
Name string
// ContainerHandle provides an handle to the container implementing the node
// This information is internal to `kind`.
// +k8s:conversion-gen=false
ContainerHandle
}

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

const (
// ControlPlaneRole identifies a node that hosts a Kubernetes control-plane
// NB. in single node clusters, control-plane nodes act also as a worker nodes
ControlPlaneRole NodeRole = "control-plane"
// WorkerRole identifies a node that hosts a Kubernetes worker
WorkerRole NodeRole = "worker"
Expand Down Expand Up @@ -154,12 +151,3 @@ type derivedConfigData struct {
// externalLoadBalancer contains the node with external-load-balancer role, if defined
externalLoadBalancer *Node
}

// +k8s:conversion-gen=false

// ContainerHandle defines info used by `kind` for transforming Nodes into containers.
// This struct is used internally by `kind` and it is NOT EXPOSED as a object of the public API.
// TODO(fabriziopandini): this is a place holder for an object that will replace current container handle
// when pkg/cluster/context.go will support multi master
type ContainerHandle struct {
}
3 changes: 2 additions & 1 deletion pkg/cluster/config/v1alpha2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ type Node struct {
type NodeRole string

const (
// ControlPlaneRole identifies a node that hosts a Kubernetes control-plane
// ControlPlaneRole identifies a node that hosts a Kubernetes control-plane.
// NB. in single node clusters, control-plane nodes act also as a worker nodes
ControlPlaneRole NodeRole = "control-plane"
// WorkerRole identifies a node that hosts a Kubernetes worker
WorkerRole NodeRole = "worker"
Expand Down
1 change: 0 additions & 1 deletion pkg/cluster/config/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions pkg/cluster/config/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5553014

Please sign in to comment.