Skip to content

Commit

Permalink
Use github.com/canonical/k8s-snap-api (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos authored Aug 20, 2024
1 parent 6883b5b commit 681192d
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 221 deletions.
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ linters-settings:
- sigs.k8s.io/cluster-api

- github.com/canonical/cluster-api-k8s
- github.com/canonical/k8s-snap-api

- github.com/google/uuid
- github.com/pkg/errors
Expand Down Expand Up @@ -148,14 +149,14 @@ linters-settings:
- name: unused-parameter
disabled: true
staticcheck:
go: "1.21"
go: "1.22"
stylecheck:
go: "1.21"
go: "1.22"
tagliatelle:
case:
rules:
# Any struct tag type can be used.
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
json: goCamel
unused:
go: "1.21"
go: "1.22"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SHELL:=/usr/bin/env bash

.DEFAULT_GOAL:=help

GO_VERSION ?= 1.21.9
GO_VERSION ?= 1.22.6
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)

ARCH ?= $(shell go env GOARCH)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module github.com/canonical/cluster-api-k8s

go 1.21
go 1.22.6

require (
github.com/canonical/k8s-snap-api v1.0.2
github.com/go-logr/logr v1.4.1
github.com/google/uuid v1.4.0
github.com/onsi/ginkgo v1.16.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/canonical/k8s-snap-api v1.0.2 h1:9tyIneGQ6dPouX/8DH/HBqQIk+PF+MtQB3Qwt43Cuu4=
github.com/canonical/k8s-snap-api v1.0.2/go.mod h1:LDPoIYCeYnfgOFrwVPJ/4edGU264w7BB7g0GsVi36AY=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
Expand Down
8 changes: 0 additions & 8 deletions pkg/ck8s/api/annotations.go

This file was deleted.

64 changes: 0 additions & 64 deletions pkg/ck8s/api/bootstrap_config.go

This file was deleted.

57 changes: 0 additions & 57 deletions pkg/ck8s/api/cluster_config.go

This file was deleted.

7 changes: 0 additions & 7 deletions pkg/ck8s/api/cluster_node.go

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/ck8s/api/doc.go

This file was deleted.

52 changes: 0 additions & 52 deletions pkg/ck8s/api/join_config.go

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/ck8s/api/tokens.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/ck8s/config_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"strings"

apiv1 "github.com/canonical/k8s-snap-api/api/v1"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"

bootstrapv1 "github.com/canonical/cluster-api-k8s/bootstrap/api/v1beta2"
apiv1 "github.com/canonical/cluster-api-k8s/pkg/ck8s/api"
"github.com/canonical/cluster-api-k8s/pkg/secret"
)

Expand Down
11 changes: 6 additions & 5 deletions pkg/ck8s/config_join.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package ck8s

import (
apiv1 "github.com/canonical/k8s-snap-api/api/v1"

bootstrapv1 "github.com/canonical/cluster-api-k8s/bootstrap/api/v1beta2"
apiv1 "github.com/canonical/cluster-api-k8s/pkg/ck8s/api"
)

type JoinControlPlaneConfig struct {
Expand All @@ -12,8 +13,8 @@ type JoinControlPlaneConfig struct {
ExtraKubeAPIServerArgs map[string]*string
}

func GenerateJoinControlPlaneConfig(cfg JoinControlPlaneConfig) apiv1.ControlPlaneNodeJoinConfig {
return apiv1.ControlPlaneNodeJoinConfig{
func GenerateJoinControlPlaneConfig(cfg JoinControlPlaneConfig) apiv1.ControlPlaneJoinConfig {
return apiv1.ControlPlaneJoinConfig{
ExtraSANS: append(cfg.ControlPlaneConfig.ExtraSANs, cfg.ControlPlaneEndpoint),

ExtraNodeKubeAPIServerArgs: cfg.ControlPlaneConfig.ExtraKubeAPIServerArgs,
Expand All @@ -23,6 +24,6 @@ func GenerateJoinControlPlaneConfig(cfg JoinControlPlaneConfig) apiv1.ControlPla
type JoinWorkerConfig struct {
}

func GenerateJoinWorkerConfig(cfg JoinWorkerConfig) apiv1.WorkerNodeJoinConfig {
return apiv1.WorkerNodeJoinConfig{}
func GenerateJoinWorkerConfig(cfg JoinWorkerConfig) apiv1.WorkerJoinConfig {
return apiv1.WorkerJoinConfig{}
}
2 changes: 1 addition & 1 deletion pkg/ck8s/workload_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"strings"

apiv1 "github.com/canonical/k8s-snap-api/api/v1"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -22,7 +23,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"

controlplanev1 "github.com/canonical/cluster-api-k8s/controlplane/api/v1beta2"
apiv1 "github.com/canonical/cluster-api-k8s/pkg/ck8s/api"
)

const (
Expand Down

0 comments on commit 681192d

Please sign in to comment.