utils

package
v0.0.0-...-55e4384 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
	" / ___| |_   _ ___| |_ ___ _ __  |  ___|__  _ __ __ _  ___ \n" +
	"| |   | | | | / __| __/ _ \\ '__| | |_ / _ \\| '__/ _` |/ _ \\\n" +
	"| |___| | |_| \\__ \\ ||  __/ |    |  _| (_) | | | (_| |  __/\n" +
	" \\____|_|\\__,_|___/\\__\\___|_|    |_|  \\___/|_|  \\__, |\\___|\n" +
	"                                                |___/      \n"

Functions

func CopyFile

func CopyFile(src, dst string) error

func CopyYAMLFiles

func CopyYAMLFiles(srcDir, destDir string) error

func CreateCrossplaneObject

func CreateCrossplaneObject(config Config, filesDir string, workingDir string) error

CreateCrossplaneObject reads the output of the SplitYAML function and writes it to a file

func GenerateFunctionTemplates

func GenerateFunctionTemplates(outputDir string, newFilePath string)

func IsClusterScoped

func IsClusterScoped(resourceName, apiVersion string) bool

isClusterScoped checks if a given resource is cluster-scoped.

func ProcessNamespaceFiles

func ProcessNamespaceFiles(dir string) error

func RemoveEmptyYAMLFiles

func RemoveEmptyYAMLFiles(dir string) error

func RemoveYAMLFiles

func RemoveYAMLFiles(dir string) error

func ResetTerminal

func ResetTerminal()

func Setup

func Setup()

func Templatehelm

func Templatehelm(config Config, helmExec HelmExecutor) error

Types

type ClusterScopedResource

type ClusterScopedResource struct {
	Name       string
	APIVersion string
}

type Config

type Config struct {
	HelmChartName       string `yaml:"helm-chart-name"`
	HelmURL             string `yaml:"helm-url"`
	Values              string `yaml:"values"`
	Secrets             bool   `yaml:"secrets"`
	Name                string `yaml:"name"`
	HelmName            string `yaml:"helm-name"`
	ManifestURL         string `yaml:"manifest-url"`
	HelmVersion         string `yaml:"helm-version"`
	Namespace           string `yaml:"namespace"`
	SourceFile          string `yaml:"sourcefile"`
	Filename            string
	CRDFiles            []string
	NamespaceFiles      []string
	SecretFiles         []string
	ExternalSecretFiles []string
	ObjectFiles         []string
	CastName            string
}

func LoadConfig

func LoadConfig(filename string) ([]Config, error)

type ConfigMap

type ConfigMap struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
}

type Container

type Container struct {
	Name         string        `yaml:"name"`
	VolumeMounts []VolumeMount `yaml:"volumeMounts"`
}

type DefaultHelmExecutor

type DefaultHelmExecutor struct{}

func (*DefaultHelmExecutor) RunHelmCommand

func (e *DefaultHelmExecutor) RunHelmCommand(args []string, stdout io.Writer, stderr io.Writer) error

type DeploymentRuntimeConfig

type DeploymentRuntimeConfig struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
	Spec Spec `yaml:"spec"`
}

type DeploymentTemplate

type DeploymentTemplate struct {
	Spec struct {
		Selector map[string]string `yaml:"selector"`
		Template TemplateSpec      `yaml:"template"`
	} `yaml:"spec"`
}

type HelmExecutor

type HelmExecutor interface {
	RunHelmCommand(args []string, stdout io.Writer, stderr io.Writer) error
}

type Namespace

type Namespace struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
}

type PodSpec

type PodSpec struct {
	Containers []Container `yaml:"containers"`
	Volumes    []Volume    `yaml:"volumes"`
}

type Spec

type Spec struct {
	DeploymentTemplate DeploymentTemplate `yaml:"deploymentTemplate"`
}

type TemplateSpec

type TemplateSpec struct {
	Spec PodSpec `yaml:"spec"`
}

type Volume

type Volume struct {
	Name      string `yaml:"name"`
	ConfigMap struct {
		Name string `yaml:"name"`
	} `yaml:"configMap"`
}

type VolumeMount

type VolumeMount struct {
	MountPath string `yaml:"mountPath"`
	Name      string `yaml:"name"`
	ReadOnly  bool   `yaml:"readOnly"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