diff --git a/.github/workflows/controller.yaml b/.github/workflows/controller.yaml index 040dd5f..4387fb2 100644 --- a/.github/workflows/controller.yaml +++ b/.github/workflows/controller.yaml @@ -12,7 +12,7 @@ jobs: build-and-push-image: runs-on: ubuntu-latest permissions: - contents: read + contents: write packages: write attestations: write id-token: write @@ -28,18 +28,50 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/pier-oliviert/phonebook - - name: Controller id: push uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: + file: ${{ github.workspace }}/Dockerfile.controller context: . target: controller push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: | + ${{ env.REGISTRY }}/${{github.repository}}:latest + ${{ env.REGISTRY }}/${{github.repository}}:${{github.event.release.tag_name}} + + - name: "Providers: AWS" + id: aws + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + file: ${{ github.workspace }}/Dockerfile.providers + context: . + target: aws + push: true + tags: | + ${{ env.REGISTRY }}/pier-oliviert/providers-aws:latest + ${{ env.REGISTRY }}/pier-oliviert/providers-aws:${{github.event.release.tag_name}} + + - name: "Providers: Azure" + id: azure + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + file: ${{ github.workspace }}/Dockerfile.providers + context: . + target: azure + push: true + tags: | + ${{ env.REGISTRY }}/pier-oliviert/providers-azure:latest + ${{ env.REGISTRY }}/pier-oliviert/providers-azure:${{github.event.release.tag_name}} + + - name: "Providers: Cloudflare" + id: cloudflare + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + file: ${{ github.workspace }}/Dockerfile.providers + context: . + target: cloudflare + push: true + tags: | + ${{ env.REGISTRY }}/pier-oliviert/providers-cloudflare:latest + ${{ env.REGISTRY }}/pier-oliviert/providers-cloudflare:${{github.event.release.tag_name}} diff --git a/Dockerfile.providers b/Dockerfile.providers index bdd5a2b..c396b01 100644 --- a/Dockerfile.providers +++ b/Dockerfile.providers @@ -16,6 +16,9 @@ RUN go mod download ## AWS FROM source AS aws-builder +COPY api/ api/ +COPY pkg/ pkg/ +COPY internal/ internal/ COPY cmd/providers/aws/main.go cmd/main.go RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o controller cmd/main.go diff --git a/go.mod b/go.mod index 580b51d..778a699 100644 --- a/go.mod +++ b/go.mod @@ -14,10 +14,10 @@ require ( github.com/onsi/gomega v1.33.1 github.com/pier-oliviert/konditionner v0.2.5 github.com/stretchr/testify v1.9.0 + k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 k8s.io/apiserver v0.31.1 k8s.io/client-go v0.31.1 - k8s.io/kubernetes v1.31.1 k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 sigs.k8s.io/controller-runtime v0.19.0 ) @@ -32,7 +32,6 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/stretchr/objx v0.5.2 // indirect golang.org/x/crypto v0.27.0 // indirect - k8s.io/api v0.31.1 // indirect ) require ( diff --git a/go.sum b/go.sum index 00ff092..fb3894c 100644 --- a/go.sum +++ b/go.sum @@ -351,8 +351,6 @@ k8s.io/kms v0.31.1 h1:cGLyV3cIwb0ovpP/jtyIe2mEuQ/MkbhmeBF2IYCA9Io= k8s.io/kms v0.31.1/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 h1:1dWzkmJrrprYvjGwh9kEUxmcUV/CtNU8QM7h1FLWQOo= k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38/go.mod h1:coRQXBK9NxO98XUv3ZD6AK3xzHCxV6+b7lrquKwaKzA= -k8s.io/kubernetes v1.31.1 h1:1fcYJe8SAhtannpChbmnzHLwAV9Je99PrGaFtBvCxms= -k8s.io/kubernetes v1.31.1/go.mod h1:/YGPL//Fb9mdv5vukvAQ7Xon+Bqwry52bmjTdORAw+Q= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= diff --git a/pkg/providers/provider.go b/pkg/providers/provider.go index c8128f8..11489e0 100644 --- a/pkg/providers/provider.go +++ b/pkg/providers/provider.go @@ -40,7 +40,7 @@ type Provider interface { } var ProviderImages = map[string]string{ - "aws": "ghcr.io/pier-oliviert/providers-aws:0.0.1", - "azure": "ghcr.io/pier-oliviert/providers-azure:0.0.1", - "cloudflare": "ghcr.io/pier-oliviert/providers-cloudflare:0.0.1", + "aws": "ghcr.io/pier-oliviert/providers-aws:0.3.4", + "azure": "ghcr.io/pier-oliviert/providers-azure:0.3.4", + "cloudflare": "ghcr.io/pier-oliviert/providers-cloudflare:0.3.4", }