Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
JorTurFer committed Jan 9, 2023
1 parent e2e8d92 commit 780b93c
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 23 deletions.
2 changes: 2 additions & 0 deletions config/interceptor/interceptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ spec:
selector:
matchLabels:
control-plane: interceptor
app: keda-http-add-on
template:
metadata:
labels:
control-plane: interceptor
app: keda-http-add-on
name: keda-http-add-on-interceptor
spec:
securityContext:
Expand Down
3 changes: 2 additions & 1 deletion config/interceptor/service-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ spec:
port: 9090
targetPort: inter-admin
selector:
control-plane: interceptor
control-plane: interceptor
app: keda-http-add-on
1 change: 1 addition & 0 deletions config/interceptor/service-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ spec:
targetPort: inter-proxy
selector:
control-plane: interceptor
app: keda-http-add-on
2 changes: 2 additions & 0 deletions config/operator/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ spec:
selector:
matchLabels:
control-plane: controller-manager
app: keda-http-add-on
template:
metadata:
labels:
control-plane: controller-manager
app: keda-http-add-on
name: keda-http-add-on-operator
spec:
serviceAccountName: keda-http-add-on
Expand Down
3 changes: 2 additions & 1 deletion config/operator/service-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ spec:
port: 9090
targetPort: admin-http
selector:
control-plane: controller-manager
control-plane: controller-manager
app: keda-http-add-on
1 change: 1 addition & 0 deletions config/operator/service-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ spec:
targetPort: https
selector:
control-plane: controller-manager
app: keda-http-add-on
2 changes: 2 additions & 0 deletions config/scaler/scaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ spec:
selector:
matchLabels:
control-plane: external-scaler
app: keda-http-add-on
template:
metadata:
labels:
control-plane: external-scaler
app: keda-http-add-on
name: keda-http-add-on-scaler
spec:
securityContext:
Expand Down
3 changes: 2 additions & 1 deletion config/scaler/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ spec:
port: 9091
targetPort: scaler-health
selector:
control-plane: external-scaler
control-plane: external-scaler
app: keda-http-add-on
11 changes: 6 additions & 5 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ The Makefile located in the root directory has targets useful for the whole proj

> All commands are case sensitive.
- `make build`: Builds all the binaries for local testing.
- `make test`: Tests the entire codebase
- `make build`: Builds all the binaries for local testing
- `make test`: Run all unit tests
- `make e2e-test`: Run all e2e tests
- `make docker-build`: Builds all docker images
- `make docker-publish`: Pushes all docker images, building them first
- `make publish-multiarch`: Pushes all docker images, building them first for `linux/arm64` and `linux/amd64`
- `make manifests`: Builds all the manifest files for Kubernetes, it's important to build after every change
- `make docker-publish`: Build and push all Docker images
- `make publish-multiarch`: Build and push all Docker images for `linux/arm64` and `linux/amd64`
- `make manifests`: Generate all the manifest files for Kubernetes, it's important to build after every change
- `make deploy`: Deploys the HTTP Add-on to the cluster selected in `~/.kube/config` using `config` folder manifests

### Required Environment Variables
Expand Down
6 changes: 1 addition & 5 deletions interceptor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"math/rand"
nethttp "net/http"
"os"
"runtime"
"time"

"github.com/go-logr/logr"
Expand Down Expand Up @@ -178,10 +177,7 @@ func main() {
lggr.Error(err, "proxy server failed")
return err
})
lggr.Info(fmt.Sprintf("Interceptor Version: %s", build.Version()))
lggr.Info(fmt.Sprintf("Interceptor Commit: %s", build.GitCommit()))
lggr.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
lggr.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
build.PrintComponentInfo(lggr, "Interceptor")

// errGrp.Wait() should hang forever for healthy admin and proxy servers.
// if it returns an error, log and exit immediately.
Expand Down
6 changes: 1 addition & 5 deletions operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"net/http"
"os"
goruntime "runtime"

"golang.org/x/sync/errgroup"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -164,10 +163,7 @@ func main() {
externalScalerCfg,
)
})
setupLog.Info(fmt.Sprintf("Operator Version: %s", build.Version()))
setupLog.Info(fmt.Sprintf("Operator Commit: %s", build.GitCommit()))
setupLog.Info(fmt.Sprintf("Go Version: %s", goruntime.Version()))
setupLog.Info(fmt.Sprintf("Go OS/Arch: %s/%s", goruntime.GOOS, goruntime.GOARCH))
build.PrintComponentInfo(setupLog, "Operator")
setupLog.Error(errGrp.Wait(), "running the operator")
}

Expand Down
14 changes: 14 additions & 0 deletions pkg/build/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package build

import (
"fmt"
"runtime"

"github.com/go-logr/logr"
)

var (
version = "main"
gitCommit string
Expand All @@ -14,3 +21,10 @@ func Version() string {
func GitCommit() string {
return gitCommit
}

func PrintComponentInfo(logger logr.Logger, component string) {
logger.Info(fmt.Sprintf("%s Version: %s", component, Version()))
logger.Info(fmt.Sprintf("%s Commit: %s", component, GitCommit()))
logger.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
logger.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
}
6 changes: 1 addition & 5 deletions scaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"net"
"net/http"
"os"
"runtime"
"time"

"github.com/go-logr/logr"
Expand Down Expand Up @@ -145,10 +144,7 @@ func main() {
table,
)
})
lggr.Info(fmt.Sprintf("Scaler Version: %s", build.Version()))
lggr.Info(fmt.Sprintf("Scaler Commit: %s", build.GitCommit()))
lggr.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
lggr.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
build.PrintComponentInfo(lggr, "Scaler")
lggr.Error(grp.Wait(), "one or more of the servers failed")
}

Expand Down

0 comments on commit 780b93c

Please sign in to comment.