Skip to content

Commit 1e604cd

Browse files
authored
Merge pull request #121 from depot/feat/ceph-only-mode
feat: support only handling volume only mode
2 parents a545429 + 8f0414d commit 1e604cd

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/index.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
CLOUD_AGENT_CONNECTION_ID,
1111
CLOUD_AGENT_PROVIDER,
1212
CLOUD_AGENT_VERSION,
13+
CLOUD_AGENT_VOLUME_ONLY,
1314
} from './utils/env'
1415
import {client} from './utils/grpc'
1516
import {logger} from './utils/logger'
@@ -48,15 +49,18 @@ async function main() {
4849
process.exit(1)
4950
}
5051

51-
switch (CLOUD_AGENT_PROVIDER) {
52-
case 'fly':
53-
startStateStream(signal, FlyProvider)
54-
break
55-
case 'aws':
56-
startStateStream(signal, AwsProvider)
57-
break
58-
default:
59-
startStateStream(signal, AwsProvider)
52+
// Volume only mode only handles ceph volume requests.
53+
if (!CLOUD_AGENT_VOLUME_ONLY) {
54+
switch (CLOUD_AGENT_PROVIDER) {
55+
case 'fly':
56+
startStateStream(signal, FlyProvider)
57+
break
58+
case 'aws':
59+
startStateStream(signal, AwsProvider)
60+
break
61+
default:
62+
startStateStream(signal, AwsProvider)
63+
}
6064
}
6165

6266
startUpdater(signal)

src/utils/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config()
44

55
// CLOUD_AGENT_PROVIDER defines the cloud provider. It defaults to 'aws' but can be 'fly'.
66
export const CLOUD_AGENT_PROVIDER = process.env.CLOUD_AGENT_PROVIDER ?? 'aws'
7+
export const CLOUD_AGENT_VOLUME_ONLY = process.env.CLOUD_AGENT_VOLUME_ONLY
78

89
export const CLOUD_AGENT_API_URL = process.env.CLOUD_AGENT_API_URL ?? 'https://api.depot.dev'
910

0 commit comments

Comments
 (0)