@m8t-stack/cli 0.2.106 → 0.2.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1454,7 +1454,7 @@ function installFoundryDnsShim() {
1454
1454
  }
1455
1455
 
1456
1456
  // src/lib/package-version.ts
1457
- var CLI_VERSION = "0.2.106";
1457
+ var CLI_VERSION = "0.2.107";
1458
1458
 
1459
1459
  // src/lib/render-error.ts
1460
1460
  init_errors();
@@ -21788,6 +21788,12 @@ async function adoptLegacyGateway(args) {
21788
21788
  if (!stamp || typeof stampEtag !== "string" || !stampEtag) {
21789
21789
  throw new LocalCliError({ code: "PLATFORM_GATEWAY_ADOPTION_NO_STAMP", message: "The installed platform stamp is malformed or lacks an ETag." });
21790
21790
  }
21791
+ if (stamp.platformVersion !== args.rollbackPlatformVersion) {
21792
+ throw new LocalCliError({
21793
+ code: "PLATFORM_GATEWAY_ADOPTION_CHANGED",
21794
+ message: `The installed platform changed after preflight; expected rollback ${args.rollbackPlatformVersion}, found ${stamp.platformVersion}.`
21795
+ });
21796
+ }
21791
21797
  const existingRequest = await readApplyRequest(client);
21792
21798
  const live = await readLiveGatewayDeployment(args.gatewayResourceId);
21793
21799
  const topologyError = legacyGatewayTopologyError(live, args.gatewayResourceId, args.subscriptionId);
@@ -24468,23 +24474,26 @@ var PlatformGatewayAdoptCommand = class extends M8tCommand {
24468
24474
  }
24469
24475
  };
24470
24476
  assertTarget(target, manifest);
24471
- if (compareSemver(`v${manifest.components.installer.version}`, "v0.1.74") < 0 || compareSemver(`v${manifest.components.cli.recommended}`, "v0.2.106") < 0) {
24477
+ if (compareSemver(`v${manifest.components.installer.version}`, "v0.1.74") < 0 || compareSemver(`v${manifest.components.cli.recommended}`, "v0.2.107") < 0) {
24472
24478
  throw new LocalCliError({
24473
24479
  code: "PLATFORM_GATEWAY_ADOPTION_TARGET_TOO_OLD",
24474
24480
  message: `Platform target ${target} predates digest-bound legacy gateway adoption support.`,
24475
- hint: "Choose a published platform target whose installer is at least 0.1.74 and recommended CLI is at least 0.2.106."
24481
+ hint: "Choose a published platform target whose installer is at least 0.1.74 and recommended CLI is at least 0.2.107."
24476
24482
  });
24477
24483
  }
24478
- if (!manifest.platform.previousVersion) {
24484
+ const credential2 = new DefaultAzureCredential21();
24485
+ const installed2 = await readStampOutcome({ credential: credential2, subscriptionId, resourceGroup });
24486
+ if (installed2.source !== "explicit") {
24479
24487
  throw new LocalCliError({
24480
24488
  code: "PLATFORM_GATEWAY_ADOPTION_NO_ROLLBACK",
24481
- message: `Platform target ${target} has no recorded previous release; refusing a gateway ownership transition without a rollback target.`
24489
+ message: "The installed platform stamp is absent or unreadable; refusing a gateway ownership transition without its exact rollback target."
24482
24490
  });
24483
24491
  }
24484
- const rollbackManifest = await fetchManifest({ channel: true, version: manifest.platform.previousVersion });
24485
- assertTarget(manifest.platform.previousVersion, rollbackManifest);
24492
+ const rollbackVersion = installed2.stamp.platformVersion;
24493
+ const rollbackManifest = await fetchManifest({ channel: true, version: rollbackVersion });
24494
+ assertTarget(rollbackVersion, rollbackManifest);
24486
24495
  const result2 = await adoptLegacyGateway({
24487
- credential: new DefaultAzureCredential21(),
24496
+ credential: credential2,
24488
24497
  subscriptionId,
24489
24498
  resourceGroup,
24490
24499
  gatewayResourceId: gw.containerAppResourceId,
@@ -24496,6 +24505,7 @@ var PlatformGatewayAdoptCommand = class extends M8tCommand {
24496
24505
  targetGatewayDigest: manifest.components.gateway.digest,
24497
24506
  rollbackGatewayTag: rollbackManifest.components.gateway.tag,
24498
24507
  rollbackGatewayDigest: rollbackManifest.components.gateway.digest,
24508
+ rollbackPlatformVersion: rollbackVersion,
24499
24509
  operatorIdentity: await getCallerObjectId(),
24500
24510
  onProgress: (m) => this.context.stderr.write(`${m}
24501
24511
  `)