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

Model getters have different annotations than fields (breaks native) #6098

Closed
manusa opened this issue Jul 2, 2024 · 3 comments · Fixed by #6101
Closed

Model getters have different annotations than fields (breaks native) #6098

manusa opened this issue Jul 2, 2024 · 3 comments · Fixed by #6101
Assignees
Labels
bug component/kubernetes-model Deals with the kubernetes-model
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jul 2, 2024

There are still some methods that are not annotated like in io.fabric8.kubernetes.api.model.ObjectMeta (annotations, labels):

    @JsonProperty("annotations")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, String> annotations = new LinkedHashMap<String, String>();

    @JsonProperty("annotations")
    public Map<String, String> getAnnotations() {
        return annotations;
    }

    @JsonProperty("annotations")
    public void setAnnotations(Map<String, String> annotations) {
        this.annotations = annotations;
    }

Originally posted by @jorsol in #6086 (comment)

@manusa
Copy link
Member Author

manusa commented Jul 2, 2024

OK, this has to do with the Fabric8DefaultRule which should really extend a different Rule. DefaultRule should be used to provide default values for fields and not to annotate fields.

Logic in this class should be moved to KubernetesCoreTypeAnnotator inside the propertyField method:

public void propertyField(JFieldVar field, JDefinedClass clazz, String propertyName, JsonNode propertyNode) {

@manusa manusa added the component/kubernetes-model Deals with the kubernetes-model label Jul 2, 2024
@jorsol
Copy link
Contributor

jorsol commented Jul 2, 2024

It seems to be affected by the same but the overhead (which was the reported issue on Quarkus quarkusio/quarkus#39934) still misses the annotation:

@JsonProperty("overhead")
public Map<String, Quantity> getOverhead() {
return overhead;
}

@manusa
Copy link
Member Author

manusa commented Jul 2, 2024

Oh dear, I thought I checked that field specifically 🤦 🤦 🤦 🤦 🤦.

@manusa manusa moved this from Planned to In Progress in Eclipse JKube Jul 2, 2024
@manusa manusa self-assigned this Jul 2, 2024
@manusa manusa added this to the 7.0.0 milestone Jul 2, 2024 — with automated-tasks
@manusa manusa moved this from In Progress to Review in Eclipse JKube Jul 2, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Eclipse JKube Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component/kubernetes-model Deals with the kubernetes-model
Projects
None yet
2 participants