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

[WIP] Change status.conditions to the Kubernetes format #557

Closed
wants to merge 8 commits into from
Closed

[WIP] Change status.conditions to the Kubernetes format #557

wants to merge 8 commits into from

Conversation

tpiperatgod
Copy link
Contributor

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #552

(or if this PR is one task of a github issue, please add Master Issue: #<xyz> to link to the master issue.)

Master Issue: #

Motivation

Explain here the context, and why you're making that change. What is the problem you're trying to solve.

Modifications

Describe the modifications you've done.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@tpiperatgod tpiperatgod requested review from nlu90, freeznet and a team as code owners January 7, 2023 07:36
@github-actions github-actions bot added the no-need-doc This pr does not need any document label Jan 7, 2023
@tpiperatgod
Copy link
Contributor Author

should we skip this codacy issue 🥲

Signed-off-by: laminar <[email protected]>
@nlu90
Copy link
Contributor

nlu90 commented Jan 10, 2023

@tpiperatgod Could you provide an example status after the change?

Signed-off-by: laminar <[email protected]>
@tpiperatgod
Copy link
Contributor Author

@tpiperatgod Could you provide an example status after the change?

FunctionMesh in creation...
image

A ready Function
image

@EronWright
Copy link
Contributor

Forgive me if I've misunderstood, but this doesn't look like Kubernetes conditions to me. Conditions are generally an array, not a map. The array has merge semantics, with the type field serving as the key.

Also, there's a standard metav1.Condition structure in recent versions of the kube library, that I would recommend you use. It has convenient functions like IsTrueFor(conditions []metav1.Condition, typ string) bool and FindCondition.

Consider using observedGeneration to convey the generation that the status corresponds to.

@tpiperatgod
Copy link
Contributor Author

Forgive me if I've misunderstood, but this doesn't look like Kubernetes conditions to me. Conditions are generally an array, not a map. The array has merge semantics, with the type field serving as the key.

Also, there's a standard metav1.Condition structure in recent versions of the kube library, that I would recommend you use. It has convenient functions like IsTrueFor(conditions []metav1.Condition, typ string) bool and FindCondition.

Consider using observedGeneration to convey the generation that the status corresponds to.

I was planning to use the Array form of Condition, but I kept the original Map form considering the need to be compatible with the previous Condition. We can change the Condition to Array form if we agree on it.

@tpiperatgod tpiperatgod changed the title Change status.conditions to the Kubernetes format [WIP] Change status.conditions to the Kubernetes format Jan 11, 2023
@tpiperatgod tpiperatgod closed this by deleting the head repository Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-need-doc This pr does not need any document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change status.conditions to the Kubernetes format
3 participants