operator-sdk
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2
Entrypoint
Return Type
OperatorSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
container | Container | - | Extra golang container |
goVersion | String | - | The go version when go.mod not yet exist |
sdkVersion | String | - | The operator-sdk cli version to use |
opmVersion | String | - | The opm cli version to use |
controllerGenVersion | String | - | The controller gen version to use |
cleanCrdVersion | String | - | The clean crd version to use |
kustomizeVersion | String | - | The kustomize version to use |
dockerVersion | String | - | The Docker version to use |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH
func (m *myModule) example(src *Directory) *OperatorSdk {
return dag.
OperatorSdk(src)
}
@function
def example(src: dagger.Directory, ) -> dag.OperatorSdk:
return (
dag.operator_sdk(src)
)
@func()
example(src: Directory, ): OperatorSdk {
return dag
.operatorSdk(src)
}
Types
OperatorSdk 🔗
kube() 🔗
K3s module
Return Type
OperatorSdkKube !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH kube
func (m *myModule) example(src *Directory) *OperatorSdkKube {
return dag.
OperatorSdk(src).
Kube()
}
@function
def example(src: dagger.Directory, ) -> dag.OperatorSdkKube:
return (
dag.operator_sdk(src)
.kube()
)
@func()
example(src: Directory, ): OperatorSdkKube {
return dag
.operatorSdk(src)
.kube()
}
golang() 🔗
The Golang module
Return Type
OperatorSdkGolang !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH golang
func (m *myModule) example(src *Directory) *OperatorSdkGolang {
return dag.
OperatorSdk(src).
Golang()
}
@function
def example(src: dagger.Directory, ) -> dag.OperatorSdkGolang:
return (
dag.operator_sdk(src)
.golang()
)
@func()
example(src: Directory, ): OperatorSdkGolang {
return dag
.operatorSdk(src)
.golang()
}
sdk() 🔗
The SDK module
Return Type
OperatorSdkSdk !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH sdk
func (m *myModule) example(src *Directory) *OperatorSdkSdk {
return dag.
OperatorSdk(src).
Sdk()
}
@function
def example(src: dagger.Directory, ) -> dag.OperatorSdkSdk:
return (
dag.operator_sdk(src)
.sdk()
)
@func()
example(src: Directory, ): OperatorSdkSdk {
return dag
.operatorSdk(src)
.sdk()
}
oci() 🔗
The OCI module
Return Type
OperatorSdkOci !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH oci
func (m *myModule) example(src *Directory) *OperatorSdkOci {
return dag.
OperatorSdk(src).
Oci()
}
@function
def example(src: dagger.Directory, ) -> dag.OperatorSdkOci:
return (
dag.operator_sdk(src)
.oci()
)
@func()
example(src: Directory, ): OperatorSdkOci {
return dag
.operatorSdk(src)
.oci()
}
withSource() 🔗
WithSource permit to update source on all sub containers
Return Type
OperatorSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | No description provided |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH with-source --src DIR_PATH
func (m *myModule) example(src *Directory, src1 *Directory) *OperatorSdk {
return dag.
OperatorSdk(src).
WithSource(src1)
}
@function
def example(src: dagger.Directory, src1: dagger.Directory) -> dag.OperatorSdk:
return (
dag.operator_sdk(src)
.with_source(src1)
)
@func()
example(src: Directory, src1: Directory): OperatorSdk {
return dag
.operatorSdk(src)
.withSource(src1)
}
installOlmOperator() 🔗
Return Type
Service !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
catalogImage | String ! | - | The catalog image to install |
name | String ! | - | The operator name |
channel | String | "stable" | The channel of the operator to install |
kubeconfig | String | - | The kubeconfig to connect on existing cluster It not set, it will run local k3s cluster |
installPromteheusCrd | Boolean | - | Set tru to install CRD prometheus. When you use internal kube, it always true The installPlan needed this if metric is enable on operator |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH install-olm-operator --catalog-image string --name string
func (m *myModule) example(src *Directory, catalogImage string, name string) *Service {
return dag.
OperatorSdk(src).
InstallOlmOperator(catalogImage, name)
}
@function
def example(src: dagger.Directory, catalog_image: str, name: str) -> dagger.Service:
return (
dag.operator_sdk(src)
.install_olm_operator(catalog_image, name)
)
@func()
example(src: Directory, catalogImage: string, name: string): Service {
return dag
.operatorSdk(src)
.installOlmOperator(catalogImage, name)
}
testOlmOperator() 🔗
It will deploy OLM, Then it will deploy operator on it Then it will check that the operator pod run
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
catalogImage | String ! | - | The catalog image to install |
name | String ! | - | The operator name |
channel | String | "stable" | The channel of the operator to install |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH test-olm-operator --catalog-image string --name string
func (m *myModule) example(ctx context.Context, src *Directory, catalogImage string, name string) string {
return dag.
OperatorSdk(src).
TestOlmOperator(ctx, catalogImage, name)
}
@function
async def example(src: dagger.Directory, catalog_image: str, name: str) -> str:
return await (
dag.operator_sdk(src)
.test_olm_operator(catalog_image, name)
)
@func()
async example(src: Directory, catalogImage: string, name: string): Promise<string> {
return dag
.operatorSdk(src)
.testOlmOperator(catalogImage, name)
}
release() 🔗
Release permit to release to operator version
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | - | The version to release |
isBuildNumber | Boolean | - | Set true if the current version is the build number We will use semver from version file to generate next minor + version as tag name |
previousVersion | String | - | The previous version to replace |
skipBuildFromPreviousVersion | Boolean | - | Set tru to not build from previous version It usefull when build from PR |
crdVersion | String | - | The CRD version do generate manifests |
channels | String | - | The list of channel. Comma separated |
withTest | Boolean | - | Set true to run tests |
kubeVersion | String | - | Set the kubeversion to use when run envtest |
withPublish | Boolean | - | Set true to publish the operator image, the bundle image and the catalog image |
publishLast | Boolean | - | Set true to publish the catalog with last tag |
registry | String ! | - | The OCI registry |
repository | String ! | - | The OCI repository |
registryUsername | String | - | The registry username |
registryPassword | Secret | - | The registry password |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ef9635462b4c8ceede3ca72e24564b21111b85d2 call \
--src DIR_PATH release --version string --registry string --repository string
func (m *myModule) example(src *Directory, version string, registry string, repository string) *Directory {
return dag.
OperatorSdk(src).
Release(version, registry, repository)
}
@function
def example(src: dagger.Directory, version: str, registry: str, repository: str) -> dagger.Directory:
return (
dag.operator_sdk(src)
.release(version, registry, repository)
)
@func()
example(src: Directory, version: string, registry: string, repository: string): Directory {
return dag
.operatorSdk(src)
.release(version, registry, repository)
}
OperatorSdkKube 🔗
withSource() 🔗
Return Type
OperatorSdkKube !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
Function OperatorSdkKube.withSource is not accessible from the operator-sdk module
Function OperatorSdkKube.withSource is not accessible from the operator-sdk module
Function OperatorSdkKube.withSource is not accessible from the operator-sdk module
Function OperatorSdkKube.withSource is not accessible from the operator-sdk module
kubectl() 🔗
Return Type
Container !
Example
Function OperatorSdkKube.kubectl is not accessible from the operator-sdk module
Function OperatorSdkKube.kubectl is not accessible from the operator-sdk module
Function OperatorSdkKube.kubectl is not accessible from the operator-sdk module
Function OperatorSdkKube.kubectl is not accessible from the operator-sdk module
kubeconfig() 🔗
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
local | Boolean | - | set true if expose the k3s on host |
Example
Function OperatorSdkKube.kubeconfig is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeconfig is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeconfig is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeconfig is not accessible from the operator-sdk module
kubeCluster() 🔗
Return Type
Service !
Example
Function OperatorSdkKube.kubeCluster is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeCluster is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeCluster is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeCluster is not accessible from the operator-sdk module
kubeContainer() 🔗
Return Type
Container !
Example
Function OperatorSdkKube.kubeContainer is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeContainer is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeContainer is not accessible from the operator-sdk module
Function OperatorSdkKube.kubeContainer is not accessible from the operator-sdk module
OperatorSdkGolang 🔗
test() 🔗
Test permit to run golang tests It will run envtest with the kube version provided
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
short | Boolean | - | if only short running tests should be executed |
shuffle | Boolean | - | if the tests should be executed out of order |
run | String | - | run select tests only, defined using a regex |
skip | String | - | skip select tests, defined using a regex |
withGotestsum | Boolean | - | Run test with gotestsum |
path | String | - | Path to test |
withKubeversion | String | "latest" | The Kubeversion version to use |
Example
Function OperatorSdkGolang.test is not accessible from the operator-sdk module
Function OperatorSdkGolang.test is not accessible from the operator-sdk module
Function OperatorSdkGolang.test is not accessible from the operator-sdk module
Function OperatorSdkGolang.test is not accessible from the operator-sdk module
withSource() 🔗
To update the source directory
Return Type
OperatorSdkGolang !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
Function OperatorSdkGolang.withSource is not accessible from the operator-sdk module
Function OperatorSdkGolang.withSource is not accessible from the operator-sdk module
Function OperatorSdkGolang.withSource is not accessible from the operator-sdk module
Function OperatorSdkGolang.withSource is not accessible from the operator-sdk module
container() 🔗
Container permit to get Golang container
Return Type
Container !
Example
Function OperatorSdkGolang.container is not accessible from the operator-sdk module
Function OperatorSdkGolang.container is not accessible from the operator-sdk module
Function OperatorSdkGolang.container is not accessible from the operator-sdk module
Function OperatorSdkGolang.container is not accessible from the operator-sdk module
OperatorSdkSdk 🔗
container() 🔗
Return Type
Container !
Example
Function OperatorSdkSdk.container is not accessible from the operator-sdk module
Function OperatorSdkSdk.container is not accessible from the operator-sdk module
Function OperatorSdkSdk.container is not accessible from the operator-sdk module
Function OperatorSdkSdk.container is not accessible from the operator-sdk module
src() 🔗
The source directory
Return Type
Directory !
Example
Function OperatorSdkSdk.src is not accessible from the operator-sdk module
Function OperatorSdkSdk.src is not accessible from the operator-sdk module
Function OperatorSdkSdk.src is not accessible from the operator-sdk module
Function OperatorSdkSdk.src is not accessible from the operator-sdk module
version() 🔗
Version display the current version of operator-sdk cli
Return Type
String !
Example
Function OperatorSdkSdk.version is not accessible from the operator-sdk module
Function OperatorSdkSdk.version is not accessible from the operator-sdk module
Function OperatorSdkSdk.version is not accessible from the operator-sdk module
Function OperatorSdkSdk.version is not accessible from the operator-sdk module
run() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
cmd | String ! | - | The cmd to run on container |
Example
Function OperatorSdkSdk.run is not accessible from the operator-sdk module
Function OperatorSdkSdk.run is not accessible from the operator-sdk module
Function OperatorSdkSdk.run is not accessible from the operator-sdk module
Function OperatorSdkSdk.run is not accessible from the operator-sdk module
generateManifests() 🔗
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
crdVersion | String | - | The CRD version to generate |
Example
Function OperatorSdkSdk.generateManifests is not accessible from the operator-sdk module
Function OperatorSdkSdk.generateManifests is not accessible from the operator-sdk module
Function OperatorSdkSdk.generateManifests is not accessible from the operator-sdk module
Function OperatorSdkSdk.generateManifests is not accessible from the operator-sdk module
generateBundle() 🔗
Bundle generate the bundle
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
imageName | String ! | - | The OCI operator image name without the version |
version | String ! | - | The current version |
channels | String | - | The channels |
previousVersion | String | - | The previous version |
Example
Function OperatorSdkSdk.generateBundle is not accessible from the operator-sdk module
Function OperatorSdkSdk.generateBundle is not accessible from the operator-sdk module
Function OperatorSdkSdk.generateBundle is not accessible from the operator-sdk module
Function OperatorSdkSdk.generateBundle is not accessible from the operator-sdk module
withSource() 🔗
WithSource permit to update the current source on sdk container
Return Type
OperatorSdkSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
Function OperatorSdkSdk.withSource is not accessible from the operator-sdk module
Function OperatorSdkSdk.withSource is not accessible from the operator-sdk module
Function OperatorSdkSdk.withSource is not accessible from the operator-sdk module
Function OperatorSdkSdk.withSource is not accessible from the operator-sdk module
installOlm() 🔗
InstallOlm permit to install the OLM
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
kubeconfig | File ! | - | The kubeconfig file to access on cluster where to install OLM |
Example
Function OperatorSdkSdk.installOlm is not accessible from the operator-sdk module
Function OperatorSdkSdk.installOlm is not accessible from the operator-sdk module
Function OperatorSdkSdk.installOlm is not accessible from the operator-sdk module
Function OperatorSdkSdk.installOlm is not accessible from the operator-sdk module
OperatorSdkOci 🔗
golangContainer() 🔗
The Golang container
Return Type
Container !
Example
Function OperatorSdkOci.golangContainer is not accessible from the operator-sdk module
Function OperatorSdkOci.golangContainer is not accessible from the operator-sdk module
Function OperatorSdkOci.golangContainer is not accessible from the operator-sdk module
Function OperatorSdkOci.golangContainer is not accessible from the operator-sdk module
dockerContainer() 🔗
The Docker container
Return Type
Container !
Example
Function OperatorSdkOci.dockerContainer is not accessible from the operator-sdk module
Function OperatorSdkOci.dockerContainer is not accessible from the operator-sdk module
Function OperatorSdkOci.dockerContainer is not accessible from the operator-sdk module
Function OperatorSdkOci.dockerContainer is not accessible from the operator-sdk module
manager() 🔗
The manager image
Return Type
Container !
Example
Function OperatorSdkOci.manager is not accessible from the operator-sdk module
Function OperatorSdkOci.manager is not accessible from the operator-sdk module
Function OperatorSdkOci.manager is not accessible from the operator-sdk module
Function OperatorSdkOci.manager is not accessible from the operator-sdk module
bundle() 🔗
The bundle image
Return Type
Container !
Example
Function OperatorSdkOci.bundle is not accessible from the operator-sdk module
Function OperatorSdkOci.bundle is not accessible from the operator-sdk module
Function OperatorSdkOci.bundle is not accessible from the operator-sdk module
Function OperatorSdkOci.bundle is not accessible from the operator-sdk module
catalog() 🔗
The catalog image
Return Type
Container !
Example
Function OperatorSdkOci.catalog is not accessible from the operator-sdk module
Function OperatorSdkOci.catalog is not accessible from the operator-sdk module
Function OperatorSdkOci.catalog is not accessible from the operator-sdk module
Function OperatorSdkOci.catalog is not accessible from the operator-sdk module
withRepositoryCredentials() 🔗
Return Type
OperatorSdkOci !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The repository URL |
username | String ! | - | The username |
password | Secret ! | - | The password |
Example
Function OperatorSdkOci.withRepositoryCredentials is not accessible from the operator-sdk module
Function OperatorSdkOci.withRepositoryCredentials is not accessible from the operator-sdk module
Function OperatorSdkOci.withRepositoryCredentials is not accessible from the operator-sdk module
Function OperatorSdkOci.withRepositoryCredentials is not accessible from the operator-sdk module
buildManager() 🔗
BuildManager permit to build manager image
Return Type
OperatorSdkOci !
Example
Function OperatorSdkOci.buildManager is not accessible from the operator-sdk module
Function OperatorSdkOci.buildManager is not accessible from the operator-sdk module
Function OperatorSdkOci.buildManager is not accessible from the operator-sdk module
Function OperatorSdkOci.buildManager is not accessible from the operator-sdk module
publishManager() 🔗
PublishManager permit to push OCI image on registry
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The image name to push |
Example
Function OperatorSdkOci.publishManager is not accessible from the operator-sdk module
Function OperatorSdkOci.publishManager is not accessible from the operator-sdk module
Function OperatorSdkOci.publishManager is not accessible from the operator-sdk module
Function OperatorSdkOci.publishManager is not accessible from the operator-sdk module
buildBundle() 🔗
BuildCatalog permit to build catalog image
Return Type
OperatorSdkOci !
Example
Function OperatorSdkOci.buildBundle is not accessible from the operator-sdk module
Function OperatorSdkOci.buildBundle is not accessible from the operator-sdk module
Function OperatorSdkOci.buildBundle is not accessible from the operator-sdk module
Function OperatorSdkOci.buildBundle is not accessible from the operator-sdk module
publishBundle() 🔗
PublishBundle permit to push OCI image on registry
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The image name to push |
Example
Function OperatorSdkOci.publishBundle is not accessible from the operator-sdk module
Function OperatorSdkOci.publishBundle is not accessible from the operator-sdk module
Function OperatorSdkOci.publishBundle is not accessible from the operator-sdk module
Function OperatorSdkOci.publishBundle is not accessible from the operator-sdk module
buildCatalog() 🔗
Build the OLM catalog
Return Type
OperatorSdkOci !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
catalogImage | String ! | - | The catalog image name |
previousCatalogImage | String | - | The previuous catalog image name If update 'true' and 'previousCatalogImage' not provided, it use the 'catalogImage' |
bundleImage | String ! | - | The bundle image name |
Example
Function OperatorSdkOci.buildCatalog is not accessible from the operator-sdk module
Function OperatorSdkOci.buildCatalog is not accessible from the operator-sdk module
Function OperatorSdkOci.buildCatalog is not accessible from the operator-sdk module
Function OperatorSdkOci.buildCatalog is not accessible from the operator-sdk module
publishCatalog() 🔗
PublishCatalog permit to publish the catalog image
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The image name to push |
Example
Function OperatorSdkOci.publishCatalog is not accessible from the operator-sdk module
Function OperatorSdkOci.publishCatalog is not accessible from the operator-sdk module
Function OperatorSdkOci.publishCatalog is not accessible from the operator-sdk module
Function OperatorSdkOci.publishCatalog is not accessible from the operator-sdk module
withSource() 🔗
WithSource permit to update the current source
Return Type
OperatorSdkOci !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
Function OperatorSdkOci.withSource is not accessible from the operator-sdk module
Function OperatorSdkOci.withSource is not accessible from the operator-sdk module
Function OperatorSdkOci.withSource is not accessible from the operator-sdk module
Function OperatorSdkOci.withSource is not accessible from the operator-sdk module