Skip to content
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

Operator-sdk Get calls are not working as expected #49

Closed
jensgrnb opened this issue Feb 3, 2022 · 0 comments · Fixed by #73
Closed

Operator-sdk Get calls are not working as expected #49

jensgrnb opened this issue Feb 3, 2022 · 0 comments · Fixed by #73
Assignees

Comments

@jensgrnb
Copy link
Contributor

jensgrnb commented Feb 3, 2022

What is is not working as you expected it?
The operator-sdk get call syntax is not returning nil on existing resources, instead it returns empty string error --> in source code this is stated as the equivalent of 500 server errror.

Where on the platform does it happen?
Operator controller.

How do we replicate the issue?
Controller resource updates are not executed when we use the operator-sdk syntax.

Expected behavior (i.e. solution)
The Get statement should return nil on existing resources not an error.

Other Comments
We fixed this by changing

err = r.Get(ctx, types.NamespacedName{Name: inventoryDaemonSet, Namespace: mondoo.Namespace}, foundConfigMap)

-->

err = r.Get(ctx, client.ObjectKeyFromObject(&corev1.ConfigMap{
			ObjectMeta: metav1.ObjectMeta{
				Name:      inventoryDaemonSet,
				Namespace: mondoo.Namespace,
			},
		}), foundConfigMap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant