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>
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>
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>
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>
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>
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>
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>
This commit adds a flag for supplying extra components to bootstrap
(and its subcommands), to match the one for `flux install`.
Since the bootstrapComponents global is used in a few places, I made
it a func and renamed the variable. For consistency, I also renamed
the var used in install.go.
Lastly, so that the flag sorts next to `--components`, I changed it to
`--components-extra` in both commands.
Signed-off-by: Michael Bridgen <michael@weave.works>
If you want to install the default set of controllers and the image-*
controllers, at present you have to list every single one of them.
An improvement on this is to let people specify what they want _in
addition_ to the default controllers. This commit adds an argument
`--extra-components` which appends to the (most likely, default value)
slice of `--components`.
Signed-off-by: Michael Bridgen <michael@weave.works>
Specifically,
- using credentials from a secret is done
- the CLI integration is underway
I gave the %-complete a decent bump to reflect those, and all the work
on making the image-* controllers have all the GOTK dials and knobs
e.g., suspend.
Signed-off-by: Michael Bridgen <michael@weave.works>
This makes it a clearer that the component does something worthwhile,
and is lacking mainly in platform-specific support.
Signed-off-by: Michael Bridgen <michael@weave.works>
This commit
- adds a brief explanation of what Flux does
- makes the target features a little more self-explanatory
- gives GitOps Toolkit its own index page
Signed-off-by: Michael Bridgen <michael@weave.works>
In the absence of a dev-guides index or other GitOps Toolkit specific
home page, link to the dev guide that exists, for now.
Signed-off-by: Michael Bridgen <michael@weave.works>
This replaces most mentions of "GitOps Toolkit" and "toolkit" with
"Flux". I have adopted the style of using "Flux v2" in the first
mention, and thereafter just "Flux".
Signed-off-by: Michael Bridgen <michael@weave.works>
* Take ObservedGeneration into account in readiness checks where
applicable
* Reduce amount of code (and duplicate GETs) by working with pointers
where possible
* Improve logged messages to properly take resource names into account
and better describe processes
This leaves the implementation tasks as not done -- a bit of a
simplification, since there's some implementation done, and some
design left to do, but it's close enough at this level.
I estimated that having the design basics figured out is worth 30%
overall.
- add notification-controller/api commands to index
- move diagrams to docs website
- update CRDs docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>