Skip to content

Commit

Permalink
fix kubeless-config fetching when authz enabled (#288)
Browse files Browse the repository at this point in the history
uses the authz axios instance and updates required permissions
  • Loading branch information
prydonius authored Apr 30, 2018
1 parent 81398ac commit bc2afdc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dashboard/src/actions/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ export function getPodName(fn: IFunction) {
export function fetchRuntimes() {
return async (dispatch: Dispatch<IStoreState>) => {
dispatch(requestRuntimes());
const runtimeList = await KubelessConfig.getRuntimes();
dispatch(receiveRuntimes(runtimeList));
return runtimeList;
try {
const runtimeList = await KubelessConfig.getRuntimes();
dispatch(receiveRuntimes(runtimeList));
return runtimeList;
} catch (e) {
dispatch(errorFunctions(e, "fetch"));
}
};
}
6 changes: 6 additions & 0 deletions dashboard/src/components/FunctionList/FunctionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ const RequiredRBACRoles: IRBACRole[] = [
resource: "functions",
verbs: ["list"],
},
{
apiGroup: "",
namespace: "kubeless",
resource: "configmaps/kubeless-config",
verbs: ["get"],
},
];

class FunctionList extends React.Component<IFunctionListProps> {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/shared/KubelessConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios from "axios";
import { axios } from "./Auth";

import { IKubelessConfigMap } from "./types";

Expand Down

0 comments on commit bc2afdc

Please sign in to comment.