Skip to content

Commit 5defeea

Browse files
authored
Merge pull request #706 from hyperweb-io/anmol/version-update
feature: update how to read and set version
2 parents d5b9bd6 + 5e7a317 commit 5defeea

File tree

205 files changed

+449
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+449
-395
lines changed

packages/packages/client/__tests__/__snapshots__/client.config.test.ts.snap

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
exports[`StarshipClient setup 1`] = `
44
"Call: setConfig({"name":"starship","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
5+
Log: No version specified, using default version: v1.8.0
56
Log: config again: [object Object]
67
Call: saveConfig()
78
Call: savePodPorts("../../__output__/default-pod-ports.yaml")
89
Call: setup()
910
helm repo add starship https://hyperweb-io.github.io/starship/
1011
helm repo update
11-
helm search repo starship/devnet --version v0.2.3
12+
helm search repo starship/devnet --version v1.8.0
1213
Call: deploy()
1314
Log: Installing the helm chart. This is going to take a while.....
14-
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
15+
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v1.8.0 --timeout 10m
1516
Log: Run "starship get-pods" to check the status of the cluster
1617
Call: startPortForward()
1718
Log: Attempting to stop any existing port-forwards...
@@ -48,8 +49,8 @@ Log: All pods have been successfully terminated!"
4849
exports[`StarshipClient setup 2`] = `
4950
"helm repo add starship https://hyperweb-io.github.io/starship/
5051
helm repo update
51-
helm search repo starship/devnet --version v0.2.3
52-
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
52+
helm search repo starship/devnet --version v1.8.0
53+
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v1.8.0 --timeout 10m
5354
ps -ef | grep -i 'kubectl port-forward' | grep -v 'grep' | awk '{print $2}'
5455
sleep 2
5556
kubectl port-forward pods/osmosis-1-genesis-0 1317:1317 > /dev/null 2>&1 &

packages/packages/client/__tests__/__snapshots__/client.ports.test.ts.snap

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
exports[`StarshipClient setup 1`] = `
44
"Call: setConfig({"name":"starship","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
5+
Log: No version specified, using default version: v1.8.0
56
Log: config again: [object Object]
67
Call: setPodPorts({"chains":{"osmosis":{"exposer":98988,"faucet":1000000,"grpc":909090,"rest":6767676}}})
78
Call: savePodPorts("../../__output__/custom-pod-ports.yaml")
89
Call: setup()
910
helm repo add starship https://hyperweb-io.github.io/starship/
1011
helm repo update
11-
helm search repo starship/devnet --version v0.2.3
12+
helm search repo starship/devnet --version v1.8.0
1213
Call: deploy()
1314
Log: Installing the helm chart. This is going to take a while.....
14-
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
15+
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v1.8.0 --timeout 10m
1516
Log: Run "starship get-pods" to check the status of the cluster
1617
Call: startPortForward()
1718
Log: Attempting to stop any existing port-forwards...
@@ -46,8 +47,8 @@ Log: All pods have been successfully terminated!"
4647
exports[`StarshipClient setup 2`] = `
4748
"helm repo add starship https://hyperweb-io.github.io/starship/
4849
helm repo update
49-
helm search repo starship/devnet --version v0.2.3
50-
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
50+
helm search repo starship/devnet --version v1.8.0
51+
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v1.8.0 --timeout 10m
5152
ps -ef | grep -i 'kubectl port-forward' | grep -v 'grep' | awk '{print $2}'
5253
sleep 2
5354
kubectl port-forward pods/osmosis-1-genesis-0 1317:6767676 > /dev/null 2>&1 &

