app

package
v0.3.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypeUserRepo ConfigType = ""
	ConfigTypeNone     ConfigType = "NONE"

	ConfigModeClusterOnly  ConfigMode = "clusterOnly"
	ConfigModeUserRepo     ConfigMode = "userRepo"
	ConfigModeExternalRepo ConfigMode = "externalRepo"

	ResourceKindApplication    ResourceKind = "Application"
	ResourceKindSecret         ResourceKind = "Secret"
	ResourceKindGitRepository  ResourceKind = "GitRepository"
	ResourceKindHelmRepository ResourceKind = "HelmRepository"
	ResourceKindKustomization  ResourceKind = "Kustomization"
	ResourceKindHelmRelease    ResourceKind = "HelmRelease"

	WeGOAppIdentifierLabelKey = "wego.weave.works/app-identifier"
)
View Source
const (
	DefaultPath           = "./"
	DefaultBranch         = "main"
	DefaultDeploymentType = "kustomize"
	AddCommitMessage      = "Add App manifests"
)
View Source
const (
	RemoveCommitMessage = "Remove App manifests"
)

Variables

This section is empty.

Functions

func CloneRepo added in v0.3.2

func CloneRepo(client git.Git, url string, branch string, dryRun bool) (func(), string, error)

CloneRepo uses the git client to clone the reop from the URL and branch. It clones into a temp directory and returns a function to use by the caller for cleanup. The temp directory is also returned.

func CommitAndPush added in v0.3.2

func CommitAndPush(client git.Git, commitMsg string, dryRun bool, logger logger.Logger, filters ...func(string) bool) error

func IsClusterReady added in v0.2.5

func IsClusterReady(l logger.Logger, k kube.Kube) error

func IsExternalConfigUrl added in v0.2.5

func IsExternalConfigUrl(url string) bool

Types

type AddParams

type AddParams struct {
	Dir                        string
	Name                       string
	Url                        string
	Path                       string
	Branch                     string
	DeploymentType             string
	Chart                      string
	SourceType                 wego.SourceType
	AppConfigUrl               string
	Namespace                  string
	DryRun                     bool
	AutoMerge                  bool
	GitProviderToken           string
	HelmReleaseTargetNamespace string
	MigrateToNewDirStructure   func(string) string
}

type App

type App struct {
	Context     context.Context
	Osys        osys.Osys
	AppGit      git.Git
	ConfigGit   git.Git
	Flux        flux.Flux
	Kube        kube.Kube
	Logger      logger.Logger
	GitProvider gitproviders.GitProvider
}

func (*App) Add

func (a *App) Add(params AddParams) error

func (*App) Get

func (a *App) Get(name types.NamespacedName) (*wego.Application, error)

func (*App) GetCommits added in v0.2.3

func (a *App) GetCommits(params CommitParams, application *wego.Application) ([]gitprovider.Commit, error)

GetCommits gets a list of commits from the repo/branch saved in the app manifest

func (*App) Pause added in v0.2.2

func (a *App) Pause(params PauseParams) error

func (*App) Remove added in v0.2.3

func (a *App) Remove(params RemoveParams) error

Remove removes the Weave GitOps automation for an application

func (*App) Status added in v0.2.1

func (a *App) Status(params StatusParams) (string, string, error)

func (*App) Unpause added in v0.2.2

func (a *App) Unpause(params UnpauseParams) error

type AppManifest added in v0.3.2

type AppManifest interface {
	ToAppYAML() []byte
}

type AppResourceInfo added in v0.2.2

type AppResourceInfo struct {
	wego.Application
	// contains filtered or unexported fields
}

type AppService

type AppService interface {
	// Add adds a new application to the cluster
	Add(params AddParams) error
	// Get returns a given applicaiton
	Get(name types.NamespacedName) (*wego.Application, error)
	// GetCommits returns a list of commits for an application
	GetCommits(params CommitParams, application *wego.Application) ([]gitprovider.Commit, error)
	// Remove removes an application from the cluster
	Remove(params RemoveParams) error
	// Status returns flux resources status and the last successful reconciliation time
	Status(params StatusParams) (string, string, error)
	// Pause pauses the gitops automation for an app
	Pause(params PauseParams) error
	// Unpause resumes the gitops automation for an app
	Unpause(params UnpauseParams) error
}

AppService entity that manages applications

func New

func New(ctx context.Context, logger logger.Logger, appGit, configGit git.Git, gitProvider gitproviders.GitProvider, flux flux.Flux, kube kube.Kube, osys osys.Osys) AppService

type Automation added in v0.3.2

type Automation interface {
	ToAutomationYAML() []byte
}

type CommitParams added in v0.2.3

type CommitParams struct {
	Name             string
	Namespace        string
	GitProviderToken string
	PageSize         int
	PageToken        int
}

type ConfigMode added in v0.2.3

type ConfigMode string

type ConfigType

type ConfigType string

type GeneratedSecretName added in v0.2.5

type GeneratedSecretName string

func CreateRepoSecretName added in v0.2.5

func CreateRepoSecretName(targetName string, repoURL string) GeneratedSecretName

func (GeneratedSecretName) String added in v0.2.5

func (s GeneratedSecretName) String() string

type PauseParams added in v0.2.2

type PauseParams struct {
	Name      string
	Namespace string
}

type RemoveParams added in v0.2.3

type RemoveParams struct {
	Name             string
	Namespace        string
	DryRun           bool
	GitProviderToken string
}

type ResourceKind added in v0.2.3

type ResourceKind string

func (ResourceKind) ToGVR added in v0.2.5

type ResourceRef added in v0.2.2

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

type Source added in v0.3.2

type Source interface {
	ToSourceYAML() []byte
}

type StatusParams added in v0.2.1

type StatusParams struct {
	Namespace string
	Name      string
}

type UnpauseParams added in v0.2.2

type UnpauseParams struct {
	Name      string
	Namespace string
}

Jump to

Keyboard shortcuts

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