1
0
mirror of synced 2026-02-06 19:05:55 +00:00
Commit Graph

483 Commits

Author SHA1 Message Date
Somtochi Onyekwere
c81afa6993 fix autocompletion for helm chart
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-08-22 14:19:08 +01:00
Hidde Beydals
2a033215a4 cmd/events: handle error value
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-22 13:39:39 +02:00
Stefan Prodan
4cdb75b74d Fix controller version info
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-22 12:36:58 +03:00
Hidde Beydals
0ab8740832 cmd: address typo in end-to-end tests
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-08-21 17:17:02 +02:00
Marcus Weiner
56b1e80758 Fix selection of kustomization resource from multi doc yaml
Signed-off-by: Marcus Weiner <marcus.weiner@gmail.com>
2023-08-07 12:05:29 +02:00
Stefan Prodan
28262f59d3 Set Kubernetes min version to 1.25
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-08-02 14:17:30 +03:00
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>
2023-07-11 10:19:12 +02:00
Rishikesh Nair
3580d4ff85 Add examples for resuming/suspending multiple objects
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
2023-06-29 12:50:38 +05:30
Rishikesh Nair
42607aadc3 Add support for passing multiple objects to suspend/resume commands
This change adds support for running `suspend/resume` on multiple
supported resources at the same time. This improves the user
experience by converting

```
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```

to

