def test_create_secret_qa(kubernetes: Kubernetes, test_namespace: str) -> None: track = "qa" project = Project(track=track) kubernetes.create_secret( data={"test_secret": "1234"}, namespace=K8S_NAMESPACE, track=track, project=project, secret_name=project.secret_name, ) kubernetes.get(resource="secret", namespace=K8S_NAMESPACE, name=project.secret_name)
def test_create_secret_stable(kubernetes: Kubernetes, test_namespace: str) -> None: track = DEFAULT_TRACK data = {"test_secret": "1234"} project = Project(track=track) kubernetes.create_secret( data=data, namespace=K8S_NAMESPACE, track=track, project=project, secret_name=project.secret_name, ) kubernetes.get(resource="secret", namespace=K8S_NAMESPACE, name=project.secret_name)
def test_delete_all(kubernetes: Kubernetes, test_namespace: str) -> None: track = DEFAULT_TRACK deploy_name = get_deploy_name(track=track) project = Project(track=track) kubernetes.create_secret( data={"test": "test"}, namespace=test_namespace, track=track, project=project, secret_name=project.secret_name, ) kubernetes.delete_all(namespace=test_namespace, labels={"release": deploy_name}) with pytest.raises(Exception): kubernetes.get(resource="secret", name=test_namespace)
def test_delete_namespace(kubernetes: Kubernetes, test_namespace: str) -> None: kubernetes.delete(resource="namespace", name=test_namespace, namespace=K8S_NAMESPACE) with pytest.raises(Exception): kubernetes.get(resource="namespace", name=test_namespace)