app

package
v0.5.1-rc0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPath           = "./"
	DefaultBranch         = "main"
	DefaultDeploymentType = "kustomize"
)
View Source
const (
	WeGOAppIdentifierLabelKey = "wego.weave.works/app-identifier"
)

Variables

This section is empty.

Functions

This section is empty.

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
}

func (AddParams) IsHelmRepository added in v0.5.0

func (a AddParams) IsHelmRepository() bool

type AppService

type AppService interface {
	// Add adds a new application to the cluster
	Add(configGit git.Git, gitProvider gitproviders.GitProvider, 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(gitProvider gitproviders.GitProvider, params CommitParams, application *wego.Application) ([]gitprovider.Commit, error)
	// Remove removes an application from the cluster
	Remove(configGit git.Git, gitProvider gitproviders.GitProvider, 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
	// Sync trigger reconciliation loop for an application
	Sync(params SyncParams) error
}

AppService entity that manages applications

func New

func New(ctx context.Context, logger logger.Logger, flux flux.Flux, kube kube.Kube, osys osys.Osys) AppService

type AppSvc added in v0.5.0

type AppSvc struct {
	Context context.Context
	Osys    osys.Osys
	Flux    flux.Flux
	Kube    kube.Kube
	Logger  logger.Logger
	Clock   clock.Clock
}

func (*AppSvc) Add added in v0.5.0

func (a *AppSvc) Add(configGit git.Git, gitProvider gitproviders.GitProvider, params AddParams) error

func (*AppSvc) Get added in v0.5.0

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

func (*AppSvc) GetCommits added in v0.5.0

func (a *AppSvc) GetCommits(gitProvider gitproviders.GitProvider, params CommitParams, application *wego.Application) ([]gitprovider.Commit, error)

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

func (*AppSvc) Pause added in v0.5.0

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

func (*AppSvc) Remove added in v0.5.0

func (a *AppSvc) Remove(configGit git.Git, gitProvider gitproviders.GitProvider, params RemoveParams) error

Remove removes the Weave GitOps automation for an application

func (*AppSvc) Status added in v0.5.0

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

func (*AppSvc) Sync added in v0.5.0

func (a *AppSvc) Sync(params SyncParams) error

Sync triggers the reconcile loop for an application

func (*AppSvc) Unpause added in v0.5.0

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

type CommitParams added in v0.2.3

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

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 StatusParams added in v0.2.1

type StatusParams struct {
	Namespace string
	Name      string
}

type SyncParams added in v0.4.1

type SyncParams struct {
	Name      string
	Namespace 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