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 driver status #491

Merged
merged 6 commits into from
Feb 23, 2024
Merged

Fix driver status #491

merged 6 commits into from
Feb 23, 2024

Conversation

JacobGros
Copy link
Contributor

@JacobGros JacobGros commented Feb 22, 2024

Description

This PR fixes issue where a failed driver deployment would lead to a misleading CSM status
Fixes:

  • instead of comparing replica count to available count, compare desired count to available for deployments
  • check pod is running and has condition set to ready before counting the pod as running for daemonset -> this change was needed as k8s will count the pods as running even if the containers are restarting

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1156

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Deployed driver and verified status
  • Deployed auth proxy to make sure status was still good
  • Ran unit tests

jooseppi-luna
jooseppi-luna previously approved these changes Feb 22, 2024
log.Infof("either controllerReplicas != controllerStatus.Available or nodeStatus is bad")
log.Infof("controllerReplicas", controllerReplicas)
log.Infof("either controllerStatus.Desired != controllerStatus.Available or nodeStatus is bad")
log.Infof("controllerStatus.Desired", controllerStatus.Desired)
Copy link
Contributor

Choose a reason for hiding this comment

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

It will be good if log format same as line 429-430 for line 452-453!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated log messages to match format + make more clear

@@ -388,7 +403,7 @@ func calculateState(ctx context.Context, instance *csmv1.ContainerStorageModule,
newStatus.State = constants.Succeeded
// TODO: Currently commented this block of code as the API used to get the latest deployment status is not working as expected
Copy link
Contributor

Choose a reason for hiding this comment

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

We should clean up commented code and //TODO in PRs.

Copy link
Contributor

@jooseppi-luna jooseppi-luna Feb 23, 2024

Choose a reason for hiding this comment

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

I guess I'm ok with getting rid of this comment, since we are planning on refactoring status anyway, so we can check on controller-runtime then. Thoughts @JacobGros ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense to me
if we ever decide we need that code again, we can look at an older operator version

Copy link
Contributor

@jooseppi-luna jooseppi-luna left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@JacobGros JacobGros merged commit acac99d into main Feb 23, 2024
8 checks passed
jooseppi-luna added a commit that referenced this pull request Feb 27, 2024
* check condition for ds, check desired for deployment

* fix logs, clean up comments

---------

Co-authored-by: Jooseppi Luna <jooseppi_luna@dell.com>
ChristianAtDell added a commit that referenced this pull request Oct 15, 2024
* check condition for ds, check desired for deployment

* fix logs, clean up comments

---------

Co-authored-by: Jooseppi Luna <jooseppi_luna@dell.com>
@mjsdell mjsdell deleted the fix-driver-status branch October 17, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants