generated from ContainerCraft/devcontainer
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor / bring multus online in new code architecture
- Loading branch information
Showing
4 changed files
with
133 additions
and
68 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
DEFAULT_ENABLED_CONFIG = { | ||
"cert_manager": True, | ||
"kubevirt": True, | ||
"multus": True, | ||
} | ||
|
||
|
||
|
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,27 @@ | ||
# pulumi/modules/multus/types.py | ||
|
||
""" | ||
Defines the data structure for the Multus module configuration. | ||
""" | ||
|
||
from dataclasses import dataclass, field | ||
from typing import Optional, Dict, Any | ||
import pulumi | ||
|
||
@dataclass | ||
class MultusConfig: | ||
version: str = "master" | ||
namespace: str = "multus" | ||
bridge_name: str = "br0" | ||
labels: Dict[str, str] = field(default_factory=dict) | ||
annotations: Dict[str, Any] = field(default_factory=dict) | ||
|
||
@staticmethod | ||
def merge(user_config: Dict[str, Any]) -> 'MultusConfig': | ||
default_config = MultusConfig() | ||
for key, value in user_config.items(): | ||
if hasattr(default_config, key): | ||
setattr(default_config, key, value) | ||
else: | ||
pulumi.log.warn(f"Unknown configuration key '{key}' in multus config.") | ||
return default_config |