-
Notifications
You must be signed in to change notification settings - Fork 2
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
[LP#2039667] Provide charm config parameters on the default storage class #31
Merged
mateoflorido
merged 4 commits into
main
from
bug/LP2039667/parameters-to-default-storage-class
Dec 15, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2023 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
# | ||
# Learn more about testing at: https://juju.is/docs/sdk/testing | ||
|
||
|
||
from unittest import mock | ||
|
||
from storage_manifests import CreateStorageClass | ||
|
||
|
||
def test_parse_parameter_config(): | ||
mock_manifests = mock.MagicMock() | ||
mock_manifests.config = {"storage-class-parameters": "key=val,something=test with spaces"} | ||
sc = CreateStorageClass(mock_manifests, "default") | ||
assert sc._params == {"key": "val", "something": "test with spaces"} | ||
|
||
|
||
def test_parse_parameter_invalid(caplog): | ||
mock_manifests = mock.MagicMock() | ||
mock_manifests.config = {"storage-class-parameters": "key=val,something"} | ||
sc = CreateStorageClass(mock_manifests, "default") | ||
assert sc._params == {"key": "val"} | ||
error_logs = [rec for rec in caplog.records if rec.levelname == "ERROR"] | ||
assert len(error_logs) == 1, "Expect one error" | ||
assert error_logs[0].message == "Storage class parameter missing '=' separator in 'something'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ def __hash__(self) -> int: | |
return hash(self.name) | ||
|
||
def __eq__(self, other) -> bool: | ||
"""Comparible based on its name.""" | ||
"""Comparable based on its name.""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixes misspelling |
||
return isinstance(other, Release) and self.name == other.name | ||
|
||
def __lt__(self, other) -> bool: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removes a deprecated method call