forked from red-hat-data-services/noobaa-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from red-hat-storage/sync_ds--master
Syncing latest changes from master for noobaa-operator
- Loading branch information
Showing
278 changed files
with
35,138 additions
and
7,900 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 |
---|---|---|
@@ -1,23 +1,30 @@ | ||
name: golangci-lint | ||
|
||
on: [push, pull_request] | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.29 | ||
version: v1.55 | ||
|
||
# Optional: if set to true then the all caching functionality will be complete disabled, | ||
# takes precedence over all other caching options. | ||
# skip-cache: true | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
args: --disable-all -E varcheck,structcheck,typecheck,errcheck,gosimple,unused,deadcode,ineffassign,staticcheck --timeout=4m | ||
args: --disable-all --print-issued-lines -E typecheck,errcheck,gosimple,unused,ineffassign,staticcheck --timeout=4m | ||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true |
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,48 @@ | ||
name: Releaser | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
base_branch: | ||
description: 'The base branch to release from' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
releaser: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
steps: | ||
- name: Set branch | ||
run: echo "BRANCH=${{ github.event.inputs.base_branch }}" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.BRANCH }} | ||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GHACTION_TOKEN_WRITE }} | ||
DOCKERHUB_USERNAME: ${{ secrets.GHACTIONSDOCKERHUBNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.GHACTIONSDOCKERHUB }} | ||
QUAY_USERNAME: ${{ secrets.GHACTIONQUAYNAME }} | ||
QUAY_TOKEN: ${{ secrets.GHACTIONQUAYTOKEN }} | ||
HOMEBREW_CORE_REPO: "noobaa/homebrew-noobaa" | ||
OCI_ORG: ${{ secrets.GHACTIONSDOCKERHUBNAME }} | ||
OPERATOR_HUB_REPO: "k8s-operatorhub/community-operators" | ||
TAG: "1" | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "NooBaa GitHub Action" | ||
bash build/tools/builder.sh --oci-org $OCI_ORG --gh-org noobaa --gh-repo noobaa-operator || exit 1 | ||
bash build/tools/releaser.sh --oci-org $OCI_ORG --gh-org noobaa --gh-repo noobaa-operator || exit 1 | ||
# - name: "Krew Release" | ||
# uses: rajatjindal/[email protected] |
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,96 @@ | ||
name: Admission Webhook Tests | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
run-admission-test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout noobaa-operator | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "noobaa/noobaa-operator" | ||
path: "noobaa-operator" | ||
|
||
- name: Setup Go on runner | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo PATH=$PATH:$HOME/go/bin >> $GITHUB_ENV | ||
echo OPERATOR_IMAGE=noobaa/noobaa-operator:integration >> $GITHUB_ENV | ||
echo CHANGE_MINIKUBE_NONE_USER=true >> $GITHUB_ENV | ||
- name: Deploy dependencies | ||
run: | | ||
set -x | ||
cd ./noobaa-operator | ||
sudo bash .travis/install-minikube.sh | ||
go get -v github.com/onsi/ginkgo/v2 | ||
go install -v github.com/onsi/ginkgo/v2/ginkgo | ||
ginkgo version | ||
- name: Change settings for k8s and minikube | ||
run: | | ||
sudo mv /root/.kube /root/.minikube $HOME | ||
sudo chown -R $USER $HOME/.kube $HOME/.minikube | ||
sed "s/root/home\/$USER/g" $HOME/.kube/config > tmp; mv tmp $HOME/.kube/config | ||
- name: Build operator image | ||
run: | | ||
set -x | ||
cd ./noobaa-operator | ||
make cli | ||
make image | ||
sudo docker tag noobaa/noobaa-operator:$(go run cmd/version/main.go) $OPERATOR_IMAGE | ||
- name: Install noobaa system | ||
run: | | ||
cd ./noobaa-operator | ||
./build/_output/bin/noobaa-operator crd create -n test | ||
./build/_output/bin/noobaa-operator operator install --operator-image=$OPERATOR_IMAGE --admission --test-env -n test | ||
./build/_output/bin/noobaa-operator system create \ | ||
--db-resources='{ "limits": {"cpu": "80m","memory": "1G"}, "requests": {"cpu": "80m","memory": "1G"}}' \ | ||
--core-resources='{ "limits": {"cpu": "80m","memory": "1G"}, "requests": {"cpu": "80m","memory": "1G"}}' \ | ||
--endpoint-resources='{ "limits": {"cpu": "80m","memory": "1G"}, "requests": {"cpu": "80m","memory": "1G"}}' \ | ||
-n test | ||
./build/_output/bin/noobaa-operator status -n test | ||
- name: Wait for phase Ready in the backingstore pod | ||
run: | | ||
cd ./noobaa-operator | ||
./.travis/number_of_pods_in_system.sh --namespace test --pods 5 | ||
kubectl wait --for=condition=available backingstore/noobaa-default-backing-store --timeout=10m -n test | ||
- name: Run Admission test | ||
run: | | ||
set -x | ||
cd ./noobaa-operator | ||
make test-admission | ||
- name: Collect logs | ||
if: ${{ failure() }} | ||
run: | | ||
set -x | ||
cd ./noobaa-operator | ||
kubectl get events --sort-by='.metadata.creationTimestamp' -A > logs_kubectl_events.txt | ||
./build/_output/bin/noobaa-operator diagnostics collect --db-dump --dir=admission-tests-logs -n test | ||
mv logs_kubectl_events.txt ./admission-tests-logs | ||
- name: Save logs | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: admission-tests-logs | ||
path: noobaa-operator/admission-tests-logs | ||
|
||
# Uncomment this step in case where you want to connect to the VM of this workflow using SSH. | ||
# Pay attention that this workflow was configured with a timeout, and you might change it for this step. | ||
# - name: Setup tmate session | ||
# if: ${{ failure() }} | ||
# uses: mxschmitt/action-tmate@v3 |
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
Oops, something went wrong.