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
Extend 3rd party resource management documentation (#2356)
* Explicitly mention example code location of `cmd/manager/main.go`
* Provide example of registration of 3rd party resource which does not
support `AddToScheme()` function
Copy file name to clipboardExpand all lines: doc/user-guide.md
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -449,7 +449,8 @@ To add a 3rd party resource to an operator, you must add it to the Manager's sch
449
449
450
450
#### Register with the Manager's scheme
451
451
452
-
Call the `AddToScheme()` function for your 3rd party resource and pass it the Manager's scheme via `mgr.GetScheme()`.
452
+
Call the `AddToScheme()` function for your 3rd party resource and pass it the Manager's scheme via `mgr.GetScheme()`
453
+
in `cmd/manager/main.go`.
453
454
454
455
Example:
455
456
```go
@@ -478,6 +479,47 @@ func main() {
478
479
}
479
480
```
480
481
482
+
##### If 3rd party resource does not have `AddToScheme()` function
483
+
484
+
Use the [SchemeBuilder][scheme_builder] package from controller-runtime to initialize a new scheme builder that can be used to register the 3rd party resource with the manager's scheme.
485
+
486
+
Example of registering `DNSEndpoints` 3rd party resource from `external-dns`:
* After adding new import paths to your operator project, run `go mod vendor` if a `vendor/` directory is present in the root of your project directory to fulfill these dependencies.
@@ -694,3 +736,4 @@ When the operator is not running in a cluster, the Manager will return an error
0 commit comments