Skip to content

Commit

Permalink
Add Make target to sync CRDS and remove profiles printcolumn as it is… (
Browse files Browse the repository at this point in the history
#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]>
  • Loading branch information
shivamerla authored Aug 9, 2024
1 parent 4844f6f commit 6a22a05
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
skip-cache: true
- name: Check golang modules
run: make check-vendor
- name: Check generated assets
run: make validate-generated-assets
test:
name: Unit test
runs-on: ubuntu-latest
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ generate-clientset: install-tools
--input-base $(CURDIR)/api \
--input "apps/v1alpha1"

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

Expand Down Expand Up @@ -189,11 +189,18 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
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.
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

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

.PHONY: sync-crds
sync-crds: manifests
@echo Syncing CRDs into Helm and OLM packages
cp $(PROJECT_DIR)/config/crd/bases/* deployments/helm/k8s-nim-operator/crds
cp $(PROJECT_DIR)/config/crd/bases/* bundle/manifests

##@ Dependencies

## Location to install dependencies to
Expand Down
1 change: 0 additions & 1 deletion api/apps/v1alpha1/nimcache_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func (s *NIMSource) EnvFromSecrets() []v1.EnvFromSource {
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0
// +kubebuilder:printcolumn:name="PVC",type=string,JSONPath=`.status.pvc`,priority=0
// +kubebuilder:printcolumn:name="Profiles",type=string,JSONPath=`.status.profiles`,priority=1
// +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp`,priority=0

// NIMCache is the Schema for the nimcaches API
Expand Down
4 changes: 0 additions & 4 deletions bundle/manifests/apps.nvidia.com_nimcaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ spec:
- jsonPath: .status.pvc
name: PVC
type: string
- jsonPath: .status.profiles
name: Profiles
priority: 1
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: string
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/apps.nvidia.com_nimcaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ spec:
- jsonPath: .status.pvc
name: PVC
type: string
- jsonPath: .status.profiles
name: Profiles
priority: 1
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ spec:
- jsonPath: .status.pvc
name: PVC
type: string
- jsonPath: .status.profiles
name: Profiles
priority: 1
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: string
Expand Down Expand Up @@ -266,7 +262,6 @@ spec:
type: object
type: array
required:
- resources
- source
- storage
type: object
Expand Down

0 comments on commit 6a22a05

Please sign in to comment.