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
To add a resource to an operator, you must add it to a scheme. By creating an `AddToScheme` method or reusing one you can easily add a resource to your scheme. An [example][deployments_register] shows that you define a function and then use the [runtime][runtime_package] package to create a `SchemeBuilder`
272
+
273
+
#### Current Operator-SDK
274
+
You then need to tell the operators to use these functions to add the resources to its scheme. In operator-sdk you use [AddToSDKScheme][osdk_add_to_scheme] to add this.
When using controller runtime, you will also need to tell its scheme about your resourece. In controller runtime to add to the scheme, you can get the managers [scheme][manager_scheme]. If you would like to see what kubebuilder generates to add the resoureces to the [scheme][simple_resource].
290
+
Example:
291
+
```go
292
+
import (
293
+
....
294
+
appsv1 "k8s.io/api/apps/v1"
295
+
)
296
+
297
+
func main() {
298
+
....
299
+
if err := appsv1.AddToScheme(mgr.GetScheme()); err != nil {
0 commit comments