Documentation ¶
Index ¶
- Constants
- Variables
- func AddValuesToChart(name string, values []byte, verbose bool) (string, func(), error)
- func GenerateQuestions(schema []byte, batchMode bool, askExisting bool, basePath string, ...) ([]byte, error)
- func ProcessValues(schema []byte, name string, gitOpsURL string, teamName string, basePath string, ...) (string, func(), error)
- func StashValues(values []byte, name string, jxClient versioned.Interface, ns string, ...) (bool, *jenkinsv1.App, error)
- type AppType
- type ChartDetails
- type GitOpsOptions
- func (o *GitOpsOptions) AddApp(app string, dir string, version string, repository string, alias string, ...) error
- func (o *GitOpsOptions) DeleteApp(app string, alias string, autoMerge bool) error
- func (o *GitOpsOptions) GetApps(appNames map[string]bool, expandFn func([]string) (*v1.AppList, error)) (*v1.AppList, error)
- func (o *GitOpsOptions) UpgradeApp(app string, version string, repository string, username string, ...) error
- type HelmOpsOptions
- func (o *HelmOpsOptions) AddApp(app string, chart string, name string, version string, values []byte, ...) error
- func (o *HelmOpsOptions) DeleteApp(app string, releaseName string, purge bool) error
- func (o *HelmOpsOptions) UpgradeApp(app string, version string, repository string, username string, ...) error
- type InstallOptions
- func (o *InstallOptions) AddApp(app string, version string, repository string, username string, ...) error
- func (o *InstallOptions) DeleteApp(app string, alias string, releaseName string, purge bool) error
- func (o *InstallOptions) GetApps(appNames []string) (apps *jenkinsv1.AppList, err error)
- func (o *InstallOptions) UpgradeApp(app string, version string, repository string, username string, ...) error
Constants ¶
const ( // AppPodTemplateName the name of the pod template to store default settings for pods executing an App extension step AppPodTemplateName = "app-extension" // AppTypeLabel label used to store the app type in the App CRD. AppTypeLabel = "jenkins.io/app-type" // Controller is an App type which installs a controller into the cluster. Controller AppType = iota // PipelineExtension is an App type which wants to modify the build pipeline by being executed as part of the meta pipeline. PipelineExtension )
These are the different App types
const (
//ValuesAnnotation is the name of the annotation used to stash values
ValuesAnnotation = "jenkins.io/values.yaml"
)
Variables ¶
var AllTypes = []AppType{ Controller, PipelineExtension, }
AllTypes exposes all App types in a slice
Functions ¶
func AddValuesToChart ¶
AddValuesToChart adds a values file to the chart rooted at dir
func GenerateQuestions ¶
func GenerateQuestions(schema []byte, batchMode bool, askExisting bool, basePath string, secretURLClient secreturl.Client, existing map[string]interface{}, vaultScheme string, handles util.IOFileHandles) ([]byte, error)
GenerateQuestions asks questions based on the schema
func ProcessValues ¶
func ProcessValues( schema []byte, name string, gitOpsURL string, teamName string, basePath string, batchMode bool, askExisting bool, secretURLClient secreturl.Client, existing map[string]interface{}, vaultScheme string, handles util.IOFileHandles, verbose bool) (string, func(), error)
ProcessValues is responsible for taking a schema, asking questions of the user (using in, out and outErr), and generating a yaml file that contains the answers. The path to the yaml file is returned, along with a function to cleanup temporary resources, including the yaml file. The gitOpsURL, if specified, is used to determine the path to store the secrets in the vault, otherwise the team name is used. If batchMode is true, it alters the way questions are asked, trying to use existing answers or defaults where possible. If askExisting is true then all questions, even those with existing answers are asked. The vault client is used to store secrets, and the secretsScheme is used as the scheme part of the url to the secret.
func StashValues ¶
func StashValues(values []byte, name string, jxClient versioned.Interface, ns string, chartDir string, repository string) (bool, *jenkinsv1.App, error)
StashValues takes the values used to configure an app and annotates the APP CRD with them allowing them to be used at a later date e.g. when the app is upgraded
Types ¶
type ChartDetails ¶
ChartDetails are details about a chart returned by the chart interrogator
type GitOpsOptions ¶
type GitOpsOptions struct {
*InstallOptions
}
GitOpsOptions is the options used for Git Operations for apps
func (*GitOpsOptions) AddApp ¶
func (o *GitOpsOptions) AddApp(app string, dir string, version string, repository string, alias string, autoMerge bool) error
AddApp adds the app with version rooted in dir from the repository. An alias can be specified.
func (*GitOpsOptions) DeleteApp ¶
func (o *GitOpsOptions) DeleteApp(app string, alias string, autoMerge bool) error
DeleteApp deletes the app with alias
func (*GitOpsOptions) GetApps ¶
func (o *GitOpsOptions) GetApps(appNames map[string]bool, expandFn func([]string) (*v1.AppList, error)) (*v1.AppList, error)
GetApps retrieves all the apps information for the given appNames from the repository and / or the CRD API
func (*GitOpsOptions) UpgradeApp ¶
func (o *GitOpsOptions) UpgradeApp(app string, version string, repository string, username string, password string, alias string, interrogateChartFunc func(dir string, existing map[string]interface{}) (*ChartDetails, error), autoMerge bool) error
UpgradeApp upgrades the app (or all apps if empty) to a version ( or latest if empty) from a repository with username and password. If one app is being upgraded an alias can be specified.
type HelmOpsOptions ¶
type HelmOpsOptions struct {
*InstallOptions
}
HelmOpsOptions is the options used for Helm Operations for apps
func (*HelmOpsOptions) AddApp ¶
func (o *HelmOpsOptions) AddApp(app string, chart string, name string, version string, values []byte, repository string, username string, password string, releaseName string, setValues []string, helmUpdate bool) error
AddApp adds the app with a version and releaseName from the chart from the repository with username and password. A values file or a slice of name=value pairs can be passed in to configure the chart
func (*HelmOpsOptions) DeleteApp ¶
func (o *HelmOpsOptions) DeleteApp(app string, releaseName string, purge bool) error
DeleteApp deletes the app, optionally allowing the user to set the releaseName
func (*HelmOpsOptions) UpgradeApp ¶
func (o *HelmOpsOptions) UpgradeApp(app string, version string, repository string, username string, password string, releaseName string, alias string, helmUpdate bool) error
UpgradeApp upgrades the app with releaseName (or all apps if the app name is empty) to the specified version ( or the latest version if the version is empty) using the repository with username and password
type InstallOptions ¶
type InstallOptions struct { Helmer helm.Helmer KubeClient kubernetes.Interface InstallTimeout string JxClient versioned.Interface Namespace string EnvironmentCloneDir string GitProvider gits.GitProvider Gitter gits.Gitter Verbose bool DevEnv *jenkinsv1.Environment BatchMode bool IOFileHandles util.IOFileHandles GitOps bool TeamName string BasePath string VaultClient vault.Client AutoMerge bool SecretsScheme string // contains filtered or unexported fields }
InstallOptions are shared options for installing, removing or upgrading apps for either GitOps or HelmOps
func (*InstallOptions) AddApp ¶
func (o *InstallOptions) AddApp(app string, version string, repository string, username string, password string, releaseName string, valuesFiles []string, setValues []string, alias string, helmUpdate bool) error
AddApp adds the app at a particular version ( or latest if not specified) from the repository with username and password. A releaseName can be specified. Values can be passed with in files or as a slice of name=value pairs. An alias can be specified. GitOps or HelmOps will be automatically chosen based on the o.GitOps flag
func (*InstallOptions) DeleteApp ¶
DeleteApp deletes the app. An alias and releaseName can be specified. GitOps or HelmOps will be automatically chosen based on the o.GitOps flag
func (*InstallOptions) GetApps ¶
func (o *InstallOptions) GetApps(appNames []string) (apps *jenkinsv1.AppList, err error)
GetApps gets a list of installed apps
func (*InstallOptions) UpgradeApp ¶
func (o *InstallOptions) UpgradeApp(app string, version string, repository string, username string, password string, releaseName string, alias string, update bool, askExisting bool) error
UpgradeApp upgrades the app (or all apps if empty) to a particular version ( or the latest if not specified) from the repository with username and password. An alias can be specified. GitOps or HelmOps will be automatically chosen based on the o.GitOps flag