Skip to content

Commit

Permalink
migrate to Operator SDK v1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
Zbynek Roubalik committed Aug 18, 2020
1 parent ab4deb8 commit f85de04
Show file tree
Hide file tree
Showing 93 changed files with 1,559 additions and 9,406 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
${{ runner.os }}-go-
- name: Verify Generated clientset is up to date
run: make verify-clientset
run: make clientset-verify

- name: Build
run: make build

- name: Test
run: make test

- name: Build
run: make build
28 changes: 8 additions & 20 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}

- name: Release Deployment YAML files
- name: Release Deployment YAML file
run: make release
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
Expand All @@ -50,26 +50,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Upload deployment YAML files as ZIP to GitHub release
- name: Upload Deployment YAML files (zip)
id: upload-deployment-yaml-zip
# Upload deployment YAML file to GitHub release
- name: Upload Deployment YAML file
id: upload-deployment-yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/kedacore/keda/releases/${{ steps.get-release-info.outputs.id }}/assets?name=keda-${{ steps.get_version.outputs.VERSION }}.zip
asset_path: keda-${{ steps.get_version.outputs.VERSION }}.zip
asset_name: keda-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip

# Upload deployment YAML files as TAR to GitHub release
- name: Upload Deployment YAML files (tar.gz)
id: upload-deployment-yaml-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/kedacore/keda/releases/${{ steps.get-release-info.outputs.id }}/assets?name=keda-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_path: keda-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_name: keda-${{ steps.get_version.outputs.VERSION }}.tar.gz
asset_content_type: application/tar+gzip
upload_url: https://uploads.github.com/repos/kedacore/keda/releases/${{ steps.get-release-info.outputs.id }}/assets?name=keda-${{ steps.get_version.outputs.VERSION }}.yaml
asset_path: keda-${{ steps.get_version.outputs.VERSION }}.yaml
asset_name: keda-${{ steps.get_version.outputs.VERSION }}.yaml
asset_content_type: application/x-yaml
6 changes: 0 additions & 6 deletions .github/workflows/v2-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,9 @@ jobs:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
run: echo $DOCKER_HUB_ACCESS_TOKEN | docker login -u $DOCKER_HUB_USERNAME --password-stdin

- name: Backup the original ScaledJob CRD
run: cp deploy/crds/keda.sh_scaledjobs_crd.yaml deploy/crds/keda.sh_scaledjobs_crd.yaml.orig

- name: Publish
run: make publish

- name: Use the original ScaledJob CRD
run: mv -f deploy/crds/keda.sh_scaledjobs_crd.yaml.orig deploy/crds/keda.sh_scaledjobs_crd.yaml

- name: Run end to end tests
env:
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ ASALocalRun/

# Keda artifacts
dist/
build/_output
bin
.DS_Store

apiserver.local.config/
Expand Down
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Build the manager binary
FROM golang:1.14 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

COPY Makefile Makefile
COPY .git/ .git/

# Copy the go source
COPY hack/ hack/
COPY version/ version/
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/

# Build
RUN make manager

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/bin/keda .
USER nonroot:nonroot

ENTRYPOINT ["/keda", "--zap-log-level=info", "--zap-encoder=console"]
37 changes: 37 additions & 0 deletions Dockerfile.adapter
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Build the manager binary
FROM golang:1.14 as builder

WORKDIR /workspace

RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config

# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

COPY Makefile Makefile
COPY .git/ .git/

# Copy the go source
COPY hack/ hack/
COPY version/ version/
COPY api/ api/
COPY adapter/ adapter/
COPY pkg/ pkg/

# Build
RUN make adapter

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder --chown=nonroot:nonroot /apiserver.local.config /apiserver.local.config
COPY --from=builder /workspace/bin/keda-adapter .
USER nonroot:nonroot


ENTRYPOINT ["/keda-adapter", "--secure-port=6443", "--logtostderr=true", "--v=0"]
Loading

0 comments on commit f85de04

Please sign in to comment.