Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit b095739

Browse files
Merge pull request #16 from ncdc/kcp-1.24
Updates for kcp/1.24
2 parents 813d765 + 8007356 commit b095739

File tree

9 files changed

+112
-93
lines changed

9 files changed

+112
-93
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.17 as builder
2+
FROM golang:1.18 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ APIEXPORT_NAME ?= data.my.domain
7777

7878
.PHONY: run
7979
run: manifests generate fmt vet ## Run a controller from your host.
80-
go run ./main.go $(NAME_PREFIX)$(APIEXPORT_NAME)
80+
go run ./main.go --api-export-name $(NAME_PREFIX)$(APIEXPORT_NAME)
8181

8282
.PHONY: docker-build
8383
docker-build: build ## Build docker image with the manager.

config/kcp/apiexport.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ metadata:
55
spec:
66
latestResourceSchemas:
77
- today.widgets.data.my.domain
8+
permissionClaims:
9+
- group: ""
10+
resource: "secrets"
11+
- group: ""
12+
resource: "configmaps"

config/rbac/role.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ rules:
9191
- get
9292
- list
9393
- watch
94-
- apiGroups:
95-
- apis.kcp.dev
96-
resources:
97-
- apiexports/status
98-
verbs:
99-
- get
10094
- apiGroups:
10195
- data.my.domain
10296
resources:

controllers/configmap_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
"k8s.io/apimachinery/pkg/types"
2828

29-
"github.com/kcp-dev/logicalcluster"
29+
"github.com/kcp-dev/logicalcluster/v2"
3030

3131
ctrl "sigs.k8s.io/controller-runtime"
3232
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -135,7 +135,6 @@ func (r *ConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
135135

136136
secret.SetName(configMap.GetName())
137137
secret.SetNamespace(configMap.GetNamespace())
138-
secret.SetClusterName(logicalcluster.From(&configMap).String())
139138
secret.SetOwnerReferences([]metav1.OwnerReference{metav1.OwnerReference{
140139
Name: configMap.GetName(),
141140
UID: configMap.GetUID(),

controllers/widget_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package controllers
1919
import (
2020
"context"
2121

22-
"github.com/kcp-dev/logicalcluster"
22+
"github.com/kcp-dev/logicalcluster/v2"
2323
"k8s.io/apimachinery/pkg/api/errors"
2424
"k8s.io/apimachinery/pkg/runtime"
2525
ctrl "sigs.k8s.io/controller-runtime"

go.mod

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module github.com/kcp-dev/controller-runtime-example
22

3-
go 1.17
3+
go 1.18
44

55
require (
6-
github.com/kcp-dev/kcp/pkg/apis v0.5.0-alpha.1
7-
github.com/kcp-dev/logicalcluster v1.1.1
6+
github.com/kcp-dev/kcp/pkg/apis v0.7.0
7+
github.com/kcp-dev/logicalcluster/v2 v2.0.0-alpha.1
88
github.com/onsi/ginkgo v1.16.5
9-
github.com/onsi/gomega v1.17.0
10-
k8s.io/api v0.23.5
11-
k8s.io/apimachinery v0.23.5
12-
k8s.io/client-go v0.23.5
9+
github.com/onsi/gomega v1.18.1
10+
k8s.io/api v0.24.3
11+
k8s.io/apimachinery v0.24.3
12+
k8s.io/client-go v0.24.3
1313
k8s.io/klog/v2 v2.60.1
1414
sigs.k8s.io/controller-runtime v0.11.2
1515
)
@@ -22,38 +22,47 @@ require (
2222
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
2323
github.com/Azure/go-autorest/logger v0.2.1 // indirect
2424
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
25+
github.com/PuerkitoBio/purell v1.1.1 // indirect
26+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2527
github.com/beorn7/perks v1.0.1 // indirect
26-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
28+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
2729
github.com/davecgh/go-spew v1.1.1 // indirect
30+
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
2831
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
2932
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
3033
github.com/fsnotify/fsnotify v1.5.1 // indirect
3134
github.com/go-logr/logr v1.2.0 // indirect
3235
github.com/go-logr/zapr v1.2.0 // indirect
36+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
37+
github.com/go-openapi/jsonreference v0.19.5 // indirect
38+
github.com/go-openapi/swag v0.19.14 // indirect
3339
github.com/gogo/protobuf v1.3.2 // indirect
3440
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3541
github.com/golang/protobuf v1.5.2 // indirect
42+
github.com/google/gnostic v0.5.7-v3refs // indirect
3643
github.com/google/go-cmp v0.5.6 // indirect
3744
github.com/google/gofuzz v1.1.0 // indirect
3845
github.com/google/uuid v1.1.2 // indirect
39-
github.com/googleapis/gnostic v0.5.5 // indirect
4046
github.com/imdario/mergo v0.3.12 // indirect
47+
github.com/josharian/intern v1.0.0 // indirect
4148
github.com/json-iterator/go v1.1.12 // indirect
42-
github.com/kcp-dev/apimachinery v0.0.0-20220627134323-8c44889e6e09 // indirect
49+
github.com/kcp-dev/apimachinery v0.0.0-20220805180221-5b13097793e1 // indirect
50+
github.com/mailru/easyjson v0.7.6 // indirect
4351
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
4452
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4553
github.com/modern-go/reflect2 v1.0.2 // indirect
54+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4655
github.com/nxadm/tail v1.4.8 // indirect
4756
github.com/pkg/errors v0.9.1 // indirect
48-
github.com/prometheus/client_golang v1.11.0 // indirect
57+
github.com/prometheus/client_golang v1.12.1 // indirect
4958
github.com/prometheus/client_model v0.2.0 // indirect
50-
github.com/prometheus/common v0.28.0 // indirect
51-
github.com/prometheus/procfs v0.6.0 // indirect
59+
github.com/prometheus/common v0.32.1 // indirect
60+
github.com/prometheus/procfs v0.7.3 // indirect
5261
github.com/spf13/pflag v1.0.5 // indirect
5362
go.uber.org/atomic v1.7.0 // indirect
5463
go.uber.org/multierr v1.7.0 // indirect
5564
go.uber.org/zap v1.19.1 // indirect
56-
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
65+
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
5766
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
5867
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
5968
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
@@ -67,13 +76,13 @@ require (
6776
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
6877
gopkg.in/yaml.v2 v2.4.0 // indirect
6978
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
70-
k8s.io/apiextensions-apiserver v0.23.5 // indirect
71-
k8s.io/component-base v0.23.5 // indirect
72-
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
79+
k8s.io/apiextensions-apiserver v0.24.3 // indirect
80+
k8s.io/component-base v0.24.3 // indirect
81+
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
7382
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
7483
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
7584
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
7685
sigs.k8s.io/yaml v1.3.0 // indirect
7786
)
7887

79-
replace sigs.k8s.io/controller-runtime => github.com/kcp-dev/controller-runtime v0.11.3-0.20220624161137-f6e5a2f56683
88+
replace sigs.k8s.io/controller-runtime => github.com/kcp-dev/controller-runtime v0.12.2-0.20220808200255-4b60fd66e5de

0 commit comments

Comments
 (0)