Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
addreas committed Jul 5, 2022
1 parent ad4b486 commit 2ec5f1b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/integreatly/v1alpha1/grafana_types.go
Expand Up @@ -40,7 +40,7 @@ type GrafanaSpec struct {
ReadinessProbeSpec *ReadinessProbeSpec `json:"readinessProbeSpec,omitempty"`

// DashboardContentCacheDuration sets a default for when a `GrafanaDashboard` resource doesn't specify a `contentCacheDuration`.
// If left unset or 0 the default behaviour is to cache indefinitely.
// If left unset or 0 the default behavior is to cache indefinitely.
DashboardContentCacheDuration *metav1.Duration `json:"dashboardContentCacheDuration,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion api/integreatly/v1alpha1/grafanadashboard_types.go
Expand Up @@ -134,7 +134,7 @@ func (d *GrafanaDashboard) Hash() string {
}

if d.Status.Content != "" {
io.WriteString(hash, d.Status.Content)
io.WriteString(hash, d.Status.Content) //nolint
}

return fmt.Sprintf("%x", hash.Sum(nil))
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/integreatly.org_grafanas.yaml
Expand Up @@ -1842,7 +1842,7 @@ spec:
dashboardContentCacheDuration:
description: DashboardContentCacheDuration sets a default for when
a `GrafanaDashboard` resource doesn't specify a `contentCacheDuration`.
If left unset or 0 the default behaviour is to cache indefinitely.
If left unset or 0 the default behavior is to cache indefinitely.
type: string
dashboardLabelSelector:
items:
Expand Down
7 changes: 5 additions & 2 deletions controllers/grafanadashboard/dashboard_pipeline.go
Expand Up @@ -267,8 +267,11 @@ func (r *DashboardPipelineImpl) loadDashboardFromURL() error {
return nil
}

func (r *DashboardPipelineImpl) refreshDashboard() error {
return r.Client.Get(r.Context, types.NamespacedName{Name: r.Dashboard.Name, Namespace: r.Dashboard.Namespace}, r.Dashboard)
func (r *DashboardPipelineImpl) refreshDashboard() {
err := r.Client.Get(r.Context, types.NamespacedName{Name: r.Dashboard.Name, Namespace: r.Dashboard.Namespace}, r.Dashboard)
if err != nil {
r.Logger.V(1).Error(err, "refreshing dashboard generation failed")
}
}

func (r *DashboardPipelineImpl) loadDashboardFromGrafanaCom() error {
Expand Down
3 changes: 2 additions & 1 deletion controllers/grafanadashboard/grafanadashboard_controller.go
Expand Up @@ -264,7 +264,8 @@ func (r *GrafanaDashboardReconciler) reconcileDashboards(request reconcile.Reque
}

// Process new/updated dashboards
for _, dashboard := range namespaceDashboards.Items {
for i := range namespaceDashboards.Items {
dashboard := namespaceDashboards.Items[i]
// Is this a dashboard we care about (matches the label selectors)?
if !r.isMatch(&dashboard) {
log.Log.Info("dashboard found but selectors do not match",
Expand Down
2 changes: 1 addition & 1 deletion deploy/manifests/latest/crds.yaml
Expand Up @@ -2465,7 +2465,7 @@ spec:
dashboardContentCacheDuration:
description: DashboardContentCacheDuration sets a default for when
a `GrafanaDashboard` resource doesn't specify a `contentCacheDuration`.
If left unset or 0 the default behaviour is to cache indefinitely.
If left unset or 0 the default behavior is to cache indefinitely.
type: string
dashboardLabelSelector:
items:
Expand Down
2 changes: 1 addition & 1 deletion documentation/api.md
Expand Up @@ -1963,7 +1963,7 @@ Grafana is the Schema for the grafanas API
<td><b>dashboardContentCacheDuration</b></td>
<td>string</td>
<td>
DashboardContentCacheDuration sets a default for when a `GrafanaDashboard` resource doesn't specify a `contentCacheDuration`. If left unset or 0 the default behaviour is to cache indefinitely.<br/>
DashboardContentCacheDuration sets a default for when a `GrafanaDashboard` resource doesn't specify a `contentCacheDuration`. If left unset or 0 the default behavior is to cache indefinitely.<br/>
</td>
<td>false</td>
</tr><tr>
Expand Down

0 comments on commit 2ec5f1b

Please sign in to comment.