cli: don't backup CRs that cannot be found (#2133)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-07-27 10:28:56 +02:00 committed by GitHub
parent a3184af7a2
commit 28e29ffe61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 2 deletions

View file

@ -99,7 +99,7 @@ func (k *Kubectl) GetCRs(ctx context.Context, gvr schema.GroupVersionResource) (
crdClient := k.dynamicClient.Resource(gvr)
unstructuredList, err := crdClient.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, fmt.Errorf("listing CRDs for gvr %+v: %w", crdClient, err)
return nil, fmt.Errorf("listing CRs for GroupVersionResource %+v: %w", gvr, err)
}
return unstructuredList.Items, nil