diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml new file mode 100644 index 0000000000..5cc1adce2b --- /dev/null +++ b/.github/workflows/sync.yaml @@ -0,0 +1,25 @@ +name: Sync upstream +# This runs every day on 1000 UTC +on: + schedule: + - cron: '0 10 * * *' + # Allows manual workflow run + workflow_dispatch: + +# Don't seem to be able to restrict this down since +# it needs to be able to push workflows, but that +# permission is not available here. +permissions: write-all + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Sync with upstream + uses: DataDog/sync-upstream-release-tag@main + with: + github_actor: "${GITHUB_ACTOR}" + github_repository: "${GITHUB_REPOSITORY}" + github_token: ${{ secrets.WORKFLOW_TOKEN }} + date_suffix: "%Y%V" + upstream_repo: kubernetes/cloud-provider-aws \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..6679c906ee --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,23 @@ +include: https://gitlab-templates.ddbuild.io/compute-delivery/v2/compute-delivery.yml + +variables: + KPR_CHART_NAME: k8s-platform-k8s-cloud-controller-manager +test: + stage: verify + tags: [ "arch:amd64" ] + image: registry.ddbuild.io/images/mirror/golang:1.21.1 + script: + - make test + +docker-image: + variables: + IMAGE_NAME: aws-cloud-controller-manager + EXTRA_ARGS: "--build-arg=VERSION=${CI_COMMIT_TAG}" + extends: .build-docker-image + +# run-campaign: +# variables: +# CHART_NAME: k8s-platform-k8s-cloud-controller-manager +# COMPONENT: aws-cloud-controller-manager +# SLACK_CHANNEL: compute-ops +# extends: .run-campaign diff --git a/Dockerfile b/Dockerfile index 71b696677d..fb695357c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,20 +16,15 @@ # This build arg allows the specification of a custom Golang image. ARG GOLANG_IMAGE=golang:1.21.5 -# The distroless image on which the CPI manager image is built. -# -# Please do not use "latest". Explicit tags should be used to provide -# deterministic builds. Follow what kubernetes uses to build -# kube-controller-manager, for example for 1.23.x: -# https://github.com/kubernetes/kubernetes/blob/release-1.24/build/common.sh#L94 -ARG DISTROLESS_IMAGE=registry.k8s.io/build-image/go-runner:v2.3.1-go1.21.5-bookworm.0 +# Datadog's base docker image +ARG BASE_IMAGE ################################################################################ ## BUILD STAGE ## ################################################################################ # Build the manager as a statically compiled binary so it has no dependencies # libc, muscl, etc. -FROM --platform=linux/amd64 ${GOLANG_IMAGE} as builder +FROM ${GOLANG_IMAGE} as builder ARG GOPROXY=https://goproxy.io,direct ARG TARGETOS @@ -43,7 +38,7 @@ COPY pkg/ pkg/ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=${GOPROXY} \ go build \ -trimpath \ - -ldflags="-w -s -X k8s.io/component-base/version.gitVersion=${VERSION}" \ + -ldflags="-w -s -X k8s.io/component-base/version.gitVersion=$VERSION" \ -o=aws-cloud-controller-manager \ cmd/aws-cloud-controller-manager/main.go @@ -51,6 +46,6 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=$ ## MAIN STAGE ## ################################################################################ # Copy the manager into the distroless image. -FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} +FROM --platform=${TARGETPLATFORM} ${BASE_IMAGE} COPY --from=builder /build/aws-cloud-controller-manager /bin/aws-cloud-controller-manager ENTRYPOINT [ "/bin/aws-cloud-controller-manager" ]