utils

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResourceOperability

func CheckResourceOperability(res client.Object, productName string) error

func GetClusterByRuntime

func GetClusterByRuntime(ctx context.Context, k8sClient client.Client, nautesNamespace string, runtime interfaces.Runtime) (*nautescrd.Cluster, error)

func GetCodeRepoProviderAndCodeRepoWithURL

func GetCodeRepoProviderAndCodeRepoWithURL(ctx context.Context, k8sClient client.Client, repoKey types.NamespacedName, nautesNamespace string) (*nautescrd.CodeRepoProvider, *nautescrd.CodeRepo, error)

func GetCodeRepoURL

func GetCodeRepoURL(ctx context.Context, k8sClient client.Client, codeRepo nautescrd.CodeRepo, nautesNamespace string) (string, error)

func GetProductNameByIDInCluster

func GetProductNameByIDInCluster(cluster nautescrd.Cluster, productID string) string

func GetProductNamespacesInCluster

func GetProductNamespacesInCluster(ctx context.Context, k8sClient client.Client, product, cluster string) ([]string, error)

func GetReservedNamespacesByProduct

func GetReservedNamespacesByProduct(cluster nautescrd.Cluster, productID string) []string

func GetURLsInCluster

func GetURLsInCluster(ctx context.Context, k8sClient client.Client, product, cluster string, nautesNamespace string) ([]string, error)

func IsBelongsToProduct

func IsBelongsToProduct(res client.Object, productName string) bool

IsBelongsToProduct check resouces is maintain by nautes

func IsLegal

func IsLegal(res client.Object, productName string) (string, bool)

IsLegal used to check resources is availabel for reconcile. It will return two vars, pass or not and the reason if check is failed.

func IsOwner

func IsOwner(owner, object client.Object, scheme *runtime.Scheme) bool

IsOwner check k8s resource is belongs to another resource

func RemoveOwner

func RemoveOwner(owner, object client.Object, scheme *runtime.Scheme) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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