Commit Graph

463 Commits (1e37cbeae7f2c8bc509ee36d11fcdf24042323b8)

Author SHA1 Message Date
Sunny e901e8b6f8 Update all the references of NC v1beta2 to v1beta3
Signed-off-by: Sunny <darkowlzz@protonmail.com>
1 year ago
Sunny b28b5dd9b9 non-reconciliable & readiness of static objects
Remove reconcile subcommand for static object APIs Alerts and Providers.

Add a isStatic() method on all the object adapters to determine if
they are static and don't have reconciler. The objects that don't
have reconcilers are skipped from reconciliation and readiness
checks like HelmRepository of type OCI.

Add default ready message for `get` subcommand output for static
objects, Alerts, Providers and HelmRepositories of type OCI, as ready
message can't be derived for them from their status.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
1 year ago
Sunny 05c13fe35a check readiness using kstatus
This change replaces all the many functions and ways of calculating
readiness of objects into one unified way that uses kstatus.Compute() to
check if the object is in progress or current. Only the objects that are
current are considered to be ready. This takes advantage of the kstatus
compatibility of Flux's APIs and also makes sure that they remain
kstatus compatible.

The new isObjectReady() function is also aware of static/statusless
objects and knows how to check their readiness using kstatus. This
prepares the CLI for the upcoming static API objects.

All the is*Ready() functions for specific objects have been removed.

This change doesn't affect any of the existing tests results.

Introduce suspend and resume subcommands for alert-provider.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
1 year ago
Somtochi Onyekwere 2289c6cc60 bootstrap: provide better error message on timeout
Check GitRepository and return Ready condition message as part of error
on timeout.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Ernest Wong 5685afb9d5 Fix typos in flux bootstrap documentation
Signed-off-by: Ernest Wong <chwong719@gmail.com>
1 year ago
Somtochi Onyekwere fd163ddcf2 show cluster instance name and version in flux check and flux version
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Vinícius Garcia b596aefb91 Fix flux install command so it returns an error when unexpected arguments are passed
Co-authored-by: Max Jonas Werner <makkes@users.noreply.github.com>
Signed-off-by: Vinícius Garcia <vingarcia00@gmail.com>
1 year ago
Stefan Prodan 80efd29ec0
Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 year ago
Somtochi Onyekwere aca461912c make flux events work with lowercased kinds
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Matthew Clarke e184ef2618
fix build_artifact.go typo
Signed-off-by: Matthew Clarke <matthewclarke47@gmail.com>
1 year ago
Hidde Beydals e73d1acb20
Tweak permissions on created files
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Jabar Asadi dcbca6b1bf
feat: add gitea bootstrapper
Signed-off-by: Jabar Asadi <jasadi@d2iq.com>
1 year ago
Somtochi Onyekwere 9cd4a7215f Display better uninstall prompt if flux is managed by a different tool
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Somtochi Onyekwere 2f15ad972b confirm before overriding installation by another manager
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Somtochi Onyekwere 0eba9662e6 prevent flux install from overriding bootrapped cluster
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Hidde Beydals e3f6f0f8b3
misc: `sinceSeconds` -> `sinceDuration`
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals f5d3283cff
misc: remove unused bits of code
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals 3fdb292381
misc: address `wait.PollImmediate` deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals 43c2359705
misc: address double import
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals a2a3b4f00f
misc: use raw string for regex to avoid double esc
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals b67a46371b
misc: handle undhandled error
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Hidde Beydals 16d352b15b
misc: address `strings.Title` deprecation
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Matheus Pimenta 840e717b72 Add CLI flag for OCIRepo verify secret
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
1 year ago
Ilya Dmitrichenko b46e298b4d
Print artifact source and revision only when available
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
1 year ago
Somtochi Onyekwere 1654791feb update description of kubeconfig flags
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Sanskar Jaiswal 8df27d8c3a
modify `flux create secret tls` to create secrets of type TLS
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 year ago
Sanskar Jaiswal 6464d6c7b4
add deprecation warning per secret key field and constant
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 year ago
Sanskar Jaiswal 2fc9d73c5f
add flag `--ca-crt-file` to `flux create secret git`
Add flag `--ca-crt-file` to `flux create secret git` to specify the path
to CA certificate. It takes precedence over `--ca-file` and uses the
key `ca.crt` in the generated Secret.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 year ago
Sanskar Jaiswal b32051df53
deprecate TLS flags for flux create secret helm
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 year ago
Sanskar Jaiswal bf36a29ca2
add support for Kubernetes TLS keys for `flux create secret tls`
Add support for using `tls.key`, `tls.crt` and `ca.crt` keys while
generating a Secret, using the `--tls-key-file`, `--tls-crt-file` and
`--ca-crt-file` flags respectively.
Mark the flags `--key-file`, `--cert-file` and `--ca-file` as
deprecated.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 year ago
Somtochi Onyekwere c81afa6993 fix autocompletion for helm chart
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
1 year ago
Hidde Beydals 2a033215a4
cmd/events: handle error value
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
1 year ago
Stefan Prodan 4cdb75b74d
Fix controller version info
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 year ago
Hidde Beydals 0ab8740832
cmd: address typo in end-to-end tests
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
Stefan Prodan 28262f59d3
Set Kubernetes min version to 1.25
Signed-off-by: Stefan Prodan <stefan.prodan@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
Rishikesh Nair 3580d4ff85 Add examples for resuming/suspending multiple objects
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
2 years ago
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>
2 years ago
Stefan Prodan db0256e0f7
Set minimum supported version to Kubernetes 1.24.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 6ed6b937f8
Fix the `flux push` example for ECR
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
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>
2 years ago
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>
2 years ago
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>
2 years ago
Somtochi Onyekwere 020a494f3f Retry oci push operations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Horacio Granillo 799848c2a0 Fix break lines in create helmrelease and source
Signed-off-by: Horacio Granillo <horacio.granillo@smarttra.de>
2 years ago
Raffael Sahli b8c24f906d fix: support reconcile recursive source tree hr => chart => repo
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2 years ago
Raffael Sahli e678738ded feat: add reconcile source chart command
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
2 years ago
Stefan Prodan 13ff4afaa4
Update Kubernetes to v1.27 and Kustomize to v5.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
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>
2 years ago