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

Commit 3a84c2d

Browse files
authored
Merge pull request #48 from christopherhein/ci-scripts-directory
🌱 Adding scripts directory for prow jobs
2 parents 3a53ec2 + 36a8cf0 commit 3a84c2d

15 files changed

+273
-16
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ config/ci/manager/manager.yaml
4646
manager_image_patch.yaml-e
4747
manager_pull_policy.yaml-e
4848

49-
# Sample config files auto-generated by kubebuilder
50-
config/samples
49+
config/ci
5150

5251
# Temporary clusterctl directory
5352
cmd/clusterctl/config/manifest

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ linters:
1515
- godot
1616
- goerr113
1717
- nestif
18+
# TODO(christopherhein) Reenable these and fix errors
19+
- gosec
20+
- nakedret
21+
- unparam
22+
- staticcheck
23+
- scopelint
1824
# Run with --fast=false for more extensive checks
1925
fast: true
2026
issues:

Makefile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ $(KUSTOMIZE): # Build kustomize from tools folder.
116116

117117
envsubst: $(ENVSUBST) ## Build a local copy of envsubst.
118118
kustomize: $(KUSTOMIZE) ## Build a local copy of kustomize.
119+
controller-gen: $(CONTROLLER_GEN) ## Build a local copy of controller-gen.
120+
golangci-lint: $(GOLANGCI_LINT) ## Build a local copy of golangci-lint.
119121

120122
## --------------------------------------
121123
## Linting
@@ -124,13 +126,9 @@ kustomize: $(KUSTOMIZE) ## Build a local copy of kustomize.
124126
.PHONY: lint lint-full
125127
lint: $(GOLANGCI_LINT) ## Lint codebase
126128
$(GOLANGCI_LINT) run -v
127-
cd $(E2E_FRAMEWORK_DIR); $(GOLANGCI_LINT) run -v
128-
cd $(CAPD_DIR); $(GOLANGCI_LINT) run -v
129129

130130
lint-full: $(GOLANGCI_LINT) ## Run slower linters to detect possible issues
131131
$(GOLANGCI_LINT) run -v --fast=false
132-
cd $(E2E_FRAMEWORK_DIR); $(GOLANGCI_LINT) run -v --fast=false
133-
cd $(CAPD_DIR); $(GOLANGCI_LINT) run -v --fast=false
134132

135133
apidiff: $(GO_APIDIFF) ## Check for API differences
136134
$(GO_APIDIFF) $(shell git rev-parse origin/master) --print-compatible
@@ -140,20 +138,19 @@ apidiff: $(GO_APIDIFF) ## Check for API differences
140138
## --------------------------------------
141139

142140
.PHONY: generate
143-
generate: ## Generate code
144-
$(MAKE) generate-manifests
141+
generate:
145142
$(MAKE) generate-go
146-
# $(MAKE) generate-bindata
143+
$(MAKE) generate-manifests
147144

148145
.PHONY: generate-go
149-
generate-go: ## Runs Go related generate targets
146+
generate-go: $(CONTROLLER_GEN) ## Runs Go related generate targets
150147
go generate ./...
151148
$(CONTROLLER_GEN) \
152149
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
153150
paths=./apis/...
154151

155152
.PHONY: generate-manifests
156-
generate-manifests: ## Generate manifests e.g. CRD, RBAC etc.
153+
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
157154
$(CONTROLLER_GEN) \
158155
paths=./apis/... \
159156
paths=./controllers/... \
@@ -163,8 +160,8 @@ generate-manifests: ## Generate manifests e.g. CRD, RBAC etc.
163160
output:webhook:dir=./config/webhook \
164161
webhook
165162
## Copy files in CI folders.
166-
# cp -f ./config/rbac/*.yaml ./config/ci/rbac/
167-
# cp -f ./config/manager/manager*.yaml ./config/ci/manager/
163+
cp -f ./config/rbac/*.yaml ./config/ci/rbac/
164+
cp -f ./config/manager/manager*.yaml ./config/ci/manager/
168165

169166
.PHONY: modules
170167
modules: ## Runs go mod to ensure modules are up to date.

apis/controlplane/v1alpha4/nestedcomponent_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type NestedComponentSpec struct {
2828
// +optional
2929
addonv1alpha1.CommonSpec `json:",inline"`
3030

31-
// PatchSpecs includes the user specifed settings
31+
// PatchSpecs includes the user specified settings
3232
// +optional
3333
addonv1alpha1.PatchSpec `json:",inline"`
3434

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
2+
kind: NestedAPIServer
3+
metadata:
4+
name: nestedapiserver-sample
5+
spec:
6+
replicas: 1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
2+
kind: NestedControllerManager
3+
metadata:
4+
name: nestedcontrollermanager-sample
5+
spec:
6+
replicas: 1
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
2+
kind: NestedControlPlane
3+
metadata:
4+
name: nestedcontrolplane-sample
5+
spec:
6+
etcd:
7+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
8+
kind: NestedEtcd
9+
name: nestedetcd-sample
10+
apiserver:
11+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
12+
kind: NestedAPIServer
13+
name: nestedapiserver-sample
14+
controllerManager:
15+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
16+
kind: NestedControllerManager
17+
name: nestedcontrollermanager-sample
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
2+
kind: NestedEtcd
3+
metadata:
4+
name: nestedetcd-sample
5+
spec:
6+
replicas: 1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
2+
kind: NestedCluster
3+
metadata:
4+
name: nestedcluster-sample
5+
spec:
6+
controlPlaneEndpoint:
7+
host: "localhost"
8+
port: 6443

config/samples/v1alpha4_cluster.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: cluster.x-k8s.io/v1alpha4
2+
kind: Cluster
3+
metadata:
4+
name: cluster-sample
5+
namespace: default
6+
spec:
7+
controlPlaneEndpoint:
8+
# currently this has to be the in-cluster endpoint, the in-cluster
9+
# kubeconfig is used by controller-manager w/ ClusterIP services
10+
# we can `port-forward` this service and be able to test
11+
host: "cluster-sample-apiserver"
12+
port: 6443
13+
controlPlaneRef:
14+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
15+
kind: NestedControlPlane
16+
name: nestedcontrolplane-sample
17+
namespace: default
18+
infrastructureRef:
19+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
20+
kind: NestedCluster
21+
name: nestedcluster-sample
22+
namespace: default

0 commit comments

Comments
 (0)