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

TestCRDFieldPresenceInUnstructured does not detect list fields #3571

Open
3 tasks done
jasonvigil opened this issue Jan 30, 2025 · 3 comments
Open
3 tasks done

TestCRDFieldPresenceInUnstructured does not detect list fields #3571

jasonvigil opened this issue Jan 30, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jasonvigil
Copy link
Collaborator

Checklist

Bug Description

List fields are incorrectly reported by the test as not set, for all resources.

Additional Diagnostic Information

For example, in #3544 (comment) we noticed the error

[missing_field] crd=apigeeenvgroups.apigee.cnrm.cloud.google.com version=v1beta1: field ".spec.hostnames[]" is not set in unstructured objects

This should not fail, because the field is set in the test fixture here

Kubernetes Cluster Version

n/a

Config Connector Version

n/a

Config Connector Mode

cluster mode

Log Output

No response

Steps to reproduce the issue

Run the test in #3435

YAML snippets

@jasonvigil jasonvigil added the bug Something isn't working label Jan 30, 2025
@jingyih
Copy link
Collaborator

jingyih commented Jan 30, 2025

I believe that line needs to be manually deleted.

@Camila-B
Copy link
Contributor

It seems like it's an issue with [] being added to the list field infieldPath (ex. .spec.hostnames[]). When it tries to search for the field here, it's unable to find it since the field name doesn't originally have [] at the end.

if hasField(obj.Object, fieldPath) {

@jingyih
Copy link
Collaborator

jingyih commented Jan 30, 2025

Oh I misunderstood earlier. This looks like a bug in the test.

/cc the test author @acpana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants