gvktools

package
v0.0.0-...-ef63bee Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToUnstructured

func ConvertToUnstructured(resourceObject runtime.Object) (resource *unstructured.Unstructured)

ConvertToUnstructured converts a runtime.Object to an *unstructured.Unstructured

func GetResourceAndGvkFromApplication

func GetResourceAndGvkFromApplication(application *rocketv1alpha1.Application) (*unstructured.Unstructured, *schema.GroupVersionKind, error)

GetResourceAndGvkFromApplication 从 application 中获取资源和 gvk

func GetResourceAndGvkFromDistribution

func GetResourceAndGvkFromDistribution(rd *rocketv1alpha1.Distribution) (*unstructured.Unstructured, *schema.GroupVersionKind, error)

GetResourceAndGvkFromDistribution 从 distribution 中获取资源和 gvk

func Match

bool: is deploy in current cluster

func NamespacedScope

func NamespacedScope(rd *unstructured.Unstructured, cli *discovery.DiscoveryClient) (bool, error)

NamespacedScope 判断资源是否是 namespace 类型的资源

func NeedToUpdate

func NeedToUpdate(old, new *unstructured.Unstructured) bool

NeedToUpdate returns true if the new object has to be updated. This is determined by comparing the old object with the new one. The old object is the one currently stored in the cluster, while the new one is the one generated by the controller. We ignore changes in annotations and labels since they are not part of the resource spec.

func SetGVRForApplication

func SetGVRForApplication(gvk *schema.GroupVersionKind) schema.GroupVersionResource

SetGVRForDistribution 根据 gvk 设置 gvr

func ValidateResource

func ValidateResource(gvr schema.GroupVersionResource) error

ValidateResource 验证资源是否支持

Types

This section is empty.

Jump to

Keyboard shortcuts

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