func getIAMPolicy()

in pkg/berglas/iam_storage.go [159:174]


func getIAMPolicy(ctx context.Context, h *iam.Handle) (*iam.Policy, error) {
	var policy *iam.Policy

	if err := iamRetry(ctx, func(ctx context.Context) error {
		rPolicy, err := h.Policy(ctx)
		if err != nil {
			return err
		}
		policy = rPolicy
		return nil
	}); err != nil {
		return nil, err
	}

	return policy, nil
}