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

⚠️ Update VC controller-runtime #70

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions virtualcluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ deploy: manifests

# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:artifacts:config=config/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:none
hack/make-rules/replace-null.sh
# To work around a known controller gen issue
# https://github.com/kubernetes-sigs/kubebuilder/issues/1544
Expand Down Expand Up @@ -163,7 +163,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.3.0 ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOPATH)/bin/controller-gen
Expand Down
6 changes: 3 additions & 3 deletions virtualcluster/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/apis"
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/controller"
"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/pkg/webhook"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client/config"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"

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

// Start the Cmd
log.Info("Starting the Cmd.")
if err := mgr.Start(signals.SetupSignalHandler()); err != nil {
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
log.Error(err, "unable to run the manager")
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion virtualcluster/cmd/syncer/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (

"github.com/spf13/cobra"
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/util/term"
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/tools/leaderelection"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/cli/globalflag"
"k8s.io/component-base/term"
"k8s.io/klog"

syncerconfig "sigs.k8s.io/cluster-api-provider-nested/virtualcluster/cmd/syncer/app/config"
Expand Down
2 changes: 1 addition & 1 deletion virtualcluster/cmd/vn-agent/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (

"github.com/pkg/errors"
"github.com/spf13/cobra"
"k8s.io/apiserver/pkg/util/term"
certutil "k8s.io/client-go/util/cert"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/cli/globalflag"
"k8s.io/component-base/term"
"k8s.io/klog"

"sigs.k8s.io/cluster-api-provider-nested/virtualcluster/cmd/vn-agent/app/options"
Expand Down
163 changes: 163 additions & 0 deletions virtualcluster/config/crd/cluster.x-k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: clusters.cluster.x-k8s.io
spec:
group: cluster.x-k8s.io
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
scope: Namespaced
versions:
- name: v1alpha4
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
clusterNetwork:
properties:
apiServerPort:
format: int32
type: integer
pods:
properties:
cidrBlocks:
items:
type: string
type: array
required:
- cidrBlocks
type: object
serviceDomain:
type: string
services:
properties:
cidrBlocks:
items:
type: string
type: array
required:
- cidrBlocks
type: object
type: object
controlPlaneEndpoint:
properties:
host:
type: string
port:
format: int32
type: integer
required:
- host
- port
type: object
controlPlaneRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
resourceVersion:
type: string
uid:
type: string
type: object
infrastructureRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
resourceVersion:
type: string
uid:
type: string
type: object
paused:
type: boolean
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
type: string
severity:
type: string
status:
type: string
type:
type: string
required:
- status
- type
type: object
type: array
controlPlaneInitialized:
type: boolean
controlPlaneReady:
type: boolean
failureDomains:
additionalProperties:
properties:
attributes:
additionalProperties:
type: string
type: object
controlPlane:
type: boolean
type: object
type: object
failureMessage:
type: string
failureReason:
type: string
infrastructureReady:
type: boolean
observedGeneration:
format: int64
type: integer
phase:
type: string
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading