testutils

package
v1.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8sCoreAPIVersion  = "v1"
	ResourceConfigmaps = "configmaps"
)
View Source
const (
	ExtensionsAPIGroup   = "extensions.kubeblocks.io"
	ExtensionsAPIVersion = "v1alpha1"
	ResourceAddons       = "addons"
)

Extensions API group

Variables

View Source
var (
	// KubeBlocksRepoName helm repo name for kubeblocks
	KubeBlocksRepoName = "kubeblocks"

	// KubeBlocksChartName helm chart name for kubeblocks
	KubeBlocksChartName = "kubeblocks"

	// KubeBlocksReleaseName helm release name for kubeblocks
	KubeBlocksReleaseName = "kubeblocks"

	// KubeBlocksChartURL the helm chart repo for installing kubeblocks
	KubeBlocksChartURL = "https://apecloud.github.io/helm-charts"

	// GitLabHelmChartRepo the helm chart repo in GitLab
	GitLabHelmChartRepo = "https://jihulab.com/api/v4/projects/85949/packages/helm/stable"

	// CfgKeyHelmRepoURL the helm repo url key
	CfgKeyHelmRepoURL = "HELM_REPO_URL"
)

The purpose of this package is to remove the dependency of the KubeBlocks project on 'pkg/cli'.

Functions

func AddRepo

func AddRepo(r *repo.Entry) error

AddRepo adds a repo

func AddonGVR

func AddonGVR() schema.GroupVersionResource

func ConfigmapGVR

func ConfigmapGVR() schema.GroupVersionResource

func GetHelmChartRepoURL

func GetHelmChartRepoURL() string

GetHelmChartRepoURL gets helm chart repo, chooses one from GitHub and GitLab based on the IP location

func GetIPLocation

func GetIPLocation() (string, error)

func GetQuiteLog

func GetQuiteLog() action.DebugLog

func GetResourceObjectFromGVR

func GetResourceObjectFromGVR(gvr schema.GroupVersionResource, key client.ObjectKey, client dynamic.Interface, k8sObj interface{}) error

GetResourceObjectFromGVR queries the resource object using GVR.

func GetVerboseLog

func GetVerboseLog() action.DebugLog

func NewActionConfig

func NewActionConfig(cfg *Config) (*action.Configuration, error)

func NewConfigFlagNoWarnings

func NewConfigFlagNoWarnings() *genericclioptions.ConfigFlags

NewConfigFlagNoWarnings returns a ConfigFlags that disables warnings.

func NewFactory

func NewFactory() cmdutil.Factory

func ReleaseNotFound

func ReleaseNotFound(err error) bool

Types

type Config

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

func NewConfig

func NewConfig(namespace string, kubeConfig string, ctx string, debug bool) *Config

func (*Config) Namespace

func (o *Config) Namespace() string

func (*Config) SetNamespace

func (o *Config) SetNamespace(namespace string)

type InstallOpts

type InstallOpts struct {
	Name            string
	Chart           string
	Namespace       string
	Wait            bool
	Version         string
	TryTimes        int
	Login           bool
	CreateNamespace bool
	ValueOpts       *values.Options
	Timeout         time.Duration
	Atomic          bool
	DisableHooks    bool
	ForceUninstall  bool

	// for helm template
	DryRun     *bool
	OutputDir  string
	IncludeCRD bool
}

func (*InstallOpts) GetInstalled

func (i *InstallOpts) GetInstalled(cfg *action.Configuration) (*release.Release, error)

GetInstalled gets helm package release info if installed.

func (*InstallOpts) Install

func (i *InstallOpts) Install(cfg *Config) (*release.Release, error)

Install installs a Chart

func (*InstallOpts) RemoveRemainSecrets

func (i *InstallOpts) RemoveRemainSecrets(cfg *action.Configuration) (int, error)

func (*InstallOpts) Uninstall

func (i *InstallOpts) Uninstall(cfg *Config) error

Uninstall uninstalls a Chart

Jump to

Keyboard shortcuts

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