Documentation ¶
Index ¶
- Constants
- Variables
- func CreateScheme() *apiruntime.Scheme
- type ClusterStatus
- type Kube
- type KubeHTTP
- func (k *KubeHTTP) Apply(ctx context.Context, manifest []byte, namespace string) error
- func (k *KubeHTTP) Delete(ctx context.Context, manifest []byte) error
- func (c *KubeHTTP) DeleteByName(ctx context.Context, name string, gvr schema.GroupVersionResource, ...) error
- func (k *KubeHTTP) FluxPresent(ctx context.Context) (bool, error)
- func (k *KubeHTTP) GetApplication(ctx context.Context, name types.NamespacedName) (*wego.Application, error)
- func (k *KubeHTTP) GetApplications(ctx context.Context, namespace string) ([]wego.Application, error)
- func (k *KubeHTTP) GetClusterName(ctx context.Context) (string, error)
- func (k *KubeHTTP) GetClusterStatus(ctx context.Context) ClusterStatus
- func (k *KubeHTTP) GetResource(ctx context.Context, name types.NamespacedName, resource Resource) error
- func (k KubeHTTP) GetSecret(ctx context.Context, name types.NamespacedName) (*corev1.Secret, error)
- func (k *KubeHTTP) SecretPresent(ctx context.Context, secretName string, namespace string) (bool, error)
- type Resource
Constants ¶
View Source
const FluxNamespace = "flux-system"
View Source
const WeGOCRDName = "apps.wego.weave.works"
View Source
const WeGONamespace = "wego-system"
Variables ¶
View Source
var ( GVRSecret schema.GroupVersionResource = corev1.SchemeGroupVersion.WithResource("secrets") GVRApp schema.GroupVersionResource = wego.GroupVersion.WithResource("apps") GVRKustomization schema.GroupVersionResource = kustomizev1.GroupVersion.WithResource("kustomizations") GVRGitRepository schema.GroupVersionResource = sourcev1.GroupVersion.WithResource("gitrepositories") GVRHelmRepository schema.GroupVersionResource = sourcev1.GroupVersion.WithResource("helmrepositories") GVRHelmRelease schema.GroupVersionResource = helmv2.GroupVersion.WithResource("helmreleases") )
Functions ¶
func CreateScheme ¶ added in v0.2.0
func CreateScheme() *apiruntime.Scheme
Types ¶
type ClusterStatus ¶
type ClusterStatus int
const ( Unknown ClusterStatus = iota Unmodified FluxInstalled GitOpsInstalled )
func (ClusterStatus) String ¶
func (cs ClusterStatus) String() string
Function to translate ClusterStatus to a string
type Kube ¶
type Kube interface { Apply(ctx context.Context, manifest []byte, namespace string) error Delete(ctx context.Context, manifest []byte) error DeleteByName(ctx context.Context, name string, gvr schema.GroupVersionResource, namespace string) error SecretPresent(ctx context.Context, string, namespace string) (bool, error) GetApplications(ctx context.Context, namespace string) ([]wego.Application, error) FluxPresent(ctx context.Context) (bool, error) GetClusterName(ctx context.Context) (string, error) GetClusterStatus(ctx context.Context) ClusterStatus GetApplication(ctx context.Context, name types.NamespacedName) (*wego.Application, error) GetResource(ctx context.Context, name types.NamespacedName, resource Resource) error GetSecret(ctx context.Context, name types.NamespacedName) (*corev1.Secret, error) }
type KubeHTTP ¶ added in v0.2.0
type KubeHTTP struct { Client client.Client ClusterName string DynClient dynamic.Interface RestMapper *restmapper.DeferredDiscoveryRESTMapper }
This is an alternative implementation of the kube.Kube interface, specifically designed to query the K8s API directly instead of relying on `kubectl` to be present in the PATH.
func (*KubeHTTP) DeleteByName ¶ added in v0.2.3
func (*KubeHTTP) FluxPresent ¶ added in v0.2.0
func (*KubeHTTP) GetApplication ¶ added in v0.2.0
func (k *KubeHTTP) GetApplication(ctx context.Context, name types.NamespacedName) (*wego.Application, error)
func (*KubeHTTP) GetApplications ¶ added in v0.2.0
func (*KubeHTTP) GetClusterName ¶ added in v0.2.0
func (*KubeHTTP) GetClusterStatus ¶ added in v0.2.0
func (k *KubeHTTP) GetClusterStatus(ctx context.Context) ClusterStatus
func (*KubeHTTP) GetResource ¶ added in v0.2.1
Click to show internal directories.
Click to hide internal directories.