From ddb7073a86a39d5e4d4531c702458e905a382990 Mon Sep 17 00:00:00 2001 From: Marketen Date: Tue, 10 Mar 2026 15:42:36 +0000 Subject: [PATCH] compute default labels at install --- packages/dockerCompose/src/userSettings.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/dockerCompose/src/userSettings.ts b/packages/dockerCompose/src/userSettings.ts index aa9191f94a..cc31c66010 100644 --- a/packages/dockerCompose/src/userSettings.ts +++ b/packages/dockerCompose/src/userSettings.ts @@ -1,5 +1,5 @@ import path from "path"; -import { mapValues, pick, omitBy, isObject } from "lodash-es"; +import { mapValues, omitBy, isObject } from "lodash-es"; import { parsePortMappings, stringifyPortMappings, @@ -238,7 +238,14 @@ export function applyUserSettings( const nextLabels = { ...(service.labels || {}), - ...writeDefaultsToLabels(pick(service, ["environment", "ports", "volumes"])) + // Compute default labels from post-applied values so they match the + // compose content written to disk. This keeps the daemon idempotent: + // re-computing labels from the same on-disk values yields no diff. + ...writeDefaultsToLabels({ + environment: nextEnvironment, + ports: nextPorts, + volumes: nextServiceVolumes + }) }; return {