Skip to content

Commit 2916dae

Browse files
DevinwongCopilot
andauthored
[Part 1] test: marker commit to simulate ANC hotfix cherry-pick (dry run) (#8590)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 800950d commit 2916dae

3 files changed

Lines changed: 36 additions & 8 deletions

File tree

aks-node-controller/app.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,20 @@ func (a *App) Run(ctx context.Context, args []string) int {
134134
func (a *App) runProvisionCommand(ctx context.Context, flags ProvisionFlags, dryRun bool) error {
135135
slog.Info("aks-node-controller started", "task", "Provision")
136136

137+
// Dry-run beacon for the official/v20260514 ANC hotfix end-to-end validation.
138+
// Emitted both to slog (journalctl -u aks-node-controller.service,
139+
// /var/log/azure/aks-node-controller.log) AND as a GuestAgent event so the
140+
// signal surfaces in Azure telemetry / Kusto without needing SSH access.
141+
// The hotfix-installed binary will emit this; the VHD-baked 202605.14.0 binary will not.
142+
beaconNow := time.Now()
143+
slog.Info("ANC hotfix dry-run beacon",
144+
"version", Version,
145+
"branch", "official/v20260514",
146+
"hotfixTag", "anc/v202605.14.1")
147+
a.eventLogger.LogEvent("HotfixBeacon",
148+
fmt.Sprintf("ANC hotfix dry-run beacon version=%s branch=official/v20260514 hotfixTag=anc/v202605.14.1", Version),
149+
helpers.EventLevelInformational, beaconNow, beaconNow)
150+
137151
startTime := time.Now()
138152
a.eventLogger.LogEvent("Provision", "Starting", helpers.EventLevelInformational, startTime, startTime)
139153
provisionResult, err := a.runProvision(ctx, flags, dryRun)

aks-node-controller/app_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ func TestApp_Run(t *testing.T) {
178178
assert.Equal(t, 0, exitCode)
179179

180180
events := tt.eventLogger.Events()
181-
assert.Len(t, events, 2)
182-
assert.Contains(t, events[0].Message, "Starting")
183-
assert.Contains(t, events[1].Message, "Completed")
181+
assert.Len(t, events, 3)
182+
assert.Contains(t, events[0].Message, "ANC hotfix dry-run beacon")
183+
assert.Contains(t, events[1].Message, "Starting")
184+
assert.Contains(t, events[2].Message, "Completed")
184185
})
185186

186187
t.Run("provision command with provision-config and nbc-cmd flag", func(t *testing.T) {
@@ -190,9 +191,10 @@ func TestApp_Run(t *testing.T) {
190191
assert.Equal(t, 0, exitCode)
191192

192193
events := tt.eventLogger.Events()
193-
assert.Len(t, events, 2)
194-
assert.Contains(t, events[0].Message, "Starting")
195-
assert.Contains(t, events[1].Message, "Completed")
194+
assert.Len(t, events, 3)
195+
assert.Contains(t, events[0].Message, "ANC hotfix dry-run beacon")
196+
assert.Contains(t, events[1].Message, "Starting")
197+
assert.Contains(t, events[2].Message, "Completed")
196198
})
197199

198200
t.Run("provision command with command runner error", func(t *testing.T) {
@@ -203,8 +205,8 @@ func TestApp_Run(t *testing.T) {
203205
assert.Equal(t, 666, exitCode)
204206

205207
events := tt.eventLogger.Events()
206-
assert.Len(t, events, 2)
207-
assert.Equal(t, "Error", events[1].EventLevel)
208+
assert.Len(t, events, 3)
209+
assert.Equal(t, "Error", events[2].EventLevel)
208210
})
209211
}
210212

parts/linux/cloud-init/nodecustomdata.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ write_files:
2525
Any overridden files will be listed here - Hotfix mode
2626
Example: {{GetCSEHelpersScriptFilepath}}
2727
28+
# Dry-run beacon for the official/v20260514 ANC hotfix end-to-end validation.
29+
# Greppable from the node via: cat /opt/azure/containers/anc-hotfix-dryrun-beacon.txt
30+
# Proves the nodecustomdata change reached the node (independent of the
31+
# auto-injected anc-hotfix block that targets aks-node-controller-hotfix.json).
32+
- path: /opt/azure/containers/anc-hotfix-dryrun-beacon.txt
33+
permissions: "0644"
34+
owner: root
35+
content: |
36+
anc-hotfix-dry-run beacon
37+
branch: official/v20260514
38+
hotfix-tag: anc/v202605.14.1
39+
2840
{{if IsAKSCustomCloud}}
2941
- path: {{GetInitAKSCustomCloudFilepath}}
3042
permissions: "0744"

0 commit comments

Comments
 (0)