Skip to content

Commit

Permalink
certgenerator fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
charandas committed Jul 7, 2023
1 parent 7b3642e commit 3bd8181
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ replace go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => go.open

replace go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0

// replace github.com/grafana/grafana-apiserver => /Users/charandas/go/src/github.com/grafana/grafana-apiserver
replace github.com/grafana/grafana-apiserver => /Users/charandas/go/src/github.com/grafana/grafana-apiserver

// Override Prometheus version because Prometheus v2.X is tagged as v0.X for Go modules purposes and Go assumes
// that v1.Y is higher than v0.X, so when we resolve dependencies if any dependency imports v1.Y we'd
Expand Down
4 changes: 2 additions & 2 deletions pkg/modules/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package registry

import (
"github.com/grafana/dskit/services"
"github.com/grafana/grafana-apiserver/pkg/certgenerator"

"github.com/grafana/grafana/pkg/api"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/modules"
"github.com/grafana/grafana/pkg/registry/coregrd"
"github.com/grafana/grafana/pkg/services/certgenerator"
"github.com/grafana/grafana/pkg/services/k8s/apiserver"
"github.com/grafana/grafana/pkg/services/k8s/client"
"github.com/grafana/grafana/pkg/services/provisioning"
Expand All @@ -23,7 +23,7 @@ func ProvideRegistry(
moduleManager modules.Manager,
apiServer apiserver.Service,
clientset client.Service,
certGenerator certgenerator.Service,
certGenerator certgenerator.ServiceInterface,
httpServer *api.HTTPServer,
provisioning *provisioning.ProvisioningServiceImpl,
coreGRDRegistry *coregrd.Registry,
Expand Down
17 changes: 0 additions & 17 deletions pkg/services/certgenerator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,12 @@ package certgenerator
import (
"path/filepath"

"github.com/grafana/dskit/services"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/modules"
"github.com/grafana/grafana/pkg/setting"

"github.com/grafana/grafana-apiserver/pkg/certgenerator"
)

const (
DefaultAPIServerIp = "127.0.0.1"
)

var (
_ services.NamedService = (*certgenerator.Service)(nil)
)

type service struct {
*services.BasicService
cfg *setting.Cfg
certUtil *certgenerator.CertUtil
Log log.Logger
}

func ProvideService(cfg *setting.Cfg) (*certgenerator.Service, error) {
return certgenerator.CreateService(modules.CertGenerator, filepath.Join(cfg.DataPath, "k8s"))
}
3 changes: 1 addition & 2 deletions pkg/services/certgenerator/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package certgenerator

import (
"github.com/google/wire"
"github.com/grafana/dskit/services"
"github.com/grafana/grafana-apiserver/pkg/certgenerator"
)

var WireSet = wire.NewSet(
ProvideService,
wire.Bind(new(services.NamedService), new(*certgenerator.Service)),
wire.Bind(new(certgenerator.ServiceInterface), new(*certgenerator.Service)),
)

0 comments on commit 3bd8181

Please sign in to comment.