You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Info("Could not create ServiceMonitor object", "error", err.Error())
773
+
// If this operator is deployed to a cluster without the prometheus-operator running, it will return
774
+
// ErrServiceMonitorNotPresent, which can be used to safely skip ServiceMonitor creation.
775
+
if err == metrics.ErrServiceMonitorNotPresent {
776
+
log.Info("Install prometheus-operator in your cluster to create ServiceMonitor objects", "error", err.Error())
777
+
}
778
+
}
779
+
}
780
+
781
+
// serveCRMetrics gets the Operator/CustomResource GVKs and generates metrics based on those types.
782
+
...
783
+
```
784
+
785
+
**NOTE**: For more information check the PR which is responsible for the above changes [#2190](https://github.com/operator-framework/operator-sdk/pull/2190).
786
+
682
787
**Deprecations**
683
788
684
789
The `github.com/operator-framework/operator-sdk/pkg/restmapper` package was deprecated in favor of the `DynamicRESTMapper` implementation in [controller-runtime](https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/client/apiutil#NewDiscoveryRESTMapper). Users should migrate to controller-runtime's implementation, which is a drop-in replacement.
**NOTE**: For more information check the PRs which are responsible for the above changes [#2606](https://github.com/operator-framework/operator-sdk/pull/2606),[#2603](https://github.com/operator-framework/operator-sdk/pull/2603) and [#2601](https://github.com/operator-framework/operator-sdk/pull/2601).
987
1092
1093
+
**(Optional) Support for watching multiple namespaces**
1094
+
1095
+
There are changes to add support for watching multiple namespaces. These changes require `cmd/manager/main.go` to be updated as follows.
1096
+
1097
+
Update imports:
1098
+
1099
+
```go
1100
+
import (
1101
+
...
1102
+
"strings"
1103
+
1104
+
...
1105
+
"sigs.k8s.io/controller-runtime/pkg/cache"
1106
+
...
1107
+
)
1108
+
```
1109
+
1110
+
Replace:
1111
+
1112
+
```go
1113
+
funcmain() {
1114
+
...
1115
+
// Create a new Cmd to provide shared dependencies and start components
// Create a new manager to provide shared dependencies and start components
1147
+
mgr, err:= manager.New(cfg, options)
1148
+
if err != nil {
1149
+
log.Error(err, "")
1150
+
os.Exit(1)
1151
+
}
1152
+
```
1153
+
1154
+
**NOTE**: For more information check the PR which is responsible for the above changes [#2522](https://github.com/operator-framework/operator-sdk/pull/2522).
0 commit comments