operator

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvBaseOs = "MO_BASE_OS"
)

Variables

This section is empty.

Functions

func Build

func Build()

Alias for buildDocker target

func BuildDocker

func BuildDocker()

Builds Docker image for the operator.

This step will also build and test the operator go code. The docker image will be tagged based on the state of your git working tree.

func BuildGo

func BuildGo()

Builds operator go code.

By default, a dev version will be stamped into the binary.

Set env variable MO_VERSION to specify a specific version to stamp.

func Clean

func Clean()

Remove the operator build directories, and the top-level build directory.

It's maybe a bit weird that this clean target reaches up out of it's directory to clean a top level thing, but right now that top-level thing holds the operator golang binary, so we clean it here.

func DeployToArtifactory

func DeployToArtifactory()

Deploy operator image to artifactory.

Most of our internal end-to-end tests rely on operator container images being available from the Docker repository in Artifactory. Artifactory can get overloaded and so we typically push only commits to stable branches.

This target assumes that you have several environment variables set: MO_ART_USR - artifactory user MO_ART_PSW - artifactory password/api key MO_TAGS - pipe-delimited docker tags to retag/push to Artifactory

func DeployToECR

func DeployToECR()

Deploy operator image to ECR.

Most test workflows for Cassandra as a Service rely on operator container images being available from the Elastic Container Registry. We typically push PR builds here to enable easy testing of work prior to merge.

This target assumes that you have several environment variables set: MO_ECR_ID - ECR access key ID MO_ECR_SECRET - ECR secret access key MO_TAGS - pipe-delimited docker tags to retag/push to ECR

func DeployToGHPackages

func DeployToGHPackages()

Deploy operator image to Github packages.

This target assumes that you have several environment variables set: MO_GH_USR - github user MO_GH_TOKEN - github token MO_TAGS - pipe-delimited docker tags to retag/push to Github packages

func GenerateClient

func GenerateClient()

Gen operator client code.

Uses k8s code-generator to generate client code that resides in the operator/pkg/generated/clientset/ directory.

func GenerateDiagrams

func GenerateDiagrams()

Generate diagrams for docs.

func PrintFullVersion added in v1.5.0

func PrintFullVersion()

func PrintVersion added in v1.5.0

func PrintVersion()

func SdkGenerate

func SdkGenerate()

Generate files with the operator-sdk.

This launches a docker container and executes `operator-sdk generate` with the k8s and kube-openapi code-generators

The k8s code-generator currently only generates DeepCopy() functions for all custom resource types under pkg/apis/...

The kube-openapi code-generator generates a crd yaml file for every custom resource under pkg/apis/... that are tagged for OpenAPIv3. The generated crd files are located under deploy/crds/...

func Test

func Test()

Run all automated test targets

func TestAndBuild

func TestAndBuild()

Run go tests and build a docker image if they pass

func TestGenerateClient

func TestGenerateClient()

Asserts that generated client boilerplate files are up to date.

Note: this test WILL UPDATE YOUR WORKING DIRECTORY if it fails. There is no dry run mode for code-generation, so this test simply tries to do it and fails if there are uncommitted changes to your working directory afterward.

func TestGo

func TestGo()

Runs unit tests for operator go code.

func TestMage

func TestMage()

Runs unit tests for operator mage library.

Since we have a good amount of logic around building and versioning the operator, we want to make sure that the logic is sound.

func TestSdk

func TestSdk()

Tests the operator-sdk itself.

Uses the example project and kubernetes CLI tools. This does not test the DSE operator code in any way.

func TestSdkGenerate

func TestSdkGenerate()

Test that asserts that boilerplate files generated by the operator SDK are up to date.

Ensures that we don't change the DseDatacenterSpec without also regenerating the boilerplate files that the Operator SDK manages which depend on that spec.

Note: this test WILL UPDATE YOUR WORKING DIRECTORY if it fails. There is no dry run mode for sdk generation, so this test simply tries to do it and fails if there are uncommitted changes to your working directory afterward.

Types

type FullVersion

type FullVersion struct {
	Core        cfgutil.Version
	Branch      string
	Uncommitted bool
	Hash        string
}

func (FullVersion) String

func (v FullVersion) String() string

type GitData

type GitData struct {
	Branch                string
	LongHash              string
	HasUncommittedChanges bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL