Skip to content

Commit

Permalink
chore: cleanup unused scripts, update make manifests (#569)
Browse files Browse the repository at this point in the history
* chore: cleanup unused scripts, update make manifets

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: generate operator from helm template

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* ci: add manifests and codegen validation in pull request

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: add comments on the generate-manifests script

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: generate zfs-operator by disabling helm labels

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

---------

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
  • Loading branch information
Abhinandan-Purkait authored Jul 31, 2024
1 parent 2f93897 commit 3854ec2
Show file tree
Hide file tree
Showing 28 changed files with 2,161 additions and 3,616 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
needs: ["lint"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19.9
cache: false

- name: Unit test
run: make test

Expand Down Expand Up @@ -111,7 +118,7 @@ jobs:

csi-driver:
runs-on: ubuntu-latest
needs: ["lint", "bdd-tests"]
needs: ["bdd-tests"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
41 changes: 40 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- uses: rrbutani/use-nix-shell-action@v1.1.0
with:
file: shell.nix

- name: Check if the chart follows a valid semver version
run: |
branch_name="${{ github.event.pull_request.base.ref }}"
Expand All @@ -42,12 +43,50 @@ jobs:
run: |
ct lint --config ct.yaml
validate_codegen:
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}/go
GOBIN: ${{ github.workspace }}/go/bin
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/openebs/zfs-localpv

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19.9
cache: false

- name: Helm tool installer
uses: Azure/setup-helm@v4.2.0

- name: Verify kubegen
run: |
make verify-kubegen
- name: Verify manifests
run: |
make verify-manifests
unit-tests:
runs-on: ubuntu-latest
needs: ["lint", "validate_codegen"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19.9
cache: false

- name: Unit test
run: make test

Expand Down Expand Up @@ -118,7 +157,7 @@ jobs:

csi-driver:
runs-on: ubuntu-latest
needs: ["lint", "bdd-tests"]
needs: ["bdd-tests"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
needs: ["lint"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19.9
cache: false

- name: Unit test
run: make test

Expand Down Expand Up @@ -104,7 +111,7 @@ jobs:

csi-driver:
runs-on: ubuntu-latest
needs: ["lint", "bdd-tests"]
needs: ["bdd-tests"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bootstrap: controller-gen

.PHONY: controller-gen
controller-gen:
TMP_DIR=$(shell mktemp -d) && cd $$TMP_DIR && go mod init tmp && go install -mod=mod sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0 && rm -rf $$TMP_DIR;
@go install -mod=mod sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0

# SRC_PKG is the path of code files
SRC_PKG := github.com/openebs/zfs-localpv/pkg
Expand All @@ -144,7 +144,7 @@ kubegendelete:

.PHONY: deepcopy-install
deepcopy-install:
@go install -mod=mod k8s.io/code-generator/cmd/deepcopy-gen
@go install -mod=mod k8s.io/code-generator/cmd/deepcopy-gen@v0.27.2

.PHONY: deepcopy
deepcopy:
Expand All @@ -156,7 +156,7 @@ deepcopy:

.PHONY: clientset-install
clientset-install:
@go install -mod=mod k8s.io/code-generator/cmd/client-gen
@go install -mod=mod k8s.io/code-generator/cmd/client-gen@v0.27.2

.PHONY: clientset
clientset:
Expand All @@ -170,7 +170,7 @@ clientset:

.PHONY: lister-install
lister-install:
@go install -mod=mod k8s.io/code-generator/cmd/lister-gen
@go install -mod=mod k8s.io/code-generator/cmd/lister-gen@v0.27.2

.PHONY: lister
lister:
Expand All @@ -182,7 +182,7 @@ lister:

.PHONY: informer-install
informer-install:
@go install -mod=mod k8s.io/code-generator/cmd/informer-gen
@go install -mod=mod k8s.io/code-generator/cmd/informer-gen@v0.27.2

.PHONY: informer
informer:
Expand Down Expand Up @@ -236,4 +236,14 @@ golint:
@echo "--------------------------------"
@echo ""

.PHONY: verify-manifests
verify-manifests: bootstrap manifests
@./buildscripts/check-diff.sh
@echo "Completed verify-manifests no changes detected !!"

.PHONY: verify-kubegen
verify-kubegen: bootstrap kubegen
@./buildscripts/check-diff.sh
@echo "Completed verify-codegen no changes detected !!"

include Makefile.buildx.mk
15 changes: 0 additions & 15 deletions Makefile.buildx.mk
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@

# Copyright 2018-2020 The OpenEBS Authors. All rights reserved.
#
# 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.

# Build zfs-driver docker images with buildx
# Experimental docker feature to build cross platform multi-architecture docker images
# https://docs.docker.com/buildx/working-with-buildx/
Expand Down
14 changes: 0 additions & 14 deletions buildscripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
#!/usr/bin/env bash

# Copyright © 2020 The OpenEBS Authors
# 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 builds the application from source for multiple platforms.
set -e

# Get the parent directory of where this script is.
Expand Down
5 changes: 5 additions & 0 deletions buildscripts/check-diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -e

git --no-pager diff --exit-code pkg/generated pkg/apis deploy/yamls
Loading

0 comments on commit 3854ec2

Please sign in to comment.