-
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.
Switch from krt library to controller-runtime library (#15)
* Switch from krt to controller-runtime * Add a SAN for vCluster's k8s API service This fixes the issue where ArgoCD cannot communicate to a vCluster through the host svc on the kubeconfig due to the certificate missing a SAN for the <clustername>.<namespace>.svc hostname * Add container image build GHA * Remove unused sample secret
- Loading branch information
Showing
12 changed files
with
352 additions
and
930 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Build and Push Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- 'go.sum' | ||
- 'Dockerfile' | ||
tags: | ||
- 'v**' | ||
|
||
jobs: | ||
buildx: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- 'linux/amd64' | ||
- 'linux/arm64' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: true | ||
|
||
- name: Docker meta | ||
id: image-metadata | ||
uses: docker/metadata-action@v5 | ||
env: | ||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index | ||
with: | ||
images: | | ||
docker.io/superorbital/capargo | ||
tags: | | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=sha,enable={{is_default_branch}} | ||
type=schedule,pattern={{date 'YYYYMMDD-hhmmss' tz='UTC'}},enable={{is_default_branch}} | ||
type=match,pattern=v(\d.\d.\d),group=1,prefix=v,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | ||
type=match,pattern=v(\d.\d).\d,group=1,prefix=v,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | ||
type=match,pattern=v(\d).\d.\d,group=1,prefix=v,enable=${{ startsWith(github.ref, 'refs/tags/v') }} | ||
labels: | | ||
org.opencontainers.image.licenses=LicenseRef-Proprietary | ||
org.opencontainers.image.authors=SuperOrbital, LLC | ||
org.opencontainers.image.description=A controller that automatically registers any Cluster API cluster in your local ArgoCD instance. | ||
org.opencontainers.image.documentation=https://github.com/superorbital/${{ github.event.repository.name }}/tree/${{ github.sha }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
org.opencontainers.image.source=https://github.com/superorbital/${{ github.event.repository.name }}/tree/${{ github.sha }} | ||
org.opencontainers.image.title=${{ matrix.directory }} | ||
org.opencontainers.image.url=https://github.com/superorbital/${{ github.event.repository.name }}/tree/${{ github.sha }} | ||
org.opencontainers.image.vendor=SuperOrbital, LLC | ||
annotations: | | ||
org.opencontainers.image.licenses=LicenseRef-Proprietary | ||
org.opencontainers.image.authors=SuperOrbital, LLC | ||
org.opencontainers.image.description=A controller that automatically registers any Cluster API cluster in your local ArgoCD instance. | ||
org.opencontainers.image.documentation=https://github.com/superorbital/${{ github.event.repository.name }}/tree/${{ github.sha }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
org.opencontainers.image.source=https://github.com/superorbital/${{ github.event.repository.name }}/tree/${{ github.sha }} | ||
org.opencontainers.image.title=${{ matrix.directory }} | ||
org.opencontainers.image.url=https://github.com/superorbital/${{ github.event.repository.name }}/tree/${{ github.sha }} | ||
org.opencontainers.image.vendor=SuperOrbital, LLC | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Available platforms | ||
run: echo ${{ steps.buildx.outputs.platforms }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
provenance: false | ||
sbom: false | ||
build-args: | | ||
BUILDTIME=${{ fromJSON(steps.image-metadata.outputs.json).labels['org.opencontainers.image.created'] }} | ||
VERSION=${{ fromJSON(steps.image-metadata.outputs.json).labels['org.opencontainers.image.version'] }} | ||
REVISION=${{ fromJSON(steps.image-metadata.outputs.json).labels['org.opencontainers.image.revision'] }} | ||
context: '.' | ||
file: Dockerfile | ||
platforms: ${{ matrix.platform }} | ||
push: true | ||
tags: ${{ steps.image-metadata.outputs.tags }} | ||
labels: ${{ steps.image-metadata.outputs.labels }} | ||
annotations: ${{ steps.image-metadata.outputs.annotations }} |
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
Oops, something went wrong.