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 availability zones and topology configuration #5

Merged
merged 9 commits into from
Mar 27, 2024

Conversation

Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

Looking VERY nice. thank you so much
Few nits/questions

charmcraft.yaml Outdated Show resolved Hide resolved
src/storage_manifests.py Outdated Show resolved Hide resolved
src/storage_manifests.py Outdated Show resolved Hide resolved
src/storage_manifests.py Outdated Show resolved Hide resolved
src/storage_manifests.py Outdated Show resolved Hide resolved
src/storage_manifests.py Show resolved Hide resolved
Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

Really looking great. Would you rebase as well since i fixed the linting issue in main

src/storage_manifests.py Outdated Show resolved Hide resolved
@VariableDeclared
Copy link
Contributor Author

thanks again @addyess !

Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

Hopefully my last nits i swear

src/storage_manifests.py Show resolved Hide resolved
src/storage_manifests.py Outdated Show resolved Hide resolved
@VariableDeclared
Copy link
Contributor Author

thank you again @addyess for your comprehensive review! I really should fix my workpace

Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

I may have sent you down a bum path unintentionally. And for that i'm sorry @VariableDeclared

(obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"),
]
):
if not (obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops... i didn't do you well if i suggested this line change. This shouldn't be changed. It was totally incorrect before

Suggested change
if not (obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"):
if not any(
[
(obj.kind == "DaemonSet" and obj.metadata.name == "csi-cinder-nodeplugin"),
(obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"),
]
):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gosh, my mistake

Comment on lines 147 to 151
if not any(
[
(obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"),
]
):
Copy link
Contributor

Choose a reason for hiding this comment

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

instead this one only appiles to the controller plugins

Suggested change
if not any(
[
(obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"),
]
):
if not (obj.kind == "Deployment" and obj.metadata.name == "csi-cinder-controllerplugin"):

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!

@VariableDeclared
Copy link
Contributor Author

thank you again! made those changes

@addyess
Copy link
Contributor

addyess commented Mar 27, 2024

@VariableDeclared

i'm spotting errors in the unit tests:

  File "/home/runner/work/cinder-csi-operator/cinder-csi-operator/tests/unit/test_charm.py", line 162, in test_waits_for_kube_control
    assert storage_messages == {
AssertionError: assert {'Setting secret for Deployment/csi-cinder-controllerplugin', 'Encode secret data for storage.', 'Setting secret for DaemonSet/csi-cinder-nodeplugin', 'Configuring cinder topology awareness=true', 'Creating storage class csi-cinder-default'} == {'Creating storage class csi-cinder-default', 'Setting secret for Deployment/csi-cinder-controllerplugin', 'Setting secret for DaemonSet/csi-cinder-nodeplugin', 'Encode secret data for storage.'}
  
  Extra items in the left set:
  'Configuring cinder topology awareness=true'
  
  Full diff:
    {
  +     'Configuring cinder topology awareness=true',
        'Creating storage class csi-cinder-default',
        'Encode secret data for storage.',
        'Setting secret for DaemonSet/csi-cinder-nodeplugin',
        'Setting secret for Deployment/csi-cinder-controllerplugin',
    }

Looks like we need to add following line 162 of /tests/unit/test_charm.py

'Configuring cinder topology awareness=true'

@addyess addyess self-requested a review March 27, 2024 17:27
Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

Hooray! 🍰
LGTM

@addyess addyess merged commit 89ab579 into canonical:main Mar 27, 2024
5 checks passed
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.

2 participants