Commit Graph

879 Commits (1301bf7c15164d752384b353336c2247ffc19e9c)
 

Author SHA1 Message Date
Hidde Beydals 1301bf7c15
Merge pull request from alexei-led/main
Support check command with multiple config files
Alexei Ledenev 69387fd2a4 Support check command with multiple config files
Resolves: 
Signed-off-by: Alexei Ledenev <alexei.led@gmail.com>
Stefan Prodan 12a0ebe3ba
Merge pull request from fluxcd/pat-hint
Add note about deploy key linked to pat
Philip Laine 3de81827eb Move hint to github guide
Signed-off-by: Philip Laine <philip.laine@xenit.se>
Philip Laine a7362b60e7 Add note about deploy key linked to pat
Signed-off-by: Philip Laine <philip.laine@xenit.se>
Stefan Prodan 5d4bb3a43f
Merge pull request from fluxcd/kustomize-helm-e2e
Add e2e test for flux2-kustomize-helm-example
Stefan Prodan d02d507812
Add e2e test for flux2-kustomize-helm-example
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Stefan Prodan 554de7ba6f
Merge pull request from fluxcd/fix-action-binary
Move flux binary to GitHub workspace
Stefan Prodan 5d9ccc973d
Move flux binary to GitHub workspace
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Stefan Prodan 53ffb8aa00
Merge pull request from fluxcd/flux-action-docs-ignore
Add note about ignoring flux action binary
Stefan Prodan c4da4a81aa
Add note about ignoring flux action binary
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Hidde Beydals b824ea8858
Merge pull request from fluxcd/docs/zsh-completion-example
Fix zsh completion command example
Hidde Beydals 22e26efec1 Fix zsh completion command example
Signed-off-by: Hidde Beydals <hello@hidde.co>
Hidde Beydals 679490e8f4
Merge pull request from fluxcd/update-components
Update toolkit components
fluxcdbot 15f17ed36d Update toolkit components
Hidde Beydals c8265fb80c
Merge pull request from fluxcd/docs-fix-image-updates-branch
Add branch to image automation docs
Stefan Prodan 3883e92631
Add branch to image automation docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Stefan Prodan aa9bc4ce8b
Merge pull request from fluxcd/update-components
Update kustomize-controller to v0.5.1
fluxcdbot 37c14e8088 Update toolkit components
Hidde Beydals 439fbafc01
Merge pull request from fluxcd/case-insensitive-selector-args
Make resource selector args case insensitive
Hidde Beydals 1b8e980519 Make resource selector args case insensitive
So that `<kind>/<name>` flags can be supplied as:

* `secret/foo`
* `Secret/foo`
* `SeCrEt/foo`

But result in: `Secret/foo`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
Hidde Beydals 567acb6291
Merge pull request from fluxcd/flags-tests
Add tests for CLI flags
Hidde Beydals 996bfe87ff Add tests for CLI flags
This includes various bug fixes, especially around the area of missing
names for `<kind>/<name>` formats.

Signed-off-by: Hidde Beydals <hello@hidde.co>
Hidde Beydals 3c1793b6c5
Merge pull request from fluxcd/fix-azure-devops-docs
Stefan Prodan 1a7f253767
Fix Azure DevOps SSH URL in docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Hidde Beydals f188e59b21
Merge pull request from fluxcd/safe-rel-path
Add safe guards for relative paths
Hidde Beydals 5ea4e814f5 Add safe guards for relative paths
This commit adds multiple safe guards for relative paths, ensuring they
never traverse outside the working directory.

The `SafeRelativePath` flag calculates the safe relative path based on a
relative base dir, which results in a flattened path.

The write methods of `manifestgen` make use of the `SecureJoin` as well,
to ensure writes are never outside of the given directory when used as
a lib outside of the CLI.

