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

[Fix] Make sure the ERS only handles defaulted EDS CR #71

Merged
merged 1 commit into from
Dec 24, 2020

Conversation

ahmed-mez
Copy link
Contributor

What does this PR do?

  • Make the ERS controller requeue the request if the CR is not defaulted (yet) by the EDS controller

Motivation

By design, the ERS controller can receive requests before the EDS controller defaults the CR.

This PR adds safeguard against nil pointers when accessing CR fields (e.g Spec.Strategy.ReconcileFrequency.Duration) in the ERS controller.

Additional Notes

Related to #65

Describe your test plan

Same as #65

  • Create a new ExtendedDaemonset. The reconcileFrequency should have been defaulted when
    the CR is created.
  • Edit this ExtendedDaemonset and remove the reconcileFrequency from the spec.strategy;
    The controller should update the spec.strategy to add it back.
  • Another test is to set a different reconcileFrequency value, to validate that the controller
    Didn't override a value provided by the user.

@ahmed-mez ahmed-mez added bug Something isn't working component/controller labels Dec 24, 2020
@ahmed-mez ahmed-mez added this to the v0.5 milestone Dec 24, 2020
@ahmed-mez ahmed-mez requested a review from a team as a code owner December 24, 2020 14:42
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Comment on lines -35 to -37
if dd.Spec.Strategy.ReconcileFrequency == nil {
return false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is duplicated (see below in this function)

Copy link
Contributor

@xornivore xornivore left a comment

Choose a reason for hiding this comment

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

👍

@codecov-io
Copy link

codecov-io commented Dec 24, 2020

Codecov Report

❗ No coverage uploaded for pull request base (v0.5@87217d6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             v0.5      #71   +/-   ##
=======================================
  Coverage        ?   31.93%           
=======================================
  Files           ?       41           
  Lines           ?     2918           
  Branches        ?        0           
=======================================
  Hits            ?      932           
  Misses          ?     1897           
  Partials        ?       89           
Flag Coverage Δ
unittests 31.93% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


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 87217d6...cc20664. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/controller
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants