argocd

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongContentType = errors.New("Content-Type header is not set to 'application/json'")
	ErrReadingBody      = errors.New("couldn't read request body")
	ErrMarshallingBody  = errors.New("couldn't unmarshal request body")
)

Functions

func ArgocdPlugin

func ArgocdPlugin(plugin Executor) func(w http.ResponseWriter, req *http.Request)

func GetDiff added in v0.0.7

GetDiff gets a diff between two unstructured objects to stdout using an external diff utility

Types

type ActionSpec

type ActionSpec struct {
	App     *AppActionSpec `json:"app,omitempty"`
	Timeout string         `json:"timeout,omitempty"`
}

type ApiExecutor

type ApiExecutor struct {
	// contains filtered or unexported fields
}

func NewApiExecutor

func NewApiExecutor(apiClient apiclient.Client) ApiExecutor

func (*ApiExecutor) Execute

type App

type App struct {
	// Namespace is the namespace in which the app is installed. If empty, assume the same namespace as the Argo CD
	// API server.
	Namespace string `json:"namespace,omitempty"`
	// Name is the name of the app (not prefixed with {namespace}/).
	Name string `json:"name,omitempty"`
}

App specifies the app to be synced.

type AppActionSpec

type AppActionSpec struct {
	// A sync action
	Sync *SyncAction `json:"sync,omitempty"`
	Diff *DiffAction `json:"diff,omitempty"`
}

AppActionSpec describes all possible actions that can be taken by the plugin.

type DiffAction added in v0.0.7

type DiffAction struct {
	App         `json:"app,omitempty"`
	Revision    string `json:"revision,omitempty"`
	Refresh     bool   `json:"refresh,omitempty"`
	HardRefresh bool   `json:"hardRefresh,omitempty"`
}

type Executor

type Executor interface {
	// Execute runs commands based on the args provided from the workflow
	Execute(args executor.ExecuteTemplateArgs) executor.ExecuteTemplateReply
}

Executor performs the tasks requested by the Workflow.

type PluginSpec

type PluginSpec struct {
	ArgoCD ActionSpec `json:"argocd,omitempty"`
}

PluginSpec represents the `plugin` block of an Argo Workflows template.

type SyncAction

type SyncAction struct {
	// Apps is a YAML array of objects representing the apps to be synced. For example, `[{name: my-app}, {name: my-app, namespace: app-ns}]`.
	Apps string `json:"apps,omitempty"`
	// Options is a YAML array of option=value pairs to configure the sync operation. https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/
	Options string `json:"options,omitempty"`
}

SyncAction describes an action that triggers an argocd sync.

Jump to

Keyboard shortcuts

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