Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): update grafana dashboard base url if empty #417

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/go-logr/zapr v1.2.4
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.6.0
github.com/kubeslice/apis v0.3.1
github.com/kubeslice/apis v0.3.3-0.20250211074525-2e8c016c39e3
github.com/kubeslice/gateway-sidecar v0.2.0
github.com/kubeslice/kubeslice-monitoring v0.2.1
github.com/kubeslice/netops v0.1.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubeslice/apis v0.3.1 h1:5t8vTpyiu+2w8vLq4ATpEfhPJX4gG6mMZF+PcJQw8gM=
github.com/kubeslice/apis v0.3.1/go.mod h1:YDSfpIsQM+FtQPaZVGNCTZnlp3viWuQhkjJjIHQdaYs=
github.com/kubeslice/apis v0.3.3-0.20250211074525-2e8c016c39e3 h1:ysmjS2BwUmDWw87mzLEbabCKfNl7lsV22IQU3WXYAgM=
github.com/kubeslice/apis v0.3.3-0.20250211074525-2e8c016c39e3/go.mod h1:YDSfpIsQM+FtQPaZVGNCTZnlp3viWuQhkjJjIHQdaYs=
github.com/kubeslice/gateway-sidecar v0.2.0 h1:Ja3fIUivuSjUFQ4lPCt79ATq99BxslvAFYUwV9Urpy4=
github.com/kubeslice/gateway-sidecar v0.2.0/go.mod h1:nM1+Wjud2vk44cUg+9iwBbWTpqI+2Ecbn9NuaHEs9aY=
github.com/kubeslice/kubeslice-monitoring v0.2.1 h1:wtmIEigpQoKzuckof7QRqdsaa4lV/rqxd/FcmOj5N5Q=
Expand Down
13 changes: 13 additions & 0 deletions pkg/hub/controllers/cluster/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const (
MAX_CLUSTER_DEREGISTRATION_ATTEMPTS = 3
)

var GrafanaDashboardUrl = os.Getenv("GRAFANA_DASHBOARD_URL")

type Reconciler struct {
client.Client
MeshClient client.Client
Expand Down Expand Up @@ -104,6 +106,17 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
}

cl := cluster.NewCluster(r.MeshClient, cr.Name)

if cr.Spec.ClusterProperty.Monitoring.GrafanaDashboardBaseURL == "" {
if GrafanaDashboardUrl != "" {
cr.Spec.ClusterProperty.Monitoring.GrafanaDashboardBaseURL = GrafanaDashboardUrl
err := r.Update(ctx, cr)
if err != nil {
return ctrl.Result{}, err
}
}
}

res, err, requeue := r.updateClusterCloudProviderInfo(ctx, cr, cl)
if err != nil {
utils.RecordEvent(ctx, r.EventRecorder, cr, nil, ossEvents.EventClusterProviderUpdateInfoFailed, controllerName)
Expand Down

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

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

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

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ github.com/josharian/intern
# github.com/json-iterator/go v1.1.12
## explicit; go 1.12
github.com/json-iterator/go
# github.com/kubeslice/apis v0.3.1
# github.com/kubeslice/apis v0.3.3-0.20250211074525-2e8c016c39e3
## explicit; go 1.16
github.com/kubeslice/apis/pkg/controller/v1alpha1
github.com/kubeslice/apis/pkg/worker/v1alpha1
Expand Down
Loading