Documentation ¶
Index ¶
- func ConvertToUnstructured(resourceObject runtime.Object) (resource *unstructured.Unstructured)
- func GetResourceAndGvkFromApplication(application *rocketv1alpha1.Application) (*unstructured.Unstructured, *schema.GroupVersionKind, error)
- func GetResourceAndGvkFromDistribution(rd *rocketv1alpha1.Distribution) (*unstructured.Unstructured, *schema.GroupVersionKind, error)
- func Match(rd *rocketv1alpha1.Distribution) (*unstructured.Unstructured, *schema.GroupVersionKind, bool, error)
- func NamespacedScope(rd *unstructured.Unstructured, cli *discovery.DiscoveryClient) (bool, error)
- func NeedToUpdate(old, new *unstructured.Unstructured) bool
- func SetGVRForApplication(gvk *schema.GroupVersionKind) schema.GroupVersionResource
- func SetGVRForDistribution(gvk *schema.GroupVersionKind) schema.GroupVersionResource
- func ValidateResource(gvr schema.GroupVersionResource) error
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 ¶
func Match(rd *rocketv1alpha1.Distribution) (*unstructured.Unstructured, *schema.GroupVersionKind, bool, error)
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 SetGVRForDistribution ¶
func SetGVRForDistribution(gvk *schema.GroupVersionKind) schema.GroupVersionResource
func ValidateResource ¶
func ValidateResource(gvr schema.GroupVersionResource) error
ValidateResource 验证资源是否支持
Types ¶
This section is empty.