File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
stackable-cockpit/src/platform Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,19 @@ pub async fn get_endpoints(
50
50
51
51
let listeners = kube_client
52
52
. 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 ) ?;
55
66
56
67
let mut endpoints = IndexMap :: new ( ) ;
57
68
for listener in & listeners {
@@ -77,7 +88,7 @@ pub async fn get_endpoints(
77
88
// find Listeners is currently not required. However, once we add the recommended labels to the k8s Services, we
78
89
// would have duplicated entries (one from the Listener and one from the Service). Because of this we don't look at
79
90
// the Services in case we found Listeners!
80
- if !listeners. items . is_empty ( ) {
91
+ if !listeners. is_empty ( ) {
81
92
return Ok ( endpoints) ;
82
93
}
83
94
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.
7
7
### Added
8
8
9
9
- 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 ] ).
11
11
12
12
### Changed
13
13
You can’t perform that action at this time.
0 commit comments