application

package
v0.4.18 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const (
	InstallationModeFlat   = "flat"
	InstallationModeNormal = "normal"

	AppTypeKsonnet   = "ksonnet"
	AppTypeHelm      = "helm"
	AppTypeKustomize = "kustomize"
	AppTypeDirectory = "dir"
)

Variables

View Source
var (
	// Errors
	ErrEmptyAppSpecifier            = errors.New("empty app not allowed")
	ErrEmptyAppName                 = errors.New("app name can not be empty, please specify application name")
	ErrEmptyProjectName             = errors.New("project name can not be empty, please specificy project name with: --project")
	ErrAppAlreadyInstalledOnProject = errors.New("application already installed on project")
	ErrAppCollisionWithExistingBase = errors.New("an application with the same name and a different base already exists, consider choosing a different name")
	ErrUnknownAppType               = errors.New("unknown application type")
)

Functions

func DeleteFromProject

func DeleteFromProject(repofs fs.FS, appName, projectName string) error

func GenerateManifests

func GenerateManifests(k *kusttypes.Kustomization) ([]byte, error)

GenerateManifests writes the in-memory kustomization to disk, fixes relative resources and runs kustomize build, then returns the generated manifests.

If there is a namespace on 'k' a namespace.yaml file with the namespace object will be written next to the persisted kustomization.yaml.

To include the namespace in the generated manifests just add 'namespace.yaml' to the resources of the kustomization

Types

type Application

type Application interface {
	Name() string

	CreateFiles(repofs fs.FS, appsfs fs.FS, projectName string) error
}

type ClusterResConfig added in v0.2.0

type ClusterResConfig struct {
	Name   string `json:"name"`
	Server string `json:"server"`
}

type Config

type Config struct {
	AppName           string            `json:"appName"`
	UserGivenName     string            `json:"userGivenName"`
	DestNamespace     string            `json:"destNamespace"`
	DestServer        string            `json:"destServer"`
	SrcPath           string            `json:"srcPath"`
	SrcRepoURL        string            `json:"srcRepoURL"`
	SrcTargetRevision string            `json:"srcTargetRevision"`
	Labels            map[string]string `json:"labels"`
	Annotations       map[string]string `json:"annotations"`
}

type CreateOptions

type CreateOptions struct {
	AppName          string
	AppType          string
	AppSpecifier     string
	DestNamespace    string
	DestServer       string
	InstallationMode string
	Labels           map[string]string
	Annotations      map[string]string
	Exclude          string
	Include          string
}

func AddFlags

func AddFlags(cmd *cobra.Command) *CreateOptions

AddFlags adds application creation flags to cmd.

func (*CreateOptions) Parse

func (o *CreateOptions) Parse(projectName, repoURL, targetRevision, repoRoot string) (Application, error)
CreateOptions impl

Parse tries to parse `CreateOptions` into an `Application`.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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