Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add kusion config core functions #883

Merged
merged 5 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/apis/core/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ConfigBackends = "backends"
// Config contains configurations for kusion cli, which stores in ${KUSION_HOME}/config.yaml.
type Config struct {
// Backends contains the configurations for multiple backends.
Backends *BackendConfigs `yaml:"backends,omitempty"`
Backends *BackendConfigs `yaml:"backends,omitempty" json:"backends,omitempty"`
}

const (
Expand Down Expand Up @@ -34,26 +34,26 @@ const (
// BackendConfigs contains the configuration of multiple backends and the current backend.
type BackendConfigs struct {
// Current is the name of the current used backend.
Current string `yaml:"current,omitempty"`
Current string `yaml:"current,omitempty" json:"current,omitempty"`

// Backends contains the types and configs of multiple backends, whose key is the backend name.
Backends map[string]*BackendConfig `yaml:"backends,omitempty,inline"`
Backends map[string]*BackendConfig `yaml:",omitempty,inline" json:",omitempty,inline"`
}

// BackendConfig contains the type and configs of a backend, which is used to store Spec, State and Workspace.
type BackendConfig struct {
// Type is the backend type, supports BackendTypeLocal, BackendTypeMysql, BackendTypeOss, BackendTypeS3.
Type string `yaml:"type,omitempty"`
Type string `yaml:"type,omitempty" json:"type,omitempty"`

// Configs contains config items of the backend, whose keys differ from different backend types.
Configs map[string]any `yaml:"configs,omitempty"`
Configs map[string]any `yaml:"configs,omitempty" json:"configs,omitempty"`
}

// BackendLocalConfig contains the config of using local file system as backend, which can be converted
// from BackendConfig if Type is BackendTypeLocal.
type BackendLocalConfig struct {
// Path of the directory to store the files.
Path string
Path string `yaml:"path,omitempty" json:"path,omitempty"`
}

// BackendMysqlConfig contains the config of using mysql database as backend, which can be converted
Expand Down
Loading
Loading