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

Valid config that omits the 'name' field is rejected #73

Open
tjohnes opened this issue Jun 7, 2024 · 0 comments
Open

Valid config that omits the 'name' field is rejected #73

tjohnes opened this issue Jun 7, 2024 · 0 comments

Comments

@tjohnes
Copy link

tjohnes commented Jun 7, 2024

Per the multi-network CRD spec, if spec.config is valid but omits the name field, then the NPWG implementation adds a name field containing the NAD name (section 3.4.2).

preprocessCNIConfig attempts to mirror this behavior, but it only adds the name if there is an error unmarshalling the config:

	if err := json.Unmarshal(config, &c); err != nil {
		if n, ok := c["name"]; !ok || n == "" {
			c["name"] = name
		}
	}

This means valid config that omits the name field is rejected by the webhook.

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

No branches or pull requests

1 participant