packages/packages/client/__tests__/__snapshots__/client.test.ts.snap

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
exports[`StarshipClient setup 1`] = `
44
"Call: setConfig({"name":"starship","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
5+
Log: No version specified, using default version: v1.8.0
56
Log: config again: [object Object]
67
Call: setup()
78
helm repo add starship https://hyperweb-io.github.io/starship/
89
helm repo update
9-
helm search repo starship/devnet --version v0.2.3
10+
helm search repo starship/devnet --version v1.8.0
1011
Call: deploy()
1112
Log: Installing the helm chart. This is going to take a while.....
12-
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
13+
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v1.8.0 --timeout 10m
1314
Log: Run "starship get-pods" to check the status of the cluster
1415
Call: startPortForward()
1516
Log: Attempting to stop any existing port-forwards...
@@ -46,8 +47,8 @@ Log: All pods have been successfully terminated!"
4647
exports[`StarshipClient setup 2`] = `
4748
"helm repo add starship https://hyperweb-io.github.io/starship/
4849
helm repo update
49-
helm search repo starship/devnet --version v0.2.3
50-
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v0.2.3 --timeout 10m
50+
helm search repo starship/devnet --version v1.8.0
51+
helm install -f ../../__fixtures__/config.yaml osmojs starship/devnet --version v1.8.0 --timeout 10m
5152
ps -ef | grep -i 'kubectl port-forward' | grep -v 'grep' | awk '{print $2}'
5253
sleep 2
5354
kubectl port-forward pods/osmosis-1-genesis-0 1317:1317 > /dev/null 2>&1 &

packages/packages/client/__tests__/__snapshots__/client.verify.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
exports[`StarshipClient verify should handle explorer verification failure 1`] = `
44
"Call: setConfig({"name":"osmojs","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
5+
Log: No version specified, using default version: v1.8.0
56
Log: config again: [object Object]
67
Call: verify()
78
Log: Verifying services...
@@ -26,6 +27,7 @@ exports[`StarshipClient verify should handle explorer verification failure 2`] =
2627

2728
exports[`StarshipClient verify should handle registry verification failure 1`] = `
2829
"Call: setConfig({"name":"osmojs","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
30+
Log: No version specified, using default version: v1.8.0
2931
Log: config again: [object Object]
3032
Call: verify()
3133
Log: Verifying services...
@@ -50,6 +52,7 @@ exports[`StarshipClient verify should handle registry verification failure 2`] =
5052

5153
exports[`StarshipClient verify should handle relayer verification failure 1`] = `
5254
"Call: setConfig({"name":"osmojs","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
55+
Log: No version specified, using default version: v1.8.0
5356
Log: config again: [object Object]
5457
Call: verify()
5558
Log: Verifying services...
@@ -74,6 +77,7 @@ exports[`StarshipClient verify should handle relayer verification failure 2`] =
7477

7578
exports[`StarshipClient verify should skip disabled services 1`] = `
7679
"Call: setConfig({"name":"osmojs","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":false,"ports":{"rest":8081,"grpc":9091}},"explorer":{"enabled":false}})
80+
Log: No version specified, using default version: v1.8.0
7781
Log: config again: [object Object]
7882
Call: verify()
7983
Log: Verifying services...
@@ -97,6 +101,7 @@ exports[`StarshipClient verify should skip disabled services 2`] = `""`;
97101

