Documentation
¶
Index ¶
- Constants
- Variables
- func CheckIfFileExists(f string) bool
- func CleanUp(files ...string)
- func FromK8sObjectToYaml(obj client.Object, gvk schema.GroupVersion) ([]byte, error)
- func FromYamlToK8sObject(doc string, resources ...any) error
- func GetHostPlatform() string
- func GetManagerHelmValues() map[string]interface{}
- func Int32P(i int32) *int32
- func Log(args ...any)
- func LogErr(format string, args ...any)
- func Logf(format string, args ...any)
- func NewKLog(ctx context.Context) logr.Logger
- func RandomWriteToTmpFolder(fileName, content string) (string, error)
- func RawK8sInterface(yamlBytes []byte) (map[string]interface{}, error)
- func SliceContains(slice []string, item string) bool
- func StringP(s string) *string
- func Stringify(data []map[string]interface{}) (string, error)
- func Stringy(data map[string]interface{}) (string, error)
- func WaitUntilJobSucceeds(ctx context.Context, k8sClient client.Client, name, namespace string) error
- func WaitUntilSecretCreated(ctx context.Context, k8sClient client.Client, name, namespace string) error
- func WriteToPath(dir, fileName, content string) error
- type Shell
- type ShellPipe
Constants ¶
const ( ManagerHostPathMount = "/local/plugins" PluginDirectoryPath = "PLUGIN_PATH" PluginHostPath = "/greenhouse/local/plugins" )
Variables ¶
var DefaultElapsedTime = 30 * time.Second
Functions ¶
func CheckIfFileExists ¶
func FromK8sObjectToYaml ¶
FromK8sObjectToYaml - Converts a Kubernetes object to a YAML document
func FromYamlToK8sObject ¶
FromYamlToK8sObject - Converts a YAML document to a Kubernetes object if yaml contains multiple documents, then corresponding kubernetes objects should be provided
func GetHostPlatform ¶
func GetHostPlatform() string
func GetManagerHelmValues ¶
func GetManagerHelmValues() map[string]interface{}
GetManagerHelmValues - returns the default values for the manager helm chart
func RandomWriteToTmpFolder ¶
RandomWriteToTmpFolder - writes the provided content to temp folder in OS Concurrent writes do not conflict as the file name is appended with a random string
func RawK8sInterface ¶
RawK8sInterface - unmarshalls the provided YAML bytes into a map[string]interface{}
func SliceContains ¶
func WaitUntilJobSucceeds ¶
func WaitUntilJobSucceeds(ctx context.Context, k8sClient client.Client, name, namespace string) error
WaitUntilJobSucceeds - waits until a job succeeds in the given namespace with a backoff strategy
func WaitUntilSecretCreated ¶
func WaitUntilSecretCreated(ctx context.Context, k8sClient client.Client, name, namespace string) error
WaitUntilSecretCreated - waits until a secret is created in the given namespace with a backoff strategy
func WriteToPath ¶
Types ¶
type Shell ¶
func (Shell) ExecWithResult ¶
ExecWithResult executes the shell command and returns the output of the command