Signed-off-by: Hidde Beydals <hello@hidde.co>
Stefan Prodan 008b3b8408
Merge pull request from fluxcd/docs-image-updates
Add image automation guide
Stefan Prodan 7ae3dee900
Add image automation guide
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Stefan Prodan 2395ab6e14
Merge pull request from fluxcd/fix-cluster-domain
Fix cluster domain mapping
Stefan Prodan 8efe053ffa
Fix cluster domain mapping
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
Stefan Prodan 612600b88c
Merge pull request from L3o-pold/add-cluster-domain-bootstrap-option
Add cluster-domain option for bootstrap command
Léopold Jacquot 4d7df52dbe Add cluster-domain option for bootstrap command
Signed-off-by: Léopold Jacquot <leopold.jacquot@infomaniak.com>
Stefan Prodan b6c63a1aa4
Merge pull request from fluxcd/update-components
Update source-controller to v0.5.4
fluxcdbot a4788ce6bb Update toolkit components
Michael Bridgen 0ba6fc1b36
Merge pull request from fluxcd/image-controller-commands
Add commands for image automation API
Michael Bridgen 0e35c209d9 Factor out upsert and upsertAndWait
It's a common pattern in the create commands to construct a value,
then (if not exporting it) upsert it and wait for it to
reconcile. This commit factors `upsert`, which does the update/insert
bit, and `upsertAndWait`, which does the whole thing.

Since these output messages, they are methods of `apiType` (previously
`names`), so that they have access to the name of the kind they are
operating on.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 3b9b2cbe9f Reuse isReady from create_image commands
I implemented the isReady procedure for adapters for resume -- use it
in create too.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 45240bdb71 Rename "auto" subcommands to "image"
This means all the sub-subcommands can drop the `image-` prefix,
making them shorter and more fluent.

E.g.,

    flux create image policy

rather than

    flux create auto image-policy

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 22a5ac7f0f Standardise the names of types
Most commands use either a kind, or a more readable spelling of a
kind, in their output. To make this easier, this centralises the
definition of those names in one place, and lets the command
implementations choose whichever they need.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen d55d185044 Implement suspend, resume, reconcile image-update
.. and refactor. These are all amenable to the adapter refactoring
that has served well so far.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 2bb09697ce Centralise adapter types
Since the generic commands tend to share a few of the methods they
need -- at least AsClientObject -- it's worth having just one wrapper
struct for each API type, and adding methods to it where necessary.

For the automation types, I put these in auto.go.

While doing this I also did some tidying:

 - I changed the name of the wrappers to `<type>Adapter`, and the
   generic adapter to `universalAdapter` (it's only needed for delete,
   so far).

 - I de-exported and renamed some interface methods e.g.,
   `exportItem`. They aren't needed outside the package.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen f316aff2d3 Add delete, export, get image-update
This uses the established abstractions to implement the usual
subcommands for the ImageUpdateAutomation type.

I've called the sub-subcommand in each case `image-update`, as a
fairly safe shorthand for the much longer `image-update-automation`.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 433628791b Add create auto image-update command
This adds the create subcommand, without attempting any refactoring.

NB the TODO: the image/v1alpha1 API does not yet export a const for
the name of the kind. The field `RunInterval` will likely be changed
to `Interval` (with a value field), at some point, too.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 4f52b77563 Factor out export command control flow
The export command works the same way for most (all?) types. I have
made it generic and moved it into export.go, then ported
{export,create}_auto_image{repository,policy}.go to use it.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 52145c045d Add delete image-policy and refactor
This adds a command for deleting ImagePolicy objects. Since the
control flow for the command needs only a runtime.Object (and a name
for the type), it can be factored out.

I have made the argument (field in the deleteCommand struct) an
interface `objectContainer`, through which the command code gets a
`runtime.Object` to deserialise into (and delete). It could be simply
a `runtime.Object` here; however things like `getCommand` require
other methods, so it's convenient to have an interface for it.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 512761080e Add get auto image-policy and refactor
This factors the get command implementation so that the control flow
is generic and relies on a handful of methods, then uses that to add
`get auto image-policy` and to rewrite `get auto image-repository`.

Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen 037a5b71fd Add {create,export} auto image-policy
Signed-off-by: Michael Bridgen <michael@weave.works>
Michael Bridgen b66bdec61a Add subcommands for image-repository
This adds all the standard subcommands for the ImageRepository type.

Following `source`, I have put them under a namespace: `auto`,
referring to automation.

NB For `create` I use controllerutil.CreateOrUpdate, which looks to me
like a slightly more rounded version of the upsert* funcs.

Signed-off-by: Michael Bridgen <michael@weave.works>
Hidde Beydals 16f52610ab
Merge pull request from fluxcd/update-components
Update source-controller to v0.5.3