-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: perdasilva <[email protected]>
- Loading branch information
1 parent
665c25b
commit 5cbf02b
Showing
5 changed files
with
109 additions
and
13 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
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,37 @@ | ||
package plugins | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned" | ||
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient" | ||
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// HostOperator is an extensible and observable operator that hosts the plug-in, i.e. which the plug-in is extending | ||
type HostOperator interface { | ||
queueinformer.ObservableOperator | ||
queueinformer.ExtensibleOperator | ||
} | ||
|
||
// OperatorConfig gives access to required configuration from the host operator | ||
type OperatorConfig interface { | ||
OperatorClient() operatorclient.ClientInterface | ||
ExternalClient() versioned.Interface | ||
ResyncPeriod() func() time.Duration | ||
WatchedNamespaces() []string | ||
Logger() *logrus.Logger | ||
} | ||
|
||
// OperatorPlugin provides a simple interface | ||
// that can be used to extend the olm operator's functionality | ||
type OperatorPlugin interface { | ||
// Shutdown is called once the host operator is done | ||
// to give the plug-in a change to clean up resources if necessary | ||
Shutdown() error | ||
} | ||
|
||
// OperatorPlugInFactoryFunc factory function that returns a new instance of a plug-in | ||
type OperatorPlugInFactoryFunc func(ctx context.Context, config OperatorConfig, hostOperator HostOperator) (OperatorPlugin, error) |
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