clusteradopt

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverHelmfiles

func DiscoverHelmfiles(root string) []string

func IsSystemNamespace

func IsSystemNamespace(ns string) bool

func RenderStackYAML

func RenderStackYAML(snapshot *Snapshot, opts RenderOptions) (string, []ValuesFile, []ChartFile, error)

Types

type ChartFile

type ChartFile struct {
	Path  string
	Chart *chart.Chart
}

type ClusterInfo

type ClusterInfo struct {
	Name       string `json:"name,omitempty"`
	Context    string `json:"context,omitempty"`
	Kubeconfig string `json:"kubeconfig,omitempty"`
}

type DiscoverOptions

type DiscoverOptions struct {
	Kubeconfig      string
	Context         string
	Namespaces      []string
	AllNamespaces   bool
	IncludeSystem   bool
	IncludeHelm     bool
	IncludeGitOps   bool
	IncludeWorkload bool
}

type GitOpsObject

type GitOpsObject struct {
	System      string `json:"system"`
	Kind        string `json:"kind"`
	Namespace   string `json:"namespace,omitempty"`
	Name        string `json:"name"`
	Source      string `json:"source,omitempty"`
	Destination string `json:"destination,omitempty"`
}

type HelmRelease

type HelmRelease struct {
	Name         string         `json:"name"`
	Namespace    string         `json:"namespace"`
	Chart        string         `json:"chart,omitempty"`
	ChartVersion string         `json:"chartVersion,omitempty"`
	AppVersion   string         `json:"appVersion,omitempty"`
	Status       string         `json:"status,omitempty"`
	Values       map[string]any `json:"values,omitempty"`
	ChartObject  *chart.Chart   `json:"-"`
}

func DiscoverHelmReleases

func DiscoverHelmReleases(ctx context.Context, opts DiscoverOptions, namespaces []string) ([]HelmRelease, []string)

type NamespaceInfo

type NamespaceInfo struct {
	Name   string `json:"name"`
	Status string `json:"status,omitempty"`
}

type RenderOptions

type RenderOptions struct {
	StackName   string
	ClusterName string
	Kubeconfig  string
	Context     string
	ChartsDir   string
	WriteCharts bool
	ValuesDir   string
	WriteValues bool
}

type Snapshot

type Snapshot struct {
	Cluster      ClusterInfo     `json:"cluster,omitempty"`
	Namespaces   []NamespaceInfo `json:"namespaces,omitempty"`
	HelmReleases []HelmRelease   `json:"helmReleases,omitempty"`
	GitOps       []GitOpsObject  `json:"gitOps,omitempty"`
	Workloads    []Workload      `json:"workloads,omitempty"`
	Helmfiles    []string        `json:"helmfiles,omitempty"`
	Warnings     []string        `json:"warnings,omitempty"`
}

func Discover

func Discover(ctx context.Context, kc *kube.Client, opts DiscoverOptions) (*Snapshot, error)

type ValuesFile

type ValuesFile struct {
	Path   string
	Values map[string]any
}

type ValuesWriteResult

type ValuesWriteResult struct {
	Created []string
	Skipped []string
}

func WriteChartFiles

func WriteChartFiles(root string, files []ChartFile, force bool, dryRun bool) (ValuesWriteResult, error)

func WriteValuesFiles

func WriteValuesFiles(root string, files []ValuesFile, force bool, dryRun bool) (ValuesWriteResult, error)

type Workload

type Workload struct {
	Kind        string `json:"kind"`
	Namespace   string `json:"namespace"`
	Name        string `json:"name"`
	ManagedBy   string `json:"managedBy,omitempty"`
	HelmRelease string `json:"helmRelease,omitempty"`
	GitOps      string `json:"gitOps,omitempty"`
}

Jump to

Keyboard shortcuts

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