-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement config validation * Add tests * Throw error on invalid config * Fix bug * Log on error * Throw exception on invalid * Refactor kube enums * Fix validation bug * Add test for invalid enum in config * Add config path to error message * Fix schema bug and add test * Fix clouds list * Update config docs * Move k8s docs * Update schema versions * Update k8s config
- Loading branch information
Showing
15 changed files
with
373 additions
and
132 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
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
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
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,29 @@ | ||
"""Kubernetes enums for SkyPilot.""" | ||
import enum | ||
|
||
|
||
class KubernetesNetworkingMode(enum.Enum): | ||
"""Enum for the different types of networking modes for accessing | ||
jump pods. | ||
""" | ||
NODEPORT = 'nodeport' | ||
PORTFORWARD = 'portforward' | ||
|
||
@classmethod | ||
def from_str(cls, mode: str) -> 'KubernetesNetworkingMode': | ||
"""Returns the enum value for the given string.""" | ||
if mode.lower() == cls.NODEPORT.value: | ||
return cls.NODEPORT | ||
elif mode.lower() == cls.PORTFORWARD.value: | ||
return cls.PORTFORWARD | ||
else: | ||
raise ValueError(f'Unsupported kubernetes networking mode: ' | ||
f'{mode}. The mode must be either ' | ||
f'\'{cls.PORTFORWARD.value}\' or ' | ||
f'\'{cls.NODEPORT.value}\'. ') | ||
|
||
|
||
class KubernetesServiceType(enum.Enum): | ||
"""Enum for the different types of services.""" | ||
NODEPORT = 'NodePort' | ||
CLUSTERIP = 'ClusterIP' |
Oops, something went wrong.