```
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.)
since it has been implemented at the `suspend.go` and `resume.go`
level.

When the `--wait` flag is passed to the `resume` command, then Flux
will wait for all resources in parallel within a goroutine each.

Each object is only processed once, even if user provided its name
more than once.

If suspension or resuming fails for one object, it is still carried
out for the remaining objects.

As a special case, the old behaviour of `resume` is retained, i.e.
when only one object name is provided, `resume` waits for the object
to become ready even if the `--wait` flag is not provided. In all
other cases the `--wait` flag is always considered.

closes #3746
closes #3793

Co-Authored-By: Max Jonas Werner <mail@makk.es>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-29 08:23:13 +02:00
Stefan Prodan
db0256e0f7 Set minimum supported version to Kubernetes 1.24.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-28 17:36:04 +03:00
Stefan Prodan
6ed6b937f8 Fix the flux push example for ECR
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-06-27 16:33:40 +03:00
Max Jonas Werner
173ee5fcdc Don't log errors with missing CRDs for "get * all" commands
Whenever an API type is not available then both, `flux get all` and
`flux get image all` will just skip over that type instead of logging
an error message.

Before:

```
$ flux get all
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: source.toolkit.fluxcd.io/v1beta2: the server
could not find the requested resource
[...]
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could
not find the requested resource
✗ failed to get API group resources: unable to retrieve the complete
list of server APIs: image.toolkit.fluxcd.io/v1beta2: the server could
not find the requested resource
[...]
$ echo $?
0
```

After:

```
$ flux get all
$ echo $?
0
```
closes #3973

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-22 18:03:38 +02:00
Max Jonas Werner
cbdd71e44e Make flux logs more lenient
UX changes:

- Only print an error when a pod doesn't have a matching container
  instead of exiting early.
- Return a non-zero status code when no pod is found at all.

Details:

In certain situations there might be 3rd-party pods running in the
Flux namespace that cause the command to fail streaming logs, e.g.
when they have multiple containers but none of them is called
`manager` (which all Flux-maintained pods do). An example of such a
situation is when Flux is installed with the 3rd-party Flux extension
on AKS.

The `logs` command is now more forgiving and merely logs an error in
these situations instead of completely bailing out. It still returns a
non-zero exit code.

For the parallel log streaming with `-f` the code is now a little more
complex so that errors are now written to stderr in parallel with all
other logs written to stdout. That's what `asyncCopy` is for.

refs #3944

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-05 10:07:38 +02:00
Sanskar Jaiswal
aa65589391 set controller-runtime logger to a null logger
This is required because controller-runtime expects its consumers to
set a logger through log.SetLogger within 30 seconds of the program's
initalization. If not set, the entire debug stack is printed as an
error. Ref: https://github.com/kubernetes-sigs/controller-runtime/blob/ed8be90/pkg/log/log.go#L59
Since we have our own logging and don't care about controller-runtime's
logger, we configure it's logger to do nothing.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-05-30 14:40:17 +05:30
Somtochi Onyekwere
020a494f3f Retry oci push operations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-05-29 09:59:47 +01:00
Horacio Granillo
799848c2a0 Fix break lines in create helmrelease and source
Signed-off-by: Horacio Granillo <horacio.granillo@smarttra.de>
2023-05-26 15:37:55 +02:00
Raffael Sahli
b8c24f906d fix: support reconcile recursive source tree hr => chart => repo
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-05-25 13:40:21 +02:00
Raffael Sahli
e678738ded feat: add reconcile source chart command
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2023-05-25 13:40:21 +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
fluxcdbot
ace242fca2 Update toolkit components
- kustomize-controller to v1.0.0-rc.2
  https://github.com/fluxcd/kustomize-controller/blob/v1.0.0-rc.2/CHANGELOG.md
- source-controller to v1.0.0-rc.2
  https://github.com/fluxcd/source-controller/blob/v1.0.0-rc.2/CHANGELOG.md
- notification-controller to v1.0.0-rc.2
  https://github.com/fluxcd/notification-controller/blob/v1.0.0-rc.2/CHANGELOG.md
- image-reflector-controller to v0.27.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.27.1/CHANGELOG.md
- image-automation-controller to v0.33.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.33.0/CHANGELOG.md

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-05-09 18:34:03 +03:00
Vincent Gillet
86df468c3f Fix autocompletion for image repository reconcile
Signed-off-by: Vincent Gillet <gilletvincent@gmail.com>
2023-05-08 20:14:19 +08:00
Matheus Pimenta
56d265ae11 Add OCI provider option to create Helm source command
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-05-02 10:08:40 +01:00
cui fliter
3edfff49a2 fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-01 18:05:10 +02:00
Max Jonas Werner
6700aac4a4 better messaging for pull artifact command
- When there's an error stat'ing the output directory flux now prints
  the error:

  Before:
  ```
  ✗ invalid output path ./ro-dir/foo
  ```

  After:
  ```
  ✗ invalid output path "./ro-dir/foo": stat ./ro-dir/foo: permission denied
  ```
- When no output directory is provided flux now explicitly says so in
  the error:

  Before:
  ```
  ✗ invalid output path
  ```

  After:
  ```
  ✗ output path cannot be empty
  ```

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-04-13 12:43:49 +02:00
Somtochi Onyekwere
a52f5aaa75 Add label selector flag to get cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-11 17:00:57 +01:00
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>
2023-04-06 11:33:13 +02:00
Stefan Prodan
cecffc0588 Add commonMetadata to flux build/diff
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-04-05 16:09:49 +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
Somtochi Onyekwere
e44ab85880 update testdata yamls
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-05 16:05:20 +03:00
Somtochi Onyekwere
24452ecd37 Update GitRepository Receiver, and Kustomization to v1
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-04-05 16:05:20 +03:00
Santosh Kaluskar
6afef04a88 Add support for create source git with --commit and --ref-name flags
Signed-off-by: Santosh Kaluskar <dtshbl@gmail.com>
2023-03-24 16:54:50 +05:30
Yiannis
b55f49b4fe fix: Remove any leading and trailing whitespace from resource before
exporting

Signed-off-by: Yiannis <yiannistri@users.noreply.github.com>
2023-03-24 09:07:36 +00:00
Timo Furrer
2e1721ca85 Implement --deploy-token-auth in GitLab bootstrapping
This change set implements support for the `--deploy-token-auth` option
in the `flux bootstrap gitlab` command.

That option will reconcile a GitLab Project Deploy Token to use for the
authentication of the GitLab git repository.
A GitLab Project Deploy Token can be used the same way as a Personal
Access Token which is already supported via `--token-auth`.
The difference with the GitLab Project Deploy Token is that the token is
managed (created, updated, deleted) by Flux and not provided by the
user.

This change is transparent to the source-controller.

A prerequisite for this change is the
`fluxcd/go-git-providers` change here:

* https://github.com/fluxcd/go-git-providers/pull/191

See related discussion here: https://github.com/fluxcd/flux2/discussions/3595
GitLab Issue here: https://gitlab.com/gitlab-org/gitlab/-/issues/392605

Signed-off-by: Timo Furrer <tuxtimo@gmail.com>
2023-03-21 14:03:09 +01:00
Matheus Pimenta
c9fea671a7 Add retry interval option to create kustomization command
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2023-03-21 12:36:07 +00:00
Santosh Kaluskar
5a45d2b127 Create secret with bearer-token
Signed-off-by: Santosh Kaluskar <dtshbl@gmail.com>
2023-03-14 22:31:45 +05:30
Hidde Beydals
af153ea0cf events: avoid having to keep individal kind maps
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
3f3d68a33a events: reword error messages
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
c0916edc44 events: prevent defer in loop
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
34220fd514 events: make --for case insensitive for kinds
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:32 +01:00
Hidde Beydals
5b8f673baa events: use constants for supported Flux kinds
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 14:41:31 +01:00
Somtochi Onyekwere
5b18289808 Add flux events command
This adds a command to Flux which behaves similarly as `kubectl events`,
including the Flux sources events when showing events for top level
objects, thus making debugging easy for Flux users.

For example, `flux events --for kustomization/<name>` includes the
events of its source (e.g. a `GitRepository`, `OCIRepository` or
`Bucket`).

In addition, `flux events --for helmrelease/<name>` includes events of
the `HelmChart` and `HelmRepository`. While `flux events --for
alerts/<name>` includes the events of the `Provider`.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2023-03-09 14:41:31 +01:00
Hidde Beydals
26aafa1b6f e2e: update podinfo to version with newer APIs
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-09 11:43:05 +01:00
Hidde Beydals
1cc7682d44 Replace helmv2.KubeConfig with meta.KubeConfig
This is a backwards compatible change in terms of "YAML API", as they
spec still equals the previous one. Object type has just changed.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-08 18:51:14 +01:00
Stefan Prodan
a64913f2f0 Allow custom annotations to be set when pushing OCI artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-03-03 12:40:59 +02:00
Stefan Prodan
7490d4d4b8 Add command to print the reconcilers status
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-20 13:08:04 +02:00
Stefan Prodan
b44a3d36ba Remove deprecated flags
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2023-02-17 14:23:11 +02:00
Hidde Beydals
0f7b903ace Update push artifact's --revision to RFC-0005
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 12:48:55 +01:00
Hidde Beydals
7f99655a2b Update golden files with RFC-0005 revision formats
Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-02-17 12:48:55 +01:00
Sunny
9dd98fb2b2 Update image-reflector API to v1beta2
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-02-17 00:32:48 +05:30