-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Produce apis to add a k8s cloud and tear down its models first
- Loading branch information
Showing
4 changed files
with
139 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ build | |
dist/ | ||
*.orig | ||
report | ||
.coverage | ||
.coverage | ||
juju-crashdump* |
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,15 @@ | ||
# test that pytest operator supports adding a k8s to an existing controller | ||
# This is a new k8s cloud created/managed by pytest-operator | ||
|
||
from pytest_operator.plugin import OpsTest | ||
from kubernetes import config as k8s_config | ||
from kubernetes.client import Configuration | ||
|
||
async def test_add_k8s_cloud(ops_test: OpsTest): | ||
config = type.__call__(Configuration) | ||
k8s_config.load_config(client_configuration=config) | ||
k8s_cloud = await ops_test.add_k8s(config, skip_storage=True, storage_class=None) | ||
k8s_model = await ops_test.track_model("secondary", cloud_name=k8s_cloud, keep=ops_test.ModelKeep.NEVER) | ||
with ops_test.model_context("secondary"): | ||
await k8s_model.deploy("coredns", trust=True) | ||
await k8s_model.wait_for_idle(apps=["coredns"], status="active") |
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