Documentation ¶
Overview ¶
Package tkgpackageclient provides functionality for package plugin
Index ¶
- Variables
- func DisplayProgress(initialMsg string, pp *tkgpackagedatamodel.PackageProgress) error
- func GetCurrentRepositoryAndTagInUse(pkgr *kappipkg.PackageRepository) (repository, tag string, err error)
- func ParseRegistryImageURL(imgURL string) (repository, tag string, err error)
- type DataValueProperty
- type DockerConfigEntry
- type DockerConfigJSON
- type PackageValuesSchemaParser
- type TKGPackageClient
Constants ¶
This section is empty.
Variables ¶
var ( Secret = &corev1.Secret{} SecretExport = &secretgenctrl.SecretExport{} )
Functions ¶
func DisplayProgress ¶ added in v0.17.0
func DisplayProgress(initialMsg string, pp *tkgpackagedatamodel.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 ¶ added in v0.6.0
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 ¶ added in v0.17.0
ParseRegistryImageURL parses the registry image URL to get repository and tag, tag is empty if not specified
Types ¶
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 ¶ added in v0.17.0
type DockerConfigJSON ¶ added in v0.5.0
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 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
type TKGPackageClient ¶
type TKGPackageClient interface { AddRegistrySecret(o *tkgpackagedatamodel.RegistrySecretOptions) error AddRepository(o *tkgpackagedatamodel.RepositoryOptions, packageProgress *tkgpackagedatamodel.PackageProgress, operationType tkgpackagedatamodel.OperationType) AddRepositorySync(o *tkgpackagedatamodel.RepositoryOptions, operationType tkgpackagedatamodel.OperationType) error DeleteRegistrySecret(o *tkgpackagedatamodel.RegistrySecretOptions) (bool, error) DeleteRepository(o *tkgpackagedatamodel.RepositoryOptions, packageProgress *tkgpackagedatamodel.PackageProgress) DeleteRepositorySync(o *tkgpackagedatamodel.RepositoryOptions) error GetPackageInstall(o *tkgpackagedatamodel.PackageOptions) (*kappipkg.PackageInstall, error) GetPackage(o *tkgpackagedatamodel.PackageOptions) (*kapppkg.PackageMetadata, *kapppkg.Package, error) GetRepository(o *tkgpackagedatamodel.RepositoryOptions) (*kappipkg.PackageRepository, error) GetSecretExport(o *tkgpackagedatamodel.RegistrySecretOptions) (*secretgen.SecretExport, error) InstallPackage(o *tkgpackagedatamodel.PackageOptions, packageProgress *tkgpackagedatamodel.PackageProgress, operationType tkgpackagedatamodel.OperationType) InstallPackageSync(o *tkgpackagedatamodel.PackageOptions, operationType tkgpackagedatamodel.OperationType) error ListPackageInstalls(o *tkgpackagedatamodel.PackageOptions) (*kappipkg.PackageInstallList, error) ListPackageMetadata(o *tkgpackagedatamodel.PackageAvailableOptions) (*kapppkg.PackageMetadataList, error) ListPackages(o *tkgpackagedatamodel.PackageAvailableOptions) (*kapppkg.PackageList, error) ListRegistrySecrets(o *tkgpackagedatamodel.RegistrySecretOptions) (*corev1.SecretList, error) ListSecretExports(o *tkgpackagedatamodel.RegistrySecretOptions) (*secretgen.SecretExportList, error) ListRepositories(o *tkgpackagedatamodel.RepositoryOptions) (*kappipkg.PackageRepositoryList, error) UninstallPackage(o *tkgpackagedatamodel.PackageOptions, packageProgress *tkgpackagedatamodel.PackageProgress) UninstallPackageSync(o *tkgpackagedatamodel.PackageOptions) error UpdateRegistrySecret(o *tkgpackagedatamodel.RegistrySecretOptions) error UpdatePackage(o *tkgpackagedatamodel.PackageOptions, packageProgress *tkgpackagedatamodel.PackageProgress, operationType tkgpackagedatamodel.OperationType) UpdatePackageSync(o *tkgpackagedatamodel.PackageOptions, operationType tkgpackagedatamodel.OperationType) error UpdateRepository(o *tkgpackagedatamodel.RepositoryOptions, progress *tkgpackagedatamodel.PackageProgress, operationType tkgpackagedatamodel.OperationType) UpdateRepositorySync(o *tkgpackagedatamodel.RepositoryOptions, operationType tkgpackagedatamodel.OperationType) error }
TKGPackageClient is the TKG package client interface
func NewTKGPackageClient ¶
func NewTKGPackageClient(kubeconfigPath string) (TKGPackageClient, error)
NewTKGPackageClient instantiates pkgClient pkgClient with kubeconfig
func NewTKGPackageClientForContext ¶ added in v0.17.0
func NewTKGPackageClientForContext(kubeconfigPath, kubeContext string) (TKGPackageClient, error)
NewTKGPackageClientForContext instantiates pkgClient with kubeconfig and kubecontext
func NewTKGPackageClientWithKappClient ¶ added in v0.17.0
func NewTKGPackageClientWithKappClient(kappClient kappclient.Client) (TKGPackageClient, error)
Source Files ¶
- client.go
- display_utils.go
- image_utils.go
- interface.go
- package_get.go
- package_install.go
- package_list.go
- package_uninstall.go
- package_update.go
- registry_secret_add.go
- registry_secret_delete.go
- registry_secret_list.go
- registry_secret_update.go
- repository_add.go
- repository_delete.go
- repository_get.go
- repository_list.go
- repository_update.go
- utils.go