You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/11/14 21:17:02 UTC
[GitHub] ashb commented on a change in pull request #4188: [AIRFLOW-3251] KubernetesPodOperator does not use 'image_pull_secrets…
ashb commented on a change in pull request #4188: [AIRFLOW-3251] KubernetesPodOperator does not use 'image_pull_secrets…
URL: https://github.com/apache/incubator-airflow/pull/4188#discussion_r233622811
##########
File path: tests/contrib/minikube/test_kubernetes_pod_operator.py
##########
@@ -251,6 +251,22 @@ def test_faulty_service_account(self):
with self.assertRaises(ApiException):
k.execute(None)
+ def test_faulty_image_pull_secrets(self):
+ bad_image_pull_secrets = "foobar"
+ k = KubernetesPodOperator(
+ namespace='default',
+ image="ubuntu:16.04",
+ cmds=["bash", "-cx"],
+ arguments=["echo 10"],
+ labels={"foo": "bar"},
+ name="test",
+ task_id="task",
+ startup_timeout_seconds=5,
+ image_pull_secrets=bad_image_pull_secrets
+ )
+ with self.assertRaises(ApiException):
Review comment:
This test alone seems a little bit hard-to-reason about.
Could you do something like `assertRaisesRegexp(ApiException, r'invalid pull secrets')` (or what ever string indicates the pull secrets are the problem - try to make it not too specific.) And perhaps a comment too so we know what this test was trying to test if it fails in the future.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services