Documentation ¶
Index ¶
- Constants
- type ArgoCD
- type Args
- func (a *Args) Append(vs ...interface{}) *Args
- func (a *Args) AppendStrings(s ...string) *Args
- func (a *Args) AppendValueFromOutput(ref string) *Args
- func (a *Args) AppendValueFromOutputWithPrefix(prefix, ref string) *Args
- func (a *Args) AppendValueIfOutput(v, ref string) *Args
- func (a *Args) Collect(get func(string) (string, error)) ([]string, error)
- func (a *Args) CopyFrom(other *Args) *Args
- func (a *Args) Len() int
- func (a *Args) MustCollect(get func(string) (string, error)) []string
- func (a *Args) String() string
- func (a *Args) Visit(str func(string), out func(DynArg), flag func(KargoValueProvider))
- type BashScript
- type Cmd
- type Compose
- type Config
- type DynArg
- type Env
- type Generator
- type GetValue
- type Helm
- type Join
- type KargoArgsAppender
- type KargoValueProvider
- type Kompose
- type Kustomize
- type KustomizeGit
- type KustomizeImage
- type KustomizeImages
- type PullRequestOptions
- type Set
- type Target
- type Upload
Constants ¶
View Source
const ( // FieldTagKargo is used to defining kargo flags. // Currently, this is used to exclude the field from the field-to-flag conversion. // Example: Name `yaml:"name" kargo:""` FieldTagKargo = "kargo" // FieldTagArgoCD is used to defining helm-upgrade flags FieldTagCompose = "compose" FieldTagHelm = "helm" FieldTagKustomize = "kustomize" FieldTagKompose = "kompose" // FieldTagArgoCDApp is used to defining argocd-app-create flags FieldTagArgoCDApp = "argocd-app" )
View Source
const ( KustomizeStrategyBuildAndKubectlApply = "BuildAndKubectlApply" KustomizeStrategySetImageAndCreatePR = "SetImageAndCreatePullRequest" )
View Source
const ( Plan = iota Apply )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgoCD ¶
type ArgoCD struct { Repo string `yaml:"repo" kargo:""` // Branch is the branch to be used for the deployment. // This isn't part of the arguments for argocd-repo-add because // it doesn't support branch. // However, we use it when you want to push manifests to a branch // and trigger a deployment. Branch string `yaml:"branch" kargo:""` RepoFrom string `yaml:"repoFrom" kargo:""` RepoSSHPrivateKeyPath string `yaml:"repoSSHPrivateKeyPath" kargo:""` RepoSSHPrivateKeyPathFrom string `yaml:"repoSSHPrivateKeyPathFrom" kargo:""` Path string `yaml:"path" kargo:""` PathFrom string `yaml:"pathFrom" kargo:""` Upload []Upload `yaml:"upload" kargo:""` DirRecurse bool `yaml:"dirRecurse" argocd-app:"directory-recurse,paramless"` // Server is the ArgoCD server to be used for the deployment. Server string `yaml:"server" kargo:""` // ServerFrom is the key to be used to get the ArgoCD server from the environment. ServerFrom string `yaml:"serverFrom" kargo:""` // Username is the username to be used for the deployment. Username string `yaml:"username" kargo:""` // UsernameFrom is the key to be used to get the username from the environment. UsernameFrom string `yaml:"usernameFrom" kargo:""` // Password is the password to be used for the deployment. Password string `yaml:"password" kargo:""` // PasswordFrom is the key to be used to get the password from the environment. PasswordFrom string `yaml:"passwordFrom" kargo:""` // Insecure is set to true if the user wants to skip TLS verification. Insecure bool `yaml:"insecure" kargo:""` // InsecureFrom is the key to be used to get the insecure flag from the environment. InsecureFrom string `yaml:"insecureFrom" kargo:""` // Project is the ArgoCD project to be used for the deployment. Project string `yaml:"project" argocd-app:"project"` // Push is set to true if the user wants kargo to automatically // - git-clone the repo // - git-add the files in the config.Path // - git-commit // - git-push // so that it triggers the deployment. Push bool `yaml:"push" kargo:""` // DestName is the name of the K8s cluster where the deployment is to be done. DestName string `yaml:"name" kargo:""` // DestNameFrom is the key to be used to get the target K8s cluster name from the environment. DestNameFrom string `yaml:"nameFrom" kargo:""` // DestNamespace is the namespace to be used for the deployment. DestNamespace string `yaml:"namespace" kargo:""` // DestServer is the Kubernetes API endpoint of the cluster where the deployment is to be done. DestServer string `yaml:"destServer" kargo:""` // DestServerFrom is the key to be used to get the target Kubernetes API endpoint from the environment. DestServerFrom string `yaml:"destServerFrom" kargo:""` // ConfigManagementPlugin is the config management plugin to be used. ConfigManagementPlugin string `yaml:"configManagementPlugin" argocd-app:"config-management-plugin"` }
type Args ¶
type Args struct {
// contains filtered or unexported fields
}
func (*Args) AppendStrings ¶
func (*Args) AppendValueFromOutput ¶
func (*Args) AppendValueFromOutputWithPrefix ¶
func (*Args) AppendValueIfOutput ¶
type BashScript ¶
type BashScript struct {
Script *Args
}
func NewBashScript ¶
func NewBashScript(args *Args) *BashScript
func (*BashScript) KargoValue ¶
func (b *BashScript) KargoValue(get GetValue) (string, error)
type Cmd ¶
type Cmd struct { ID string Name string Args *Args Dir string // AddEnv is a map of environment variables to add to the command. // That is, the command will be run with the environment variables // specified in AddEnv in addition to the environment variables provided // by the current process(os.Environ). AddEnv map[string]string }
type Config ¶
type Config struct { // Name is the application name. // It defaults to the basename of the path if // kargo is run as a command. Name string `yaml:"name" argocd-app:",arg"` Path string `yaml:"path" kargo:""` PathFrom string `yaml:"pathFrom" kargo:""` Env []Env `yaml:"env" argocd-app:"plugin-env"` Compose *Compose `yaml:"compose"` Kompose *Kompose `yaml:"kompose"` Kustomize *Kustomize `yaml:"kustomize"` Helm *Helm `yaml:"helm"` ArgoCD *ArgoCD `yaml:"argocd"` }
type DynArg ¶
type DynArg struct { // Prefix is a prefix to be prepended to the value of FromOutput. // For example, Prefix=foo= and FromOutput=bar will result in foo=$bar. // This is handy when you need to compose a command-line argument like --foo=$bar, // instead of --foo bar. Prefix string // FromOutput is a reference to an output of another kargo command. FromOutput string // Value is the value used when the FromOutput is provided and the output is non-empty. Value string }
DynArg is a dynamic argument that is resolved at runtime. It is used to compose a command-line argument like --foo=$bar, where $bar is a value of another kargo command.
type Env ¶
type Generator ¶
type Generator struct { GetValue GetValue // TempDir is the directory to write kustomize-build output // for use by kubectl-apply. TempDir string // TailLogs is set to true if you want kargo to tail the logs TailLogs bool // ToolsCommand is the command to run kargo tools. // // If you set this to e.g. `mycmd tools`, kargo will run // `mycmd tools <tool> <args...>` if needed. // // An example of a tool is `create-pullrequest`, whose command becomes // `mycmd tools create-pullrequest <args...>`. // // This needs to be set if you want to use kargo tools. // If this is not set and kargo required to run a tool, // kargo will return an error. ToolsCommand []string // ToolName is the name of the tool to be used for gitops. // It becomes the prefix of the branch name to be created, // and the prefix of the environment variable name to be used. ToolName string // PullRequestOutputFile is the path to the file to write the pull request info to. PullRequestOutputFile string }
Generator generates commands and config files required to plan and apply the deployment denoted by Config. This and Config is usually the two most interesting structs when you are going to use kargo as a Go library.
type Helm ¶
type Helm struct { Repo string `yaml:"repo" helm:""` Chart string `yaml:"chart" helm:"" argocd-app:"helm-chart"` Version string `yaml:"version" argocd-app:"revision"` Set []Set `yaml:"set" helm:"set" argocd-app:"helm-set"` ValuesFiles []string `yaml:"valuesFiles" helm:"values" argocd-app:"values"` }
type KargoArgsAppender ¶
type KargoValueProvider ¶
type Kustomize ¶
type Kustomize struct { // Strategy is the strategy to be used for the deployment. // // The supported values are: // - BuildAndKubectlApply // - SetImageAndCreatePullRequest // // BuildAndKubectlApply is the default strategy. // It runs kustomize build and kubectl apply to deploy the application. // // SetImageAndCreatePullRequest runs kustomize edit set image and creates a pull request. // It's useful to trigger a deployment workflow in CI/CD. Strategy string `yaml:"strategy" kargo:""` Images KustomizeImages `yaml:"images" argocd-app:"kustomize-image"` Git KustomizeGit `yaml:"git" kargo:""` }
type KustomizeGit ¶ added in v0.2.0
type KustomizeImage ¶
type KustomizeImages ¶
type KustomizeImages []KustomizeImage
func (KustomizeImages) KargoAppendArgs ¶
func (i KustomizeImages) KargoAppendArgs(args *Args, key string) (*Args, error)
type PullRequestOptions ¶ added in v0.8.1
type PullRequestOptions struct { // AssigneeIDs is the list of GitHub user IDs to assign to the pull request. // Each ID can be either an integer or a string. AssigneeIDs []string // OutputFile is the path to the file to write the pull request info to. OutputFile string // GitUserName is the name of the user to use for git commits. GitUserName string // GitUserEmail is the email of the user to use for git commits. GitUserEmail string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.