Commit Graph

37 Commits (1013e98c0fe6909bcab118153b91ebc9780a951b)

Author SHA1 Message Date
Milas Bowman 7697699e65
fix: skip remote Kustomizations on recursive diff
When recursively diffing Kustomization objects on a cluster, each
Kustomization is built and then a server-side dry-run apply is
performed. This isn't practical to perform if the Kustomization
references a remote cluster via `kubeConfig.secretRef`.

Currently, because it's not skipped, it's treated as though it's
being applied to the context cluster, not the remote cluter, which
results in an incorrect diff.

Instead, write out special message / warnings indicating that it
has been skipped:
```
► Kustomization/my-ns/my-kst skipped: diff not supported for remote clusters
```

Signed-off-by: Milas Bowman <devnull@milas.dev>
2 months ago
Boris Kreitchman 2d37544b06 Recursively build and diff Kustomizations
Signed-off-by: Boris Kreitchman <bkreitch@gmail.com>
4 months ago
Boris Kreitchman 170e4f6f57 Stop spinner on cancel
Signed-off-by: Boris Kreitchman <bkreitch@gmail.com>
5 months ago
Stefan Prodan 7d52267fc4
Add `--strict-substitute` flag to `flux build` and `flux diff ks` commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
9 months ago
Taka Nishida 8fdfbcd251 Fix typo
Signed-off-by: Taka Nishida <takpme@gmail.com>
11 months ago
Stefan Prodan 5e14014e37
Update dependencies to Kubernetes v1.28.6
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
12 months ago
Stefan Prodan 80efd29ec0
Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 year ago
Hidde Beydals e73d1acb20
Tweak permissions on created files
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals f137263fe9
misc: clean up immediately and avoid delayed defer
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals 22134b1233
misc: use `errors.As` instead of type checking
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Marcus Weiner 56b1e80758 Fix selection of kustomization resource from multi doc yaml
Signed-off-by: Marcus Weiner <marcus.weiner@gmail.com>
1 year ago
Soule BA 90d95988aa
Take into account the server-side inventory for local diff
If implemented users will be able to use a local kustomization file while
retrieving status from the live kustomization file.

Signed-off-by: Soule BA <soule@weave.works>
2 years ago
cui fliter 3edfff49a2 fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2 years ago
Soule BA b74638c25c
Add the possibility to ignore files with build and diff ks
If implemented, user will be able to ignore files when using `build
kustomization` and `diff kustomization` both with .sourceignore and
`ignore-paths` flag.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2 years ago
Stefan Prodan f0c498ff54
Add support for .sourceignore to flux build/diff
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan cecffc0588
Add commonMetadata to flux build/diff
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
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>
2 years ago
Somtochi Onyekwere 24452ecd37
Update GitRepository Receiver, and Kustomization to v1
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Hidde Beydals 16e0b93bec
diff: update Action references to typed Action
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2 years ago
Soule BA 2c1085d9ce
Fix dry-run still loading kubeconfig issue
If this is implemented, it will not assume that access to a kubeconfig
is guaranteed even if just for retrieving configured namespace.

Signed-off-by: Soule BA <soule@weave.works>
2 years ago
Hidde Beydals b004fbfc41 Use k8s.io/apimachinery/pkg for error aggregation
Signed-off-by: Hidde Beydals <hello@hidde.co>
2 years ago
Soule BA ad5daee004
Add a dry-run mode to flux build kustomization
If implemented user will be able to use `flux build kustomization`
without any connection to the cluster.

Signed-off-by: Soule BA <soule@weave.works>
2 years ago
Soule BA 35ea91c111
Revert MakeSecureFSOnDisk to MakeFSOnDisk
The reason to this is because MakeSecureFSOnDisk is not consistent
between OS.

Signed-off-by: Soule BA <soule@weave.works>
2 years ago
Somtochi Onyekwere 355ed94852 check for correct kustomization in multi-doc yaml
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Hidde Beydals 57442e8faa kustomize: use FS from `fluxcd/pkg`
This switches to a secure FS implementation in most places, except for
where we can not make changes at this moment because it would break
behavior.

Not handled in this commit:

- Allowing the root for `manifestgen` packages to be configured.
- Allowing the user to define a working root while building locally.
- Defaulting to the secure FS implementation in
  `kustomization.MakeDefaultOptions`. Problem here is that constructing
  the secure FS could result in an error, which we can not surface
  without signature changes to the constructor func.

Signed-off-by: Hidde Beydals <hello@hidde.co>
3 years ago
Sanskar Jaiswal 5c9cbe676d handle secret types properly while masking sops data
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
3 years ago
Soule BA 5536af9756
Add an option to diff with a local kustomization file
If implemented, users will be able to provide a local kustomization file
to `flux build/diff`.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Stefan Prodan 0d8194c800 Add the kube client qps and burst to the global args
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Soule BA 7359e63960
Introduce a printer interface for flux resource
If implemented, there will a common interface to print flux resource.

We are adding new way to print resource information e.g. diff of
objects.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 32ad462ebe
Fix stringData Secret issue
This commit migrate to the last version of pkg/ssa v0.14.1 that contains a fix
for stringData secrets. The test case was changed accordingly to
    validate a stringData drift.

A progress-bar flag option has also been added in order to be able to
disable it.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 01f910e257
Add a simple spinner when running flux diff kustomization
If implemented, users will see a spinner run while the diff is on-going.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 2e9fd33ce5
Mask dockerconfigjson secret types and support StringData secrets
If implemented, flux diff kustomization will managed correctly sops
managed dockerconfigjson secrets.
Sops encrypted secret with stringData maps are supported too.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 8b444283e6
Fix wrong deletion message on flux diff
If implemented, when an error happens when dry-running an object, we
return early. This match pkg ssa implementation

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 997e6be3a2
Make sure to trim all sops data
If implemented this fixes #2363 and make sure we can build with sops
encrypted data

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA b86b195450
Add contextual error code for flux diff kustomization
If implemented, calling the diff command on kustomization will return 0,
1(if changes are identified), >1 for errors.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 10b761e4e7
Add license Header to internal/build files
This adds an up to date license header to the files.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Soule BA 306f8f5715
Add graceful shutdown when interrupted
If implemented this permit restoring a clean state in case of signal
interruption.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago