Documentation ¶
Index ¶
- Constants
- Variables
- func GetFreePort() (int, error)
- func GetNonEmptyLines(output string) []string
- func GetProjectDir() (string, error)
- func GetRandString(length int) string
- func GetRandomName() string
- func GetRandomNamespaceName() string
- func InstallCertManager() error
- func InstallPrometheusOperator() error
- func LoadImageToKindClusterWithName(name string) error
- func NewCompanionCR(opts ...CompanionOption) *kcmv1alpha1.Companion
- func NewCompanionDeployment(name, namespace string) *kappsv1.Deployment
- func NewConfigMap(name, namespace string) *kcorev1.ConfigMap
- func NewDeployment(name, namespace string, annotations map[string]string) *kappsv1.Deployment
- func NewLogger() (*zap.Logger, error)
- func NewNamespace(name string) *kcorev1.Namespace
- func NewSugaredLogger() (*zap.SugaredLogger, error)
- func Run(cmd *exec.Cmd) ([]byte, error)
- func UninstallCertManager()
- func UninstallPrometheusOperator()
- type CompanionOption
Constants ¶
const ( NameFormat = "name-%s" NamespaceFormat = "namespace-%s" )
Variables ¶
var (
ErrPortCreationFailed = errors.New("failed to get port")
)
Functions ¶
func GetFreePort ¶
GetFreePort determines a free port on the host. It does so by delegating the job to net.ListenTCP. Then providing a port of 0 to net.ListenTCP, it will automatically choose a port for us.
func GetNonEmptyLines ¶
GetNonEmptyLines converts given command output string into individual objects according to line breakers, and ignores the empty elements in it.
func GetProjectDir ¶
GetProjectDir will return the directory where the project is.
func GetRandString ¶
func GetRandomName ¶
func GetRandomName() string
func GetRandomNamespaceName ¶
func GetRandomNamespaceName() string
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 LoadImageToKindClusterWithName ¶
LoadImageToKindClusterWithName loads a local docker image to the kind cluster.
func NewCompanionCR ¶
func NewCompanionCR(opts ...CompanionOption) *kcmv1alpha1.Companion
func NewCompanionDeployment ¶
func NewCompanionDeployment(name, namespace string) *kappsv1.Deployment
func NewConfigMap ¶
func NewDeployment ¶
func NewDeployment(name, namespace string, annotations map[string]string) *kappsv1.Deployment
func NewNamespace ¶
func NewSugaredLogger ¶
func NewSugaredLogger() (*zap.SugaredLogger, error)
func UninstallCertManager ¶
func UninstallCertManager()
UninstallCertManager uninstalls the cert manager.
func UninstallPrometheusOperator ¶
func UninstallPrometheusOperator()
UninstallPrometheusOperator uninstalls the prometheus.
Types ¶
type CompanionOption ¶
type CompanionOption func(*kcmv1alpha1.Companion) error
func WithCompanionCRFinalizer ¶
func WithCompanionCRFinalizer(finalizer string) CompanionOption