Skip to content

e2e support: return AppWrapper pointers instead of structs #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/support/mcad.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ func AppWrapper(t Test, namespace *corev1.Namespace, name string) func(g gomega.
}
}

func AppWrappers(t Test, namespace *corev1.Namespace) func(g gomega.Gomega) []mcadv1beta1.AppWrapper {
return func(g gomega.Gomega) []mcadv1beta1.AppWrapper {
func AppWrappers(t Test, namespace *corev1.Namespace) func(g gomega.Gomega) []*mcadv1beta1.AppWrapper {
return func(g gomega.Gomega) []*mcadv1beta1.AppWrapper {
aws, err := t.Client().MCAD().WorkloadV1beta1().AppWrappers(namespace.Name).List(t.Ctx(), metav1.ListOptions{})
g.Expect(err).NotTo(gomega.HaveOccurred())
return aws.Items

awsp := []*mcadv1beta1.AppWrapper{}
for _, v := range aws.Items {
v := v
awsp = append(awsp, &v)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

for i, v := range aws.Items {
	v := v
	awsp = append(awsp, &v)

See golang/go#56010

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks for pointing it out.
I completely forgot on this "feature".

}

return awsp
}
}

Expand Down