Documentation ¶
Index ¶
- Constants
- Variables
- func PrintDeps() error
- func PrintDepsAsFile()
- func UpdateRoleForResource(r *Resource, absProjectPath string) error
- type AddController
- type AddToScheme
- type Apis
- type Cmd
- type Controller
- type ControllerKind
- type Cr
- type Crd
- type Doc
- type Dockerfile
- type Gitignore
- type GoTestScript
- type GopkgToml
- type Operator
- type Register
- type Resource
- type Role
- type RoleBinding
- type Scaffold
- type ServiceAccount
- type TestFrameworkDockerfile
- type TestPod
- type Types
- type Version
Constants ¶
const ( // dirs CmdDir = "cmd" ManagerDir = CmdDir + filePathSep + "manager" PkgDir = "pkg" ApisDir = PkgDir + filePathSep + "apis" ControllerDir = PkgDir + filePathSep + "controller" BuildDir = "build" BuildTestDir = BuildDir + filePathSep + "test-framework" BuildBinDir = BuildDir + filePathSep + "_output" + filePathSep + "bin" DeployDir = "deploy" OlmCatalogDir = DeployDir + filePathSep + "olm-catalog" CrdsDir = DeployDir + filePathSep + "crds" VersionDir = "version" )
const ApisFile = "apis.go"
const CmdFile = "main.go"
const ControllerFile = "controller.go"
const DocFile = "doc.go"
const DockerfileFile = "Dockerfile"
const GitignoreFile = ".gitignore"
const GoTestScriptFile = "go-test.sh"
const GopkgTomlFile = "Gopkg.toml"
const OperatorYamlFile = "operator.yaml"
const RegisterFile = "register.go"
const RoleBindingYamlFile = "role_binding.yaml"
const RoleYamlFile = "role.yaml"
const ServiceAccountYamlFile = "service_account.yaml"
const TestPodYamlFile = "test-pod.yaml"
const VersionFile = "version.go"
Variables ¶
var ( // ResourceVersionRegexp matches Kubernetes API versions. // See https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-versioning ResourceVersionRegexp = regexp.MustCompile("^v[1-9][0-9]*((alpha|beta)[1-9][0-9]*)?$") // ResourceKindRegexp matches Kubernetes API Kind's. ResourceKindRegexp = regexp.MustCompile("^[A-Z]{1}[a-zA-Z0-9]+$") // ResourceGroupRegexp matches Kubernetes API Group's. ResourceGroupRegexp = regexp.MustCompile("^[a-z0-9]+$") )
Functions ¶
func PrintDepsAsFile ¶ added in v0.2.0
func PrintDepsAsFile()
func UpdateRoleForResource ¶
Types ¶
type AddController ¶
type AddController struct { input.Input // Resource defines the inputs for the controller's primary resource Resource *Resource }
AddController is the input needed to generate a pkg/controller/add_<kind>.go file
type AddToScheme ¶
type AddToScheme struct { input.Input // Resource defines the inputs for the new api Resource *Resource }
AddToScheme is the input needed to generate an addtoscheme_<group>_<version>.go file
type Controller ¶
type ControllerKind ¶
type ControllerKind struct { input.Input // Resource defines the inputs for the controller's primary resource Resource *Resource }
ControllerKind is the input needed to generate a pkg/controller/<kind>/<kind>_controller.go file
type Cr ¶
type Cr struct { input.Input // Resource defines the inputs for the new custom resource Resource *Resource }
Cr is the input needed to generate a deploy/crds/<group>_<version>_<kind>_cr.yaml file
type Crd ¶
type Crd struct { input.Input // Resource defines the inputs for the new custom resource definition Resource *Resource }
Crd is the input needed to generate a deploy/crds/<group>_<version>_<kind>_crd.yaml file
type Doc ¶
type Doc struct { input.Input // Resource defines the inputs for the new doc file Resource *Resource }
Doc is the input needed to generate a pkg/apis/<group>/<version>/doc.go file
type Dockerfile ¶
type GoTestScript ¶
type Register ¶
type Register struct { input.Input // Resource defines the inputs for the new custom resource definition Resource *Resource }
Register is the input needed to generate a pkg/apis/<group>/<version>/register.go file
type Resource ¶
type Resource struct { // APIVersion is the complete group-subdomain/version e.g app.example.com/v1alpha1 APIVersion string // Kind is the API Kind e.g AppService Kind string // FullGroup is the complete group name with subdomain e.g app.example.com // Parsed from APIVersion FullGroup string // Group is the API Group. Does not contain the sub-domain. e.g app // Parsed from APIVersion Group string // Version is the API version - e.g. v1alpha1 // Parsed from APIVersion Version string // Resource is the API Resource i.e plural(lowercased(Kind)) e.g appservices Resource string // LowerKind is lowercased(Kind) e.g appservice LowerKind string }
Resource contains the information required to scaffold files for a resource.
func NewResource ¶
type RoleBinding ¶
type Scaffold ¶
type Scaffold struct { // Repo is the go project package Repo string // AbsProjectPath is the absolute path to the project root, including the project directory. AbsProjectPath string // ProjectName is the operator's name, ex. app-operator ProjectName string GetWriter func(path string, mode os.FileMode) (io.Writer, error) }
Scaffold writes Templates to scaffold new files
type ServiceAccount ¶
type TestFrameworkDockerfile ¶
type TestPod ¶
Source Files ¶
- add_controller.go
- addtoscheme.go
- apis.go
- build_dockerfile.go
- cmd.go
- constants.go
- controller.go
- controller_kind.go
- cr.go
- crd.go
- doc.go
- gitignore.go
- go_test_script.go
- gopkgtoml.go
- operator.go
- register.go
- resource.go
- role.go
- rolebinding.go
- scaffold.go
- service_account.go
- test_framework_dockerfile.go
- test_pod.go
- test_setup.go
- types.go
- version.go