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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691
Entrypoint
Return Type
OperatorSdk !
Arguments
Name | Type | Description |
---|---|---|
src | Directory ! | The source directory |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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()
}
OperatorSdkGolang 🔗
sdk() 🔗
Return Type
OperatorSdkSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
sdkVersion | String | - | The operator-sdk 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
short | Boolean | true | if only short running tests should be executed |
shuffle | Boolean | true | 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 | true | Run test with gotestsum |
withKubeversion | String | "latest" | The Kubeversion version to use |
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 call \
golang \
test
func (m *myModule) example() *File {
return dag.
OperatorSdk().
Golang().
Test()
}
@function
def example() -> dagger.File:
return (
dag.operator_sdk()
.golang()
.test()
)
@func()
example(): File {
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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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() 🔗
Container return the container that contain the operator-sdk cli
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/operator-sdk@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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
Directory !
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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 call \
golang \
sdk \
run --cmd string
func (m *myModule) example(cmd string) *Directory {
return dag.
OperatorSdk().
Golang().
Sdk().
Run(cmd)
}
@function
def example(cmd: str) -> dagger.Directory:
return (
dag.operator_sdk()
.golang()
.sdk()
.run(cmd)
)
@func()
example(cmd: string): Directory {
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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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 |
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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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@ae7c5bab24e59eed71c38f1a5c70fc5adc1bd691 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)
}