-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
applications.argoproj.io: ApplicationStatus is not binded to Application #319
Comments
I found the ---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: applications.argoproj.io
spec:
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
spec:
description: ApplicationSpec represents desired application state. Contains
link to repository with application definition and additional parameters
link definition revision.
properties: ...
status: # here!
description: ApplicationStatus contains status information for the application
properties: ...
subresources: {} But current code only checks the if version.subresources.as_ref().is_some_and(|c| c.status.is_some())
&& self.has_status_resource(&structs)
{
println!(r#"#[kube(status = "{}Status")]"#, kind);
} So we can fix it by checking if (version.subresources.as_ref().is_some_and(|c| c.status.is_some())
|| version // also check!
.schema
.as_ref()
.and_then(|c| c.open_api_v3_schema.as_ref())
.and_then(|c| c.properties.as_ref())
.is_some_and(|c| c.contains_key("status")))
&& self.has_status_resource(&structs)
{
println!(r#"#[kube(status = "{}Status")]"#, kind);
} |
hey, there. thanks for this. your fix looks sensible, and happy to merge it, but this is also likely a bug in the schema from argo's POV. they are meant to indicate they have a subresource. |
I tested locally with If these were not meant to be, I believe we have fortunately found that there are many ways we can contribute externally. However, this is something that takes additional time. Although these may eventually be corrected, accepting them for the time being is not necessarily a bad choice. Nonetheless, I am more than willing to defer my judgment to you. Affected CRDsgit diff HEAD~1 | awk '/^diff --git / { fn = $4; gsub(/^b\//, "", fn) } /^\+#\[kube\(status \= / { print fn }' | sort -u
|
Ah, wow. Ok, yeah, makes sense. Thanks for checking all this. |
Published in 0.21.2 |
When using kube-custom-resources-rs, I found Argo's
Application
CRD has no such fieldstatus
, which is auto-generated but not auto-binded.Error Reconstruction
# applications.argoproj.io: v1alpha1, https://github.com/metio/kube-custom-resources-rs/blob/main/crd-catalog/argoproj-labs/argocd-operator/argoproj.io/v1alpha1/applications.yaml kopium applications.argoproj.io --docs --derive=Default --derive=PartialEq --smart-derive-elision
When we can see the outputs below:
When using the outputs, we can find an error below:
I think the tag
#[kube(status = "ApplicationStatus")]
is missing.The text was updated successfully, but these errors were encountered: