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@3486140c05c78468ea86eeb674d61b6c3274cbbd

Entrypoint

Return Type
OperatorSdk !
Arguments
NameTypeDescription
srcDirectory !The source directory
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd 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 🔗

golang() 🔗

Return Type
OperatorSdkGolang !
Arguments
NameTypeDefault ValueDescription
containerContainer -Set alternative Golang container
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd 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()
}

release() 🔗

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
channelsString -The list of channel. Comma separated
withTestBoolean falseSet true to run tests
containerContainer -Set alternative 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
crdVersionString -The CRD version to generate
withKubeversionString "latest"The Kubeversion version to use when run test
registryString !-The OCI registry
repositoryString !-The OCI repository
registryUsernameString !-The registry username
registryPasswordSecret !-The registry password
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 --src DIR_PATH release --registry string --repository string --registry-username string --registry-password env:MYSECRET
func (m *myModule) example(src *Directory, registry string, repository string, registryUsername string, registryPassword *Secret) *Directory  {
	return dag.
			OperatorSdk(src).
			Release(registry, repository, registryUsername, registryPassword)
}
@function
def example(src: dagger.Directory, registry: str, repository: str, registry_username: str, registry_password: dagger.Secret) -> dagger.Directory:
	return (
		dag.operator_sdk(src)
		.release(registry, repository, registry_username, registry_password)
	)
@func()
example(src: Directory, registry: string, repository: string, registryUsername: string, registryPassword: Secret): Directory {
	return dag
		.operatorSdk(src)
		.release(registry, repository, registryUsername, registryPassword)
}

OperatorSdkGolang 🔗

container() 🔗

Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 container
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.container()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.container()
}

sdk() 🔗

Return Type
OperatorSdkSdk !
Arguments
NameTypeDefault ValueDescription
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
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk
func (m *myModule) example() *OperatorSdkSdk  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk()
}
@function
def example() -> dag.OperatorSdkSdk:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
	)
@func()
example(): OperatorSdkSdk {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
}

oci() 🔗

Return Type
OperatorSdkOci !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci
func (m *myModule) example() *OperatorSdkOci  {
	return dag.
			OperatorSdk().
			Golang().
			Oci()
}
@function
def example() -> dag.OperatorSdkOci:
	return (
		dag.operator_sdk()
		.golang()
		.oci()
	)
@func()
example(): OperatorSdkOci {
	return dag
		.operatorSdk()
		.golang()
		.oci()
}

lint() 🔗

Lint the target project using golangci-lint

Return Type
String !
Arguments
NameTypeDefault ValueDescription
formatString "colored-line-number"the type of report that should be generated
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 lint
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			OperatorSdk().
			Golang().
			Lint(ctx)
}
@function
async def example() -> str:
	return await (
		dag.operator_sdk()
		.golang()
		.lint()
	)
@func()
async example(): Promise<string> {
	return dag
		.operatorSdk()
		.golang()
		.lint()
}

format() 🔗

