@@ -8,6 +8,7 @@ import { tmpdir } from "node:os";
88import { stringify } from "yaml" ;
99import { TERRARIUM_SPLASH , TERRARIUM_VERSION } from "./generated/build-info" ;
1010import { verifyOidcConfig , verifyS3Config } from "./ctl/verify" ;
11+ import { normalizeS3Endpoint } from "./lib/common" ;
1112
1213const PREFIX = "terrariumctl install" ;
1314const REPO_URL = process . env . TERRARIUM_REPO_URL ?? "https://github.com/terion-name/terrarium.git" ;
@@ -493,7 +494,7 @@ async function promptAndVerifyExternalOidc(options: InstallOptions): Promise<voi
493494 */
494495async function promptAndVerifyS3 ( options : InstallOptions ) : Promise < void > {
495496 while ( true ) {
496- options . s3Endpoint = await promptText ( "S3 endpoint" , options . s3Endpoint || "https://s3.amazonaws.com" ) ;
497+ options . s3Endpoint = normalizeS3Endpoint ( await promptText ( "S3 endpoint" , options . s3Endpoint || "https://s3.amazonaws.com" ) ) ;
497498 options . s3Bucket = await promptText ( "S3 bucket" , options . s3Bucket ) ;
498499 options . s3Region = await promptText ( "S3 region" , options . s3Region || "us-east-1" ) ;
499500 options . s3Prefix = await promptText ( "S3 prefix" , options . s3Prefix || "terrarium" ) ;
@@ -809,7 +810,7 @@ function validateNonInteractive(options: InstallOptions): void {
809810 if ( ! options . s3SecretKey ) {
810811 fail ( "--s3-secret-key is required when S3 is enabled" ) ;
811812 }
812- options . s3Endpoint = options . s3Endpoint || "https://s3.amazonaws.com" ;
813+ options . s3Endpoint = normalizeS3Endpoint ( options . s3Endpoint || "https://s3.amazonaws.com" ) ;
813814 options . s3Region = options . s3Region || "us-east-1" ;
814815 }
815816
@@ -1079,7 +1080,7 @@ export function registerInstallCommand(cli: CAC): void {
10791080 options . storageSource = readCliOption ( cliOptions , "storageSource" ) ;
10801081 options . storageSize = readCliOption ( cliOptions , "storageSize" ) ;
10811082 options . enableS3 = Boolean ( cliOptions . enableS3 ) ;
1082- options . s3Endpoint = readCliOption ( cliOptions , "s3Endpoint" , [ "s3-endpoint" ] ) ;
1083+ options . s3Endpoint = normalizeS3Endpoint ( readCliOption ( cliOptions , "s3Endpoint" , [ "s3-endpoint" ] ) ) ;
10831084 options . s3Bucket = readCliOption ( cliOptions , "s3Bucket" , [ "s3-bucket" ] ) ;
10841085 options . s3Region = readCliOption ( cliOptions , "s3Region" , [ "s3-region" ] ) ;
10851086 options . s3Prefix = readCliOption ( cliOptions , "s3Prefix" , [ "s3-prefix" ] ) || options . s3Prefix ;
0 commit comments