Skip to content

Commit

Permalink
Merge pull request #142 from srl-labs/chore/update-code-gen-make-targets
Browse files Browse the repository at this point in the history
chore: updated make targets to jive with updated kube builder things,…
  • Loading branch information
carlmontanari authored Apr 23, 2024
2 parents 53a0de8 + bfe3d51 commit 65ba547
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 26 deletions.
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,31 @@ install-tools: ## Install lint/test tools

install-code-generators: ## Install latest code-generator tools
go install k8s.io/code-generator/cmd/deepcopy-gen@latest
go install k8s.io/code-generator/cmd/openapi-gen@latest
go install k8s.io/kube-openapi/cmd/openapi-gen@latest
go install k8s.io/code-generator/cmd/client-gen@latest
go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest

run-deepcopy-gen: ## Run deepcopy-gen
GOMOD111=on \
deepcopy-gen \
--go-header-file hack/boilerplate.go.txt \
--input-dirs github.com/srl-labs/clabernetes/apis/... \
--output-file-base zz_generated.deepcopy \
--trim-path-prefix ${GOPATH}/src/github.com/srl-labs/clabernetes
--output-file zz_generated.deepcopy.go \
github.com/srl-labs/clabernetes/apis/...

run-openapi-gen: ## Run openapi-gen
GOMOD111=on \
openapi-gen \
--go-header-file hack/boilerplate.go.txt \
--input-dirs github.com/srl-labs/clabernetes/apis/... \
--trim-path-prefix ${GOPATH}/src/github.com/srl-labs/clabernetes \
--output-package github.com/srl-labs/clabernetes/generated/openapi
--output-dir generated/openapi \
--output-file openapi_generated.go \
--output-pkg github.com/srl-labs/clabernetes/generated/openapi \
github.com/srl-labs/clabernetes/apis/...

run-client-gen: ## Run client-gen
GOMOD111=on \
client-gen \
--go-header-file hack/boilerplate.go.txt \
--input-base github.com/srl-labs/clabernetes \
--input apis/v1alpha1 \
--trim-path-prefix ${GOPATH}/src/github.com/srl-labs/clabernetes \
--output-package github.com/srl-labs/clabernetes/generated \
--output-dir generated \
--output-pkg github.com/srl-labs/clabernetes/generated \
--clientset-name clientset

run-generate-crds: ## Run controller-gen for crds
Expand Down
1 change: 1 addition & 0 deletions apis/v1alpha1/topologyspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ type Scheduling struct {
// +optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Tolerations is a list of Tolerations that will be set on the launcher pod spec.
// +listType=atomic
// +optional
Tolerations []k8scorev1.Toleration `json:"tolerations"`
}
Expand Down
7 changes: 4 additions & 3 deletions assets/crd/clabernetes.containerlab.dev_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: configs.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down Expand Up @@ -53,8 +53,9 @@ spec:
This is disabled by default.
type: boolean
containerlabTimeout:
description: ContainerlabTimeout sets the `--timeout` flag when
invoking containerlab in the launcher pods.
description: |-
ContainerlabTimeout sets the `--timeout` flag when invoking containerlab in the launcher
pods.
type: string
containerlabVersion:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: connectivities.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down
2 changes: 1 addition & 1 deletion assets/crd/clabernetes.containerlab.dev_imagerequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: imagerequests.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down
3 changes: 2 additions & 1 deletion assets/crd/clabernetes.containerlab.dev_topologies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: topologies.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down Expand Up @@ -353,6 +353,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
type: object
expose:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: configs.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down Expand Up @@ -53,8 +53,9 @@ spec:
This is disabled by default.
type: boolean
containerlabTimeout:
description: ContainerlabTimeout sets the `--timeout` flag when
invoking containerlab in the launcher pods.
description: |-
ContainerlabTimeout sets the `--timeout` flag when invoking containerlab in the launcher
pods.
type: string
containerlabVersion:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: connectivities.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: imagerequests.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.15.0
name: topologies.clabernetes.containerlab.dev
spec:
group: clabernetes.containerlab.dev
Expand Down Expand Up @@ -353,6 +353,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
type: object
expose:
Expand Down
7 changes: 5 additions & 2 deletions generated/openapi/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65ba547

Please sign in to comment.