packageclient

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 27 Imported by: 4

Documentation

Overview

Package packageclient provides functionality for package plugin

Index

Constants

This section is empty.

Variables

View Source
var (
	Secret       = &corev1.Secret{}
	SecretExport = &secretgenctrl.SecretExport{}
)

Functions

func DisplayProgress

func DisplayProgress(initialMsg string, pp *packagedatamodel.PackageProgress) error

DisplayProgress creates an spinner instance; keeps receiving the progress messages in the channel and displays those using the spinner until an error occurs

func GetCurrentRepositoryAndTagInUse

func GetCurrentRepositoryAndTagInUse(pkgr *kappipkg.PackageRepository) (repository, tag string, err error)

GetCurrentRepositoryAndTagInUse fetches the current tag used by package repository, taking tagselection into account

func ParseRegistryImageURL

func ParseRegistryImageURL(imgURL string) (repository, tag string, err error)

ParseRegistryImageURL parses the registry image URL to get repository and tag, tag is empty if not specified

Types

type CrtClient

type CrtClient interface {
	crtclient.Client
}

CrtClient clientset interface

type DataValueProperty

type DataValueProperty struct {
	Key         string
	Type        interface{}
	Description interface{}
	Default     interface{}
}

DataValueProperty holds the details of each property under Carvel package.spec.valuesSchema.openAPIv3.properties. The example of the schema could be found at: https://carvel.dev/kapp-controller/docs/latest/packaging/#package-1 From above example, we would have the following:

DataValueProperty.Key = "namespace"
DataValueProperty.Type = "string"
DataValueProperty.Description = "Namespace where fluent-bit will be installed."
DataValueProperty.Default = "fluent-bit"

type DockerConfigEntry

type DockerConfigEntry struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty" datapolicy:"password"`
}

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths map[string]DockerConfigEntry `json:"auths" datapolicy:"token"`
}

DockerConfigJSON represents authentication information for pulling images from private registries Note: datapolicy is seemingly used for log sanitization: https://github.com/kubernetes/enhancements/blob/master/keps/sig-security/1933-secret-logging-static-analysis/README.md TODO: change to use k8s types after upgrading the K8s version

type PackageClient

type PackageClient interface {
	AddRegistrySecret(o *packagedatamodel.RegistrySecretOptions) error
	AddRepository(o *packagedatamodel.RepositoryOptions, packageProgress *packagedatamodel.PackageProgress, operationType packagedatamodel.OperationType)
	AddRepositorySync(o *packagedatamodel.RepositoryOptions, operationType packagedatamodel.OperationType) error
	DeleteRegistrySecret(o *packagedatamodel.RegistrySecretOptions) (bool, error)
	DeleteRepository(o *packagedatamodel.RepositoryOptions, packageProgress *packagedatamodel.PackageProgress)
	DeleteRepositorySync(o *packagedatamodel.RepositoryOptions) error
	GetPackageInstall(o *packagedatamodel.PackageOptions) (*kappipkg.PackageInstall, error)
	GetPackage(o *packagedatamodel.PackageOptions) (*kapppkg.PackageMetadata, *kapppkg.Package, error)
	GetRepository(o *packagedatamodel.RepositoryOptions) (*kappipkg.PackageRepository, error)
	GetSecretExport(o *packagedatamodel.RegistrySecretOptions) (*secretgen.SecretExport, error)
	InstallPackage(o *packagedatamodel.PackageOptions, packageProgress *packagedatamodel.PackageProgress, operationType packagedatamodel.OperationType)
	InstallPackageSync(o *packagedatamodel.PackageOptions, operationType packagedatamodel.OperationType) error
	ListPackageInstalls(o *packagedatamodel.PackageOptions) (*kappipkg.PackageInstallList, error)
	ListPackageMetadata(o *packagedatamodel.PackageAvailableOptions) (*kapppkg.PackageMetadataList, error)
	ListPackages(o *packagedatamodel.PackageAvailableOptions) (*kapppkg.PackageList, error)
	ListRegistrySecrets(o *packagedatamodel.RegistrySecretOptions) (*corev1.SecretList, error)
	ListSecretExports(o *packagedatamodel.RegistrySecretOptions) (*secretgen.SecretExportList, error)
	ListRepositories(o *packagedatamodel.RepositoryOptions) (*kappipkg.PackageRepositoryList, error)
	UninstallPackage(o *packagedatamodel.PackageOptions, packageProgress *packagedatamodel.PackageProgress)
	UninstallPackageSync(o *packagedatamodel.PackageOptions) error
	UpdateRegistrySecret(o *packagedatamodel.RegistrySecretOptions) error
	UpdatePackage(o *packagedatamodel.PackageOptions, packageProgress *packagedatamodel.PackageProgress, operationType packagedatamodel.OperationType)
	UpdatePackageSync(o *packagedatamodel.PackageOptions, operationType packagedatamodel.OperationType) error
	UpdateRepository(o *packagedatamodel.RepositoryOptions, progress *packagedatamodel.PackageProgress, operationType packagedatamodel.OperationType)
	UpdateRepositorySync(o *packagedatamodel.RepositoryOptions, operationType packagedatamodel.OperationType) error
}

PackageClient is the TKG package client interface

func NewPackageClient

func NewPackageClient(kubeconfigPath string) (PackageClient, error)

NewPackageClient instantiates pkgClient pkgClient with kubeconfig

func NewPackageClientForContext

func NewPackageClientForContext(kubeconfigPath, kubeContext string) (PackageClient, error)

NewPackageClientForContext instantiates pkgClient with kubeconfig and kubecontext

func NewPackageClientWithKappClient

func NewPackageClientWithKappClient(kappClient kappclient.Client) (PackageClient, error)

type PackageValuesSchemaParser

type PackageValuesSchemaParser struct {
	Doc                 *openapi3.T
	DataValueProperties []DataValueProperty
	// contains filtered or unexported fields
}

PackageValuesSchemaParser loads Carvel package values schema and extract property details

func NewValuesSchemaParser

func NewValuesSchemaParser(valuesSchema kapppkg.ValuesSchema) (*PackageValuesSchemaParser, error)

NewValuesSchemaParser instantiate a new PackageValuesSchemaParser

func (*PackageValuesSchemaParser) ParseProperties

func (parser *PackageValuesSchemaParser) ParseProperties() ([]DataValueProperty, error)

ParseProperties parses the loaded doc and feed the details into []DataValueProperty

Jump to

Keyboard shortcuts

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