From bc33f19333eaca6e578e38651011f06930f3eaef Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Fri, 3 Jan 2020 18:56:55 -0800 Subject: [PATCH] fix: diff local ignore kustomize build options (#2942) --- cmd/argocd/commands/app.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index fcad08a346..a8c23ce8d8 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -818,8 +818,8 @@ func liveObjects(resources []*argoappv1.ResourceDiff) ([]*unstructured.Unstructu return objs, nil } -func getLocalObjects(app *argoappv1.Application, local, appLabelKey, kubeVersion string) []*unstructured.Unstructured { - manifestStrings := getLocalObjectsString(app, local, appLabelKey, kubeVersion, nil) +func getLocalObjects(app *argoappv1.Application, local, appLabelKey, kubeVersion string, kustomizeOptions *argoappv1.KustomizeOptions) []*unstructured.Unstructured { + manifestStrings := getLocalObjectsString(app, local, appLabelKey, kubeVersion, kustomizeOptions) objs := make([]*unstructured.Unstructured, len(manifestStrings)) for i := range manifestStrings { obj := unstructured.Unstructured{} @@ -920,7 +920,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co cluster, err := clusterIf.Get(context.Background(), &clusterpkg.ClusterQuery{Server: app.Spec.Destination.Server}) errors.CheckError(err) util.Close(conn) - localObjs := groupLocalObjs(getLocalObjects(app, local, argoSettings.AppLabelKey, cluster.ServerVersion), liveObjs, app.Spec.Destination.Namespace) + localObjs := groupLocalObjs(getLocalObjects(app, local, argoSettings.AppLabelKey, cluster.ServerVersion, argoSettings.KustomizeOptions), liveObjs, app.Spec.Destination.Namespace) for _, res := range resources.Items { var live = &unstructured.Unstructured{} err := json.Unmarshal([]byte(res.LiveState), &live)