Skip to content

Commit

Permalink
Merge pull request #218 from joelsmith/kedamain
Browse files Browse the repository at this point in the history
Switch from keda build-tools image to keda-tools image
  • Loading branch information
joelsmith authored Feb 20, 2024
2 parents bfdc85b + a07537c commit 903e520
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 64 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
packages: write
id-token: write # needed for signing the images with GitHub OIDC Token **not production ready**

container: ghcr.io/kedacore/build-tools:1.20.5
container: ghcr.io/kedacore/keda-tools:1.21.6
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Go modules cache
uses: actions/cache@v3
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Go modules cache
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Check out code
uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Check out code
uses: actions/checkout@v3
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/setup-python@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- name: Get golangci
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.2
- uses: pre-commit/[email protected]
3 changes: 1 addition & 2 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ jobs:
build:
name: Push Release
runs-on: ubuntu-latest
# build-tools is built from ../../tools/build-tools.Dockerfile
permissions:
contents: write
packages: write
id-token: write # needed for signing the images with GitHub OIDC Token **not production ready**

container: ghcr.io/kedacore/build-tools:1.20.5
container: ghcr.io/kedacore/keda-tools:1.21.6
steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ issues:
- linters:
- stylecheck
text: "ST1000:"
# Exclude some linters from running on test files.
- path: _test\.go$
text: "dot-imports: should not use dot imports"

linters-settings:
funlen:
Expand All @@ -96,3 +99,10 @@ linters-settings:
- standard
- default
- prefix(github.com/kedacore/keda)
# copied from https://github.com/kedacore/keda/blob/1ab35e75a63b3b33ca59552dda93220fd916a05d/.golangci.yml#L163-L168
depguard: #https://github.com/kedacore/keda/issues/4980
rules:
main:
deny:
- pkg: sync/atomic
desc: "use type-safe atomics from go.uber.org/atomic"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM ghcr.io/kedacore/build-tools:1.20.5 as builder
FROM ghcr.io/kedacore/keda-tools:1.21.6 as builder

ARG BUILD_VERSION=main
ARG GIT_COMMIT=HEAD
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ spec:
# policy:
# rules:
# - level: Metadata
# omitStages: "RequestReceived"
# omitStages:
# - RequestReceived
# omitManagedFields: false
# lifetime:
# maxAge: "2"
Expand Down
4 changes: 2 additions & 2 deletions controllers/keda/configmap_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ func (r *ConfigMapReconciler) SetupWithManager(mgr ctrl.Manager, installNamespac
}
return false
},
DeleteFunc: func(e event.DeleteEvent) bool {
DeleteFunc: func(event.DeleteEvent) bool {
return false
},
GenericFunc: func(e event.GenericEvent) bool {
GenericFunc: func(event.GenericEvent) bool {
return false
},
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/keda/secret_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ func (r *SecretReconciler) SetupWithManager(mgr ctrl.Manager, secretNamespace st
}
return false
},
DeleteFunc: func(e event.DeleteEvent) bool {
DeleteFunc: func(event.DeleteEvent) bool {
return false
},
GenericFunc: func(e event.GenericEvent) bool {
GenericFunc: func(event.GenericEvent) bool {
return false
},
}
Expand Down
18 changes: 9 additions & 9 deletions controllers/keda/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ func ReplaceKedaOperatorLogLevel(logLevel string, scheme *runtime.Scheme, logger

if !found {
logger.Info("Ignoring speficied Log level for KEDA Operator, it needs to be set to ", strings.Join(logLevels, ", "), "or an integer value greater than 0")
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand All @@ -707,7 +707,7 @@ func ReplaceKedaOperatorLogEncoder(logEncoder string, scheme *runtime.Scheme, lo

if !found {
logger.Info("Ignoring speficied Log encoder for KEDA Operator", "specified", logEncoder, "allowed values", strings.Join(logEncoders, ", "))
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand All @@ -724,7 +724,7 @@ func ReplaceMetricsServerLogLevel(logLevel string, scheme *runtime.Scheme, logge

if !found {
logger.Info("Ignoring speficied Log level for KEDA Metrics Server, it needs to be set to an integer value greater than 0")
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand All @@ -744,7 +744,7 @@ func ReplaceKedaOperatorLogTimeEncoding(logTimeEncoding string, scheme *runtime.

if !found {
logger.Info("Ignoring speficied Log time encoding for KEDA Operator", "specified", logTimeEncoding, "allowed values", strings.Join(logTimeEncodings, ", "))
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand All @@ -768,7 +768,7 @@ func ReplaceAdmissionWebhooksLogLevel(logLevel string, scheme *runtime.Scheme, l

if !found {
logger.Info("Ignoring speficied Log level for KEDA Admission Webhooks, it needs to be set to ", strings.Join(logLevels, ", "), "or an integer value greater than 0")
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand All @@ -788,7 +788,7 @@ func ReplaceAdmissionWebhooksLogEncoder(logEncoder string, scheme *runtime.Schem

if !found {
logger.Info("Ignoring speficied Log encoder for KEDA Admission Webhooks", "specified", logEncoder, "allowed values", strings.Join(logEncoders, ", "))
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand All @@ -808,7 +808,7 @@ func ReplaceAdmissionWebhooksLogTimeEncoding(logTimeEncoding string, scheme *run

if !found {
logger.Info("Ignoring speficied Log time encoding for KEDA Admission Webhooks", "specified", logTimeEncoding, "allowed values", strings.Join(logTimeEncodings, ", "))
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand Down Expand Up @@ -847,7 +847,7 @@ func ReplaceArbitraryArg(argument string, resource string, scheme *runtime.Schem
case "admissionwebhooks":
return replaceContainerArg(argTrue, prefix, containerNameAdmissionWebhooks, scheme, logger)
default:
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand Down Expand Up @@ -877,7 +877,7 @@ func ReplaceAuditConfig(argument string, selector string, scheme *runtime.Scheme
case "maxsize":
prefix = "--audit-log-maxsize="
default:
return func(u *unstructured.Unstructured) error {
return func(*unstructured.Unstructured) error {
return nil
}
}
Expand Down
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/kedacore/keda-olm-operator

go 1.20
go 1.21

toolchain go1.21.3

require (
github.com/go-logr/logr v1.4.1
Expand All @@ -9,14 +11,14 @@ require (
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.31.1
github.com/open-policy-agent/cert-controller v0.10.1
github.com/openshift/api v0.0.0-20240212125214-04ea3891d9cb
github.com/openshift/api v0.0.0-20240213032657-54b3334bfac5
k8s.io/api v0.29.1
k8s.io/apimachinery v0.29.1
k8s.io/apiserver v0.29.1
k8s.io/client-go v0.29.1
k8s.io/kube-aggregator v0.29.1
sigs.k8s.io/controller-runtime v0.17.1
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240210214532-bbe3bbe2fb38
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240213082838-4282ca1767dc
sigs.k8s.io/controller-tools v0.14.0
sigs.k8s.io/kustomize/kustomize/v5 v5.3.0
sigs.k8s.io/yaml v1.4.0
Expand Down Expand Up @@ -70,15 +72,15 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/tools v0.18.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.32.0 // indirect
Expand Down
Loading

0 comments on commit 903e520

Please sign in to comment.