-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add a verify target to check go formatting and generated files
Signed-off-by: Suleyman Akbas <[email protected]>
- Loading branch information
1 parent
1e9be13
commit c7c6ac8
Showing
7 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: operator | ||
namespace: system | ||
annotations: | ||
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}' | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
env: | ||
- name: TOPOLVM_CSI_IMAGE | ||
value: quay.io/lvms_dev/topolvm:latest | ||
- name: CSI_LIVENESSPROBE_IMAGE | ||
value: k8s.gcr.io/sig-storage/livenessprobe:v2.8.0 | ||
- name: CSI_PROVISIONER_IMAGE | ||
value: k8s.gcr.io/sig-storage/csi-provisioner:v3.3.0 | ||
- name: CSI_REGISTRAR_IMAGE | ||
value: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.6.2 | ||
- name: CSI_RESIZER_IMAGE | ||
value: k8s.gcr.io/sig-storage/csi-resizer:v1.6.0 | ||
- name: CSI_SNAPSHOTTER_IMAGE | ||
value: k8s.gcr.io/sig-storage/csi-snapshotter:v6.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
function print_failure { | ||
echo "There are unexpected changes to the tree when running 'make bundle'. Please" | ||
echo "run these commands locally and double-check the Git repository for unexpected changes which may" | ||
echo "need to be committed." | ||
exit 1 | ||
} | ||
|
||
if [ "${OPENSHIFT_CI:-false}" = true ]; then | ||
echo "> generating the OLM bundle" | ||
make bundle | ||
|
||
test -z "$(git status --porcelain | \grep -v '^??')" || print_failure | ||
echo "> verified generated bundle and deep copy" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
function print_failure { | ||
echo "There are unexpected changes to the vendor tree following 'go mod vendor' and 'go mod tidy'. Please" | ||
echo "run these commands locally and double-check the Git repository for unexpected changes which may" | ||
echo "need to be committed." | ||
exit 1 | ||
} | ||
|
||
if [ "${OPENSHIFT_CI:-false}" = true ]; then | ||
go mod vendor | ||
go mod tidy | ||
|
||
test -z "$(git status --porcelain)" || print_failure | ||
echo "verified Go modules" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
function print_failure { | ||
echo "There are unexpected changes to the tree when running 'make generate' and 'make manifests'. Please" | ||
echo "run these commands locally and double-check the Git repository for unexpected changes which may" | ||
echo "need to be committed." | ||
exit 1 | ||
} | ||
|
||
if [ "${OPENSHIFT_CI:-false}" = true ]; then | ||
make generate | ||
make manifests | ||
|
||
test -z "$(git status --porcelain | \grep -v '^??')" || print_failure | ||
echo "verified generated manifests and deep copy" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
go_files=$( find . -name '*.go' -not -path './vendor/*' -print ) | ||
bad_files=$(gofmt -s -l ${go_files}) | ||
if [[ -n "${bad_files}" ]]; then | ||
(>&2 echo "!!! gofmt needs to be run on the listed files") | ||
echo "${bad_files}" | ||
(>&2 echo "Try running 'gofmt -s -d [path]' or autocorrect with 'hack/verify-gofmt.sh | xargs -n 1 gofmt -s -w'") | ||
exit 1 | ||
fi |