Skip to content

Commit

Permalink
Merge pull request #15 from K-Phoen/update-grabana
Browse files Browse the repository at this point in the history
Update grabana to v0.10.0
  • Loading branch information
K-Phoen authored Apr 15, 2020
2 parents 4e6e631 + 162d96f commit e74c99c
Show file tree
Hide file tree
Showing 51 changed files with 1,823 additions and 391 deletions.
2 changes: 1 addition & 1 deletion cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {

darkInformerFactory := informers.NewSharedInformerFactory(darkClient, time.Second*30)

grabanaClient := grabana.NewClient(&http.Client{}, cfg.GrafanaHost, cfg.GrafanaToken)
grabanaClient := grabana.NewClient(&http.Client{}, cfg.GrafanaHost, grabana.WithAPIToken(cfg.GrafanaToken))
dashboardCreator := dashboards.NewCreator(grabanaClient)

controller := internal.NewController(kubeClient, darkClient, darkInformerFactory.Controller().V1().GrafanaDashboards(), dashboardCreator)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/K-Phoen/dark
go 1.13

require (
github.com/K-Phoen/grabana v0.6.3
github.com/K-Phoen/grabana v0.10.0
github.com/caarlos0/env v3.5.0+incompatible
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/grafana-tools/sdk v0.0.0-20200127194913-bdcab199ffde
github.com/grafana-tools/sdk v0.0.0-20200326200416-f0431e44c1c3
github.com/leodido/go-urn v1.2.0 // indirect
github.com/stretchr/testify v1.4.0
go.uber.org/zap v1.14.1
Expand Down
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/K-Phoen/grabana v0.6.3 h1:Rk54mMPPuSo8Oe5N9pC8hHhgHT3nnhRw2Q47P08JwPE=
github.com/K-Phoen/grabana v0.6.3/go.mod h1:kOnSP/jusHkwX2YPnR3dkQZHMnKvaNEaSz6uTeXYlkc=
github.com/K-Phoen/grabana v0.10.0 h1:GQcpDAeHS1Tc4ZV2Ws+Dq4AqnIEaPaWRpuWkfsOYhO0=
github.com/K-Phoen/grabana v0.10.0/go.mod h1:dvei2nA99XDfr7odmewPk9+TMtB4VTdMbAxCFXejyKE=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
Expand Down Expand Up @@ -91,8 +91,10 @@ github.com/googleapis/gnostic v0.1.0 h1:rVsPeBmXbYv4If/cumu1AzZPwV58q433hvONV1UE
github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/gosimple/slug v1.1.1 h1:fRu/digW+NMwBIP+RmviTK97Ho/bEj/C9swrCspN3D4=
github.com/gosimple/slug v1.1.1/go.mod h1:ER78kgg1Mv0NQGlXiDe57DpCyfbNywXXZ9mIorhxAf0=
github.com/grafana-tools/sdk v0.0.0-20200127194913-bdcab199ffde h1:lNCyyTOAGdqim0hdYMJzAw8rIxhTefFXUDGZDimmAMQ=
github.com/grafana-tools/sdk v0.0.0-20200127194913-bdcab199ffde/go.mod h1:SUJysgVE/2fXHt5gqHP7/pJWuerDO8/bjTEXzccPSFQ=
github.com/gosimple/slug v1.9.0 h1:r5vDcYrFz9BmfIAMC829un9hq7hKM4cHUrsv36LbEqs=
github.com/gosimple/slug v1.9.0/go.mod h1:AMZ+sOVe65uByN3kgEyf9WEBKBCSS+dJjMX9x4vDJbg=
github.com/grafana-tools/sdk v0.0.0-20200326200416-f0431e44c1c3 h1:VTVvPDSLqUYbiAl3VxiVWELHhMzChi+mo32+aPhQ6AM=
github.com/grafana-tools/sdk v0.0.0-20200326200416-f0431e44c1c3/go.mod h1:aqBqJVTJmj0MTX9cP8wuReJPte6HyttMDzSS2u8nJwo=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
Expand Down Expand Up @@ -138,6 +140,8 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be h1:ta7tUOvsPHVHGom5hKW5VXNc2xZIkfCKP8iaqOyYtUQ=
Expand Down
17 changes: 1 addition & 16 deletions internal/pkg/converter/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ type JSON struct {
logger *zap.Logger
}

type sdkLegend struct {
AlignAsTable bool `json:"alignAsTable"`
Avg bool `json:"avg"`
Current bool `json:"current"`
HideEmpty bool `json:"hideEmpty"`
HideZero bool `json:"hideZero"`
Max bool `json:"max"`
Min bool `json:"min"`
RightSide bool `json:"rightSide"`
Show bool `json:"show"`
SideWidth *uint `json:"sideWidth,omitempty"`
Total bool `json:"total"`
Values bool `json:"values"`
}

func NewJSON(logger *zap.Logger) *JSON {
return &JSON{
logger: logger,
Expand Down Expand Up @@ -271,7 +256,7 @@ func (converter *JSON) convertGraph(panel sdk.Panel) grabana.DashboardPanel {
return grabana.DashboardPanel{Graph: graph}
}

func (converter *JSON) convertLegend(sdkLegend sdkLegend) []string {
func (converter *JSON) convertLegend(sdkLegend sdk.Legend) []string {
var legend []string

if !sdkLegend.Show {
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/converter/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func TestConvertLegend(t *testing.T) {

converter := NewJSON(zap.NewNop())

rawLegend := sdkLegend{
rawLegend := sdk.Legend{
AlignAsTable: true,
Avg: true,
Current: true,
Expand Down
14 changes: 7 additions & 7 deletions vendor/github.com/K-Phoen/grabana/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/github.com/K-Phoen/grabana/alert/alert.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 23 additions & 41 deletions vendor/github.com/K-Phoen/grabana/alert/condition.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e74c99c

Please sign in to comment.