Documentation ¶
Index ¶
- func CreateOrUpdateCattleHelmChart(helmChart helmv1.HelmChart, namespaces ...string) (*helmv1.HelmChart, error)
- func DeleteCattleHelmChart(namespace string, name string) error
- func GetChartReleaseHistory(namespace, releaseName string) ([]*release.Release, error)
- func GetKubernetesConfig() (*rest.Config, error)
- func GetNamespaces() ([]string, error)
- func ListCattleHelmCharts(namespaces ...string) ([]helmv1.HelmChart, error)
- func ListHelmChartReleases(namespace string) ([]*release.Release, error)
- func NewCattleHelmChartClient() (*versioned.Clientset, error)
- func SetupHelmConfiguration(namespace string) (*action.Configuration, error)
- type Client
- func (kc *Client) ApplyResource(fileContent []byte) error
- func (kc *Client) DeleteResource(resourceType, resourceName, namespace string, fileContent []byte) error
- func (kc *Client) GetResources(resourceType, resourceName, namespace string) ([]unstructured.Unstructured, error)
- func (kc *Client) ListAPIResources() ([]*metav1.APIResourceList, error)
- type ExtendedCattleHelmChart
- type ReleaseWithWorkloadStatus
- type WorkloadStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateCattleHelmChart ¶
func CreateOrUpdateCattleHelmChart(helmChart helmv1.HelmChart, namespaces ...string) (*helmv1.HelmChart, error)
CreateOrUpdateCattleHelmChart creates or updates a Helm chart. It automatically handles resource version conflicts.
func DeleteCattleHelmChart ¶
DeleteCattleHelmChart deletes a Helm chart by name and namespace.
func GetChartReleaseHistory ¶
func GetKubernetesConfig ¶
GetKubernetesConfig returns Kubernetes configuration It tries to read from KUBECONFIG, fallback to default kubeconfig path, or use in-cluster config
func GetNamespaces ¶
GetNamespaces returns a list of kubernetes namespaces
func ListCattleHelmCharts ¶
ListCattleHelmCharts lists Helm charts in the specified namespaces. If no namespace is provided, charts in all namespaces are listed.
func ListHelmChartReleases ¶
ListHelmChartReleases lists all Helm charts in the given namespace. Returns a slice of release.Release pointers and any error encountered.
func NewCattleHelmChartClient ¶
NewCattleHelmChartClient creates a new clientset for interacting with Cattle Helm Charts. It returns an error if the Kubernetes configuration cannot be created.
func SetupHelmConfiguration ¶
func SetupHelmConfiguration(namespace string) (*action.Configuration, error)
SetupHelmConfiguration sets up the Helm configuration with the given namespace. Returns an action.Configuration object and any error encountered.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides dynamic interactions with Kubernetes
func (*Client) ApplyResource ¶
ApplyResource applies a Kubernetes resource from a YAML/JSON content
func (*Client) DeleteResource ¶
func (kc *Client) DeleteResource(resourceType, resourceName, namespace string, fileContent []byte) error
DeleteResource deletes a Kubernetes resource. If resourceType and resourceName are provided, it deletes that specific resource. If fileContent is provided, it extracts the resource details from the file and then deletes it.
func (*Client) GetResources ¶
func (kc *Client) GetResources(resourceType, resourceName, namespace string) ([]unstructured.Unstructured, error)
GetResources retrieves a list of Kubernetes resources based on the resource type, name, and namespace. If namespace is an empty string, it lists resources across all namespaces.
func (*Client) ListAPIResources ¶
func (kc *Client) ListAPIResources() ([]*metav1.APIResourceList, error)
ListAPIResources lists all available API resources
type ExtendedCattleHelmChart ¶
type ExtendedCattleHelmChart struct { *helmv1.HelmChart InstallerJobLogs string `json:"installer_job_logs,omitempty"` InstallerJobCompleted bool `json:"installer_job_completed"` }
ExtendedCattleHelmChart is a Helm chart with additional fields
func GetCattleHelmChart ¶
func GetCattleHelmChart(namespace string, name string) (*ExtendedCattleHelmChart, error)
GetCattleHelmChart retrieves a specific Helm chart by name and namespace.
type ReleaseWithWorkloadStatus ¶
type ReleaseWithWorkloadStatus struct { *release.Release Manifest interface{} `json:"manifest"` Workloads []WorkloadStatus `json:"workloads"` }
ReleaseWithWorkloadStatus represents a Helm chart release with the status of its workloads.
func GetHelmChartRelease ¶
func GetHelmChartRelease(namespace, releaseName string) (*ReleaseWithWorkloadStatus, error)
GetHelmChartRelease returns a Helm chart release with the given namespace and release name.
func GetHelmChartReleaseWithWorkloads ¶
func GetHelmChartReleaseWithWorkloads(namespace, releaseName string) (*ReleaseWithWorkloadStatus, error)
GetHelmChartReleaseWithWorkloads returns a Helm chart release with the status of its workloads.
type WorkloadStatus ¶
type WorkloadStatus struct { Status interface{} `json:"status"` Name string `json:"name"` Kind string `json:"kind"` }
WorkloadStatus represents the status of a Kubernetes workload.