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
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
132e9b2
fix: Apisix Cluster Config status
Chever-John Apr 23, 2023
e4bcc97
test: e2e test for Apisix Cluster Config status
Chever-John Apr 23, 2023
2b31690
chore: make update-all
Chever-John May 3, 2023
f9d8999
chore: type the cluster name
Chever-John May 4, 2023
e9de4f1
typo: from ApisixPluginConfig to ApisixClusterConfig
Chever-John May 4, 2023
73365ea
fix: newApisixClusterConfig
Chever-John May 6, 2023
1d5d245
fix: change clusterConfig's name
Chever-John May 6, 2023
021fd8b
chore: change FIt to It
Chever-John May 6, 2023
d65a927
fix: change config's name
Chever-John May 7, 2023
21c6331
fix: add crd-subresource-status for apisixConsumer
Chever-John May 7, 2023
e8784b9
fix: yamllint error
Chever-John May 14, 2023
307298b
typo: something need to correct
Chever-John May 15, 2023
a51ab89
fix: used resource must be released
Chever-John May 16, 2023
f59d8ef
fix: yamllint error
Chever-John May 16, 2023
f636628
fix: change the status sub-resource from
Chever-John May 16, 2023
21d3ac1
ci: accelerate ci for judging error
Chever-John May 16, 2023
a1e7e4c
chore: fmt the status.go
Chever-John May 16, 2023
8b1dbe2
chore: makefile
Chever-John May 16, 2023
eb899b1
fix: package error
Chever-John May 17, 2023
f3c9496
fix: remove unused package
Chever-John May 17, 2023
dd922ab
fix: the ci error
Chever-John May 18, 2023
65aa00c
fix: ci error
Chever-John May 18, 2023
b1571f0
fix: ci error
Chever-John May 18, 2023
6851347
fix: ci debug
Chever-John May 19, 2023
c0da9a8
fix: ci error
Chever-John May 29, 2023
7da1727
Merge branch 'master' into fix/add-crd-status-field
Chever-John May 29, 2023
1e7c01d
ci: Set cron for automatic execution upon changes in dev status
Chever-John Sep 11, 2023
eab049e
solve merge conflicts
Revolyssup Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions samples/deploy/crd/v1/ApisixClusterConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,27 @@ spec:
type: number
minimum: 0.00001
maximum: 1
status:
type: object
properties:
observedGeneration:
type: integer
conditions:
type: array
items:
type: object
properties:
type:
type: string
status:
type: string
lastTransitionTime:
type: string
reason:
type: string
message:
type: string
required:
- type
- status
- lastTransitionTime
14 changes: 14 additions & 0 deletions test/e2e/suite-ingress/suite-ingress-features/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:)

assert.Nil(ginkgo.GinkgoT(), s.NewApisixClusterConfig("default", true, true), "create cluster config error")
time.Sleep(6 * time.Second)

// status should be recorded as successfulen
output, err := s.GetOutputFromString("acc", clusterConfigName, "-o", "yaml")
assert.Nil(ginkgo.GinkgoT(), err, "Get output of ApisixClusterConfig resource")
assert.Contains(ginkgo.GinkgoT(), output, "type: ResourcesAvailable", "status.conditions.type is recorded")
Chever-John marked this conversation as resolved.
Show resolved Hide resolved
assert.Contains(ginkgo.GinkgoT(), output, "reason: ResourcesSynced", "status.conditions.reason is recorded")
assert.Contains(ginkgo.GinkgoT(), output, `status: "True"`, "status.conditions.status is recorded")
assert.Contains(ginkgo.GinkgoT(), output, "message: Sync Successfully", "status.conditions.message is recorded")
})
//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.

Expand Down