Skip to content

Commit

Permalink
Sync CRDs between operator and helm chart
Browse files Browse the repository at this point in the history
CRDs are synced automatically and CI check is added.

Closes: Mellanox#134
Signed-off-by: Ivan Kolodiazhnyi <ikolodiazhny@nvidia.com>
  • Loading branch information
e0ne committed Mar 19, 2021
1 parent 0a521c0 commit 16a3258
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ before_script:
script:
- make lint
- make test-coverage
- bash scripts/check_changes.sh
# - goveralls -coverprofile=network-operator.cover -service=travis-ci
- make image

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ undeploy: manifests ## UnDeploy controller from the configured Kubernetes cluste
.PHONY: manifests
manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
cp config/crd/bases/* deployment/network-operator/crds/

generate: controller-gen ## Generate code
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down
25 changes: 25 additions & 0 deletions scripts/check-manifests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Copyright 2020 NVIDIA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script has been designed to run on CI only so it supposes that
# there is a clean git copy.

make manifests
HAS_CHANGES=$(git diff-index --name-only HEAD --)

if [[ $(git diff --stat) != '' ]]; then
echo "Please, update manifests running 'make manifests' command"
exit 1
fi

0 comments on commit 16a3258

Please sign in to comment.