config

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleConfig added in v0.39.0

func ExampleConfig() (string, error)

ExampleConfig returns a valid JSON string with the config structure

func OpenOnEditor added in v0.30.0

func OpenOnEditor(configFile string) error

OpenOnEditor opens the given config file on the user's default text editor.

func View added in v0.31.0

func View(config *Config) error

View prints a simplified view of the config to the standard output

Types

type Auth

type Auth struct {
	GithubToken        string `json:"github_token"`
	SSHKeyPath         string `json:"ssh_key_path" validate:"filepath"`
	AWSAccessKeyID     string `json:"aws_access_key_id"`
	AWSSecretAccessKey string `json:"aws_secret_access_key"`
	AWSSessionToken    string `json:"aws_session_token"`
	AWSDefaultRegion   string `json:"aws_default_region"`
}

Auth

type ChartsRelease added in v0.38.7

type ChartsRelease struct {
	Workspace     string   `json:"workspace" validate:"required,dirpath"`
	ChartsRepoURL string   `json:"charts_repo_url" validate:"required"`
	ChartsForkURL string   `json:"charts_fork_url" validate:"required"`
	BranchLines   []string `json:"branch_lines" validate:"required"`
}

ChartsRelease

type Config

type Config struct {
	User      *User          `json:"user"`
	K3s       *K3s           `json:"k3s" validate:"omitempty"`
	Rancher   *Rancher       `json:"rancher" validate:"omitempty"`
	RKE2      *RKE2          `json:"rke2" validate:"omitempty"`
	Charts    *ChartsRelease `json:"charts" validate:"omitempty"`
	Auth      *Auth          `json:"auth"`
	Dashboard *Dashboard     `json:"dashboard"`
}

Config

func Load

func Load(configFile string) (*Config, error)

Load reads the given config file and returns a struct containing the necessary values to perform a release.

func Read added in v0.39.0

func Read(r io.Reader) (*Config, error)

Read reads the given JSON file with the config and returns a struct

func (*Config) Validate added in v0.39.0

func (c *Config) Validate() error

type Dashboard added in v0.44.0

type Dashboard struct {
	Versions           map[string]DashboardRelease `json:"versions" validate:"dive"`
	RepoOwner          string                      `json:"repo_owner" validate:"required"`
	RepoName           string                      `json:"repo_name" validate:"required"`
	UIRepoOwner        string                      `json:"ui_repo_owner" validate:"required"`
	UIRepoName         string                      `json:"ui_repo_name" validate:"required"`
	RancherRepoOwner   string                      `json:"rancher_repo_owner" validate:"required"`
	RancherRepoName    string                      `json:"rancher_repo_name" validate:"required"`
	RancherUpstreamURL string                      `json:"rancher_upstream_url" validate:"required"`
}

Dashboard

type DashboardRelease added in v0.44.0

type DashboardRelease struct {
	PreviousTag          string `json:"previous_tag" validate:"required"`
	ReleaseBranch        string `json:"release_branch" validate:"required"`
	UIReleaseBranch      string `json:"ui_release_branch" validate:"required"`
	UIPreviousTag        string `json:"ui_previous_tag" validate:"required"`
	Tag                  string
	RancherReleaseBranch string `json:"rancher_release_branch" validate:"required"`
	RancherUpstreamURL   string
	DryRun               bool `json:"dry_run"`
}

type K3s

type K3s struct {
	Versions map[string]K3sRelease `json:"versions" validate:"dive,omitempty"`
}

K3s

type K3sRelease

type K3sRelease struct {
	OldK8sVersion                 string `json:"old_k8s_version" validate:"required"`
	NewK8sVersion                 string `json:"new_k8s_version" validate:"required"`
	OldK8sClient                  string `json:"old_k8s_client" validate:"required"`
	NewK8sClient                  string `json:"new_k8s_client" validate:"required"`
	OldSuffix                     string `json:"old_suffix" validate:"required,startswith=k3s"`
	NewSuffix                     string `json:"new_suffix" validate:"required,startswith=k3s"`
	ReleaseBranch                 string `json:"release_branch" validate:"required"`
	Workspace                     string `json:"workspace" validate:"required,dirpath"`
	NewGoVersion                  string `json:"-"`
	K3sRepoOwner                  string `json:"k3s_repo_owner" validate:"required"`
	SystemAgentInstallerRepoOwner string `json:"system_agent_installer_repo_owner" validate:"required"`
	K8sRancherURL                 string `json:"k8s_rancher_url" validate:"required"`
	K3sUpstreamURL                string `json:"k3s_upstream_url" validate:"required"`
	DryRun                        bool   `json:"dry_run"`
}

K3sRelease

type RKE2

type RKE2 struct {
	Versions []string `json:"versions"`
}

RKE2

type Rancher added in v0.34.0

type Rancher struct {
	Versions map[string]RancherRelease `json:"versions" validate:"dive,omitempty"`
}

Rancher

type RancherRelease added in v0.34.0

type RancherRelease struct {
	ReleaseBranch    string `json:"release_branch" validate:"required"`
	RancherRepoOwner string `json:"rancher_repo_owner" validate:"required"`
}

RancherRelease

type UIRelease added in v0.44.0

type UIRelease struct {
	UIRepoOwner   string `json:"ui_repo_owner" validate:"required"`
	UIRepoName    string `json:"ui_repo_name"`
	PreviousTag   string `json:"previous_tag"`
	ReleaseBranch string `json:"release_branch" validate:"required"`
	DryRun        bool   `json:"dry_run"`
}

type User

type User struct {
	Email          string `json:"email" validate:"required,email"`
	GithubUsername string `json:"github_username" validate:"required"`
}

User

Jump to

Keyboard shortcuts

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