Skip to content

Commit

Permalink
converts k8s v1beta1 to v1
Browse files Browse the repository at this point in the history
Updates helm to 3.6.3 (#123)

* updates helm dep to 3.6.3 and all other things that depend on that version

* put cancelfunc on context in setup

finish updates
  • Loading branch information
stinkyfingers committed Aug 10, 2021
1 parent 95dbbbf commit 3fda60c
Show file tree
Hide file tree
Showing 25 changed files with 1,273 additions and 930 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
CRD_OPTIONS ?= "crd:trivialVersions=true,crdVersions=v1"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand All @@ -14,7 +14,7 @@ endif
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)

KUBEBUILDER_VERSION="1.0.8"
KUBEBUILDER_VERSION="2.3.0"
KUBEBUILDER_INSTALL_DIR ?= "/usr/local"
KUBEBUILDER_RELEASE="kubebuilder_${KUBEBUILDER_VERSION}_${GOOS}_${GOARCH}"

Expand All @@ -34,7 +34,7 @@ test: generate fmt vet manifests
manager: generate fmt vet
go build -o bin/manager cmd/manager/main.go

# Build ketch binary
# Build ketch binary
.PHONY: ketch
ketch: generate fmt vet
go build -o bin/ketch ./cmd/ketch/
Expand Down Expand Up @@ -119,7 +119,7 @@ ifeq (, $(shell which controller-gen))
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.5 ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
Expand Down
9 changes: 5 additions & 4 deletions cmd/ketch/app_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"bytes"
"context"
"io/ioutil"
"k8s.io/apimachinery/pkg/api/errors"
"os"
"path"
"testing"

"k8s.io/apimachinery/pkg/api/errors"

registryv1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -60,7 +61,7 @@ func newMockClient() *mockClient {
}
}

func (m *mockClient) Get(_ context.Context, _ client.ObjectKey, obj runtime.Object) error {
func (m *mockClient) Get(_ context.Context, _ client.ObjectKey, obj client.Object) error {
m.getCounter++

if f, ok := m.get[m.getCounter]; ok {
Expand All @@ -78,7 +79,7 @@ func (m *mockClient) Get(_ context.Context, _ client.ObjectKey, obj runtime.Obje
panic("unhandled type")
}

func (m *mockClient) Create(_ context.Context, obj runtime.Object, _ ...client.CreateOption) error {
func (m *mockClient) Create(_ context.Context, obj client.Object, _ ...client.CreateOption) error {
m.createCounter++

if f, ok := m.create[m.createCounter]; ok {
Expand All @@ -96,7 +97,7 @@ func (m *mockClient) Create(_ context.Context, obj runtime.Object, _ ...client.C
panic("unhandled type")
}

func (m *mockClient) Update(ctx context.Context, obj runtime.Object, opts ...client.UpdateOption) error {
func (m *mockClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error {
m.updateCounter++

if f, ok := m.update[m.updateCounter]; ok {
Expand Down
15 changes: 10 additions & 5 deletions cmd/ketch/framework_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ func TestUpdateFrameworkFromYaml(t *testing.T) {
frontendFramework := &ketchv1.Framework{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: "frontend-framework",
Name: "frontend-framework",
ResourceVersion: "1",
},
Spec: ketchv1.FrameworkSpec{
NamespaceName: "frontend",
Expand Down Expand Up @@ -339,7 +340,8 @@ ingressController:
className: default-classname`,
framework: &ketchv1.Framework{
ObjectMeta: metav1.ObjectMeta{
Name: "frontend-framework",
Name: "frontend-framework",
ResourceVersion: "1",
},
TypeMeta: metav1.TypeMeta{
Kind: "Framework",
Expand Down Expand Up @@ -368,7 +370,8 @@ ingressController:
yamlData: `name: frontend-framework`,
framework: &ketchv1.Framework{
ObjectMeta: metav1.ObjectMeta{
Name: "frontend-framework",
Name: "frontend-framework",
ResourceVersion: "1",
},
TypeMeta: metav1.TypeMeta{
Kind: "Framework",
Expand Down Expand Up @@ -409,7 +412,8 @@ func TestUpdateFrameworkFromArgs(t *testing.T) {
frontendFramework := &ketchv1.Framework{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: "frontend-framework",
Name: "frontend-framework",
ResourceVersion: "1",
},
Spec: ketchv1.FrameworkSpec{
NamespaceName: "frontend",
Expand Down Expand Up @@ -450,7 +454,8 @@ func TestUpdateFrameworkFromArgs(t *testing.T) {
},
framework: &ketchv1.Framework{
ObjectMeta: metav1.ObjectMeta{
Name: "frontend-framework",
Name: "frontend-framework",
ResourceVersion: "1",
},
TypeMeta: metav1.TypeMeta{
Kind: "Framework",
Expand Down
Loading

0 comments on commit 3fda60c

Please sign in to comment.