utils

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectOSArch added in v1.7.0

func DetectOSArch() (osName, arch string)

DetectOSArch returns the OS and architecture strings used in Istio release artifact names. Istio uses "osx" for macOS, "linux" for Linux; "amd64" or "arm64" for architecture.

func DownloadIstio added in v1.7.0

func DownloadIstio(version, tmpDir string) (istioDir string, err error)

DownloadIstio downloads an Istio release from GitHub, extracts it to tmpDir, and returns the path to the extracted directory (e.g. tmpDir/istio-1.28.4).

func GetIstioctlPath added in v1.7.0

func GetIstioctlPath(istioDir string) string

GetIstioctlPath returns the path to the istioctl binary within an extracted Istio directory.

func GetNonEmptyLines

func GetNonEmptyLines(output string) []string

GetNonEmptyLines converts given command output string into individual objects according to line breakers, and ignores the empty elements in it.

func GetProjectDir

func GetProjectDir() (string, error)

GetProjectDir will return the directory where the project is

func InstallCertManager

func InstallCertManager() error

InstallCertManager installs the cert manager bundle.

func InstallPrometheusOperator

func InstallPrometheusOperator() error

InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.

func IsCertManagerCRDsInstalled added in v1.7.0

func IsCertManagerCRDsInstalled() bool

IsCertManagerCRDsInstalled checks if any Cert Manager CRDs are installed by verifying the existence of key CRDs related to Cert Manager.

func IsPrometheusCRDsInstalled added in v1.7.0

func IsPrometheusCRDsInstalled() bool

IsPrometheusCRDsInstalled checks if any Prometheus CRDs are installed by verifying the existence of key CRDs related to Prometheus.

func KindCreateCluster added in v1.7.0

func KindCreateCluster(name string, wait time.Duration) error

KindCreateCluster creates a kind cluster with the given name and wait duration.

func KindDeleteCluster added in v1.7.0

func KindDeleteCluster(name string) error

KindDeleteCluster deletes a kind cluster by name.

func LoadImageToKindCluster added in v1.7.0

func LoadImageToKindCluster(image, clusterName string) error

LoadImageToKindCluster loads a local docker image into the specified kind cluster.

func LoadImageToKindClusterWithName

func LoadImageToKindClusterWithName(name string) error

LoadImageToKindClusterWithName loads a local docker image to the kind cluster. The cluster name is taken from KIND_CLUSTER env, defaulting to "kind".

func Run

func Run(cmd *exec.Cmd) (string, error)

Run executes the provided command within this context

func RunIstioInstall added in v1.7.0

func RunIstioInstall(istioctl, revision, profile string) error

RunIstioInstall runs istioctl install with the given revision and profile. If revision is empty, the default revision is used (no --set revision).

func RunIstioTagSet added in v1.7.0

func RunIstioTagSet(istioctl, tag, revision string, overwrite bool) error

RunIstioTagSet runs istioctl tag set to associate a tag with a revision.

func RunIstioUpgrade added in v1.7.0

func RunIstioUpgrade(istioctl, profile string) error

RunIstioUpgrade runs istioctl upgrade with the given profile.

func UncommentCode added in v1.7.0

func UncommentCode(filename, target, prefix string) error

UncommentCode searches for target in the file and remove the comment prefix of the target content. The target content may span multiple lines.

func UninstallCertManager

func UninstallCertManager()

UninstallCertManager uninstalls the cert manager

func UninstallPrometheusOperator

func UninstallPrometheusOperator()

UninstallPrometheusOperator uninstalls the prometheus

func VersionToRevision added in v1.7.0

func VersionToRevision(version string) string

VersionToRevision converts an Istio version like "1.28.4" to a revision name "1-28-4".

func WaitForIstioReady added in v1.7.0

func WaitForIstioReady(revision string) error

WaitForIstioReady waits for the istiod deployment to be available in istio-system. For revisioned installs (e.g. revision "1-28-4"), pass the revision; for default install, pass "".

Types

This section is empty.

Jump to

Keyboard shortcuts

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