Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] created scaffolding for go/v4 #333

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 @@ -234,12 +234,12 @@ kind-delete: ## Delete the kind cluster
##@ Build

.PHONY: build
build: generate fmt ## Build manager binary.
go build -o bin/manager main.go
build: generate fmt vet ## Build manager binary.
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) ## 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 @@ -46,7 +46,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"
//+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
4 changes: 2 additions & 2 deletions hooks/build-finalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -e

BUILD_DIR=~/project/package/docker
cp -r ~/project/api $BUILD_DIR
cp -r ~/project/controllers $BUILD_DIR
cp -r ~/project/internal/controller $BUILD_DIR
cp -r ~/project/pkg $BUILD_DIR
cp go.mod go.sum main.go $BUILD_DIR
cp go.mod go.sum cmd/main.go $BUILD_DIR

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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
2 changes: 1 addition & 1 deletion test/e2e/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

infrav1 "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"
)

const (
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
Loading