[go: nahoru, domu]

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

Setting a field of Paved object to nil should remove that field #188

Open
muvaf opened this issue Aug 20, 2020 · 1 comment
Open

Setting a field of Paved object to nil should remove that field #188

muvaf opened this issue Aug 20, 2020 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@muvaf
Copy link
Member
muvaf commented Aug 20, 2020

What problem are you facing?

Currently, it's possible to set nil for a field in fieldpath library but that still leaves the map with that key whose value is nil. Later on, when this map is sent to api-server, it doesn't pass the validation since it should've been omitted if it was nil.

How could Crossplane help solve your problem?

Here is code snippet from unstructured.Unstructured:

func (u *Unstructured) SetLabels(labels map[string]string) {
	if labels == nil {
		RemoveNestedField(u.Object, "metadata", "labels")
		return
	}
	u.setNestedMap(labels, "metadata", "labels")
}

As you can see, in case of nil value, they remove the field completely instead of setting a nil value. I'd suggest we do the same thing in SetValue function in fieldpath.

@muvaf muvaf added the enhancement New feature or request label Aug 20, 2020
@stale
Copy link
stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant