fluxcd-flux2/cmd/flux
Florian Forster 72a948e8a9
flux diff artifact: Print the differences in human readable form.
I was hoping to use `flux diff artifact` as part of a CI pipeline to show the
difference between the merge request and the currently deployed artifact. The
existing implementation doesn't work for us, since it only compares the
checksums.

This commit changes the output produced by `flux diff artifact` to a list of
changes in human readable form. The code is using the `dyff` package to produce
a semantic diff of the YAML files. That means, for example, that changes in the
order of map fields are ignored, while changes in the order of lists are not.

Example output:

```
$ ./bin/flux diff artifact "oci://${IMAGE}" --path=example-service/

spec.replicas  (apps/v1/Deployment/example-service-t205j6/backend-production)
  ± value change
    - 1
    + 7

✗ "oci://registry.gitlab.com/${REDACTED}/example-service-t205j6/deploy:production" and "example-service/" differ
```

The new `--brief` / `-q` flag enables users to revert to the previous behavior
of only printing a has changed/has not changed line.

Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-09-23 11:08:12 +02:00
..
testdata Recursively build and diff Kustomizations 2024-09-06 21:24:38 +03:00
alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
alert_provider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
bootstrap.go Add --ssh-hostkey-algos flag to bootstrap command 2024-05-01 13:02:50 +03:00
bootstrap_bitbucket_server.go Generate image pull secret at bootstrap 2024-04-05 16:42:15 +03:00
bootstrap_git.go Add --ssh-hostkey-algos flag to bootstrap command 2024-05-01 13:02:50 +03:00
bootstrap_gitea.go Generate image pull secret at bootstrap 2024-04-05 16:42:15 +03:00
bootstrap_github.go Generate image pull secret at bootstrap 2024-04-05 16:42:15 +03:00
bootstrap_gitlab.go Introduce visibility flag for bootstrap gitlab 2024-07-17 20:22:25 +02:00
build.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
build_artifact.go fix build_artifact.go typo 2023-11-14 15:02:54 -05:00
build_artifact_test.go tests: only provide template values when used 2023-02-15 13:22:44 +01:00
build_kustomization.go Recursively build and diff Kustomizations 2024-09-06 21:24:38 +03:00
build_kustomization_test.go Recursively build and diff Kustomizations 2024-09-06 21:24:38 +03:00
check.go Set Kubernetes 1.28 as min required version 2024-05-10 18:52:15 +03:00
check_test.go Add /v2 suffix to module name in preparation of 2.0.0 release 2023-04-05 16:05:21 +03:00
cluster_info.go show cluster instance name and version in flux check and flux version 2023-12-06 15:21:55 +01:00
cluster_info_test.go Update dependencies to Kubernetes v1.28.6 2024-01-30 14:07:35 +02:00
completion.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
completion_bash.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
completion_fish.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
completion_powershell.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
completion_zsh.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
create_alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
create_alertprovider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
create_helmrelease.go Add support for creating HR with .spec.ChartRef 2024-05-11 22:49:52 +02:00
create_helmrelease_test.go Add support for creating HR with .spec.ChartRef 2024-05-11 22:49:52 +02:00
create_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create_image_policy.go misc: remove unused bits of code 2023-10-17 14:08:09 +02:00
create_image_repository.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create_image_update.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
create_kustomization.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
create_receiver.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
create_secret.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create_secret_git.go add flag --ca-crt-file to flux create secret git 2023-08-23 14:44:09 +05:30
create_secret_git_test.go add flag --ca-crt-file to flux create secret git 2023-08-23 14:44:09 +05:30
create_secret_helm.go Mark source helm commands as GA 2024-05-06 12:50:22 +03:00
create_secret_helm_test.go Add create oci secret command 2022-08-09 12:44:59 +03:00
create_secret_notation.go Add command for creating notation configuration secrets 2024-04-23 22:29:23 +10:00
create_secret_notation_test.go build(deps): bump notation-go to v1.2.1 2024-09-05 22:22:47 +10:00
create_secret_oci.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create_secret_oci_test.go Add create oci secret command 2022-08-09 12:44:59 +03:00
create_secret_tls.go add deprecation warning per secret key field and constant 2023-08-23 14:44:09 +05:30
create_secret_tls_test.go add support for Kubernetes TLS keys for flux create secret tls 2023-08-23 14:44:09 +05:30
create_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create_source_bucket.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
create_source_chart.go Add (create|delete|export) source chart commands 2024-05-09 11:57:38 +02:00
create_source_chart_test.go Add (create|delete|export) source chart commands 2024-05-09 11:57:38 +02:00
create_source_git.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
create_source_git_test.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
create_source_helm.go Mark source helm commands as GA 2024-05-06 12:50:22 +03:00
create_source_helm_test.go Add OCI support to create source helm 2022-06-01 15:59:52 +02:00
create_source_oci.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
create_source_oci_test.go Add flags for issuer/subject OCI signature verification 2024-04-17 09:45:33 +02:00
create_tenant.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
create_test.go validate that object name adheres to RFC 1123 for flux create commands 2022-02-16 10:51:03 +01:00
delete.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
delete_alertprovider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
delete_helmrelease.go Mark HelmRelease commands as GA 2024-05-09 17:18:11 +03:00
delete_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_image_policy.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_image_repository.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_image_update.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
delete_kustomization.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_receiver.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_source_bucket.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_source_chart.go Add (create|delete|export) source chart commands 2024-05-09 11:57:38 +02:00
delete_source_git.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
delete_source_helm.go Migrate flux uninstall to Helm Source API v1 2024-05-06 15:43:10 +03:00
delete_source_oci.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
diff.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
diff_artifact.go flux diff artifact: Print the differences in human readable form. 2024-09-23 11:08:12 +02:00
diff_artifact_test.go feat: diff artifact capability added 2022-10-20 13:23:50 +03:00
diff_kustomization.go Recursively build and diff Kustomizations 2024-09-06 21:24:38 +03:00
diff_kustomization_test.go Recursively build and diff Kustomizations 2024-09-06 21:24:38 +03:00
docgen.go Revert "Fix broken "edit this page" links in Flux CLI section" 2022-09-06 15:20:42 +02:00
envsubst.go Add flux envsubst command 2024-04-08 17:54:38 +03:00
envsubst_test.go Add flux envsubst command 2024-04-08 17:54:38 +03:00
events.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
events_test.go Update tests to GA APIs 2024-05-09 19:05:45 +03:00
export.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
export_alertprovider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
export_helmrelease.go Mark HelmRelease commands as GA 2024-05-09 17:18:11 +03:00
export_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_image_policy.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_image_repository.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_image_update.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
export_kustomization.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_receiver.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_secret.go misc: remove unused bits of code 2023-10-17 14:08:09 +02:00
export_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_source_bucket.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_source_chart.go Add (create|delete|export) source chart commands 2024-05-09 11:57:38 +02:00
export_source_git.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_source_helm.go Mark source helm commands as GA 2024-05-06 12:50:22 +03:00
export_source_oci.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
export_test.go Add (create|delete|export) source chart commands 2024-05-09 11:57:38 +02:00
get.go Properly detect unsupported API errors 2023-12-13 13:16:18 +01:00
get_alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
get_alertprovider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
get_all.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
get_helmrelease.go Mark HelmRelease commands as GA 2024-05-09 17:18:11 +03:00
get_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
get_image_all.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
get_image_policy.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
get_image_repository.go misc: address strings.Title deprecation 2023-10-17 14:07:58 +02:00
get_image_update.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
get_kustomization.go misc: address strings.Title deprecation 2023-10-17 14:07:58 +02:00
get_receiver.go misc: address strings.Title deprecation 2023-10-17 14:07:58 +02:00
get_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
get_source_all.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
get_source_bucket.go misc: address strings.Title deprecation 2023-10-17 14:07:58 +02:00
get_source_chart.go Mark source helm commands as GA 2024-05-06 12:50:22 +03:00
get_source_git.go misc: address strings.Title deprecation 2023-10-17 14:07:58 +02:00
get_source_helm.go Mark source helm commands as GA 2024-05-06 12:50:22 +03:00
get_source_oci.go misc: address strings.Title deprecation 2023-10-17 14:07:58 +02:00
get_test.go Add label selector flag to get cmd 2023-04-11 17:00:57 +01:00
helmrelease.go Mark HelmRelease commands as GA 2024-05-09 17:18:11 +03:00
helmrelease_test.go e2e: update podinfo to version with newer APIs 2023-03-09 11:43:05 +01:00
image.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
image_test.go tests: rename "kubectl" setupTestNamespace 2023-02-15 13:56:55 +01:00
install.go Generate image pull secret at install 2024-04-06 11:39:51 +03:00
install_test.go Generate image pull secret at install 2024-04-06 11:39:51 +03:00
kustomization.go Update GitRepository Receiver, and Kustomization to v1 2023-04-05 16:05:20 +03:00
kustomization_test.go Add support for passing multiple objects to suspend/resume commands 2023-06-29 08:23:13 +02:00
list.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
list_artifact.go Update Kubernetes to v1.27 and Kustomize to v5.0 2023-05-23 18:49:47 +03:00
log.go Add Warningf to logger interface amd impl 2021-04-08 10:48:27 +03:00
logs.go chore: remove repetitive word 2024-06-11 23:56:04 +02:00
logs_e2e_test.go misc: sinceSeconds -> sinceDuration 2023-10-17 14:08:10 +02:00
logs_unit_test.go Make flux logs more lenient 2023-06-05 10:07:38 +02:00
main.go update description of kubeconfig flags 2023-09-18 10:48:08 +01:00
main_e2e_test.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
main_test.go Recursively build and diff Kustomizations 2024-09-06 21:24:38 +03:00
main_unit_test.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
manifests.embed.go Add missing copyright headers 2021-10-14 16:14:28 +03:00
object.go Add support for passing multiple objects to suspend/resume commands 2023-06-29 08:23:13 +02:00
pull.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
pull_artifact.go Print artifact source and revision only when available 2023-10-12 16:00:57 +03:00
push.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
push_artifact.go Add --reproducible flag to flux push artifact 2024-05-08 13:30:22 +02:00
readiness.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
readiness_test.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
receiver.go Update GitRepository Receiver, and Kustomization to v1 2023-04-05 16:05:20 +03:00
reconcile.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
reconcile_helmrelease.go Fix reconcile helmrelease command description 2024-08-08 00:30:38 +01:00
reconcile_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
reconcile_image_repository.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
reconcile_image_updateauto.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
reconcile_kustomization.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
reconcile_receiver.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
reconcile_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
reconcile_source_bucket.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
reconcile_source_chart.go Migrate flux events to Helm Source API v1 2024-05-06 15:15:38 +03:00
reconcile_source_git.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
reconcile_source_helm.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
reconcile_source_oci.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
reconcile_with_source.go Mark source helm commands as GA 2024-05-06 12:50:22 +03:00
resume.go non-reconciliable & readiness of static objects 2023-12-08 21:15:20 +05:30
resume_alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
resume_alertprovider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
resume_helmrelease.go Mark HelmRelease commands as GA 2024-05-09 17:18:11 +03:00
resume_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
resume_image_repository.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
resume_image_updateauto.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
resume_kustomization.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
resume_receiver.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
resume_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
resume_source_bucket.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
resume_source_chart.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
resume_source_git.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
resume_source_helm.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
resume_source_oci.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
source.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
source_oci_test.go e2e: update podinfo to version with newer APIs 2023-03-09 11:43:05 +01:00
stats.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
status.go check readiness using kstatus 2023-12-08 19:47:12 +05:30
suspend.go Add support for passing multiple objects to suspend/resume commands 2023-06-29 08:23:13 +02:00
suspend_alert.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
suspend_alertprovider.go Update all the references of NC v1beta2 to v1beta3 2023-12-08 21:16:54 +05:30
suspend_helmrelease.go Mark HelmRelease commands as GA 2024-05-09 17:18:11 +03:00
suspend_image.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
suspend_image_repository.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
suspend_image_updateauto.go Update image-automation-controller API to v1beta2 2024-05-07 08:34:10 +00:00
suspend_kustomization.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
suspend_receiver.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
suspend_source.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
suspend_source_bucket.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
suspend_source_chart.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
suspend_source_git.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
suspend_source_helm.go Update Helm Source APIs to v1 (GA) 2024-05-06 12:28:34 +03:00
suspend_source_oci.go Add examples for resuming/suspending multiple objects 2023-06-29 12:50:38 +05:30
tag.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
tag_artifact.go Update Kubernetes to v1.27 and Kustomize to v5.0 2023-05-23 18:49:47 +03:00
trace.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
trace_test.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
tree.go add a preview note for all non-bootstrap commands 2023-04-05 16:05:21 +03:00
tree_kustomization.go Update HelmRelease API to v2 2024-05-09 17:10:00 +03:00
tree_kustomization_test.go Update Go to v1.17 2022-01-10 16:30:38 +01:00
uninstall.go Properly detect unexpected arguments 2024-01-21 13:06:59 -06:00
version.go show cluster instance name and version in flux check and flux version 2023-12-06 15:21:55 +01:00
version_test.go Fix controller version info 2023-08-22 12:36:58 +03:00
version_utils.go Add /v2 suffix to module name in preparation of 2.0.0 release 2023-04-05 16:05:21 +03:00
version_utils_test.go Update Go to v1.17 2022-01-10 16:30:38 +01:00