Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kerenlahav committed Jul 3, 2023
1 parent fe104e0 commit cd35024
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/v1/servicebinding_validating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package v1

import (
"reflect"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
"time"

"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

"fmt"

"github.com/SAP/sap-btp-service-operator/api"
Expand Down
2 changes: 1 addition & 1 deletion controllers/serviceinstance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ func getTags(tags []byte) ([]string, error) {

func getSpecHash(serviceInstance *servicesv1.ServiceInstance) string {
spec := serviceInstance.Spec
spec.Shared = pointer.BoolPtr(false)
spec.Shared = pointer.Bool(false)
specBytes, _ := json.Marshal(spec)
s := string(specBytes)
return generateEncodedMD5Hash(s)
Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"flag"
"k8s.io/client-go/rest"
"os"

"fmt"
Expand Down Expand Up @@ -82,7 +83,10 @@ func main() {
allowedNamespaces := config.Get().AllowedNamespaces
allowedNamespaces = append(allowedNamespaces, config.Get().ReleaseNamespace)
setupLog.Info(fmt.Sprintf("Allowed namespaces are %v", allowedNamespaces))
mgrOptions.NewCache = cache.MultiNamespacedCacheBuilder(allowedNamespaces)
mgrOptions.NewCache = func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
opts.Namespaces = allowedNamespaces
return cache.New(config, opts)
}
}
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), mgrOptions)
if err != nil {
Expand Down

0 comments on commit cd35024

Please sign in to comment.