-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade grafana-operator to 4.1.0
This commit upgrades the Grafana Operator to 4.1.0 and configures the operator to scan dashboards from all namespace. This change was introduced in 4.0.2 [1]. grafana/grafana-operator#579
- Loading branch information
1 parent
c13d605
commit 3a741ee
Showing
3 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package grafana_operator | ||
|
||
import ( | ||
"github.com/operator-framework/api/pkg/operators/v1alpha1" | ||
"sigs.k8s.io/controller-runtime/pkg/event" | ||
"sigs.k8s.io/controller-runtime/pkg/predicate" | ||
) | ||
|
||
// installPlanFilter filter events on v1alpha1.InstallPlan resources | ||
type installPlanFilter struct { | ||
predicate.Funcs | ||
} | ||
|
||
// Update returns true only when the v1alpha1.Status.BundleLookup field | ||
// is set by OLM. | ||
func (f installPlanFilter) Update(e event.UpdateEvent) bool { | ||
previous, ok := e.ObjectOld.(*v1alpha1.InstallPlan) | ||
if !ok { | ||
return false | ||
} | ||
current, ok := e.ObjectNew.(*v1alpha1.InstallPlan) | ||
if !ok { | ||
return false | ||
} | ||
|
||
return len(previous.Status.BundleLookups) == 0 && len(current.Status.BundleLookups) != 0 | ||
} |