Commit graph

8 commits

Author SHA1 Message Date
Florian Forster
0a56dabf2d
flux diff artifact: Fix and document --path=- which reads from STDIN.
Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-09-23 11:08:15 +02:00
Florian Forster
d28d9ff58d
Use printers.DyffPrinter to format the output.
Also updates the list of options passed to `dyff.CompareInputFiles` to be the
same as in the internal `build` package.

Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-09-23 11:08:15 +02:00
Florian Forster
2c4194e0a5
flux diff artifact: Check for an expected error using errors.Is.
This fixes the `TestDiffArtifact` unit test.

Signed-off-by: Florian Forster <fforster@gitlab.com>
2024-09-23 11:08:15 +02:00
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
Stefan Prodan
13ff4afaa4
Update Kubernetes to v1.27 and Kustomize to v5.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-23 18:49:47 +03:00
Sanskar Jaiswal
97b064be13
add a preview note for all non-bootstrap commands
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-04-05 16:05:21 +03:00
Max Jonas Werner
52acac1a37
Add /v2 suffix to module name in preparation of 2.0.0 release
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-04-05 16:05:21 +03:00
Batuhan Apaydın
c3d7cad53e
feat: diff artifact capability added
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-10-20 13:23:50 +03:00