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

The KRM object passed into the gkehub direct controller doesn't match what is specified in the test suite regarding mutually exclusive fields #3344

Open
3 tasks done
ziyue-101 opened this issue Dec 10, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ziyue-101
Copy link
Collaborator

ziyue-101 commented Dec 10, 2024

Checklist

  • I did not find a related open enhancement request.
  • I understand that enhancement requests filed in the GitHub repository are by default low priority.
  • If this request is time-sensitive, I have submitted a corresponding issue with GCP support.

Describe the feature or resource

Running mock tests for basicsaugkehubfeaturemembership . The version field and management field should not be set together. Thus, the version field is removed while adding the management field in the update.yaml. However, when the direct controller tries to update the resource, the KRM it retrieves from the local k8s cluster has two fields present, which should have only the management field not the version field.

Step to reproduce.

I used

{
           "name": "Debug hub mock test",
           "type": "go",
           "request": "launch",
           "mode": "test",
           "program": "./tests/e2e",
           "env": {
               "E2E_KUBE_TARGET" :"envtest",
               "RUN_E2E":"1",
               "E2E_GCP_TARGET":"mock",
               "WRITE_GOLDEN_OUTPUT":"1",
               "GOLDEN_REQUEST_CHECKS" :"1",
               "GOLDEN_OBJECT_CHECKS" :"1",
           },
           "args": [
               "-test.v",
               "-test.run", "TestAllInSeries/fixtures/basiccsaugkehubfeaturemembership",
               "-test.timeout", "900s",
           ],
           "showLog": true
       }

and found the u unstructed as the input of AdapterForObject has two fields at the same time.
image

Additional information

No response

Importance

No response

@ziyue-101 ziyue-101 added the enhancement New feature or request label Dec 10, 2024
@ziyue-101 ziyue-101 changed the title The KRM object passed into the scifi controller doesn't match what is specified in the test suite for mutually exclusive fields The KRM object passed into the gkehub direct controller doesn't match what is specified in the test suite for mutually exclusive fields Dec 10, 2024
@ziyue-101
Copy link
Collaborator Author

/cc @acpana @maqiuyujoyce @yuwenma

@ziyue-101 ziyue-101 changed the title The KRM object passed into the gkehub direct controller doesn't match what is specified in the test suite for mutually exclusive fields The KRM object passed into the gkehub direct controller doesn't match what is specified in the test suite regarding mutually exclusive fields Dec 10, 2024
@maqiuyujoyce
Copy link
Collaborator

maqiuyujoyce commented Dec 11, 2024

I think I know what's going on. In pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basiccsaugkehubfeaturemembership, the create.yaml contains version field but the update.yaml doesn't contain it. And in TestAllInSeries(), we update the resource via PATCH, which doesn't replace the whole manifest, but only updates the fields specified in the update manifest.

I think we either need to add additional test flow for UPDATE, but replace this PATCH with UPDATE.

@maqiuyujoyce maqiuyujoyce mentioned this issue Dec 11, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants