Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
Molify the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
liztio committed Jul 15, 2019
1 parent eee3a0a commit d8cfeb9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 84 deletions.
3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ require (
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/tools v0.0.0-20190710184609-286818132824 // indirect
golang.org/x/tools/gopls v0.1.3 // indirect
k8s.io/api v0.0.0-20190703205437-39734b2a72fe
k8s.io/apiextensions-apiserver v0.0.0-20181213153335-0fe22c71c476 // indirect
k8s.io/apimachinery v0.0.0-20190703205208-4cfb76a8bf76
k8s.io/cli-runtime v0.0.0-20190704050804-7ea68ffa02c5
k8s.io/client-go v11.0.0+incompatible
k8s.io/cluster-bootstrap v0.0.0-20181213155137-5f9271efc2e7 // indirect
k8s.io/klog v0.3.0
Expand Down
81 changes: 0 additions & 81 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions kind/controlplane/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"sigs.k8s.io/kind/pkg/container/cri"
)

// CreateKindCluster sets up a KIND cluster and turns it into a CAPD control plane
func CreateKindCluster(image, clusterName string) error {
lb, err := actions.SetUpLoadBalancer(clusterName)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions kind/controlplane/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// TODO: Add version number?
const userAgent = "capdctl"

// GetKubeconfig retrieves and parsing the kind cluster config
func GetKubeconfig(clusterName string) (*rest.Config, error) {
ctx := cluster.NewContext(clusterName)
path := ctx.KubeConfigPath()
Expand Down
1 change: 1 addition & 0 deletions objects/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)

// GetManegementCluster returns all the objects needed to create a working CAPD management cluster
func GetManegementCluster(version, capiImage, capdImage string) ([]runtime.Object, error) {
capiObjects, err := GetCAPI(version, capiImage)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions objects/capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func decodeCAPIObjects(yaml io.Reader) ([]runtime.Object, error) {
return objects, nil
}

// GetCAPI retrieves the objects needed to create a CAPI control plane from Github and parses them into runtime.Objects
func GetCAPI(version, capiImage string) ([]runtime.Object, error) {
reader, err := getCAPIYAML(version, capiImage)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions objects/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

const controlPlaneSet = "controlplane"

// GetMachineDeployment returns a worker node machine deployment object
func GetMachineDeployment(name, namespace, clusterName, kubeletVersion string, replicas int32) capi.MachineDeployment {
labels := map[string]string{
"cluster.k8s.io/cluster-name": clusterName,
Expand Down Expand Up @@ -54,6 +55,7 @@ func GetMachineDeployment(name, namespace, clusterName, kubeletVersion string, r
}
}

// GetCluster returns a cluster object with the given name and namespace
func GetCluster(clusterName, namespace string) capi.Cluster {
return capi.Cluster{
ObjectMeta: meta.ObjectMeta{
Expand All @@ -74,6 +76,7 @@ func GetCluster(clusterName, namespace string) capi.Cluster {
}
}

// GetMachine returns a machine with the given parameters
func GetMachine(name, namespace, clusterName, set, version string) capi.Machine {
machine := capi.Machine{
ObjectMeta: meta.ObjectMeta{
Expand Down
2 changes: 2 additions & 0 deletions objects/control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

const namespace = "docker-provider-system"

// GetNamespace returns a "docker-provider-system" namespace object
func GetNamespace() core.Namespace {
return core.Namespace{
ObjectMeta: meta.ObjectMeta{
Expand All @@ -48,6 +49,7 @@ const (
dockerLibPath = "/var/lib/docker"
)

// GetStatefulSet returns a statefulset for running CAPD with the given image name
func GetStatefulSet(image string) apps.StatefulSet {
return apps.StatefulSet{
ObjectMeta: meta.ObjectMeta{
Expand Down
2 changes: 2 additions & 0 deletions objects/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

const clusterRoleName = "docker-provider-manager-role"

// GetClusterRole returns the cluster role capi needs to function properly
func GetClusterRole() rbac.ClusterRole {
return rbac.ClusterRole{
ObjectMeta: meta.ObjectMeta{
Expand Down Expand Up @@ -95,6 +96,7 @@ func GetClusterRole() rbac.ClusterRole {
}
}

// GetClusterRoleBinding returns the binding for the role created by GetClusterRole
func GetClusterRoleBinding() rbac.ClusterRoleBinding {
return rbac.ClusterRoleBinding{
ObjectMeta: meta.ObjectMeta{
Expand Down

0 comments on commit d8cfeb9

Please sign in to comment.