diff --git a/pkg/kfapp/gcp/gcp.go b/pkg/kfapp/gcp/gcp.go index 627f997b..f3171278 100644 --- a/pkg/kfapp/gcp/gcp.go +++ b/pkg/kfapp/gcp/gcp.go @@ -800,6 +800,7 @@ func (gcp *Gcp) updateDM(resources kftypesv3.ResourceEnum) error { "--zone="+gcp.kfDef.Spec.Zone, "--project="+gcp.kfDef.Spec.Project) credCmd.Stdout = os.Stdout + credCmd.Stderr = os.Stderr log.Infof("Running get-credentials %v --zone=%v --project=%v ...", gcp.kfDef.Name, gcp.kfDef.Spec.Zone, gcp.kfDef.Spec.Project) if err := credCmd.Run(); err != nil { diff --git a/py/kubeflow/kfctl/testing/pytests/kfctl_second_apply.py b/py/kubeflow/kfctl/testing/pytests/kfctl_second_apply.py index 2976fad6..ea190ea9 100644 --- a/py/kubeflow/kfctl/testing/pytests/kfctl_second_apply.py +++ b/py/kubeflow/kfctl/testing/pytests/kfctl_second_apply.py @@ -7,8 +7,6 @@ from kubeflow.testing import util -@pytest.mark.skipif(os.getenv("JOB_TYPE") == "presubmit", - reason="test second apply doesn't run in presubmits") def test_second_apply(record_xml_attribute, app_path, kfctl_path): """Test that we can run kfctl apply again with error. @@ -20,4 +18,10 @@ def test_second_apply(record_xml_attribute, app_path, kfctl_path): msg = "kfctl Go binary not found: {path}".format(path=kfctl_path) logging.error(msg) raise RuntimeError(msg) + + # Need to activate account for scopes. + if os.getenv("GOOGLE_APPLICATION_CREDENTIALS"): + util.run(["gcloud", "auth", "activate-service-account", + "--key-file=" + os.environ["GOOGLE_APPLICATION_CREDENTIALS"]]) + util.run([kfctl_path, "apply", "-V", "-f=" + os.path.join(app_path, "tmp.yaml")], cwd=app_path)