Skip to content

Commit

Permalink
Merge pull request #115 from datawire/thallgren/fix-panic
Browse files Browse the repository at this point in the history
Fix panic when determining cluster domain.
  • Loading branch information
thallgren authored Dec 5, 2023
2 parents 23cd9db + be8ba87 commit fff99fe
Show file tree
Hide file tree
Showing 43 changed files with 1,574 additions and 1,337 deletions.
79 changes: 25 additions & 54 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ on:
pull_request_target:
types:
- labeled

env:
A8R_AGENT_REGISTRY: 'localhost:5000'
KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml

jobs:
build-image:
integration-test:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'ok to test' }}
steps:
Expand All @@ -22,69 +27,35 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: stable
- name: Build image
run: |
make image-tar
- name: Upload image
uses: actions/upload-artifact@v3
with:
name: image
path: build-output/ambassador-agent-image.tar
test:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- name: Get last run
uses: ./.github/actions/rerun-cache
id: get_last_run
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: stable
- name: Setup kubectl
uses: azure/setup-kubectl@v3
id: kubectl
if: steps.get_last_run.outputs.passed != 'success'
- name: Download image
uses: actions/download-artifact@v3
if: steps.get_last_run.outputs.passed != 'success'
with:
name: image
- name: Prepare kluster
uses: ./.github/actions/prepare-kluster
if: steps.get_last_run.outputs.passed != 'success'
- name: Provision Kubeception cluster
id: kluster
with:
token: ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }}
image-tar: ambassador-agent-image.tar
github-sha: ${{ github.event.pull_request.head.sha }}
uses: datawire/infra-actions/[email protected]
with:
distribution: Kubeception
version: 1.26
kubeconfig: ${{ env.KUBECONFIG }}
kubeceptionToken: ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }}
gkeCredentials: '{"project_id": "foo"}' # See https://github.com/datawire/infra-actions/issues/66
- name: Add a private image registry to the cluster
run: make private-registry
- name: Build image
id: build
run: |
make push-image
echo "version=$(cat build-output/version.txt)" >> $GITHUB_OUTPUT
- name: Run tests
if: steps.get_last_run.outputs.passed != 'success'
uses: nick-invision/retry@v2
env:
A8R_AGENT_VERSION: ${{ steps.build.outputs.version }}
AMBASSADOR_AGENT_DOCKER_IMAGE: localhost:5000/ambassador-agent:${{ steps.build.outputs.version }}
KAT_SERVER_DOCKER_IMAGE: docker.io/datawiredev/kat-server:3.0.1-0.20220817135951-2cb28ef4f415
with:
max_attempts: 3
timeout_minutes: 15
command: |
export DTEST_KUBECONFIG=${{ steps.kluster.outputs.kubeconfig }}
export KUBECONFIG=${{ steps.kluster.outputs.kubeconfig }}
export AMBASSADOR_AGENT_DOCKER_IMAGE=datawiredev/ambassador-agent:dev-latest
export KAT_SERVER_DOCKER_IMAGE=docker.io/datawiredev/kat-server:3.0.1-0.20220817135951-2cb28ef4f415
make go-integration-test
- name: Mark test as succesfull
run: echo "::set-output name=run_result::success" > run_result
- name: Cleanup kluster
uses: ./.github/actions/cleanup-kluster
if: always()
with:
token: ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }}
github-sha: ${{ github.event.pull_request.head.sha }}





5 changes: 1 addition & 4 deletions .github/workflows/licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: "License verification"
on:
pull_request:

env:
GO_VERSION: 1.19.5

jobs:
dependency_info_linux:
name: "Verify use of forbidden licenses"
Expand All @@ -19,7 +16,7 @@ jobs:
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v3
with:
go-version: "${{env.GO_VERSION}}"
go-version: stable
- name: "Generate dependency information"
shell: bash
run: make generate
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- "**"

env:
GO_VERSION: 1.19.5

jobs:

lint:
Expand All @@ -20,7 +17,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "${{env.GO_VERSION}}"
go-version: stable

- name: Lint
run: |
Expand All @@ -39,7 +36,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "${{env.GO_VERSION}}"
go-version: stable

- name: go unit tests
run: |
Expand Down
23 changes: 15 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ linters-settings:
max-complexity: 32
skip-tests: true
depguard:
list-type: blacklist
include-go-root: true
packages-with-error-message:
- io/ioutil: "`io/ioutil` is deprecated in Go 1.16, use `io` or `os` instead"
- syscall: "Use `golang.org/x/sys/...` instead of `syscall`"
- github.com/golang/protobuf: "Use `google.golang.org/protobuf` instead of `github.com/golang/protobuf`"
- github.com/datawire/dlib/dutil: "Use either `github.com/datawire/dlib/derror` or `github.com/datawire/dlib/dhttp` instead of `github.com/datawire/dlib/dutil`"
- golang.org/x/net/http2/h2c: "Use `github.com/datawire/dlib/dhttp` instead of `golang.org/x/net/http2/h2c`"
rules:
main:
files:
- $all
deny:
- pkg: io/ioutil
desc: "`io/ioutil` is deprecated in Go 1.16, use `io` or `os` instead"
- pkg: syscall
desc: "Use `golang.org/x/sys/...` instead of `syscall`"
- pkg: github.com/golang/protobuf
desc: "Use `google.golang.org/protobuf` instead of `github.com/golang/protobuf`"
- pkg: github.com/datawire/dlib/dutil
desc: "Use either `github.com/datawire/dlib/derror` or `github.com/datawire/dlib/dhttp` instead of `github.com/datawire/dlib/dutil`"
- pkg: golang.org/x/net/http2/h2c
desc: "Use `github.com/datawire/dlib/dhttp` instead of `golang.org/x/net/http2/h2c`"
gomodguard:
blocked:
modules:
Expand Down
Loading

0 comments on commit fff99fe

Please sign in to comment.