config

package
v0.0.0-...-9c8d8c7 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PersistenceStorageClassType = "storageClass"
	PersistenceNfsType          = "nfs"
	PersistenceHostPathType     = "hostPath"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type C7NContext

type C7NContext struct {
	Name   string  `yaml:"name"`
	Server string  `yaml:"server"`
	User   C7NUser `yaml:"user"`
}

C7n 的连接上下文

type C7NUser

type C7NUser struct {
	UserName         string `yaml:"user-name"`
	Token            string `yaml:"token"`
	ProjectId        int    `yaml:"project-id"`
	OrganizationId   int    `yaml:"organization-id"`
	OrganizationCode string `yaml:"organization-code"`
	ProjectCode      string `yaml:"project-code"`
}

type C7nConfig

type C7nConfig struct {
	Version  string
	Metadata Metadata
	Spec     Spec
}

func (*C7nConfig) GetChartRepository

func (c *C7nConfig) GetChartRepository() string

func (*C7nConfig) GetDatasourceTpl

func (c *C7nConfig) GetDatasourceTpl() string

func (*C7nConfig) GetHelmValuesTpl

func (c *C7nConfig) GetHelmValuesTpl(key string) ([]byte, error)

func (*C7nConfig) GetImageRepository

func (c *C7nConfig) GetImageRepository() string

func (*C7nConfig) GetPrefix

func (c *C7nConfig) GetPrefix() string

func (*C7nConfig) GetResource

func (c *C7nConfig) GetResource(key string) *Resource

func (*C7nConfig) GetStorageClass

func (c *C7nConfig) GetStorageClass() string

func (*C7nConfig) GetStorageClassName

func (c *C7nConfig) GetStorageClassName() string

func (*C7nConfig) GetThinMode

func (c *C7nConfig) GetThinMode() bool

func (*C7nConfig) IgnorePv

func (c *C7nConfig) IgnorePv() bool

type Chart

type Chart struct {
	DefaultSource ChartRepository  `yaml:"default-source"`
	DefaultTarget ChartRepository  `yaml:"default-target"`
	Component     []ChartComponent `yaml:"component"`
}

type ChartComponent

type ChartComponent struct {
	Name     string          `yaml:"name"`
	Version  string          `yaml:"version"`
	Source   ChartRepository `yaml:"source"`
	Target   ChartRepository `yaml:"target"`
	Category string          `yaml:"category"`
}

type ChartRepository

type ChartRepository struct {
	Url      string `yaml:"url"`
	Repo     string `yaml:"repo"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type ChoerodonVersion

type ChoerodonVersion struct {
	Name string `yaml:"name"`

	// 配置文件的版本
	Version string  `yaml:"version"`
	Spec    PkgSpec `yaml:"spec"`
}

type Cluster

type Cluster struct {
	Server       string `yaml:"server"`
	User         *User  `yaml:"user"`
	SelectedUser string `yaml:"selected-user"`
}

type Config

type Config struct {
	Version string `yaml:"version"`
	// 安装 c7n 时,用户需要输入的邮箱信息
	Terms   Terms  `yaml:"terms"`
	OpsMail string `yaml:"opsMail"`

	// 暂时不知道有什么用处
	Clusters       []*NamedCluster `yaml:"clusters"`
	CurrentCluster string          `yaml:"current-cluster"`
	Users          []*NamedUser    `yaml:"users"`

	// 连接 c7n 的上下文信息
	Contexts       []C7NContext `yaml:"contexts"`
	CurrentContext string       `yaml:"currentContext"`
}

c7nctl 默认的配置项,包括安装的基本信息和连接c7n的信息

type HostPath

type HostPath struct {
	RootPath string `yaml:"rootPath"`
	Path     string `yaml:"path"`
}

type Image

type Image struct {
	Registry []ImageRegistry `yaml:"registry"`
	Images   []string        `yaml:"images"`
}

type ImageRegistry

type ImageRegistry struct {
	Domain     string `yaml:"domain"`
	Repository string `yaml:"repository"`
	Username   string `yaml:"username"`
	Password   string `yaml:"password"`
	Insecure   string `yaml:"insecure"`
}

type Metadata

type Metadata struct {
	Name      string
	Namespace string `default:"c7n-system"`
}

type NamedCluster

type NamedCluster struct {
	Name    string   `yaml:"name"`
	Cluster *Cluster `yaml:"cluster"`
}

type NamedUser

type NamedUser struct {
	Name string `yaml:"name"`
	User *User  `yaml:"user"`
}

type Nfs

type Nfs struct {
	Server   string
	RootPath string `yaml:"rootPath"`
}

type Option

type Option struct {
	ResourcePath string `yaml:"resource-path"`
	HelmValue    string `yaml:"helm-value"`

	Prefix          string `yaml:"prefix"`
	ImageRepository string `yaml:"image-repo"`
	ChartRepository string `yaml:"chart-repo"`
	DatasourceTpl   string `yaml:"datasource-tpl"`
	ThinMode        bool   `yaml:"thin-mode"`
}

type Persistence

type Persistence struct {
	Nfs              `yaml:"nfs"`
	HostPath         `yaml:"hostPath"`
	StorageClassName string `yaml:"storageClassName"`
	Type             string
	AccessModes      []v1.PersistentVolumeAccessMode `yaml:"accessModes"`
}

func (*Persistence) GetPersistentVolumeSource

func (p *Persistence) GetPersistentVolumeSource(subPath string) v1.PersistentVolumeSource

func (*Persistence) GetStorageType

func (p *Persistence) GetStorageType() string

type PkgSpec

type PkgSpec struct {
	// 需要生成离线安装包的猪齿鱼版本
	VersionRegexp string `yaml:"version-regexp"`
	Offline       bool   `yaml:"offline"`
	Chart         Chart  `yaml:"chart"`
	Image         Image  `yaml:"image"`
}

type Resource

type Resource struct {
	Host        string
	Port        int32
	Username    string
	Password    string
	Schema      string
	Domain      string
	External    bool
	Url         string
	Persistence *Persistence `yaml:"persistence"`
}

type Spec

type Spec struct {
	Persistence
	Resources map[string]*Resource
	Option    `yaml:"option"`
}

type Terms

type Terms struct {
	Accepted bool `yaml:"accepted"`
}

type User

type User struct {
	Mail       string `yaml:"mail"`
	Token      string `yaml:"token"`
	Name       string `yaml:"name"`
	ValidUntil int64  `yaml:"valid-until"`
}

type Version

type Version struct {
	Version string
	Status  string
}

type Versions

type Versions struct {
	Versions []Version
}

Jump to

Keyboard shortcuts

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