MCPcopy
hub / github.com/operator-framework/operator-sdk / GetObjectsStatus

Method GetObjectsStatus

internal/olm/client/status.go:53–79  ·  view source on GitHub ↗
(ctx context.Context, objs ...client.Object)

Source from the content-addressed store, hash-verified

51}
52
53func (c Client) GetObjectsStatus(ctx context.Context, objs ...client.Object) Status {
54 var rss []ResourceStatus
55 for _, obj := range objs {
56 gvk := obj.GetObjectKind().GroupVersionKind()
57 nn := types.NamespacedName{
58 Namespace: obj.GetNamespace(),
59 Name: obj.GetName(),
60 }
61 rs := ResourceStatus{
62 NamespacedName: nn,
63 GVK: gvk,
64 requestObject: obj,
65 }
66 u := unstructured.Unstructured{}
67 u.SetGroupVersionKind(gvk)
68 err := c.KubeClient.Get(ctx, nn, &u)
69 if err != nil {
70 rs.Error = fmt.Errorf("error getting resource %q with GVK %q: %w", nn, gvk, err)
71 }
72 if rs.Error == nil {
73 rs.Resource = &u
74 }
75 rss = append(rss, rs)
76 }
77
78 return Status{Resources: rss}
79}
80
81// HasInstalledResources only returns true if at least one resource in s
82// was returned successfully by the API server. A resource error status

Callers 3

InstallVersionMethod · 0.95
UninstallVersionMethod · 0.95
GetStatusMethod · 0.95

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected