Skip to content

Commit aeb4261

Browse files
committed
fix(cli/app/diff): respect refresh type when running which specified revision
Signed-off-by: Josef Kolář <[email protected]>
1 parent fe347e3 commit aeb4261

File tree

5 files changed

+223
-170
lines changed

5 files changed

+223
-170
lines changed

assets/swagger.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/argocd/commands/app.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1274,9 +1274,10 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
12741274
conn, appIf := clientset.NewApplicationClientOrDie()
12751275
defer argoio.Close(conn)
12761276
appName, appNs := argo.ParseFromQualifiedName(args[0], appNamespace)
1277+
refreshType := getRefreshType(refresh, hardRefresh)
12771278
app, err := appIf.Get(ctx, &application.ApplicationQuery{
12781279
Name: &appName,
1279-
Refresh: getRefreshType(refresh, hardRefresh),
1280+
Refresh: refreshType,
12801281
AppNamespace: &appNs,
12811282
})
12821283
errors.CheckError(err)
@@ -1314,6 +1315,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
13141315
AppNamespace: &appNs,
13151316
Revisions: revisions,
13161317
SourcePositions: sourcePositions,
1318+
NoCache: ptr.To(refreshType != nil),
13171319
}
13181320
res, err := appIf.GetManifests(ctx, &q)
13191321
errors.CheckError(err)
@@ -1326,6 +1328,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
13261328
Name: &appName,
13271329
Revision: &revision,
13281330
AppNamespace: &appNs,
1331+
NoCache: ptr.To(refreshType != nil),
13291332
}
13301333
res, err := appIf.GetManifests(ctx, &q)
13311334
errors.CheckError(err)

0 commit comments

Comments
 (0)