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

fix: Some CRDs missing status sub-resource #1809

Merged
merged 28 commits into from
Dec 13, 2023
Merged

fix: Some CRDs missing status sub-resource #1809

merged 28 commits into from
Dec 13, 2023

Conversation

Chever-John
Copy link
Contributor

@Chever-John Chever-John commented Apr 23, 2023

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

There are currently several resources in our custom resources that lack an observation configuration for the status sub-resource. And an e2e test file for this function. This PR aims to address these issues and completes the designs and corresponding e2e test files.

Closely linked to issue #1784.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@Chever-John Chever-John marked this pull request as draft April 23, 2023 01:22
@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (589bae6) 37.12% compared to head (ce7aeaf) 37.12%.

❗ Current head ce7aeaf differs from pull request most recent head eab049e. Consider uploading reports for the commit eab049e to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1809   +/-   ##
=======================================
  Coverage   37.12%   37.12%           
=======================================
  Files          93       93           
  Lines        7886     7886           
=======================================
  Hits         2928     2928           
  Misses       4568     4568           
  Partials      390      390           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Chever-John Chever-John marked this pull request as ready for review May 4, 2023 07:38
ginkgo.It("check ApisixClusterConfig status is recorded", func() {
// create ApisixClusterConfig resource
clusterConfigName := "cluster-config-name"
assert.Nil(ginkgo.GinkgoT(), s.NewApisixClusterConfig(clusterConfigName, true, true), "create cluster config error")

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did u mean I lose e2e-test for this api(beta3)?

Copy link

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing out!

Copy link

@afzal442 afzal442 May 4, 2023

Choose a reason for hiding this comment

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

No it is for apiV2. You are correct. I think you can undo it.
clusterConfigName := "cluster-config-name"


// status should be recorded as successfulen
output, err := s.GetOutputFromString("acc", clusterConfigName, "-o", "yaml")
assert.Nil(ginkgo.GinkgoT(), err, "Get output of ApisixPluginConfig resource")
Copy link

Choose a reason for hiding this comment

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

Suggested change
assert.Nil(ginkgo.GinkgoT(), err, "Get output of ApisixPluginConfig resource")
assert.Nil(ginkgo.GinkgoT(), err, "Get output of ApisixClusterConfig resource")

Copy link
Contributor Author

@Chever-John Chever-John May 4, 2023

Choose a reason for hiding this comment

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

tks, I will fix it!

@Chever-John Chever-John marked this pull request as draft May 6, 2023 17:22
@@ -275,6 +275,20 @@ wrw7im4TNSAdwVX4Y1F4svJ2as5SJn5QYGAzXDixNuwzXYrpP9rzA2s=
assert.Contains(ginkgo.GinkgoT(), output, `status: "False"`, "status.conditions.status is recorded")
})

ginkgo.It("check ApisixClusterConfig status is recorded", func() {
// create ApisixClusterConfig resource
clusterConfigName := "apisix-cluster-config"
Copy link

Choose a reason for hiding this comment

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

Hi, since you pass in "default" name to config, you can rmv this clusterConfigName := "apisix-cluster-config"

Copy link
Contributor Author

@Chever-John Chever-John May 7, 2023

Choose a reason for hiding this comment

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

May I know the reason why I should remove this? I didn't pass in any other value for the config name besides 'apisix-cluster-config'. Is there anything else that I'm missing?

Copy link
Contributor Author

@Chever-John Chever-John May 7, 2023

Choose a reason for hiding this comment

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

@afzal442

I apologize for overlooking the fact that the sample on the official website specifies the use of the default value as the default value for metadata.name.

Copy link

Choose a reason for hiding this comment

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

No issues @Chever-John. It's alright. I am also learning with you. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your previous guidance, it helped me a lot. I was stuck creating a test environment before, but now I can work on this issue more efficiently:)

@Chever-John Chever-John requested a review from afzal442 May 7, 2023 17:10
@Chever-John Chever-John marked this pull request as ready for review May 7, 2023 17:12
Copy link

@afzal442 afzal442 left a comment

Choose a reason for hiding this comment

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

Glad that you have achieved more than half way through this PR. 💪🏻 I can see CRD missing status sub-resource for ApisixClusterConfig is working but ApisixConsumer has some warnings now.

@tao12345666333 tao12345666333 added the bug Something isn't working label May 8, 2023
@tao12345666333
Copy link
Member

Please make CI happy first, thanks

@Chever-John
Copy link
Contributor Author

@AlinsRan need re-run the ci

e2e-test ci should must be corrected in v2 when test suit-cluster.
@tao12345666333 tao12345666333 self-assigned this Jun 6, 2023
@@ -234,8 +234,19 @@ wrw7im4TNSAdwVX4Y1F4svJ2as5SJn5QYGAzXDixNuwzXYrpP9rzA2s=
})

//TODO: ApisixGlobal
//TODO: ApisixConsumer CRD missing status definition
//TODO: ApisixClusterConfig CRD missing status definition
Copy link
Member

Choose a reason for hiding this comment

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

Also need to add a test case for the status of ApisixClusterConfig.

@github-actions
Copy link

github-actions bot commented Aug 6, 2023

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 6, 2023
@tao12345666333
Copy link
Member

could you please merge the latest code from master branch?

@github-actions github-actions bot removed the stale label Sep 1, 2023
@Chever-John
Copy link
Contributor Author

Chever-John commented Sep 11, 2023

Sure. Pleased to do that~

Let me continue the previous work.

Copy link

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 12, 2023
@Revolyssup
Copy link
Contributor

@Chever-John There are merge conflicts. Are you still working on this?

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
@Revolyssup Revolyssup merged commit 1da1ca0 into apache:master Dec 13, 2023
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants