utils

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 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 added in v0.3.0

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

func GetClusterByRuntime added in v0.3.6

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

func GetCodeRepoProviderAndCodeRepoWithURL added in v0.3.0

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

func GetCodeRepoURL added in v0.3.6

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

func GetProductNameByIDInCluster added in v0.3.6

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

func GetProductNamespacesInCluster added in v0.3.6

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

func GetReservedNamespacesByProduct added in v0.3.6

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

func GetURLsInCluster added in v0.3.6

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 added in v0.3.0

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

IsOwner check k8s resource is belongs to another resource

func RemoveOwner added in v0.3.0

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