internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetCoreV1Func = k8sutils.GetCoreV1Client
)
View Source
var GetterFunc = NewGetter()

Functions

func DeleteVerrazzanoFromRemoteCluster

func DeleteVerrazzanoFromRemoteCluster(ctx context.Context, c Client, vz *models.Verrazzano, fleetBindingName, kubeconfig, clusterName string) error

DeleteVerrazzanoFromRemoteCluster triggers the Verrazzano deletion on the remote cluster.

func GetActionConfig

func GetActionConfig(ctx context.Context, namespace string, config *rest.Config) (*helmAction.Configuration, error)

GetActionConfig returns a new Helm action configuration.

func GetDefaultVPOImageFromHelmChart

func GetDefaultVPOImageFromHelmChart() (string, error)

GetDefaultVPOImageFromHelmChart returns the default VPO image found in the VPO helm charts value.yaml

func GetVerrazzanoFromRemoteCluster

func GetVerrazzanoFromRemoteCluster(ctx context.Context, c Client, fleetBindingName, kubeconfig, clusterName string) (*models.Verrazzano, error)

GetVerrazzanoFromRemoteCluster fetches the Verrazzano object from a remote cluster.

func GetVerrazzanoPlatformOperatorAddons

func GetVerrazzanoPlatformOperatorAddons(ctx context.Context, fleetSpec *addonsv1alpha1.VerrazzanoFleetBinding) (*models.HelmModuleAddons, error)

GetVerrazzanoPlatformOperatorAddons returns the needed info to install the verrazzano-platform-operator helm chart.

func HelmInit

func HelmInit(ctx context.Context, namespace string, kubeconfig string) (*helmCli.EnvSettings, *helmAction.Configuration, error)

HelmInit initializes Helm.

func ParseDefaultVPOImage

func ParseDefaultVPOImage(vpoImage string) (registry string, repo string, image string, tag string)

ParseDefaultVPOImage parses the default VPO image and returns the parts of the VPO image

func PatchVerrazzano

func PatchVerrazzano(ctx context.Context, client Client, fleetBindingName, kubeconfig, clusterName string, obj *unstructured.Unstructured) error

PatchVerrazzano helps apply the verrazzano config on the remote cluster

func WaitForVerrazzanoUninstallCompletion

func WaitForVerrazzanoUninstallCompletion(ctx context.Context, c Client, fleetBindingName, kubeconfig, clusterName string) error

WaitForVerrazzanoUninstallCompletion waits for verrazzano uninstall process to complete within a defined timeout

Types

type Client

type Client interface {
	InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, verrazzanoFleetBinding *addonsv1alpha1.VerrazzanoFleetBinding) (*helmRelease.Release, error)
	GetHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)
	UninstallHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.UninstallReleaseResponse, error)
	GetWorkloadClusterK8sClient(ctx context.Context, kubeconfig string) (kubernetes.Interface, error)
	GetWorkloadClusterDynamicK8sClient(ctx context.Context, kubeconfig string) (dynamic.Interface, error)
}

type Getter

type Getter interface {
	GetClusterKubeconfig(ctx context.Context, cluster *clusterv1.Cluster) (string, error)
	CreateOrUpdateVerrazzano(ctx context.Context, fleetBindingName, kubeconfig, clusterName string, vzSpecRawExtension *runtime.RawExtension) error
}

type HelmClient

type HelmClient struct{}

func (*HelmClient) GetHelmRelease

func (c *HelmClient) GetHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)

GetHelmRelease returns a Helm release if it exists.

func (*HelmClient) GetWorkloadClusterDynamicK8sClient

func (c *HelmClient) GetWorkloadClusterDynamicK8sClient(ctx context.Context, kubeconfig string) (dynamic.Interface, error)

GetWorkloadClusterDynamicK8sClient returns the Dynamic K8s client of an OCNE cluster if it exists.

func (*HelmClient) GetWorkloadClusterK8sClient

func (c *HelmClient) GetWorkloadClusterK8sClient(ctx context.Context, kubeconfig string) (kubernetes.Interface, error)

GetWorkloadClusterK8sClient returns the K8s client of an OCNE cluster if it exists.

func (*HelmClient) InstallHelmRelease

func (c *HelmClient) InstallHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)

InstallHelmRelease installs a Helm release.

func (*HelmClient) InstallOrUpgradeHelmRelease

func (c *HelmClient) InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, verrazzanoFleetBinding *addonsv1alpha1.VerrazzanoFleetBinding) (*helmRelease.Release, error)

InstallOrUpgradeHelmRelease installs a Helm release if it does not exist, or upgrades it if it does and differs from the spec. It returns a boolean indicating whether an install or upgrade was performed.

func (*HelmClient) ListHelmReleases

func (c *HelmClient) ListHelmReleases(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) ([]*helmRelease.Release, error)

ListHelmReleases lists all Helm releases in a namespace.

func (*HelmClient) RollbackHelmRelease

func (c *HelmClient) RollbackHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) error

RollbackHelmRelease rolls back a Helm release.

func (*HelmClient) UninstallHelmRelease

func (c *HelmClient) UninstallHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.UninstallReleaseResponse, error)

UninstallHelmRelease uninstalls a Helm release.

func (*HelmClient) UpgradeHelmReleaseIfChanged

func (c *HelmClient) UpgradeHelmReleaseIfChanged(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, existing *helmRelease.Release, verrazzanoFleetBinding *addonsv1alpha1.VerrazzanoFleetBinding) (*helmRelease.Release, error)

UpgradeHelmReleaseIfChanged upgrades a Helm release. The boolean refers to if an upgrade was attempted.

type KubeconfigGetter

type KubeconfigGetter struct{}

func NewGetter

func NewGetter() *KubeconfigGetter

func (*KubeconfigGetter) CreateOrUpdateVerrazzano

func (k *KubeconfigGetter) CreateOrUpdateVerrazzano(ctx context.Context, client Client, fleetBindingName, kubeconfig, clusterName string, vzSpecRawExtension *runtime.RawExtension) error

CreateOrUpdateVerrazzano starts verrazzano deployment

func (*KubeconfigGetter) GetClusterKubeconfig

func (k *KubeconfigGetter) GetClusterKubeconfig(ctx context.Context, cluster *clusterv1.Cluster) (string, error)

GetClusterKubeconfig returns the kubeconfig for a selected Cluster as a string.

type VPOHelmValuesTemplate

type VPOHelmValuesTemplate struct {
	Image                string                      `json:"image,omitempty"`
	PrivateRegistry      bool                        `json:"privateRegistry"`
	Repository           string                      `json:"repository,omitempty"`
	Registry             string                      `json:"registry,omitempty"`
	PullPolicy           string                      `json:"pullPolicy,omitempty"`
	ImagePullSecrets     []addonsv1alpha1.SecretName `json:"imagePullSecrets,omitempty"`
	AppOperatorImage     string                      `json:"appOperatorImage,omitempty"`
	ClusterOperatorImage string                      `json:"clusterOperatorImage,omitempty"`
}

Directories

Path Synopsis
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.

Jump to

Keyboard shortcuts

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