automation

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppCRDPath              = "wego-system.yaml"
	RuntimePath             = "gitops-runtime.yaml"
	SourcePath              = "flux-source-resource.yaml"
	SystemKustomizationPath = "kustomization.yaml"
	SystemKustResourcePath  = "flux-system-kustomization-resource.yaml"
	UserKustResourcePath    = "flux-user-kustomization-resource.yaml"
	WegoAppPath             = "wego-app.yaml"
	WegoConfigPath          = "wego-config.yaml"

	WegoConfigMapName = "weave-gitops-config"
)
View Source
const (
	MaxKubernetesResourceNameLength = 63

	WeGOAppIdentifierLabelKey = "wego.weave.works/app-identifier"
)
View Source
const (
	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"
)

Variables

This section is empty.

Functions

func AddWegoIgnore

func AddWegoIgnore(sourceManifest []byte) ([]byte, error)

func AppAutomationDeployPath

func AppAutomationDeployPath(a models.Application) string

func AppAutomationKustomizePath

func AppAutomationKustomizePath(a models.Application) string

func AppAutomationSourcePath

func AppAutomationSourcePath(a models.Application) string

func AppDeployName

func AppDeployName(a models.Application) string

func AppToWegoApp

func AppToWegoApp(app models.Application) wego.Application

func AppYamlDir

func AppYamlDir(a models.Application) string

func AppYamlPath

func AppYamlPath(a models.Application) string

func ApplicationNameTooLong

func ApplicationNameTooLong(name string) bool

func AutomationUserKustomizePath

func AutomationUserKustomizePath(clusterName string) string

func ConstrainResourceName

func ConstrainResourceName(str string) string

func CreateClusterSourceName added in v0.6.1

func CreateClusterSourceName(gitSourceURL gitproviders.RepoURL) string

The cluster source name and the app source name need to remain distinct to prevent https://github.com/weaveworks/weave-gitops/issues/1075 from coming back. (hence the `-auto-` addition)

func CreateKustomize

func CreateKustomize(name, namespace string, resources ...string) types.Kustomization

func GenerateResourceName

func GenerateResourceName(url gitproviders.RepoURL) string

func GetAppHash

func GetAppHash(a models.Application) string

func GetClusterHash added in v0.6.1

func GetClusterHash(c models.Cluster) string

func GetOrCreateKustomize

func GetOrCreateKustomize(filename, name, namespace string) (types.Kustomization, error)

func WegoAppToApp

func WegoAppToApp(app wego.Application) (models.Application, error)

Types

type ApplicationAutomation added in v0.6.1

type ApplicationAutomation struct {
	AppYaml       AutomationManifest
	AppAutomation AutomationManifest
	AppSource     AutomationManifest
	AppKustomize  AutomationManifest
}

func (ApplicationAutomation) Manifests added in v0.6.1

func (aa ApplicationAutomation) Manifests() []AutomationManifest

type AutomationGen

type AutomationGen struct {
	GitProvider gitproviders.GitProvider
	Flux        flux.Flux
	Logger      logger.Logger
}

func (*AutomationGen) GenerateApplicationAutomation added in v0.6.1

func (a *AutomationGen) GenerateApplicationAutomation(ctx context.Context, app models.Application, clusterName string) (ApplicationAutomation, error)

func (*AutomationGen) GenerateClusterAutomation added in v0.6.1

func (a *AutomationGen) GenerateClusterAutomation(ctx context.Context, cluster models.Cluster, configURL gitproviders.RepoURL, namespace string) (ClusterAutomation, error)

func (*AutomationGen) GetSecretRefForPrivateGitSources added in v0.6.1

func (a *AutomationGen) GetSecretRefForPrivateGitSources(ctx context.Context, url gitproviders.RepoURL) (GeneratedSecretName, error)

type AutomationGenerator

type AutomationGenerator interface {
	GenerateApplicationAutomation(ctx context.Context, app models.Application, clusterName string) (ApplicationAutomation, error)
	GenerateClusterAutomation(ctx context.Context, cluster models.Cluster, configURL gitproviders.RepoURL, namespace string) (ClusterAutomation, error)
	GetSecretRefForPrivateGitSources(ctx context.Context, url gitproviders.RepoURL) (GeneratedSecretName, error)
}

func NewAutomationGenerator

func NewAutomationGenerator(gp gitproviders.GitProvider, flux flux.Flux, logger logger.Logger) AutomationGenerator

type AutomationManifest

type AutomationManifest struct {
	Path    string
	Content []byte
}

type ClusterAutomation added in v0.6.1

type ClusterAutomation struct {
	AppCRD                      AutomationManifest
	GitOpsRuntime               AutomationManifest
	SourceManifest              AutomationManifest
	SystemKustomizationManifest AutomationManifest
	SystemKustResourceManifest  AutomationManifest
	UserKustResourceManifest    AutomationManifest
	WegoAppManifest             AutomationManifest
}

func (ClusterAutomation) BootstrapManifests added in v0.6.1

func (ca ClusterAutomation) BootstrapManifests() []AutomationManifest

func (ClusterAutomation) GenerateWegoConfigManifest added in v0.6.1

func (ca ClusterAutomation) GenerateWegoConfigManifest(clusterName string, fluxNamespace string, wegoNamespace string) (AutomationManifest, error)

func (ClusterAutomation) Manifests added in v0.6.1

func (ca ClusterAutomation) Manifests() []AutomationManifest

type ConfigMode

type ConfigMode string

type GeneratedSecretName

type GeneratedSecretName string

func CreateRepoSecretName

func CreateRepoSecretName(gitSourceURL gitproviders.RepoURL) GeneratedSecretName

func (GeneratedSecretName) String

func (s GeneratedSecretName) String() string

type ResourceKind

type ResourceKind string

func DeployKind

func DeployKind(a models.Application) ResourceKind

func SourceKind

func SourceKind(a models.Application) ResourceKind

func (ResourceKind) ToGVR

type ResourceRef

type ResourceRef struct {
	Kind           ResourceKind
	Name           string
	RepositoryPath string
}

type SourceType

type SourceType string

Jump to

Keyboard shortcuts

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