mirror of
https://github.com/storytold/irsa-manager.git
synced 2026-10-24 08:15:52 +00:00
no update (secret)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package kubernetes
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
)
|
||||
|
||||
// Get gets the given object.
|
||||
func (h KubernetesClient) Get(ctx context.Context, obj client.Object) (*unstructured.Unstructured, error) {
|
||||
u, err := h.toUnstructured(obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
existingObj := &unstructured.Unstructured{}
|
||||
existingObj.SetGroupVersionKind(u.GroupVersionKind())
|
||||
err = h.client.Get(ctx, client.ObjectKeyFromObject(u), existingObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return existingObj, nil
|
||||
}
|
||||
Reference in New Issue
Block a user