File tree Expand file tree Collapse file tree
stackable-cockpit/src/platform Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,8 +50,19 @@ pub async fn get_endpoints(
5050
5151 let listeners = kube_client
5252 . list_listeners ( Some ( object_namespace) , & list_params)
53- . await
54- . context ( KubeClientFetchSnafu ) ?;
53+ . await ;
54+ let listeners = match listeners {
55+ Ok ( ok) => Ok ( ok. items ) ,
56+ Err ( k8s:: Error :: KubeClientFetch {
57+ source : kube:: Error :: Api ( err) ,
58+ } ) if err. code == 404 => {
59+ // In case the listener-operator is not installed, this will return a 404. We should not fail, as this causes
60+ // stackablectl to fail with ApiError 404 on clusters without listener-operator.
61+ Ok ( Vec :: new ( ) )
62+ }
63+ Err ( err) => Err ( err) ,
64+ }
65+ . context ( KubeClientFetchSnafu ) ?;
5566
5667 let mut endpoints = IndexMap :: new ( ) ;
5768 for listener in & listeners {
@@ -77,7 +88,7 @@ pub async fn get_endpoints(
7788 // find Listeners is currently not required. However, once we add the recommended labels to the k8s Services, we
7889 // would have duplicated entries (one from the Listener and one from the Service). Because of this we don't look at
7990 // the Services in case we found Listeners!
80- if !listeners. items . is_empty ( ) {
91+ if !listeners. is_empty ( ) {
8192 return Ok ( endpoints) ;
8293 }
8394
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file.
77### Added
88
99- Support listing endpoints of Listeners in ` stackablectl stacklet list ` command.
10- Currently only HDFS is using listener-op, so we can only test that so far ([ #213 ] ).
10+ Currently only HDFS is using listener-op, so we can only test that so far ([ #213 ] , [ # 219 ] ).
1111
1212### Changed
1313
You can’t perform that action at this time.
0 commit comments