Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Run task pod as AnyUser. (#755) #756

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 39 additions & 48 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,88 +12,79 @@ jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: make fmt

vet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: make vet

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: make cmd
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make podman-build

test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: make test

test-api:
needs:
- fmt
- vet
- build
- test-unit
runs-on: ubuntu-latest
env:
DISCONNECTED: 1
HUB_BASE_URL: http://localhost:8080
DB_PATH: /tmp/hub.db
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: |
make vet
DISCONNECTED=1 make run &
rm -f $DB_PATH
make run &
sleep 15 # probably a dirty solution
DISCONNECTED=1 HUB_BASE_URL=http://localhost:8080 make test-api
DISCONNECTED=1 HUB_BASE_URL=http://localhost:8080 make test-api # Intentionaly run 2x to catch data left in Hub DB.
make test-api

test-e2e:
build-image:
needs:
- fmt
- vet
- build
- test-unit
- test-api
runs-on: ubuntu-latest
env:
IMG: ttl.sh/konveyor-hub-${{ github.sha }}:2h
steps:
- uses: actions/checkout@v3
- name: start-minikube
uses: konveyor/tackle2-operator/.github/actions/start-minikube@main
- name: Build image in minikube
run: |
export SHELL=/bin/bash
eval $(minikube -p minikube docker-env)
make docker-build
- name: install-tackle
uses: konveyor/tackle2-operator/.github/actions/install-tackle@main
with:
tackle-hub-image: tackle2-hub:latest
tackle-image-pull-policy: IfNotPresent

- name: save image
run: |
IMG=quay.io/konveyor/tackle2-hub:latest make docker-build
docker save -o /tmp/tackle2-hub.tar quay.io/konveyor/tackle2-hub:latest

- name: Upload image as artifact
uses: actions/upload-artifact@v3
with:
name: tackle2-hub
path: /tmp/tackle2-hub.tar
retention-days: 1
- uses: actions/checkout@v4
- run: make docker-build
- run: docker push ${IMG}

test-integration:
needs: test-e2e
uses: konveyor/ci/.github/workflows/global-ci.yml@main
needs: build-image
uses: konveyor/ci/.github/workflows/global-ci-bundle.yml@main
with:
component_name: tackle2-hub
tackle_hub: ttl.sh/konveyor-hub-${{ github.sha }}:2h
api_hub_tests_ref: ${{ github.ref }}
25 changes: 9 additions & 16 deletions .github/workflows/march-image-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ concurrency:

jobs:
push-quay:
name: Build and Push Manifest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Checkout Push to Registry action
uses: konveyor/release-tools/build-push-quay@main
with:
architectures: "amd64, arm64"
containerfile: "./Dockerfile"
image_name: "tackle2-hub"
image_namespace: "konveyor"
image_registry: "quay.io"
quay_publish_robot: ${{ secrets.QUAY_PUBLISH_ROBOT }}
quay_publish_token: ${{ secrets.QUAY_PUBLISH_TOKEN }}
ref: ${{ github.ref }}
uses: konveyor/release-tools/.github/workflows/build-push-images.yaml@main
with:
registry: "quay.io/konveyor"
image_name: "tackle2-hub"
containerfile: "./Dockerfile"
architectures: '[ "amd64", "arm64" ]'
secrets:
registry_username: ${{ secrets.QUAY_PUBLISH_ROBOT }}
registry_password: ${{ secrets.QUAY_PUBLISH_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: make test

test-api:
Expand All @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.19'
go-version: '1.21'
- run: |
make vet
DISCONNECTED=1 make run &
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $(CONTROLLERGEN):

# Ensure goimports installed.
$(GOIMPORTS):
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/goimports@v0.24

# Build SAMPLE ADDON
addon: fmt vet
Expand Down Expand Up @@ -141,9 +141,12 @@ endif
test:
go test -count=1 -v $(shell go list ./... | grep -v "hub/test")

test-db:
go test -count=1 -timeout=6h -v ./database...

# Run Hub REST API tests.
test-api:
HUB_BASE_URL=$(HUB_BASE_URL) go test -count=1 -p=1 -v ./test/api/...
HUB_BASE_URL=$(HUB_BASE_URL) go test -count=1 -p=1 -v -failfast ./test/api/...

# Run Hub test suite.
test-all: test-unit test-api
Expand Down
Loading
Loading