Skip to content

Commit 7dc6754

Browse files
committed
this fixes the failure on startup, when no OLM is installed
1 parent b216c07 commit 7dc6754

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kubero:
22
context: kind-kubero
33
namespace: kubero
4-
port: 3000
4+
port: 2000
55
buildpacks:
66
- name: NodeJS
77
language: JavaScript
@@ -85,7 +85,7 @@ buildpacks:
8585
repository: webdevops/nginx
8686
tag: alpine
8787
command: "supervisord"
88-
podSizeList:
88+
podSizeList:
8989
- name: small
9090
description: 'Small (CPU: 0.25, Memory: 0.5Gi)'
9191
default: true

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ debug('app:server')
1212

1313
const app: Express = express();
1414
const server = http.createServer(app)
15-
const port: String = process.env.PORT || "3000";
15+
const port: String = process.env.PORT || "2000";
1616

1717
// API
1818
before(app);

src/modules/kubectl.ts

+14-8
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,21 @@ export class Kubectl {
290290

291291
public async getOperators() {
292292
// TODO list operators from all clusters
293-
let response = await this.customObjectsApi.listNamespacedCustomObject(
294-
'operators.coreos.com',
295-
'v1alpha1',
296-
'operators',
297-
'clusterserviceversions'
298-
)
293+
let operators = { items: [] };
294+
try {
295+
let response = await this.customObjectsApi.listNamespacedCustomObject(
296+
'operators.coreos.com',
297+
'v1alpha1',
298+
'operators',
299+
'clusterserviceversions'
300+
)
301+
//let operators = response.body as KubernetesListObject<KubernetesObject>;
302+
operators = response.body as any // TODO : fix type. This is a hacky way to get the type to work
303+
} catch (error) {
304+
debug.log(error);
305+
debug.log("error getting operators");
306+
}
299307

300-
//let operators = response.body as KubernetesListObject<KubernetesObject>;
301-
let operators = response.body as any // TODO : fix type. This is a hacky way to get the type to work
302308
return operators.items;
303309
}
304310

0 commit comments

Comments
 (0)