crd

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package crd help to create a operator controller by kubeilder or code-generate

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAPI

func CreateAPI(gvk *GVK)

CreateAPI 创建 API 0.判断 update_codegen 脚本如果不存在则进行渲染 1.创建 api 存放目录 2.创建 doc info 文件 3.渲染 api types 文件 4.渲染 PROJECT 文件

func CreateController added in v0.1.4

func CreateController(gvk *GVK)

创建 controller 0.创建目录 1.渲染 signals 2.渲染 controller 文件 3.创建 cmd 等结构和文件 4.创建 main.go 文件 5.配置 PROJECT 文件

func CreateWebhook added in v0.1.4

func CreateWebhook(gvk *GVK)

CreateWebhook 创建 webhook 0.判断 webhook 目录,创建目录 1.创建 webhook 脚手架

func Init

func Init(gvk *GVK)

Init 初始化项目 0.检测项目 go.mod 文件 1.创建 hack 目录 2.渲染 boilerplate 文件 3.渲染 tools 文件 4.渲染 PROJECT 文件 5.makefile 文件 6.dockerfile, ingore 文件

Types

type API added in v0.1.4

type API struct {
	Kind       string `yaml:"kind,omitempty"`
	Version    string `yaml:"version,omitempty"`
	Namespaced bool   `yaml:"namespaced,omitempty"`
	Status     bool   `yaml:"status,omitempty"`
	Group      string `yaml:"group,omitempty"`
	Domain     string `yaml:"domain,omitempty"`
	Controller bool   `yaml:"controller,omitempty"`
	Webhook    bool   `yaml:"webhook,omitempty"`
}

API api 相关的配置信息

type GVK

type GVK struct {
	Repo         string
	Domain       string
	Group        string
	Version      string
	Kind         string
	UseNamespace bool
	UseStatus    bool
	// attempt to create resource even if it already exists
	Force bool
}

GVK this is the infomation of your CRD

func (*GVK) ToLower added in v0.1.4

func (g *GVK) ToLower(s string) string

func (*GVK) ToTitle added in v0.1.4

func (g *GVK) ToTitle(s string) string

type ProjectManager added in v0.1.4

type ProjectManager struct {
	Domain string `yaml:"domain,omitempty"`
	Repo   string `yaml:"repo,omitempty"`
	Group  string `yaml:"group,omitempty"`
	API    []API  `yaml:"api,omitempty"`
}

ProjectManager 项目结构

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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