utils

package
v0.0.68 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 29 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package utils provides CLI utility functions and structs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMapOfBytesToMapOfStrings added in v0.0.26

func ConvertMapOfBytesToMapOfStrings(contentMap map[string][]byte) map[string]string

func CreateDirectory added in v0.0.26

func CreateDirectory(dirPath string, mode fs.FileMode)

func EnsureGatewayIngress added in v0.0.56

func EnsureGatewayIngress(env *controllers.SFKubeContext, fqdn string)

func EnsureSelfSignCert added in v0.0.56

func EnsureSelfSignCert(env *controllers.SFKubeContext)

func GetCLICRContext added in v0.0.65

func GetCLICRContext(command *cobra.Command, args []string) (*controllers.SFKubeContext, sfv1.SoftwareFactory)

GetCLICRContext setup the SFKubeContext and read the CR from the args.

func GetCLIContext

func GetCLIContext(command *cobra.Command) *controllers.SFKubeContext

func GetCRUDSubcommands

func GetCRUDSubcommands() (*cobra.Command, *cobra.Command, *cobra.Command)

func GetFileContent

func GetFileContent(filePath string) ([]byte, error)

func GetKubeConfig added in v0.0.51

func GetKubeConfig() *clientcmdapi.Config

func GetKubeConfigContextByName added in v0.0.51

func GetKubeConfigContextByName(contextName string) (*clientcmdapi.Context, string)

func MkHTTPSIngress added in v0.0.56

func MkHTTPSIngress(ns string, name string, host string, service string, port int32, extraLabels map[string]string) networkv1.Ingress

func MkHTTPSRoute added in v0.0.54

func MkHTTPSRoute(
	name string, ns string, host string, serviceName string, path string, port int, extraLabels map[string]string) apiroutev1.Route

MkHTTPSRoute produces a Route on top of a Service

func Ptr added in v0.0.56

func Ptr[T any](v T) *T

func ReadIngressIP added in v0.0.56

func ReadIngressIP(env *controllers.SFKubeContext, name string) string

func RunCmdOrDie added in v0.0.23

func RunCmdOrDie(cmd string, args ...string) string

func RunCmdWithEnvOrDie added in v0.0.23

func RunCmdWithEnvOrDie(environ []string, cmd string, args ...string) string

func SetLogger added in v0.0.32

func SetLogger(command *cobra.Command)

SetLogger enables the DEBUG LogLevel in the Logger when the debug flag is set

func VarListToMap added in v0.0.24

func VarListToMap(varsList []string) map[string]string

func WriteContentToFile added in v0.0.26

func WriteContentToFile(filePath string, content []byte, mode fs.FileMode)

func WriteIngressToEtcHosts added in v0.0.56

func WriteIngressToEtcHosts(env *controllers.SFKubeContext, fqdn string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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