From 53ee427a88569aef81aa0dfffd64d19d42fecc8f Mon Sep 17 00:00:00 2001 From: avelichk Date: Wed, 4 Dec 2019 09:25:20 +0000 Subject: [PATCH 1/4] Init changes --- .../src/components/HP/Monitor/FilterPanel.jsx | 22 +++++++++++++++++++ .../components/HP/Monitor/HPJobMonitor.jsx | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx b/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx index b19b7c5b863..68750348fc7 100644 --- a/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx +++ b/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx @@ -7,6 +7,10 @@ import FormGroup from '@material-ui/core/FormGroup'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Switch from '@material-ui/core/Switch'; import Button from '@material-ui/core/Button'; +import Select from '@material-ui/core/Select'; +import InputLabel from '@material-ui/core/InputLabel'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormControl from '@material-ui/core/FormControl'; import { filterJobs, changeType, fetchHPJobs } from '../../../actions/hpMonitorActions'; @@ -23,6 +27,12 @@ const styles = theme => ({ margin: '0 auto', textAlign: 'center', }, + selectBox: { + marginLeft: theme.spacing.unit, + marginRight: theme.spacing.unit, + width: 200, + height: 56 + } }); const FilterPanel = (props) => { @@ -36,6 +46,18 @@ const FilterPanel = (props) => { return (
+ + + Namespace + + + ({ root: { width: '90%', margin: '0 auto', + marginTop: 10 }, }); @@ -26,7 +27,7 @@ class HPJobMonitor extends React.Component { return (
-

Monitor

+

Experiment Monitor

From e15facbbe91c9027e10bb4496dc05ca94785fbca Mon Sep 17 00:00:00 2001 From: avelichk Date: Wed, 4 Dec 2019 19:06:13 +0000 Subject: [PATCH 2/4] Support namespace selection in experiment monitor page --- cmd/ui/v1alpha3/main.go | 3 +- manifests/v1alpha3/ui/rbac.yaml | 1 + pkg/ui/v1alpha3/backend.go | 23 +++ .../frontend/src/actions/generalActions.js | 8 + .../frontend/src/actions/hpMonitorActions.js | 5 +- .../frontend/src/actions/nasMonitorActions.js | 5 +- .../src/components/HP/Monitor/FilterPanel.jsx | 139 +++++++++++------- .../components/NAS/Monitor/FilterPanel.jsx | 134 +++++++++++------ .../v1alpha3/frontend/src/reducers/general.js | 7 + .../frontend/src/reducers/hpMonitor.js | 67 ++++++--- .../frontend/src/reducers/nasMonitor.js | 66 ++++++--- pkg/ui/v1alpha3/frontend/src/sagas/index.js | 45 +++++- pkg/util/v1alpha3/katibclient/katib_client.go | 12 ++ 13 files changed, 372 insertions(+), 143 deletions(-) diff --git a/cmd/ui/v1alpha3/main.go b/cmd/ui/v1alpha3/main.go index b3531f6830a..c3d68839eed 100644 --- a/cmd/ui/v1alpha3/main.go +++ b/cmd/ui/v1alpha3/main.go @@ -34,7 +34,6 @@ func main() { http.HandleFunc("/katib/submit_hp_job/", kuh.SubmitParamsJob) http.HandleFunc("/katib/submit_nas_job/", kuh.SubmitParamsJob) - //TODO: Add it in Katib client http.HandleFunc("/katib/delete_experiment/", kuh.DeleteExperiment) http.HandleFunc("/katib/fetch_hp_job/", kuh.FetchHPJob) @@ -45,6 +44,8 @@ func main() { http.HandleFunc("/katib/fetch_trial_templates/", kuh.FetchTrialTemplates) http.HandleFunc("/katib/update_template/", kuh.AddEditDeleteTemplate) + http.HandleFunc("/katib/fetch_namespaces", kuh.FetchNamespaces) + log.Printf("Serving at %s:%s", *host, *port) if err := http.ListenAndServe(fmt.Sprintf("%s:%s", *host, *port), nil); err != nil { panic(err) diff --git a/manifests/v1alpha3/ui/rbac.yaml b/manifests/v1alpha3/ui/rbac.yaml index d99849bf506..404fcc1c6aa 100644 --- a/manifests/v1alpha3/ui/rbac.yaml +++ b/manifests/v1alpha3/ui/rbac.yaml @@ -7,6 +7,7 @@ rules: - "" resources: - configmaps + - namespaces verbs: - "*" - apiGroups: diff --git a/pkg/ui/v1alpha3/backend.go b/pkg/ui/v1alpha3/backend.go index 4a8f3ee5270..b450fd9142f 100644 --- a/pkg/ui/v1alpha3/backend.go +++ b/pkg/ui/v1alpha3/backend.go @@ -169,3 +169,26 @@ func (k *KatibUIHandler) AddEditDeleteTemplate(w http.ResponseWriter, r *http.Re } w.Write(response) } + +func (k *KatibUIHandler) FetchNamespaces(w http.ResponseWriter, r *http.Request) { + + namespaceList, err := k.katibClient.GetNamespaceList() + if err != nil { + log.Printf("GetNamespaceList failed: %v", err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + var namespaces []string + + for _, namespace := range namespaceList.Items { + namespaces = append(namespaces, namespace.ObjectMeta.Name) + } + + response, err := json.Marshal(namespaces) + if err != nil { + log.Printf("Marshal namespaces failed: %v", err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + w.Write(response) +} diff --git a/pkg/ui/v1alpha3/frontend/src/actions/generalActions.js b/pkg/ui/v1alpha3/frontend/src/actions/generalActions.js index b7b89dede56..642f526e6cc 100644 --- a/pkg/ui/v1alpha3/frontend/src/actions/generalActions.js +++ b/pkg/ui/v1alpha3/frontend/src/actions/generalActions.js @@ -47,3 +47,11 @@ export const CLOSE_DELETE_EXPERIMENT_DIALOG = "CLOSE_DELETE_EXPERIMENT_DIALOG"; export const closeDeleteExperimentDialog = () => ({ type: CLOSE_DELETE_EXPERIMENT_DIALOG, }) + +export const FETCH_NAMESPACES_REQUEST = "FETCH_NAMESPACES_REQUEST"; +export const FETCH_NAMESPACES_SUCCESS = "FETCH_NAMESPACES_SUCCESS"; +export const FETCH_NAMESPACES_FAILURE = "FETCH_NAMESPACES_FAILURE"; + +export const fetchNamespaces = () => ({ + type: FETCH_NAMESPACES_REQUEST +}) diff --git a/pkg/ui/v1alpha3/frontend/src/actions/hpMonitorActions.js b/pkg/ui/v1alpha3/frontend/src/actions/hpMonitorActions.js index 643372d1faa..5dfbe7577c4 100644 --- a/pkg/ui/v1alpha3/frontend/src/actions/hpMonitorActions.js +++ b/pkg/ui/v1alpha3/frontend/src/actions/hpMonitorActions.js @@ -1,8 +1,9 @@ export const FILTER_JOBS = "FILTER_JOBS"; -export const filterJobs = (filter) => ({ +export const filterJobs = (experimentName, experimentNamespace) => ({ type: FILTER_JOBS, - filter, + experimentName, + experimentNamespace }) export const CHANGE_TYPE = "CHANGE_TYPE"; diff --git a/pkg/ui/v1alpha3/frontend/src/actions/nasMonitorActions.js b/pkg/ui/v1alpha3/frontend/src/actions/nasMonitorActions.js index f38855b5bcc..a7abce286cc 100644 --- a/pkg/ui/v1alpha3/frontend/src/actions/nasMonitorActions.js +++ b/pkg/ui/v1alpha3/frontend/src/actions/nasMonitorActions.js @@ -1,8 +1,9 @@ export const FILTER_JOBS = "FILTER_JOBS"; -export const filterJobs = (filter) => ({ +export const filterJobs = (experimentName, experimentNamespace) => ({ type: FILTER_JOBS, - filter, + experimentName, + experimentNamespace }) export const CHANGE_TYPE = "CHANGE_TYPE"; diff --git a/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx b/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx index 68750348fc7..c393c26b5b2 100644 --- a/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx +++ b/pkg/ui/v1alpha3/frontend/src/components/HP/Monitor/FilterPanel.jsx @@ -13,9 +13,11 @@ import MenuItem from '@material-ui/core/MenuItem'; import FormControl from '@material-ui/core/FormControl'; import { filterJobs, changeType, fetchHPJobs } from '../../../actions/hpMonitorActions'; +import { fetchNamespaces } from '../../../actions/generalActions' const module = "hpMonitor"; +const generalModule = "general" const styles = theme => ({ @@ -31,73 +33,98 @@ const styles = theme => ({ marginLeft: theme.spacing.unit, marginRight: theme.spacing.unit, width: 200, - height: 56 + height: 56, + textAlign: "left" } }); -const FilterPanel = (props) => { +class FilterPanel extends React.Component { - const { classes } = props; + componentDidMount() { + this.props.fetchNamespaces(); + this.props.filterJobs(this.props.experimentName, this.props.experimentNamespace) + } + + handleType = (name) => (event) => { + this.props.changeType(name, event.target.checked); + } + + onNameChange = (event) => { + this.props.filterJobs(event.target.value, this.props.experimentNamespace) + } + + onNamespaceChange = (event) => { + this.props.filterJobs(this.props.experimentName, event.target.value) + } + + render () { + + const { classes } = this.props; - const handleType = (name) => (event) => { - props.changeType(name, event.target.checked); + return ( +
+ + + + Namespace + + + + + { + Object.keys(this.props.filterType).map((filter, i) => { + return( + + } + label={filter} + /> + ); + }) + } + + +
+ ) } - - return ( -
- - - - Namespace - - - - props.filterJobs(event.target.value)} - margin="normal" - variant="outlined" - /> - { - Object.keys(props.filterType).map((filter, i) => { - return( - - } - label={filter} - /> - ); - }) - } - - -
- ) } const mapStateToProps = state => { return { - filter: state[module].filter, + experimentName: state[module].experimentName, + experimentNamespace: state[module].experimentNamespace, filterType: state[module].filterType, + namespaces: state[generalModule].namespaces } } -export default connect(mapStateToProps, { filterJobs, changeType, fetchHPJobs })(withStyles(styles)(FilterPanel)); +export default connect(mapStateToProps, { filterJobs, changeType, fetchHPJobs, fetchNamespaces })(withStyles(styles)(FilterPanel)); diff --git a/pkg/ui/v1alpha3/frontend/src/components/NAS/Monitor/FilterPanel.jsx b/pkg/ui/v1alpha3/frontend/src/components/NAS/Monitor/FilterPanel.jsx index dc3b6d2a658..748ee36efad 100644 --- a/pkg/ui/v1alpha3/frontend/src/components/NAS/Monitor/FilterPanel.jsx +++ b/pkg/ui/v1alpha3/frontend/src/components/NAS/Monitor/FilterPanel.jsx @@ -7,11 +7,17 @@ import FormGroup from '@material-ui/core/FormGroup'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Switch from '@material-ui/core/Switch'; import Button from '@material-ui/core/Button'; +import Select from '@material-ui/core/Select'; +import InputLabel from '@material-ui/core/InputLabel'; +import MenuItem from '@material-ui/core/MenuItem'; +import FormControl from '@material-ui/core/FormControl'; import { filterJobs, changeType, fetchNASJobs } from '../../../actions/nasMonitorActions'; +import { fetchNamespaces } from '../../../actions/generalActions' const module = "nasMonitor"; +const generalModule = "general" const styles = theme => ({ @@ -23,59 +29,103 @@ const styles = theme => ({ margin: '0 auto', textAlign: 'center', }, + selectBox: { + marginLeft: theme.spacing.unit, + marginRight: theme.spacing.unit, + width: 200, + height: 56, + textAlign: "left" + } }); -const FilterPanel = (props) => { - const { classes } = props; +class FilterPanel extends React.Component { + + componentDidMount() { + this.props.fetchNamespaces(); + this.props.filterJobs(this.props.experimentName, this.props.experimentNamespace) + } + + handleType = (name) => (event) => { + this.props.changeType(name, event.target.checked); + } - const handleType = (name) => (event) => { - props.changeType(name, event.target.checked); + onNameChange = (event) => { + this.props.filterJobs(event.target.value, this.props.experimentNamespace) } - return ( -
- - props.filterJobs(event.target.value)} - margin="normal" - variant="outlined" - /> - { - Object.keys(props.filterType).map((filter, i) => { - return( - - } - label={filter} - /> - ); - }) - } - - -
- ) + onNamespaceChange = (event) => { + this.props.filterJobs(this.props.experimentName, event.target.value) + } + + render () { + + const { classes } = this.props; + + return ( +
+ + + + Namespace + + + + + { + Object.keys(this.props.filterType).map((filter, i) => { + return( + + } + label={filter} + /> + ); + }) + } + + +
+ ) + } } const mapStateToProps = state => { return { - filter: state[module].filter, + experimentName: state[module].experimentName, + experimentNamespace: state[module].experimentNamespace, filterType: state[module].filterType, + namespaces: state[generalModule].namespaces } } -export default connect(mapStateToProps, { filterJobs, changeType, fetchNASJobs })(withStyles(styles)(FilterPanel)); +export default connect(mapStateToProps, { filterJobs, changeType, fetchNASJobs, fetchNamespaces })(withStyles(styles)(FilterPanel)); diff --git a/pkg/ui/v1alpha3/frontend/src/reducers/general.js b/pkg/ui/v1alpha3/frontend/src/reducers/general.js index 84fef88682e..fcf13b3397f 100644 --- a/pkg/ui/v1alpha3/frontend/src/reducers/general.js +++ b/pkg/ui/v1alpha3/frontend/src/reducers/general.js @@ -8,6 +8,8 @@ const initialState = { snackText: "", deleteDialog: false, deleteId: '', + namespaces: [ + ] }; const generalReducer = (state = initialState, action) => { @@ -98,6 +100,11 @@ const generalReducer = (state = initialState, action) => { snackOpen: true, snackText: action.message, } + case actions.FETCH_NAMESPACES_SUCCESS: + return { + ...state, + namespaces: action.namespaces + } default: return state; } diff --git a/pkg/ui/v1alpha3/frontend/src/reducers/hpMonitor.js b/pkg/ui/v1alpha3/frontend/src/reducers/hpMonitor.js index ef2f45a8af8..5564f665d5b 100644 --- a/pkg/ui/v1alpha3/frontend/src/reducers/hpMonitor.js +++ b/pkg/ui/v1alpha3/frontend/src/reducers/hpMonitor.js @@ -1,7 +1,8 @@ import * as actions from '../actions/hpMonitorActions'; const initialState = { - filter: '', + experimentName: '', + experimentNamespace: '', filterType: { "Created": true, "Running": true, @@ -25,48 +26,74 @@ const hpMonitorReducer = (state = initialState, action) => { switch (action.type) { case actions.FILTER_JOBS: let jobs = state.jobsList.slice(); - let newList = jobs.filter(job => job.name.includes(action.filter)); + let newList = jobs.filter(job => + ( + job.name.includes(action.experimentName) && + ( + job.namespace.includes(action.experimentNamespace) || + job.namespace.includes(action.experimentNamespace.replace("All namespaces", "")) + ) + ) + ) + let types = Object.assign({}, state.filterType); + var typeKeys = Object.keys(types); - let avTypes = Object.assign({}, state.filterType); - var typeKeys = Object.keys(avTypes); - - var avFilters = typeKeys.filter((key) => { - return avTypes[key] + var filters = typeKeys.filter((key) => { + return types[key] }); - let filteredJobs = newList.filter(job => avFilters.includes(job.status)); + let filteredJobs = newList.filter(job => filters.includes(job.status)); return { ...state, filteredJobsList: filteredJobs, - filter: action.filter, + experimentName: action.experimentName, + experimentNamespace: action.experimentNamespace } case actions.CHANGE_TYPE: - const types = Object.assign({}, state.filterType) + jobs = state.jobsList.slice(); + newList = jobs.filter(job => + ( + job.name.includes(state.experimentName) && + ( + job.namespace.includes(state.experimentNamespace) || + job.namespace.includes(state.experimentNamespace.replace("All namespaces", "")) + ) + ) + ) + types = Object.assign({}, state.filterType) types[action.filter] = action.checked; - var keys = Object.keys(types); + typeKeys = Object.keys(types); - var filters = keys.filter((key) => { + filters = typeKeys.filter((key) => { return types[key] }); - const jobsList = state.jobsList.slice(); - const filtered = jobsList.filter(job => filters.includes(job.status)); + filteredJobs = newList.filter(job => filters.includes(job.status)); return { ...state, filterType: types, - filteredJobsList: filtered, + filteredJobsList: filteredJobs, } case actions.FETCH_HP_JOBS_SUCCESS: jobs = action.jobs - avTypes = Object.assign({}, state.filterType); - typeKeys = Object.keys(avTypes); + types = Object.assign({}, state.filterType); + typeKeys = Object.keys(types); - avFilters = typeKeys.filter((key) => { - return avTypes[key] + filters = typeKeys.filter((key) => { + return types[key] }); - filteredJobs = jobs.filter(job => avFilters.includes(job.status)); + filteredJobs = jobs.filter(job => + ( + filters.includes(job.status) && + job.name.includes(state.experimentName) && + ( + job.namespace.includes(state.experimentNamespace) || + job.namespace.includes(state.experimentNamespace.replace("All namespaces", "")) + ) + ) + ) return { ...state, jobsList: action.jobs, diff --git a/pkg/ui/v1alpha3/frontend/src/reducers/nasMonitor.js b/pkg/ui/v1alpha3/frontend/src/reducers/nasMonitor.js index 87ddcfdff6f..e4d02c50d66 100644 --- a/pkg/ui/v1alpha3/frontend/src/reducers/nasMonitor.js +++ b/pkg/ui/v1alpha3/frontend/src/reducers/nasMonitor.js @@ -1,6 +1,8 @@ import * as actions from '../actions/nasMonitorActions'; const initialState = { + experimentName: '', + experimentNamespace: '', filter: '', filterType: { "Created": true, @@ -23,48 +25,74 @@ const nasMonitorReducer = (state = initialState, action) => { switch (action.type) { case actions.FILTER_JOBS: let jobs = state.jobsList.slice(); - let newList = jobs.filter(job => job.name.includes(action.filter)); + let newList = jobs.filter(job => + ( + job.name.includes(action.experimentName) && + ( + job.namespace.includes(action.experimentNamespace) || + job.namespace.includes(action.experimentNamespace.replace("All namespaces", "")) + ) + ) + ) + let types = Object.assign({}, state.filterType); + var typeKeys = Object.keys(types); - let avTypes = Object.assign({}, state.filterType); - var typeKeys = Object.keys(avTypes); - - var avFilters = typeKeys.filter((key) => { - return avTypes[key] + var filters = typeKeys.filter((key) => { + return types[key] }); - let filteredJobs = newList.filter(job => avFilters.includes(job.status)); + let filteredJobs = newList.filter(job => filters.includes(job.status)); return { ...state, filteredJobsList: filteredJobs, - filter: action.filter, + experimentName: action.experimentName, + experimentNamespace: action.experimentNamespace } case actions.CHANGE_TYPE: - const types = Object.assign({}, state.filterType) + jobs = state.jobsList.slice(); + newList = jobs.filter(job => + ( + job.name.includes(state.experimentName) && + ( + job.namespace.includes(state.experimentNamespace) || + job.namespace.includes(state.experimentNamespace.replace("All namespaces", "")) + ) + ) + ) + types = Object.assign({}, state.filterType) types[action.filter] = action.checked; - var keys = Object.keys(types); + typeKeys = Object.keys(types); - var filters = keys.filter((key) => { + filters = typeKeys.filter((key) => { return types[key] }); - const jobsList = state.jobsList.slice(); - const filtered = jobsList.filter(job => filters.includes(job.status)); + filteredJobs = newList.filter(job => filters.includes(job.status)); return { ...state, filterType: types, - filteredJobsList: filtered, + filteredJobsList: filteredJobs, } case actions.FETCH_NAS_JOBS_SUCCESS: jobs = action.jobs - avTypes = Object.assign({}, state.filterType); - typeKeys = Object.keys(avTypes); + types = Object.assign({}, state.filterType); + typeKeys = Object.keys(types); - avFilters = typeKeys.filter((key) => { - return avTypes[key] + filters = typeKeys.filter((key) => { + return types[key] }); - filteredJobs = jobs.filter(job => avFilters.includes(job.status)); + filteredJobs = jobs.filter(job => + ( + filters.includes(job.status) && + job.name.includes(state.experimentName) && + ( + job.namespace.includes(state.experimentNamespace) || + job.namespace.includes(state.experimentNamespace.replace("All namespaces", "")) + ) + ) + ) return { ...state, jobsList: action.jobs, diff --git a/pkg/ui/v1alpha3/frontend/src/sagas/index.js b/pkg/ui/v1alpha3/frontend/src/sagas/index.js index fcc9d0adc58..8ade06b2a42 100644 --- a/pkg/ui/v1alpha3/frontend/src/sagas/index.js +++ b/pkg/ui/v1alpha3/frontend/src/sagas/index.js @@ -667,6 +667,48 @@ const goDeleteTemplate = function* (name, kind, action) { } } +export const fetchNamespaces = function* () { + while (true) { + const action = yield take(generalActions.FETCH_NAMESPACES_REQUEST); + try { + const result = yield call( + goFetchNamespaces + ) + if (result.status === 200) { + let data = result.data + data.unshift("All namespaces") + yield put({ + type: generalActions.FETCH_NAMESPACES_SUCCESS, + namespaces: data + }) + } else { + yield put ({ + type: generalActions.FETCH_NAMESPACES_FAILURE + }) + } + } catch (err) { + console.log(err) + yield put({ + type: generalActions.FETCH_NAMESPACES_FAILURE + }) + } + } +} + +const goFetchNamespaces = function* () { + try { + const result = yield call ( + axios.get, + '/katib/fetch_namespaces' + ) + return result + } catch (err) { + yield put ({ + type: generalActions.FETCH_NAMESPACES_FAILURE + }) + } +} + export default function* rootSaga() { yield all([ fork(fetchTrialTemplates), @@ -682,6 +724,7 @@ export default function* rootSaga() { fork(fetchHPJobInfo), fork(fetchHPJob), fork(fetchHPJobTrialInfo), - fork(fetchNASJobInfo) + fork(fetchNASJobInfo), + fork(fetchNamespaces) ]); }; diff --git a/pkg/util/v1alpha3/katibclient/katib_client.go b/pkg/util/v1alpha3/katibclient/katib_client.go index bee33901cef..f72467e094e 100644 --- a/pkg/util/v1alpha3/katibclient/katib_client.go +++ b/pkg/util/v1alpha3/katibclient/katib_client.go @@ -43,6 +43,7 @@ type Client interface { GetTrialTemplates(namespace ...string) (map[string]string, error) GetSuggestion(name string, namespace ...string) (*suggestionsv1alpha3.Suggestion, error) UpdateTrialTemplates(newTrialTemplates map[string]string, namespace ...string) error + GetNamespaceList() (*apiv1.NamespaceList, error) } type KatibClient struct { @@ -184,3 +185,14 @@ func getNamespace(namespace ...string) string { } return namespace[0] } + +func (k *KatibClient) GetNamespaceList() (*apiv1.NamespaceList, error) { + + namespaceList := &apiv1.NamespaceList{} + listOpt := &client.ListOptions{} + + if err := k.client.List(context.TODO(), listOpt, namespaceList); err != nil { + return namespaceList, err + } + return namespaceList, nil +} From 2a7120e07e33198f6e02fb82b54bd3ab7bca961b Mon Sep 17 00:00:00 2001 From: avelichk Date: Thu, 5 Dec 2019 12:53:46 +0000 Subject: [PATCH 3/4] Remove console log --- pkg/ui/v1alpha3/frontend/src/sagas/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/ui/v1alpha3/frontend/src/sagas/index.js b/pkg/ui/v1alpha3/frontend/src/sagas/index.js index 8ade06b2a42..c9c34bcc234 100644 --- a/pkg/ui/v1alpha3/frontend/src/sagas/index.js +++ b/pkg/ui/v1alpha3/frontend/src/sagas/index.js @@ -687,7 +687,6 @@ export const fetchNamespaces = function* () { }) } } catch (err) { - console.log(err) yield put({ type: generalActions.FETCH_NAMESPACES_FAILURE }) From ae1bcd3f264c71600404ecc78ca951edbd0ca2fb Mon Sep 17 00:00:00 2001 From: avelichk Date: Thu, 5 Dec 2019 15:33:25 +0000 Subject: [PATCH 4/4] Run mock for katib client --- .../v1alpha3/util/katibclient/katibclient.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/mock/v1alpha3/util/katibclient/katibclient.go b/pkg/mock/v1alpha3/util/katibclient/katibclient.go index 95d452683d5..ccc2d08dffb 100644 --- a/pkg/mock/v1alpha3/util/katibclient/katibclient.go +++ b/pkg/mock/v1alpha3/util/katibclient/katibclient.go @@ -9,6 +9,7 @@ import ( v1alpha3 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1alpha3" v1alpha30 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1alpha3" v1alpha31 "github.com/kubeflow/katib/pkg/apis/controller/trials/v1alpha3" + v1 "k8s.io/api/core/v1" reflect "reflect" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -147,6 +148,21 @@ func (mr *MockClientMockRecorder) GetExperimentList(arg0 ...interface{}) *gomock return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExperimentList", reflect.TypeOf((*MockClient)(nil).GetExperimentList), arg0...) } +// GetNamespaceList mocks base method +func (m *MockClient) GetNamespaceList() (*v1.NamespaceList, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetNamespaceList") + ret0, _ := ret[0].(*v1.NamespaceList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetNamespaceList indicates an expected call of GetNamespaceList +func (mr *MockClientMockRecorder) GetNamespaceList() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespaceList", reflect.TypeOf((*MockClient)(nil).GetNamespaceList)) +} + // GetSuggestion mocks base method func (m *MockClient) GetSuggestion(arg0 string, arg1 ...string) (*v1alpha30.Suggestion, error) { m.ctrl.T.Helper()