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@b6e3253fb522d5d17c1bb699150fcc19188c1eee
Entrypoint
Return Type
OperatorSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
container | Container | - | Extra golang container |
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 |
kubeVersion | String ! | - | The kube version to use when run tests |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string
func (m *myModule) example(src *Directory, kubeVersion string) *OperatorSdk {
return dag.
OperatorSdk(src, kubeVersion)
}
@function
def example(src: dagger.Directory, kube_version: str) -> dag.OperatorSdk:
return (
dag.operator_sdk(src, kube_version)
)
@func()
example(src: Directory, kubeVersion: string): OperatorSdk {
return dag
.operatorSdk(src, kubeVersion)
}
Types
OperatorSdk 🔗
version() 🔗
Version display the current version of operator-sdk cli
Return Type
String !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string version
func (m *myModule) example(ctx context.Context, src *Directory, kubeVersion string) string {
return dag.
OperatorSdk(src, kubeVersion).
Version(ctx)
}
@function
async def example(src: dagger.Directory, kube_version: str) -> str:
return await (
dag.operator_sdk(src, kube_version)
.version()
)
@func()
async example(src: Directory, kubeVersion: string): Promise<string> {
return dag
.operatorSdk(src, kubeVersion)
.version()
}
run() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
cmd | String ! | - | The cmd to run on container |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string run --cmd string
func (m *myModule) example(src *Directory, kubeVersion string, cmd string) *Container {
return dag.
OperatorSdk(src, kubeVersion).
Run(cmd)
}
@function
def example(src: dagger.Directory, kube_version: str, cmd: str) -> dagger.Container:
return (
dag.operator_sdk(src, kube_version)
.run(cmd)
)
@func()
example(src: Directory, kubeVersion: string, cmd: string): Container {
return dag
.operatorSdk(src, kubeVersion)
.run(cmd)
}
generateManifests() 🔗
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
crdVersion | String | - | The CRD version to generate |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string generate-manifests
func (m *myModule) example(src *Directory, kubeVersion string) *Directory {
return dag.
OperatorSdk(src, kubeVersion).
GenerateManifests()
}
@function
def example(src: dagger.Directory, kube_version: str) -> dagger.Directory:
return (
dag.operator_sdk(src, kube_version)
.generate_manifests()
)
@func()
example(src: Directory, kubeVersion: string): Directory {
return dag
.operatorSdk(src, kubeVersion)
.generateManifests()
}
generateBundle() 🔗
Bundle generate the bundle
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
imageName | String ! | - | The OCI image name without the version |
version | String ! | - | The current version |
channels | String | - | The channels |
previousVersion | String | - | The previous version |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string generate-bundle --image-name string --version string
func (m *myModule) example(src *Directory, kubeVersion string, imageName string, version string) *Directory {
return dag.
OperatorSdk(src, kubeVersion).
GenerateBundle(imageName, version)
}
@function
def example(src: dagger.Directory, kube_version: str, image_name: str, version: str) -> dagger.Directory:
return (
dag.operator_sdk(src, kube_version)
.generate_bundle(image_name, version)
)
@func()
example(src: Directory, kubeVersion: string, imageName: string, version: string): Directory {
return dag
.operatorSdk(src, kubeVersion)
.generateBundle(imageName, version)
}
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@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string with-source --src DIR_PATH
func (m *myModule) example(src *Directory, kubeVersion string, src1 *Directory) *OperatorSdk {
return dag.
OperatorSdk(src, kubeVersion).
WithSource(src1)
}
@function
def example(src: dagger.Directory, kube_version: str, src1: dagger.Directory) -> dag.OperatorSdk:
return (
dag.operator_sdk(src, kube_version)
.with_source(src1)
)
@func()
example(src: Directory, kubeVersion: string, src1: Directory): OperatorSdk {
return dag
.operatorSdk(src, kubeVersion)
.withSource(src1)
}
test() 🔗
Test permit to run golang tests
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string test
func (m *myModule) example(src *Directory, kubeVersion string) *File {
return dag.
OperatorSdk(src, kubeVersion).
Test()
}
@function
def example(src: dagger.Directory, kube_version: str) -> dagger.File:
return (
dag.operator_sdk(src, kube_version)
.test()
)
@func()
example(src: Directory, kubeVersion: string): File {
return dag
.operatorSdk(src, kubeVersion)
.test()
}
withRepositoryCredentials() 🔗
Return Type
OperatorSdkOci !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The repository URL |
username | String ! | - | The username |
password | Secret ! | - | The password |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string with-repository-credentials --url string --username string --password env:MYSECRET
func (m *myModule) example(src *Directory, kubeVersion string, url string, username string, password *Secret) *OperatorSdkOci {
return dag.
OperatorSdk(src, kubeVersion).
WithRepositoryCredentials(url, username, password)
}
@function
def example(src: dagger.Directory, kube_version: str, url: str, username: str, password: dagger.Secret) -> dag.OperatorSdkOci:
return (
dag.operator_sdk(src, kube_version)
.with_repository_credentials(url, username, password)
)
@func()
example(src: Directory, kubeVersion: string, url: string, username: string, password: Secret): OperatorSdkOci {
return dag
.operatorSdk(src, kubeVersion)
.withRepositoryCredentials(url, username, password)
}
buildManager() 🔗
BuildManager permit to build manager image
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string build-manager
func (m *myModule) example(src *Directory, kubeVersion string) *Container {
return dag.
OperatorSdk(src, kubeVersion).
BuildManager()
}
@function
def example(src: dagger.Directory, kube_version: str) -> dagger.Container:
return (
dag.operator_sdk(src, kube_version)
.build_manager()
)
@func()
example(src: Directory, kubeVersion: string): Container {
return dag
.operatorSdk(src, kubeVersion)
.buildManager()
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string publish-manager --name string
func (m *myModule) example(ctx context.Context, src *Directory, kubeVersion string, name string) string {
return dag.
OperatorSdk(src, kubeVersion).
PublishManager(ctx, name)
}
@function
async def example(src: dagger.Directory, kube_version: str, name: str) -> str:
return await (
dag.operator_sdk(src, kube_version)
.publish_manager(name)
)
@func()
async example(src: Directory, kubeVersion: string, name: string): Promise<string> {
return dag
.operatorSdk(src, kubeVersion)
.publishManager(name)
}
buildBundle() 🔗
BuildCatalog permit to build catalog image
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string build-bundle
func (m *myModule) example(src *Directory, kubeVersion string) *Container {
return dag.
OperatorSdk(src, kubeVersion).
BuildBundle()
}
@function
def example(src: dagger.Directory, kube_version: str) -> dagger.Container:
return (
dag.operator_sdk(src, kube_version)
.build_bundle()
)
@func()
example(src: Directory, kubeVersion: string): Container {
return dag
.operatorSdk(src, kubeVersion)
.buildBundle()
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string publish-bundle --name string
func (m *myModule) example(ctx context.Context, src *Directory, kubeVersion string, name string) string {
return dag.
OperatorSdk(src, kubeVersion).
PublishBundle(ctx, name)
}
@function
async def example(src: dagger.Directory, kube_version: str, name: str) -> str:
return await (
dag.operator_sdk(src, kube_version)
.publish_bundle(name)
)
@func()
async example(src: Directory, kubeVersion: string, name: string): Promise<string> {
return dag
.operatorSdk(src, kubeVersion)
.publishBundle(name)
}
buildCatalog() 🔗
Return Type
Container !
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 |
update | Boolean | - | Set to true to update existing catalog |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string build-catalog --catalog-image string --bundle-image string
func (m *myModule) example(src *Directory, kubeVersion string, catalogImage string, bundleImage string) *Container {
return dag.
OperatorSdk(src, kubeVersion).
BuildCatalog(catalogImage, bundleImage)
}
@function
def example(src: dagger.Directory, kube_version: str, catalog_image: str, bundle_image: str) -> dagger.Container:
return (
dag.operator_sdk(src, kube_version)
.build_catalog(catalog_image, bundle_image)
)
@func()
example(src: Directory, kubeVersion: string, catalogImage: string, bundleImage: string): Container {
return dag
.operatorSdk(src, kubeVersion)
.buildCatalog(catalogImage, bundleImage)
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
--src DIR_PATH --kube-version string publish-catalog --name string
func (m *myModule) example(ctx context.Context, src *Directory, kubeVersion string, name string) string {
return dag.
OperatorSdk(src, kubeVersion).
PublishCatalog(ctx, name)
}
@function
async def example(src: dagger.Directory, kube_version: str, name: str) -> str:
return await (
dag.operator_sdk(src, kube_version)
.publish_catalog(name)
)
@func()
async example(src: Directory, kubeVersion: string, name: string): Promise<string> {
return dag
.operatorSdk(src, kubeVersion)
.publishCatalog(name)
}
OperatorSdkOci 🔗
golangContainer() 🔗
The Golang container
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
golang-container
func (m *myModule) example(url string, username string, password *Secret) *Container {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
GolangContainer()
}
@function
def example(url: str, username: str, password: dagger.Secret) -> dagger.Container:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.golang_container()
)
@func()
example(url: string, username: string, password: Secret): Container {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.golangContainer()
}
dockerContainer() 🔗
The Docker container
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
docker-container
func (m *myModule) example(url string, username string, password *Secret) *Container {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
DockerContainer()
}
@function
def example(url: str, username: str, password: dagger.Secret) -> dagger.Container:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.docker_container()
)
@func()
example(url: string, username: string, password: Secret): Container {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.dockerContainer()
}
withRepositoryCredentials() 🔗
Return Type
OperatorSdkOci !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
url | String ! | - | The repository URL |
username | String ! | - | The username |
password | Secret ! | - | The password |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
with-repository-credentials --url string --username string --password env:MYSECRET
func (m *myModule) example(url string, username string, password *Secret, url1 string, username1 string, password1 *Secret) *OperatorSdkOci {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
WithRepositoryCredentials(url1, username1, password1)
}
@function
def example(url: str, username: str, password: dagger.Secret, url1: str, username1: str, password1: dagger.Secret) -> dag.OperatorSdkOci:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.with_repository_credentials(url1, username1, password1)
)
@func()
example(url: string, username: string, password: Secret, url1: string, username1: string, password1: Secret): OperatorSdkOci {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.withRepositoryCredentials(url1, username1, password1)
}
buildManager() 🔗
BuildManager permit to build manager image
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
build-manager
func (m *myModule) example(url string, username string, password *Secret) *Container {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
BuildManager()
}
@function
def example(url: str, username: str, password: dagger.Secret) -> dagger.Container:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.build_manager()
)
@func()
example(url: string, username: string, password: Secret): Container {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.buildManager()
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
publish-manager --name string
func (m *myModule) example(ctx context.Context, url string, username string, password *Secret, name string) string {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
PublishManager(ctx, name)
}
@function
async def example(url: str, username: str, password: dagger.Secret, name: str) -> str:
return await (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.publish_manager(name)
)
@func()
async example(url: string, username: string, password: Secret, name: string): Promise<string> {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.publishManager(name)
}
buildBundle() 🔗
BuildCatalog permit to build catalog image
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
build-bundle
func (m *myModule) example(url string, username string, password *Secret) *Container {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
BuildBundle()
}
@function
def example(url: str, username: str, password: dagger.Secret) -> dagger.Container:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.build_bundle()
)
@func()
example(url: string, username: string, password: Secret): Container {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.buildBundle()
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
publish-bundle --name string
func (m *myModule) example(ctx context.Context, url string, username string, password *Secret, name string) string {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
PublishBundle(ctx, name)
}
@function
async def example(url: str, username: str, password: dagger.Secret, name: str) -> str:
return await (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.publish_bundle(name)
)
@func()
async example(url: string, username: string, password: Secret, name: string): Promise<string> {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.publishBundle(name)
}
buildCatalog() 🔗
Return Type
Container !
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 |
update | Boolean | - | Set to true to update existing catalog |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
build-catalog --catalog-image string --bundle-image string
func (m *myModule) example(url string, username string, password *Secret, catalogImage string, bundleImage string) *Container {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
BuildCatalog(catalogImage, bundleImage)
}
@function
def example(url: str, username: str, password: dagger.Secret, catalog_image: str, bundle_image: str) -> dagger.Container:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.build_catalog(catalog_image, bundle_image)
)
@func()
example(url: string, username: string, password: Secret, catalogImage: string, bundleImage: string): Container {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.buildCatalog(catalogImage, bundleImage)
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
publish-catalog --name string
func (m *myModule) example(ctx context.Context, url string, username string, password *Secret, name string) string {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
PublishCatalog(ctx, name)
}
@function
async def example(url: str, username: str, password: dagger.Secret, name: str) -> str:
return await (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.publish_catalog(name)
)
@func()
async example(url: string, username: string, password: Secret, name: string): Promise<string> {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.publishCatalog(name)
}
withSource() 🔗
WithSource permit to update the current source
Return Type
OperatorSdkOci !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@b6e3253fb522d5d17c1bb699150fcc19188c1eee call \
with-repository-credentials --url string --username string --password env:MYSECRET \
with-source --src DIR_PATH
func (m *myModule) example(url string, username string, password *Secret, src *Directory) *OperatorSdkOci {
return dag.
OperatorSdk().
WithRepositoryCredentials(url, username, password).
WithSource(src)
}
@function
def example(url: str, username: str, password: dagger.Secret, src: dagger.Directory) -> dag.OperatorSdkOci:
return (
dag.operator_sdk()
.with_repository_credentials(url, username, password)
.with_source(src)
)
@func()
example(url: string, username: string, password: Secret, src: Directory): OperatorSdkOci {
return dag
.operatorSdk()
.withRepositoryCredentials(url, username, password)
.withSource(src)
}