Format the source code within a target project using gofumpt. Formatted code must be copied back onto the host.`

Return Type
Directory !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 format
func (m *myModule) example() *Directory  {
	return dag.
			OperatorSdk().
			Golang().
			Format()
}
@function
def example() -> dagger.Directory:
	return (
		dag.operator_sdk()
		.golang()
		.format()
	)
@func()
example(): Directory {
	return dag
		.operatorSdk()
		.golang()
		.format()
}

test() 🔗

Test permit to run golang tests

Return Type
OperatorSdkTestResult !
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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 test
func (m *myModule) example() *OperatorSdkTestResult  {
	return dag.
			OperatorSdk().
			Golang().
			Test()
}
@function
def example() -> dag.OperatorSdkTestResult:
	return (
		dag.operator_sdk()
		.golang()
		.test()
	)
@func()
example(): OperatorSdkTestResult {
	return dag
		.operatorSdk()
		.golang()
		.test()
}

withSource() 🔗

WithSource permit to update the current source on sdk container

Return Type
OperatorSdkGolang !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-The source directory
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 with-source --src DIR_PATH
func (m *myModule) example(src *Directory) *OperatorSdkGolang  {
	return dag.
			OperatorSdk().
			Golang().
			WithSource(src)
}
@function
def example(src: dagger.Directory) -> dag.OperatorSdkGolang:
	return (
		dag.operator_sdk()
		.golang()
		.with_source(src)
	)
@func()
example(src: Directory): OperatorSdkGolang {
	return dag
		.operatorSdk()
		.golang()
		.withSource(src)
}

OperatorSdkSdk 🔗

container() 🔗

Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 container
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.container()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.container()
}

version() 🔗

Version display the current version of operator-sdk cli

Return Type
String !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 version
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Version(ctx)
}
@function
async def example() -> str:
	return await (
		dag.operator_sdk()
		.golang()
		.sdk()
		.version()
	)
@func()
async example(): Promise<string> {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.version()
}

run() 🔗

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
cmdString !-The cmd to run with operator-sdk
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 run --cmd string
func (m *myModule) example(cmd string) *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Run(cmd)
}
@function
def example(cmd: str) -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.run(cmd)
	)
@func()
example(cmd: string): Container {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.run(cmd)
}

generate() 🔗

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
crdVersionString -The CRD version to generate
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 generate
func (m *myModule) example() *Directory  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Generate()
}
@function
def example() -> dagger.Directory:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.generate()
	)
@func()
example(): Directory {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.generate()
}

bundle() 🔗

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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 bundle --image-name string --version string
func (m *myModule) example(imageName string, version string) *Directory  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Bundle(imageName, version)
}
@function
def example(image_name: str, version: str) -> dagger.Directory:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.bundle(image_name, version)
	)
@func()
example(imageName: string, version: string): Directory {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.bundle(imageName, version)
}

kube() 🔗

Prmit to run Kube with Operator

Return Type
OperatorSdkKube !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 kube
func (m *myModule) example() *OperatorSdkKube  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Kube()
}
@function
def example() -> dag.OperatorSdkKube:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.kube()
	)
@func()
example(): OperatorSdkKube {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.kube()
}

withSource() 🔗

WithSource permit to update the current source on sdk container

Return Type
OperatorSdkSdk !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-The source directory
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 with-source --src DIR_PATH
func (m *myModule) example(src *Directory) *OperatorSdkSdk  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			WithSource(src)
}
@function
def example(src: dagger.Directory) -> dag.OperatorSdkSdk:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.with_source(src)
	)
@func()
example(src: Directory): OperatorSdkSdk {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.withSource(src)
}

OperatorSdkOci 🔗

container() 🔗

Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 container
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.oci()
		.container()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.container()
}

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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 with-repository-credentials --url string --username string --password env:MYSECRET
func (m *myModule) example(url string, username string, password *Secret) *OperatorSdkOci  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			WithRepositoryCredentials(url, username, password)
}
@function
def example(url: str, username: str, password: dagger.Secret) -> dag.OperatorSdkOci:
	return (
		dag.operator_sdk()
		.golang()
		.oci()
		.with_repository_credentials(url, username, password)
	)
@func()
example(url: string, username: string, password: Secret): OperatorSdkOci {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 build-manager
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			BuildManager()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.oci()
		.build_manager()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 publish-manager --name string
func (m *myModule) example(ctx context.Context, name string) string  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			PublishManager(ctx, name)
}
@function
async def example(name: str) -> str:
	return await (
		dag.operator_sdk()
		.golang()
		.oci()
		.publish_manager(name)
	)
@func()
async example(name: string): Promise<string> {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.publishManager(name)
}

buildBundle() 🔗

BuildCatalog permit to build catalog image

Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 build-bundle
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			BuildBundle()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.oci()
		.build_bundle()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 publish-bundle --name string
func (m *myModule) example(ctx context.Context, name string) string  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			PublishBundle(ctx, name)
}
@function
async def example(name: str) -> str:
	return await (
		dag.operator_sdk()
		.golang()
		.oci()
		.publish_bundle(name)
	)
@func()
async example(name: string): Promise<string> {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.publishBundle(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@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 oci \
 with-source --src DIR_PATH
func (m *myModule) example(src *Directory) *OperatorSdkOci  {
	return dag.
			OperatorSdk().
			Golang().
			Oci().
			WithSource(src)
}
@function
def example(src: dagger.Directory) -> dag.OperatorSdkOci:
	return (
		dag.operator_sdk()
		.golang()
		.oci()
		.with_source(src)
	)
@func()
example(src: Directory): OperatorSdkOci {
	return dag
		.operatorSdk()
		.golang()
		.oci()
		.withSource(src)
}

OperatorSdkTestResult 🔗

stdout() 🔗

Return Type
String !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 test \
 stdout
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			OperatorSdk().
			Golang().
			Test().
			Stdout(ctx)
}
@function
async def example() -> str:
	return await (
		dag.operator_sdk()
		.golang()
		.test()
		.stdout()
	)
@func()
async example(): Promise<string> {
	return dag
		.operatorSdk()
		.golang()
		.test()
		.stdout()
}

coverage() 🔗

Return Type
File !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 test \
 coverage
func (m *myModule) example() *File  {
	return dag.
			OperatorSdk().
			Golang().
			Test().
			Coverage()
}
@function
def example() -> dagger.File:
	return (
		dag.operator_sdk()
		.golang()
		.test()
		.coverage()
	)
@func()
example(): File {
	return dag
		.operatorSdk()
		.golang()
		.test()
		.coverage()
}

OperatorSdkKube 🔗

container() 🔗

Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 kube \
 container
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Kube().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.kube()
		.container()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.kube()
		.container()
}

run() 🔗

Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@3486140c05c78468ea86eeb674d61b6c3274cbbd call \
 golang \
 sdk \
 kube \
 run
func (m *myModule) example() *Container  {
	return dag.
			OperatorSdk().
			Golang().
			Sdk().
			Kube().
			Run()
}
@function
def example() -> dagger.Container:
	return (
		dag.operator_sdk()
		.golang()
		.sdk()
		.kube()
		.run()
	)
@func()
example(): Container {
	return dag
		.operatorSdk()
		.golang()
		.sdk()
		.kube()
		.run()
}