Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] migrate to Operator SDK v1.0.0 #1007

Merged
merged 4 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,10 @@ ASALocalRun/

# Keda artifacts
dist/
build/_output
bin
.DS_Store

apiserver.local.config/
config
*.cert
*.key

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- Removed deprecated brokerList for Kafka scaler ([#882](https://github.com/kedacore/keda/pull/882))

### Other
- Update Operator SDK and k8s deps ([#870](https://github.com/kedacore/keda/issues/870))
- Update Operator SDK and k8s deps ([#1007](https://github.com/kedacore/keda/pull/1007),[#870](https://github.com/kedacore/keda/issues/870))

## v1.5.0

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