Skip to content

Commit 6567bbc

Browse files
committed
review comments
1 parent 48ca345 commit 6567bbc

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Added output to GitOps for scripts, indicating how many would or be applied when running.
1+
- Added output to GitOps for scripts, indicating how many scripts would be applied (dry run) or were applied.

cmd/fleetctl/fleetctl/gitops_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6676,5 +6676,5 @@ software:
66766676
// Real run.
66776677
logs = RunAppForTest(t, []string{"gitops", "-f", globalPath, "-f", teamPath})
66786678
assert.Contains(t, logs, "[+] applied 1 script\n")
6679-
assert.Contains(t, logs, fmt.Sprintf("[+] applying 1 script for fleet %s\n", teamName))
6679+
assert.Contains(t, logs, fmt.Sprintf("[+] applied 1 script for fleet %s\n", teamName))
66806680
}

server/service/client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ const (
527527
dryRunAppliedFormat = "[+] would've applied %s\n"
528528
appliedFormat = "[+] applied %s\n"
529529
applyingTeamFormat = "[+] applying %s for fleet %s\n"
530+
appliedTeamFormat = "[+] applied %s for fleet %s\n"
530531
dryRunAppliedTeamFormat = "[+] would've applied %s for fleet %s\n"
531532
)
532533

@@ -1074,10 +1075,10 @@ func (c *Client) ApplyGroup(
10741075
teamsScripts[tmName] = scriptResponses
10751076
if opts.DryRun {
10761077
// We split here on dry-run to capture the number we want to apply
1077-
logfn(format, numberWithPluralization(len(scripts), "script", "scripts"), tmName)
1078+
logfn(dryRunAppliedTeamFormat, numberWithPluralization(len(scripts), "script", "scripts"), tmName)
10781079
} else {
10791080
// vs. the number that actually got applied and returned by the server
1080-
logfn(format, numberWithPluralization(len(scriptResponses), "script", "scripts"), tmName)
1081+
logfn(appliedTeamFormat, numberWithPluralization(len(scriptResponses), "script", "scripts"), tmName)
10811082
}
10821083
}
10831084
}

0 commit comments

Comments
 (0)