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

Commit dcdeedb

Browse files
authored
Merge pull request #70 from christopherhein/update-vc-controller-runtime
⚠️ Update VC controller-runtime
2 parents 25383a1 + b56f310 commit dcdeedb

File tree

98 files changed

+13152
-1761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+13152
-1761
lines changed

virtualcluster/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ deploy: manifests
100100

101101
# Generate manifests e.g. CRD, RBAC etc.
102102
manifests: controller-gen
103-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:artifacts:config=config/crds
103+
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:none
104104
hack/make-rules/replace-null.sh
105105
# To work around a known controller gen issue
106106
# https://github.com/kubernetes-sigs/kubebuilder/issues/1544
@@ -163,7 +163,7 @@ ifeq (, $(shell which controller-gen))
163163
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
164164
cd $$CONTROLLER_GEN_TMP_DIR ;\
165165
go mod init tmp ;\
166-
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\
166+
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
167167
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
168168
}
169169
CONTROLLER_GEN=$(GOPATH)/bin/controller-gen

virtualcluster/cmd/manager/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import (
2727
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/apis"
2828
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/controller"
2929
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/webhook"
30+
ctrl "sigs.k8s.io/controller-runtime"
3031
"sigs.k8s.io/controller-runtime/pkg/client/config"
32+
logf "sigs.k8s.io/controller-runtime/pkg/log"
3133
"sigs.k8s.io/controller-runtime/pkg/manager"
32-
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
33-
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
3434

3535
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/controller/constants"
3636
logrutil "sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/controller/util/logr"
@@ -139,7 +139,7 @@ func main() {
139139

140140
// Start the Cmd
141141
log.Info("Starting the Cmd.")
142-
if err := mgr.Start(signals.SetupSignalHandler()); err != nil {
142+
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
143143
log.Error(err, "unable to run the manager")
144144
os.Exit(1)
145145
}

virtualcluster/cmd/syncer/app/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import (
2626

2727
"github.com/spf13/cobra"
2828
"k8s.io/apiserver/pkg/server/healthz"
29-
"k8s.io/apiserver/pkg/util/term"
3029
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
3130
"k8s.io/client-go/tools/leaderelection"
3231
cliflag "k8s.io/component-base/cli/flag"
3332
"k8s.io/component-base/cli/globalflag"
33+
"k8s.io/component-base/term"
3434
"k8s.io/klog"
3535

3636
syncerconfig "sigs.k8s.io/cluster-api-provider-nested/virtualcluster/cmd/syncer/app/config"

virtualcluster/cmd/vn-agent/app/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import (
2525

2626
"github.com/pkg/errors"
2727
"github.com/spf13/cobra"
28-
"k8s.io/apiserver/pkg/util/term"
2928
certutil "k8s.io/client-go/util/cert"
3029
cliflag "k8s.io/component-base/cli/flag"
3130
"k8s.io/component-base/cli/globalflag"
31+
"k8s.io/component-base/term"
3232
"k8s.io/klog"
3333

3434
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/cmd/vn-agent/app/options"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.4.1
8+
creationTimestamp: null
9+
name: clusters.cluster.x-k8s.io
10+
spec:
11+
group: cluster.x-k8s.io
12+
names:
13+
kind: Cluster
14+
listKind: ClusterList
15+
plural: clusters
16+
singular: cluster
17+
scope: Namespaced
18+
versions:
19+
- name: v1alpha4
20+
schema:
21+
openAPIV3Schema:
22+
properties:
23+
apiVersion:
24+
type: string
25+
kind:
26+
type: string
27+
metadata:
28+
type: object
29+
spec:
30+
properties:
31+
clusterNetwork:
32+
properties:
33+
apiServerPort:
34+
format: int32
35+
type: integer
36+
pods:
37+
properties:
38+
cidrBlocks:
39+
items:
40+
type: string
41+
type: array
42+
required:
43+
- cidrBlocks
44+
type: object
45+
serviceDomain:
46+
type: string
47+
services:
48+
properties:
49+
cidrBlocks:
50+
items:
51+
type: string
52+
type: array
53+
required:
54+
- cidrBlocks
55+
type: object
56+
type: object
57+
controlPlaneEndpoint:
58+
properties:
59+
host:
60+
type: string
61+
port:
62+
format: int32
63+
type: integer
64+
required:
65+
- host
66+
- port
67+
type: object
68+
controlPlaneRef:
69+
properties:
70+
apiVersion:
71+
type: string
72+
fieldPath:
73+
type: string
74+
kind:
75+
type: string
76+
name:
77+
type: string
78+
namespace:
79+
type: string
80+
resourceVersion:
81+
type: string
82+
uid:
83+
type: string
84+
type: object
85+
infrastructureRef:
86+
properties:
87+
apiVersion:
88+
type: string
89+
fieldPath:
90+
type: string
91+
kind:
92+
type: string
93+
name:
94+
type: string
95+
namespace:
96+
type: string
97+
resourceVersion:
98+
type: string
99+
uid:
100+
type: string
101+
type: object
102+
paused:
103+
type: boolean
104+
type: object
105+
status:
106+
properties:
107+
conditions:
108+
items:
109+
properties:
110+
lastTransitionTime:
111+
format: date-time
112+
type: string
113+
message:
114+
type: string
115+
reason:
116+
type: string
117+
severity:
118+
type: string
119+
status:
120+
type: string
121+
type:
122+
type: string
123+
required:
124+
- status
125+
- type
126+
type: object
127+
type: array
128+
controlPlaneInitialized:
129+
type: boolean
130+
controlPlaneReady:
131+
type: boolean
132+
failureDomains:
133+
additionalProperties:
134+
properties:
135+
attributes:
136+
additionalProperties:
137+
type: string
138+
type: object
139+
controlPlane:
140+
type: boolean
141+
type: object
142+
type: object
143+
failureMessage:
144+
type: string
145+
failureReason:
146+
type: string
147+
infrastructureReady:
148+
type: boolean
149+
observedGeneration:
150+
format: int64
151+
type: integer
152+
phase:
153+
type: string
154+
type: object
155+
type: object
156+
served: true
157+
storage: true
158+
status:
159+
acceptedNames:
160+
kind: ""
161+
plural: ""
162+
conditions: []
163+
storedVersions: []

0 commit comments

Comments
 (0)