Documentation
¶
Index ¶
- func RenderAlmCatalog(c *Config, image, version string) error
- func RenderOperatorYaml(c *Config, image string) error
- type Boilerplate
- type Build
- type CRDConfig
- type CRYaml
- type CSVConfig
- type CatalogPackageConfig
- type Config
- type Doc
- type DockerFile
- type Generator
- type Handler
- type Main
- type OperatorYaml
- type RBACYaml
- type Register
- type Types
- type UpdateGenerated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderAlmCatalog ¶ added in v0.0.5
RenderAlmCatalog generates catalog manifests "deploy/alm-catalog/*" The current working directory must be the project repository root
func RenderOperatorYaml ¶ added in v0.0.2
RenderOperatorYaml generates "deploy/operator.yaml"
Types ¶
type Boilerplate ¶
type Boilerplate struct {
ProjectName string
}
Boilerplate contains all the customized data needed to generate codegen/boilerplate.go.txt for a new operator when pairing with boilerplateTmpl template.
type Build ¶
Build contains all the customized data needed to generate tmp/build.sh for a new operator when pairing with buildTmpl template.
type CRDConfig ¶ added in v0.0.5
type CRDConfig struct {
Kind string
KindSingular string
KindPlural string
GroupName string
Version string
}
CRDConfig contains the data needed to generate deploy/alm-catalog/crd.yaml
type CRYaml ¶ added in v0.0.2
CRYaml contains all the customized data needed to generate deploy/cr.yaml.
type CSVConfig ¶ added in v0.0.5
type CSVConfig struct {
Kind string
KindSingular string
KindPlural string
GroupName string
CRDVersion string
ProjectName string
CSVName string
Image string
CatalogVersion string
}
CSVConfig contains the data needed to generate deploy/alm-catalog/csv.yaml
type CatalogPackageConfig ¶ added in v0.0.5
CatalogPackageConfig contains the data needed to generate deploy/alm-catalog/package.yaml
type Config ¶
type Config struct {
// APIVersion is the kubernetes apiVersion that has the format of $GROUP_NAME/$VERSION.
APIVersion string `yaml:"apiVersion"`
// Kind is the kubernetes resource kind.
Kind string `yaml:"kind"`
// ProjectName is name of the new operator application
// and is also the name of the base directory.
ProjectName string `yaml:"projectName"`
}
type Doc ¶
Doc contains all the customized data needed to generate apis/<apiDirName>/<version>/doc.go for a new operator when pairing with apisDocTmpl template.
type DockerFile ¶
type DockerFile struct {
ProjectName string
}
DockerFile contains all the customized data needed to generate tmp/build/Dockerfie for a new operator when pairing with dockerFileTmpl template.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
NewGenerator creates a new scaffold Generator.
func (*Generator) Render ¶
Render generates the default project structure:
├── <projectName> │ ├── cmd │ │ └── <projectName> │ ├── config │ ├── deploy │ ├── pkg │ │ ├── apis │ │ │ └── <api-dir-name> // computed from apiDirName(apiVersion). │ │ │ └── <version> // computed from version(apiVersion). │ │ └── stub │ └── tmp │ ├── build │ └── codegen
type Handler ¶
type Handler struct {
// imports
OperatorSDKImport string
RepoPath string
Kind string
APIDirName string
Version string
}
Handler contains all the customized data needed to generate stub/handler.go for a new operator when pairing with handlerTmpl template.
type Main ¶
type Main struct {
// imports
OperatorSDKImport string
StubImport string
SDKVersionImport string
APIVersion string
Kind string
}
Main contains all the customized data needed to generate cmd/<projectName>/main.go for a new operator when pairing with mainTmpl template.
type OperatorYaml ¶
type OperatorYaml struct {
Kind string
KindSingular string
KindPlural string
GroupName string
Version string
ProjectName string
Image string
}
OperatorYaml contains all the customized data needed to generate deploy/operator.yaml for a new operator when pairing with operatorYamlTmpl template.
type RBACYaml ¶
RBACYaml contains all the customized data needed to generate deploy/rbac.yaml for a new operator when pairing with rbacYamlTmpl template.
type Register ¶
Register contains all the customized data needed to generate apis/<apiDirName>/<version>/register.go for a new operator when pairing with apisDocTmpl template.
type Types ¶
Types contains all the customized data needed to generate apis/<apiDirName>/<version>/types.go for a new operator when pairing with apisTypesTmpl template.
type UpdateGenerated ¶
UpdateGenerated contains all the customized data needed to generate codegen/update-generated.sh for a new operator when pairing with updateGeneratedTmpl template.