-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add openAPI schema for AntreaAgentInfo and AntreaControllerInfo #5206
Conversation
0ba6da0
to
36df4cf
Compare
68b647b
to
656a58b
Compare
docs/api.md
Outdated
| `AntreaAgentInfo` | v1 | v1.0.0 | N/A | N/A | | ||
| `AntreaControllerInfo` | v1 | v1.0.0 | N/A | N/A | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `AntreaAgentInfo` | v1 | v1.0.0 | N/A | N/A | | |
| `AntreaControllerInfo` | v1 | v1.0.0 | N/A | N/A | | |
| `AntreaAgentInfo` | v1 | v1.13.0 | N/A | N/A | | |
| `AntreaControllerInfo` | v1 | v1.13.0 | N/A | N/A | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
docs/api.md
Outdated
| `AntreaAgentInfo` | v1beta1 | v1.0.0 | v1.13.0 | v2.0.0 | | ||
| `AntreaControllerInfo` | v1beta1 | v1.0.0 | v1.13.0 | v2.0.0 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `AntreaAgentInfo` | v1beta1 | v1.0.0 | v1.13.0 | v2.0.0 | | |
| `AntreaControllerInfo` | v1beta1 | v1.0.0 | v1.13.0 | v2.0.0 | | |
| `AntreaAgentInfo` | v1beta1 | v1.0.0 | v1.13.0 | N/A | | |
| `AntreaControllerInfo` | v1beta1 | v1.0.0 | v1.13.0 | N/A | |
We are probably unable to remove them in 2.0.0 considering we need to follow the K8s deprecation policy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
hack/update-codegen-dockerized.sh
Outdated
@@ -146,7 +150,7 @@ function generate_antrea_client_code { | |||
--input-dirs "${ANTREA_PKG}/pkg/apis/controlplane/v1beta2" \ | |||
--input-dirs "${ANTREA_PKG}/pkg/apis/system/v1beta1" \ | |||
--input-dirs "${ANTREA_PKG}/pkg/apis/stats/v1alpha1" \ | |||
--input-dirs "${ANTREA_PKG}/pkg/apis/crd/v1beta1" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this shouldn't be removed since we still have v1beta1 crd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
pkg/apis/crd/v1/doc.go
Outdated
@@ -0,0 +1,20 @@ | |||
// Copyright 2019 Antrea Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright 2019 Antrea Authors | |
// Copyright 2023 Antrea Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
pkg/apis/crd/v1/register.go
Outdated
@@ -0,0 +1,56 @@ | |||
// Copyright 2019 Antrea Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
pkg/apis/system/v1beta1/register.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tnqn should this api be promoted to v1 as controller/agent info?
test/e2e/framework.go
Outdated
@@ -2880,8 +2880,8 @@ func retryOnConnectionLostError(backoff wait.Backoff, fn func() error) error { | |||
} | |||
|
|||
func (data *TestData) checkAntreaAgentInfo(interval time.Duration, timeout time.Duration, name string) error { | |||
err := wait.PollImmediate(interval, timeout, func() (bool, error) { | |||
aai, err := data.crdClient.CrdV1beta1().AntreaAgentInfos().Get(context.TODO(), name, metav1.GetOptions{}) | |||
err := wait.Poll(interval, timeout, func() (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the method changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
f93c864
to
a140121
Compare
schema: | ||
openAPIV3Schema: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we discussed this API promotion, we said we would add a correct openAPI schema as part of the CRD definition. This PR does not do that. See #5068
I feel more comfortable with beta, but no strong opinion. |
I don't have strong opinion either. If we don't really have a strong reason to do it, should we just enhance the validation in this release? It seems fine to me to just enhance the schema in-place? |
I'm fine with staying in beta and adding the correct openAPI schema. I feel like even if we only add the schema, it is better to increment the version number (v1beta1 -> v1beta2). But then again, this is essentially a "read-only" API, so it probably doesn't matter very much. |
I will update this pr with two modifications:
|
Introducing a new version still comes with some cost: all clients including antrea-ui and nephe need to update their code, but there is no usage change, and no stage change like other API promotions (from alpha to beta). Given the enhancement doesn't break anything and there is no real benefit from v1beta2, should we just keep v1beta1? |
Given this API usage (read-only for clients), I am fine with this |
a140121
to
d5a7e3f
Compare
/test-multicast-e2e |
1 similar comment
/test-multicast-e2e |
bd886e9
to
62ba983
Compare
items: | ||
type: string | ||
apiCABundle: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should also have a format: byte
property, given that the Go type is []byte
and it will be base64-encoded when it is serialized.
see https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
type: string | ||
flowTable: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this work here instead:
flowTable:
type: object
additionalProperties:
type: number
format: int32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated. Number represents floating point numbers
. I think it should be type: integer
?
networkPolicyNum: | ||
type: integer | ||
addressGroupNum: | ||
type: integer | ||
appliedToGroupNum: | ||
type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add format: in32
for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
62ba983
to
4ca2b30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more comment, otherwise lgtm
networkPolicyNum: | ||
type: integer | ||
addressGroupNum: | ||
type: integer | ||
appliedToGroupNum: | ||
type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are missing format: int32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated. Thanks
Signed-off-by: ceclinux <[email protected]>
4ca2b30
to
32ccd8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/test-all |
No description provided.