Skip to content

Commit

Permalink
created scaffolding for go/v4
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Nov 21, 2023
1 parent 4ebb393 commit 85ba579
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PLATFORMS_E2E ?= linux/amd64
KIND_CLUSTER_NAME ?= capi-test

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.23
ENVTEST_K8S_VERSION = 1.28.0

#
# Directories.
Expand Down Expand Up @@ -205,11 +205,11 @@ kind-delete: ## Delete the kind cluster

.PHONY: build
build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
go build -o bin/manager cmd/main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go
go run cmd/main.go

.PHONY: docker-build
docker-build: $(KO) test-unittest ## Build docker image with the manager.
Expand Down
33 changes: 32 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: cluster.x-k8s.io
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
multigroup: true
projectName: cluster-api-provider-nutanix
repo: github.com/nutanix-cloud-native/cluster-api-provider-nutanix
resources:
Expand All @@ -13,6 +18,15 @@ resources:
kind: NutanixCluster
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixCluster
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
Expand All @@ -22,6 +36,15 @@ resources:
kind: NutanixMachine
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachine
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
Expand All @@ -30,4 +53,12 @@ resources:
kind: NutanixMachineTemplate
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachineTemplate
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
version: v1beta1
version: "3"
2 changes: 1 addition & 1 deletion main.go → cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (

infrav1alpha4 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
"github.com/nutanix-cloud-native/cluster-api-provider-nutanix/controllers"
"github.com/nutanix-cloud-native/cluster-api-provider-nutanix/internal/controller"
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
//+kubebuilder:scaffold:imports
Expand Down
7 changes: 7 additions & 0 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
- infrastructure_v1alpha4_nutanixcluster.yaml
- infrastructure_v1alpha4_nutanixmachine.yaml
- infrastructure_v1alpha4_nutanixmachinetemplate.yaml
- infrastructure_v1beta1_nutanixcluster.yaml
- infrastructure_v1beta1_nutanixmachine.yaml
- infrastructure_v1beta1_nutanixmachinetemplate.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var _ = BeforeSuite(func() {

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}

Expand Down
4 changes: 2 additions & 2 deletions tilt-provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"config": {
"image": "ghcr.io/nutanix-cloud-native/cluster-api-provider-nutanix/controller",
"live_reload_deps": [
"main.go",
"cmd",
"go.mod",
"go.sum",
"api",
"controllers",
"internal",
"pkg",
"config"
],
Expand Down

0 comments on commit 85ba579

Please sign in to comment.