Skip to content

Commit 6a22a05

Browse files
authored
Add Make target to sync CRDS and remove profiles printcolumn as it is… (#42)
* Add Make target to sync CRDS and remove profiles printcolumn as it is now a map Signed-off-by: Shiva Krishna, Merla <[email protected]> * Generate manifests before sync Signed-off-by: Shiva Krishna, Merla <[email protected]> * Add to validation target Add validation step in the CI pipeline for generated assets Signed-off-by: Shiva Krishna, Merla <[email protected]> --------- Signed-off-by: Shiva Krishna, Merla <[email protected]>
1 parent 4844f6f commit 6a22a05

File tree

6 files changed

+10
-15
lines changed

6 files changed

+10
-15
lines changed

.github/workflows/golang.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
skip-cache: true
5151
- name: Check golang modules
5252
run: make check-vendor
53+
- name: Check generated assets
54+
run: make validate-generated-assets
5355
test:
5456
name: Unit test
5557
runs-on: ubuntu-latest

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ generate-clientset: install-tools
9696
--input-base $(CURDIR)/api \
9797
--input "apps/v1alpha1"
9898

99-
validate-generated-assets: manifests generate generate-clientset
99+
validate-generated-assets: manifests generate generate-clientset sync-crds
100100
@echo "- Verifying that the generated code and manifests are in-sync..."
101101
@git diff --exit-code -- api config
102102

@@ -189,11 +189,18 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
189189
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
190190
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
191191

192+
.PHONY: install-tools
192193
install-tools:
193194
@echo Installing tools from tools.go
194195
export GOBIN=$(PROJECT_DIR)/bin && \
195196
grep '^\s*_' tools/tools.go | awk '{print $$2}' | xargs -tI % $(GO_CMD) install -mod=readonly -modfile=tools/go.mod %
196197

198+
.PHONY: sync-crds
199+
sync-crds: manifests
200+
@echo Syncing CRDs into Helm and OLM packages
201+
cp $(PROJECT_DIR)/config/crd/bases/* deployments/helm/k8s-nim-operator/crds
202+
cp $(PROJECT_DIR)/config/crd/bases/* bundle/manifests
203+
197204
##@ Dependencies
198205

199206
## Location to install dependencies to

api/apps/v1alpha1/nimcache_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ func (s *NIMSource) EnvFromSecrets() []v1.EnvFromSource {
217217
// +kubebuilder:subresource:status
218218
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0
219219
// +kubebuilder:printcolumn:name="PVC",type=string,JSONPath=`.status.pvc`,priority=0
220-
// +kubebuilder:printcolumn:name="Profiles",type=string,JSONPath=`.status.profiles`,priority=1
221220
// +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp`,priority=0
222221

223222
// NIMCache is the Schema for the nimcaches API

bundle/manifests/apps.nvidia.com_nimcaches.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ spec:
2121
- jsonPath: .status.pvc
2222
name: PVC
2323
type: string
24-
- jsonPath: .status.profiles
25-
name: Profiles
26-
priority: 1
27-
type: string
2824
- jsonPath: .metadata.creationTimestamp
2925
name: Age
3026
type: string

config/crd/bases/apps.nvidia.com_nimcaches.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ spec:
2121
- jsonPath: .status.pvc
2222
name: PVC
2323
type: string
24-
- jsonPath: .status.profiles
25-
name: Profiles
26-
priority: 1
27-
type: string
2824
- jsonPath: .metadata.creationTimestamp
2925
name: Age
3026
type: string

deployments/helm/k8s-nim-operator/crds/apps.nvidia.com_nimcaches.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ spec:
2121
- jsonPath: .status.pvc
2222
name: PVC
2323
type: string
24-
- jsonPath: .status.profiles
25-
name: Profiles
26-
priority: 1
27-
type: string
2824
- jsonPath: .metadata.creationTimestamp
2925
name: Age
3026
type: string
@@ -266,7 +262,6 @@ spec:
266262
type: object
267263
type: array
268264
required:
269-
- resources
270265
- source
271266
- storage
272267
type: object

0 commit comments

Comments
 (0)