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

adding status handling to the mock server #3092

Merged
merged 3 commits into from
May 12, 2021

Conversation

shawkins
Copy link
Contributor

@shawkins shawkins commented May 8, 2021

Description

Addresses #3088 so that the mock server is aware of the status subresource (except for patch /status).

This also addresses several issues with replace:

  • it's implemented as an update, rather than delete/add
  • the uid is retained

I believe these changes will help resolve operator-framework/java-operator-sdk#396

This does not address create conflicts - I've left that commented out in this pr as there seem to be quite a few tests to correct.

Fix #3088

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@centos-ci
Copy link

Can one of the admins verify this patch?

@shawkins
Copy link
Contributor Author

shawkins commented May 8, 2021

Seeing the ServiceCrudTest failure with the expectation that status will exist after create probably means that status is not actually a subresource for a knative Service. In a general sense what I'm trying to do here won't work completely unless we know the resource / crd is defined with status as a subresource.

@shawkins
Copy link
Contributor Author

shawkins commented May 9, 2021

@rohanKanojia @manusa are you okay with the mock server assuming that /status is a subresource?

@iocanel
Copy link
Member

iocanel commented May 10, 2021

@rohanKanojia @manusa are you okay with the mock server assuming that /status is a subresource?

I think that it makes sense!

@rohanKanojia
Copy link
Member

I think we need to modify CustomResourceCrudTest with respect to new default metadata changes in case of create

[INFO] 
Error:  Failures: 
Error:    CustomResourceCrudTest.testCreateOrReplaceRaw:105 expected:<{metadata={name=foo}, spec=initial}> but was:<{metadata={name=foo, uid=ca059a1e-bb79-4511-b7a9-2c1ebf7c0771, resourceVersion=1, generation=1, creationTimestamp=2021-05-10T10:46:59.872828Z}, spec=initial}>
[INFO] 
Error:  Tests run: 744, Failures: 1, Errors: 0, Skipped: 4
[INFO] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Skipping Fabric8 :: Kubernetes :: Project
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Fabric8 :: Kubernetes :: Project 5.4-SNAPSHOT:

@shawkins
Copy link
Contributor Author

I think we need to modify CustomResourceCrudTest with respect to new default metadata changes in case of create

I've updated to just check for the expected fields. We have default metadata tests closer to the mock logic.

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants