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

Iniitialize status conditions #191

Merged
merged 2 commits into from
Nov 11, 2021
Merged

Conversation

shashwathi
Copy link
Contributor

Pull request

What this PR does / why we need it

K8s API server is rejecting status condition with no values. So update initialize conditions func to initialize all fields in status resource.

Which issue(s) this PR fixes

Fixes #177

Describe testing done for PR

Use the testcase from #177 issue.

Additional information or special notes for your reviewer

- k8s api server is rejecting status condition with no values. So
update initialize conditions func to initialize all fields in all sub status.
@vmwclabot vmwclabot added the cla-not-required CLA not required label Nov 10, 2021
@codecov
Copy link

codecov bot commented Nov 10, 2021

Codecov Report

Merging #191 (ce1d9da) into main (416eee3) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head ce1d9da differs from pull request most recent head c0f9cd0. Consider uploading reports for the commit c0f9cd0 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
- Coverage   94.38%   94.34%   -0.04%     
==========================================
  Files          16       16              
  Lines         641      637       -4     
==========================================
- Hits          605      601       -4     
  Misses         25       25              
  Partials       11       11              
Impacted Files Coverage Δ
...ervicebinding/v1alpha3/servicebinding_lifecycle.go 94.66% <100.00%> (-0.28%) ⬇️
pkg/reconciler/servicebinding/servicebinding.go 79.41% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 416eee3...c0f9cd0. Read the comment docs.

serviceAvailable := metav1.Condition{Type: ServiceBindingConditionServiceAvailable}
projectionReady := metav1.Condition{Type: ServiceBindingConditionProjectionReady}
func (bs *ServiceBindingStatus) InitializeConditions(now metav1.Time) {
ready := metav1.Condition{Type: ServiceBindingConditionReady, Status: metav1.ConditionUnknown, LastTransitionTime: now, Reason: InitializeConditionReason}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if it would be simpler to set the metav1.time inside the method. Perhaps the unit test will be challenging!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup you guessed it right

@@ -442,7 +456,7 @@ func TestServiceBindingStatus_MarkServiceAvailable(t *testing.T) {
{
Type: ServiceBindingConditionReady,
Status: metav1.ConditionUnknown,
Reason: "Unknown",
Reason: "ProjectionReadyUnknown",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that Reason ProjectionReadyUnknown correct? Can you please help me with some detail for this reason value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aggregare func builds the reason string with sub condition type + condition reason. Same for other comment

@@ -572,11 +587,21 @@ func TestServiceBindingStatus_aggregateReadyCondition(t *testing.T) {
{
Type: ServiceBindingConditionReady,
Status: "Unknown",
Reason: "ServiceAvailableUnknown",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServiceAvailableUnknown - same question here as well

Copy link

@suarezjulian suarezjulian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shashwathi shashwathi merged commit 34897a1 into vmware-tanzu:main Nov 11, 2021
@shashwathi shashwathi deleted the iss-177 branch November 11, 2021 19:00
@scothis
Copy link
Contributor

scothis commented Dec 17, 2021

Still seeing this behavior in v0.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required CLA not required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error reporting when service is not matched
5 participants