98102
exports[`StarshipClient verify should verify all services successfully 1`] = `
99103
"Call: setConfig({"name":"starship","version":"v0.2.3","chains":[{"id":"osmosis-1","name":"osmosis","image":"pyramation/osmosis:v16.1.0","numValidators":1,"ports":{"rest":1317,"rpc":26657,"faucet":8007}},{"id":"cosmos-2","name":"cosmos","numValidators":1,"ports":{"rest":1313,"rpc":26653,"faucet":8003}}],"relayers":[{"name":"osmos-cosmos","type":"hermes","replicas":1,"chains":["osmosis-1","cosmos-2"]}],"registry":{"enabled":true,"ports":{"rest":8081,"grpc":9091}}})
104+
Log: No version specified, using default version: v1.8.0
100105
Log: config again: [object Object]
101106
Call: verify()
102107
Log: Verifying services...

packages/packages/client/src/client.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,6 @@ export class StarshipClient implements StarshipClientI {
303303
if (this.ctx.name) {
304304
this.config.name = this.ctx.name;
305305
}
306-
if (this.ctx.version) {
307-
this.config.version = this.ctx.version;
308-
}
309306

310307
// Use default name and version if not provided
311308
if (!this.config.name) {
@@ -314,13 +311,13 @@ export class StarshipClient implements StarshipClientI {
314311
);
315312
this.config.name = defaultName;
316313
}
317-
if (!this.config.version) {
314+
if (!this.ctx.version) {
318315
this.log(
319316
chalk.yellow(
320317
'No version specified, using default version: ' + defaultVersion
321318
)
322319
);
323-
this.config.version = defaultVersion;
320+
this.ctx.version = defaultVersion;
324321
}
325322

326323
this.log('config again: ' + this.config);
@@ -375,14 +372,7 @@ export class StarshipClient implements StarshipClientI {
375372
});
376373
this.exec(['helm', 'repo', 'update'], { ignoreError: false });
377374
this.exec(
378-
[
379-
'helm',
380-
'search',
381-
'repo',
382-
this.ctx.chart,
383-
'--version',
384-
this.config.version
385-
],
375+
['helm', 'search', 'repo', this.ctx.chart, '--version', this.ctx.version],
386376
{ ignoreError: false }
387377
);
388378
}
@@ -408,7 +398,7 @@ export class StarshipClient implements StarshipClientI {
408398
this.config.name,
409399
this.ctx.chart,
410400
'--version',
411-
this.config.version,
401+
this.ctx.version,
412402
'--timeout',
413403
this.ctx.timeout,
414404
...this.getDeployArgs(),

packages/packages/generator/__tests__/__output__/builder-tests/build-chain/configmaps/keys.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: keys
55
labels:
66
app.kubernetes.io/instance: starship-generator-test
7-
app.kubernetes.io/version: 4.0.0
7+
app.kubernetes.io/version: 4.0.0-alpha.0
88
app.kubernetes.io/managed-by: starship
99
app.kubernetes.io/component: configmap
1010
app.kubernetes.io/part-of: global

packages/packages/generator/__tests__/__output__/builder-tests/build-chain/configmaps/setup-scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: setup-scripts
55
labels:
66
app.kubernetes.io/instance: starship-generator-test
7-
app.kubernetes.io/version: 4.0.0
7+
app.kubernetes.io/version: 4.0.0-alpha.0
88
app.kubernetes.io/managed-by: starship
99
app.kubernetes.io/component: configmap
1010
app.kubernetes.io/part-of: global

packages/packages/generator/__tests__/__output__/builder-tests/build-chain/explorer/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: explorer
55
labels:
66
app.kubernetes.io/instance: starship-generator-test
7-
app.kubernetes.io/version: 4.0.0
7+
app.kubernetes.io/version: 4.0.0-alpha.0
88
app.kubernetes.io/managed-by: starship
99
app.kubernetes.io/component: explorer
1010
app.kubernetes.io/part-of: starship

packages/packages/generator/__tests__/__output__/builder-tests/build-chain/explorer/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: explorer
55
labels:
66
app.kubernetes.io/instance: starship-generator-test
7-
app.kubernetes.io/version: 4.0.0
7+
app.kubernetes.io/version: 4.0.0-alpha.0
88
app.kubernetes.io/managed-by: starship
99
app.kubernetes.io/component: explorer
1010
app.kubernetes.io/part-of: starship
@@ -27,7 +27,7 @@ spec:
2727
app.kubernetes.io/type: ping-pub
2828
app.kubernetes.io/name: explorer
2929
app.kubernetes.io/rawname: explorer
30-
app.kubernetes.io/version: 4.0.0
30+
app.kubernetes.io/version: 4.0.0-alpha.0
3131
spec:
3232
containers:
3333
- name: explorer

packages/packages/generator/__tests__/__output__/builder-tests/build-chain/explorer/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: explorer
55
labels:
66
app.kubernetes.io/instance: starship-generator-test
7-
app.kubernetes.io/version: 4.0.0
7+
app.kubernetes.io/version: 4.0.0-alpha.0
88
app.kubernetes.io/managed-by: starship
99
app.kubernetes.io/component: explorer
1010
app.kubernetes.io/part-of: starship

0 commit comments

Comments
 (0)