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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e
Entrypoint
Return Type
OperatorSdk !
Arguments
Name | Type | Description |
---|---|---|
src | Directory ! | The source directory |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
container | Container | - | Set alternative Golang container |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
OperatorSdkRelease !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
channels | String | - | The list of channel. Comma separated |
withTest | Boolean | false | Set true to run tests |
container | Container | - | Set alternative 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 |
crdVersion | String | - | The CRD version to generate |
withKubeversion | String | "latest" | The Kubeversion version to use when run test |
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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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) *OperatorSdkRelease {
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) -> dag.OperatorSdkRelease:
return (
dag.operator_sdk(src)
.release(registry, repository, registry_username, registry_password)
)
@func()
example(src: Directory, registry: string, repository: string, registryUsername: string, registryPassword: Secret): OperatorSdkRelease {
return dag
.operatorSdk(src)
.release(registry, repository, registryUsername, registryPassword)
}
OperatorSdkGolang 🔗
sdk() 🔗
Return Type
OperatorSdkSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
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 |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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()
}
container() 🔗
Container return the container that contain golang
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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()
}
lint() 🔗
Lint the target project using golangci-lint
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
format | String | "colored-line-number" | the type of report that should be generated |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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)
}
OperatorSdkRelease 🔗
stdout() 🔗
Return Type
String !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e call \
release --registry string --repository string --registry-username string --registry-password env:MYSECRET \
stdout
func (m *myModule) example(ctx context.Context, registry string, repository string, registryUsername string, registryPassword *Secret) string {
return dag.
OperatorSdk().
Release(registry, repository, registryUsername, registryPassword).
Stdout(ctx)
}
@function
async def example(registry: str, repository: str, registry_username: str, registry_password: dagger.Secret) -> str:
return await (
dag.operator_sdk()
.release(registry, repository, registry_username, registry_password)
.stdout()
)
@func()
async example(registry: string, repository: string, registryUsername: string, registryPassword: Secret): Promise<string> {
return dag
.operatorSdk()
.release(registry, repository, registryUsername, registryPassword)
.stdout()
}
directory() 🔗
Return Type
Directory !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e call \
release --registry string --repository string --registry-username string --registry-password env:MYSECRET \
directory
func (m *myModule) example(registry string, repository string, registryUsername string, registryPassword *Secret) *Directory {
return dag.
OperatorSdk().
Release(registry, repository, registryUsername, registryPassword).
Directory()
}
@function
def example(registry: str, repository: str, registry_username: str, registry_password: dagger.Secret) -> dagger.Directory:
return (
dag.operator_sdk()
.release(registry, repository, registry_username, registry_password)
.directory()
)
@func()
example(registry: string, repository: string, registryUsername: string, registryPassword: Secret): Directory {
return dag
.operatorSdk()
.release(registry, repository, registryUsername, registryPassword)
.directory()
}
OperatorSdkSdk 🔗
container() 🔗
Container return the container that contain the operator-sdk cli
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
cmd | String ! | - | The cmd to run with operator-sdk |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
crdVersion | String | - | The CRD version to generate |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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)
}
runOnKube() 🔗
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
kubeVersion | String | - | The kubeversion you should |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e call \
golang \
sdk \
run-on-kube
func (m *myModule) example() *Container {
return dag.
OperatorSdk().
Golang().
Sdk().
RunOnKube()
}
@function
def example() -> dagger.Container:
return (
dag.operator_sdk()
.golang()
.sdk()
.run_on_kube()
)
@func()
example(): Container {
return dag
.operatorSdk()
.golang()
.sdk()
.runOnKube()
}
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
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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() 🔗
Container return the container that contain golang
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The image name to push |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The image name to push |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | The source directory |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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@6bdee7330b6d5df8e4403ac25affc24e3277dd2e 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()
}