Dagger
Search

operator-sdk

This module has been generated via dagger init and serves as a reference to
basic 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@446ecd5abe607123a336f7a32f594c2e16bcce24

Entrypoint

Return Type
OperatorSdk !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-The source directory
containerContainer -Extra golang container
sdkVersionString -The operator-sdk cli version to use
opmVersionString -The opm cli version to use
controllerGenVersionString -The controller gen version to use
cleanCrdVersionString -The clean crd version to use
kustomizeVersionString -The kustomize version to use
dockerVersionString -The Docker version to use
kubeVersionString !-The kube version to use when run tests
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
cmdString !-The cmd to run on container
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
crdVersionString -The CRD version to generate
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
imageNameString !-The OCI image name without the version
versionString !-The current version
channelsString -The channels
previousVersionString -The previous version
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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)
}

test() 🔗

Test permit to run golang tests

Return Type
File !
Arguments
NameTypeDefault ValueDescription
shortBoolean -if only short running tests should be executed
shuffleBoolean -if the tests should be executed out of order
runString -run select tests only, defined using a regex
skipString -skip select tests, defined using a regex
withGotestsumBoolean -Run test with gotestsum
pathString -Path to test
withKubeversionString "latest"The Kubeversion version to use
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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()
}

withSource() 🔗

WithSource permit to update source on all sub containers

Return Type
OperatorSdk !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-No description provided
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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)
}

withRepositoryCredentials() 🔗

Return Type
OperatorSdkOci !
Arguments
NameTypeDefault ValueDescription
urlString !-The repository URL
usernameString !-The username
passwordSecret !-The password
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
nameString !-The image name to push
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
nameString !-The image name to push
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
catalogImageString !-The catalog image name
previousCatalogImageString -The previuous catalog image name If update 'true' and 'previousCatalogImage' not provided, it use the 'catalogImage'
bundleImageString !-The bundle image name
updateBoolean -Set to true to update existing catalog
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
nameString !-The image name to push
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
urlString !-The repository URL
usernameString !-The username
passwordSecret !-The password
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
nameString !-The image name to push
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
nameString !-The image name to push
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
catalogImageString !-The catalog image name
previousCatalogImageString -The previuous catalog image name If update 'true' and 'previousCatalogImage' not provided, it use the 'catalogImage'
bundleImageString !-The bundle image name
updateBoolean -Set to true to update existing catalog
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
nameString !-The image name to push
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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
NameTypeDefault ValueDescription
srcDirectory !-The source directory
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@446ecd5abe607123a336f7a32f594c2e16bcce24 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)
}