-
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 (#129)
* Produce apis to add a k8s cloud and tear down its models first * Don't test if there's no k8s around, only wait for model to disappear when we're not keeping it * Successfully tested with storage * workaround issue kubernetes-client/python#2203 * Adjust linting for BundleOpt * test with updated inclusivity workflow
- Loading branch information
Showing
8 changed files
with
221 additions
and
21 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 |
---|---|---|
|
@@ -7,4 +7,6 @@ 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
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,20 @@ | ||
# test that pytest operator supports adding a k8s to an existing controller | ||
# This is a new k8s cloud created/managed by pytest-operator | ||
|
||
from kubernetes.config.config_exception import ConfigException | ||
import pytest | ||
from pytest_operator.plugin import OpsTest | ||
|
||
|
||
async def test_add_k8s(ops_test: OpsTest): | ||
try: | ||
k8s_cloud = await ops_test.add_k8s(skip_storage=False) | ||
except (ConfigException, TypeError): | ||
pytest.skip("No Kubernetes config found to add-k8s") | ||
|
||
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("grafana-k8s", trust=True) | ||
await k8s_model.wait_for_idle(apps=["grafana-k8s"], 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
Oops, something went wrong.