kapp

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultWorkingDirectory is the working directory
	DefaultWorkingDirectory string = "working"

	// DefaultAppCrdNamespace is the default App Crd namespace
	DefaultAppCrdNamespace string = "tanzu-extensions"
	// DefaultServiceAccountPostfix is the default Service Account postfix name
	DefaultServiceAccountPostfix string = "-extension-sa"
	// DefaultRoleBindingPostfix is the default Role Binding postfix name
	DefaultRoleBindingPostfix string = "-extension"

	// DefaultRepositoryName is tce-main.tanzu.vmware
	DefaultRepositoryName string = "tce-main.tanzu.vmware"
	// DefaultRepositoryImage is projects.registry.vmware.com/tce/main:stable
	DefaultRepositoryImage string = "projects.registry.vmware.com/tce/main:stable"
)

Variables

View Source
var (
	// ErrAppNotPresentOrInstalled is Application is not present/installed
	ErrAppNotPresentOrInstalled = errors.New("application is not present/installed")
)

Functions

This section is empty.

Types

type AppCrdInput

type AppCrdInput struct {
	// Common between UserDefined and Secret
	Namespace string

	// UserDefined
	Name       string
	URL        string
	Paths      map[string]string
	Version    string
	ConfigPath string
	Config     []byte

	// From Secret
	ClusterName string

	// Force delete
	Force bool
	// Teardown by deleting ServiceAccount and RoleBinding
	Teardown bool
}

AppCrdInput for creating an app

type Config

type Config struct {
	// Kubeconfig is the users kubeconfig
	Kubeconfig string

	// ExtensionServiceAccountPostfix is the extension postfix for service account
	ExtensionServiceAccountPostfix string
	// ExtensionRoleBindingPostfix is the extension postfix for role binding
	ExtensionRoleBindingPostfix string

	// Repositories list of repos
	Repositories []*Repository `json:"repositories"`
}

Config struct

func InitKappConfig

func InitKappConfig() (*Config, error)

InitKappConfig inits the Config and also checks Environment variables

func NewConfig

func NewConfig() *Config

NewConfig generates a Config object

func (*Config) FromEnv

func (cfg *Config) FromEnv() error

FromEnv initializes the configuration object with values obtained from environment variables. If an environment variable is set for a property that's already initialized, the environment variable's value takes precedence.

type Kapp

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

Kapp object for kapp

func NewKapp

func NewKapp() (*Kapp, error)

NewKapp generates a Kapp object

func (*Kapp) DeletePackage

func (k *Kapp) DeletePackage(input *AppCrdInput) error

DeletePackage removes the InstalledPackage CR and related assets from the cluster.

func (*Kapp) DeleteRepository

func (k *Kapp) DeleteRepository(name string) error

DeleteRepository deletes a repo

func (*Kapp) DeleteRepositoryFromFile

func (k *Kapp) DeleteRepositoryFromFile(filename string) error

DeleteRepositoryFromFile does it from a file

func (*Kapp) GetWorkingDirectory

func (k *Kapp) GetWorkingDirectory() string

GetWorkingDirectory for ytt

func (*Kapp) InstallDefaultRepository

func (k *Kapp) InstallDefaultRepository() error

InstallDefaultRepository uses TCE

func (*Kapp) InstallPackage

func (k *Kapp) InstallPackage(input *AppCrdInput) error

InstallPackage creates the InstalledPackage CR and applies it to the cluster.

func (*Kapp) InstallRepository

func (k *Kapp) InstallRepository(name, url string) error

InstallRepository installs a generic repo

func (*Kapp) InstallRepositoryFromFile

func (k *Kapp) InstallRepositoryFromFile(filename string) error

InstallRepositoryFromFile does it from a file

func (*Kapp) ListRepositories

func (k *Kapp) ListRepositories() (*instpkg.PackageRepositoryList, error)

ListRepositories lists all repos

func (*Kapp) ResolveInstalledPackage

func (k *Kapp) ResolveInstalledPackage(name, version, namespace string) (*ipkg.InstalledPackage, error)

ResolveInstalledPackage takes a package name (publicName) and version and returns the contents of that InstalledPackage. When only the name is provided, the newest InstalledPackage resolved is returned. If a package cannot be resolved due to the name and/or version, an error is returned.

func (*Kapp) ResolvePackage

func (k *Kapp) ResolvePackage(name, version string) (*kapppack.Package, error)

ResolvePackage takes a package name (publicName) and version and returns the contents of that package. When only the name is provided, the newest package resolved is returned. If a package cannot be resolved due to the name and/or version, an error is returned.

func (*Kapp) ResolvePackageBundleLocation

func (k *Kapp) ResolvePackageBundleLocation(pkg *kapppack.Package) (string, error)

ResolvePackageBundleLocation takes a Package CR and looks up the associated imgpkg bundle. There may only be 1 imgpkg bundle associated with the Package CR or else an error is returned.

func (*Kapp) ResolvePackageVersion

func (k *Kapp) ResolvePackageVersion(pkg *kapppack.Package) string

ResolvePackageVersion takes a package an input and returns the Package's version

func (*Kapp) RetrievePackages

func (k *Kapp) RetrievePackages() ([]kapppack.Package, error)

RetrievePackages returns all packages available in the cluster.

type Repository

type Repository struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

Repository object

Jump to

Keyboard shortcuts

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