Skip to content

Commit

Permalink
Fix the TFJobs Dashboard UI (kubeflow#1717)
Browse files Browse the repository at this point in the history
* Fix the TFJobs Dashboard UI

* The UI isn't able to list jobs in all namespaces because the
  cluster role binding isn't using the correct role

Related to kubeflow/training-operator#836

* Fix test.
  • Loading branch information
jlewi authored and leoncamel committed Oct 14, 2018
1 parent 8ba1e18 commit d55da51
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ examples/.ipynb_checkpoints/


!testing/test-infra/vendor

# This is required for testing but we don't
# want to check it in right now.
components/gcp-click-to-deploy/src/user_config/**
28 changes: 28 additions & 0 deletions kubeflow/core/tests/tf-job_test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -521,3 +521,31 @@ std.assertEqual(
],
}
)

&&

std.assertEqual(
tfjobv1alpha1.tfUiRoleBinding,
{
apiVersion: "rbac.authorization.k8s.io/v1beta1",
kind: "ClusterRoleBinding",
metadata: {
labels: {
app: "tf-job-dashboard",
},
name: "tf-job-dashboard",
},
roleRef: {
apiGroup: "rbac.authorization.k8s.io",
kind: "ClusterRole",
name: "tf-job-dashboard",
},
subjects: [
{
kind: "ServiceAccount",
name: "tf-job-dashboard",
namespace: "test-kf-001",
},
],
}
)
6 changes: 3 additions & 3 deletions kubeflow/core/tf-job-operator.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,9 @@
},
subjects: [
{
kind: tfServiceAccount.kind,
name: tfServiceAccount.metadata.name,
namespace: tfServiceAccount.metadata.namespace,
kind: tfUiServiceAccount.kind,
name: tfUiServiceAccount.metadata.name,
namespace: tfUiServiceAccount.metadata.namespace,
},
],
},
Expand Down

0 comments on commit d55da51

Please sign in to comment.