Commit graph

812 commits

Author SHA1 Message Date
Matheus Pimenta
65d4635709
Fix 'flux get all --status-selector' for Alert and Provider
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-06-25 12:16:35 +01:00
Matheus Pimenta
cec25b5d1e
Fix 'flux get all --status-selector' for empty results
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-06-25 12:16:24 +01:00
Matheus Pimenta
f234f2f26f
Simplify status filter in get command
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-06-25 08:27:45 +01:00
3uzbcqje
5afd1d8728
cmd: support type!=status in get --status-selector
`flux get --status-selector` only supported equality (`type=status`),
so finding objects that are not in a given state required multiple
invocations, e.g. listing everything that is not ready needed both
`Ready=False` and `Ready=Unknown`.

Add support for a negated selector `type!=status`. Since all resource
adapters delegate matching to the shared `statusMatches` helper and
filtering is centralised in `getRowsToPrint`, negation is implemented
purely in the parse/filter layer by inverting the match result. This
covers every resource type and the `--watch` path without touching the
per-resource adapters.

A missing condition is treated as not-matching by `statusMatches` (Flux
considers it "waiting to be reconciled"), so `Ready!=True` also surfaces
objects that have no Ready condition yet, i.e. the complete not-ready set:

    flux get all -A --status-selector Ready!=True

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: 3uzbcqje <3uzbcqje@addy.to>
2026-06-24 10:53:37 -07:00
Matheus Pimenta
9a68454996
Fix Receiver type
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-06-24 16:00:20 +01:00
Hidde Beydals
96fda4cd56
Reject ssh-signing-reuse early in github and gitea
`bootstrap github` and `bootstrap gitea` generate the SSH transport
key in-process, so they have no operator-supplied key to reuse for
commit signing. Both subcommands already reject
`--ssh-signing-reuse-private-key` with a provider-specific
"not supported" error, but the check sat after `bootstrapValidate`,
which fails first with the generic
"--ssh-signing-reuse-private-key requires --private-key-file"
message. A user invoking e.g. `flux bootstrap github
--ssh-signing-reuse-private-key` is told to set a flag that the
subcommand cannot honour anyway, masking the real problem.

Move the unsupported-flag rejection to the top of each `RunE` —
before the interactive PAT prompt and before `bootstrapValidate` —
so the provider-specific error wins. The deeper, now-redundant
check is dropped. `TestBootstrapProviderRejectsReuseBeforeValidate`
exercises both subcommands with the reuse flag set and no
`--private-key-file` to lock in the precedence.

Assisted-by: claude/opus-4.7
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-19 15:03:54 +02:00
Hidde Beydals
4f45409697
Seed defaultComponents in bootstrap signing tests
`resetCmdArgs` in `main_test.go` rebuilds `bootstrapArgs` from
`NewBootstrapFlags`, which deliberately omits the cobra-populated
`defaultComponents`. In the `e2e` build, `TestMain` runs `flux install
…` before any test executes; that call triggers the reset and leaves
`bootstrapArgs.defaultComponents` empty for the lifetime of the
process. `bootstrapValidate` then trips on its `requiredComponents`
pre-check and fails with "component source-controller is required"
before it ever reaches the SSH/GPG signing flag validation that this
test cares about.

Save, seed, and restore `defaultComponents` per subtest so the
required-component check passes regardless of whether the test runs
under the plain or the `e2e` build tag.

Assisted-by: claude/opus-4.7
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-19 15:03:46 +02:00
Hidde Beydals
923a8ae394
Cover signingKey round-trip in export tests
Extends the existing TestExport 'image update' case with a signingKey
block on the seeded ImageUpdateAutomation, asserting the new field
survives the kubeClient.Get + serialize path. Parallels how the
existing fixture exercises every other field on the resource.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 16:21:19 +02:00
Hidde Beydals
4e8c13ba59
Cover create image update signing flags
Adds golden-file tests for the new --signing-key-secret and
--signing-key-type flags: no-signing (baseline), default-gpg (asserts
type is omitted when only the secret is set, deferring to the
controller's gpg default), ssh, and the two validation-error cases.
Establishes cmd/flux/testdata/create_image_update/ for future
expansion of this command's coverage.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 16:21:18 +02:00
Hidde Beydals
61316ccca7
Add signing-key flags to create image update
Closes a pre-existing gap where the ImageUpdateAutomation SigningKey
field was reachable only by hand-editing the rendered YAML. The two
new flags --signing-key-secret and --signing-key-type populate the
spec.git.commit.signingKey block directly.

When --signing-key-secret is set without --signing-key-type, the run
function leaves spec.git.commit.signingKey.type empty so the
controller's documented default ('gpg' when type is unset[1]) applies
server-side rather than baking the choice into the rendered YAML.
Validation rejects --signing-key-type without --signing-key-secret
and rejects values outside {gpg, ssh}, using the typed
SigningKeyType constants exported from the image-automation-
controller API so the validator and populator share a single source
of truth.

[1]: https://github.com/fluxcd/image-automation-controller/pull/1035

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 16:21:14 +02:00
Hidde Beydals
43574215a6
Test bootstrap signing flag validation
Covers the validation matrix of the new --gpg-* / --ssh-signing-*
surface: mutual exclusion (across GPG/SSH groups and within the SSH
group between --ssh-signing-key-file and --ssh-signing-reuse-private-
key), alias resolution between --ssh-signing-password and
--ssh-signing-passphrase, the dependency checks (--ssh-signing-
password requires --ssh-signing-key-file; --ssh-signing-reuse-
private-key requires --private-key-file), and pre-flight key-parse
failures (malformed PEM, encrypted SSH key without passphrase, GPG
ring with wrong passphrase). Test keys are checked in so the test
does not depend on local ssh-keygen or gpg invocations at run time.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 14:40:43 +02:00
Hidde Beydals
de76bb4725
Wire SSH signing into provider bootstrap commands
Adds the same explicit-path SSH-signing wiring to flux bootstrap
github / gitlab / gitea / bitbucket-server, consulting the new
effectiveSshSigningPassword helper for the resolved passphrase.

The reuse-path wiring applies only to gitlab and bitbucket-server
(which consume --private-key-file as the SSH transport key). github
and gitea generate the transport key in-process, so they reject
--ssh-signing-reuse-private-key explicitly with a message explaining
why. The reject check fires immediately after each subcommand's
bootstrapOpts slice literal closes, before any conditional appends,
so the failure semantics match the reading order of the code.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 14:40:43 +02:00
Hidde Beydals
b767c68876
Wire SSH signing into bootstrap git
Reads --ssh-signing-key-file when set, decodes the file contents,
resolves the effective signing passphrase, and appends
bootstrap.WithSSHCommitSigning to the bootstrap options. When
--ssh-signing-reuse-private-key is set, reads the transport
--private-key-file, pre-flights it against the subcommand-local
gitArgs.password, and reuses the same bytes + passphrase for signing.

The reuse-path pre-flight lives in this subcommand's RunE because
bootstrapValidate does not have access to the transport password.
Mutual exclusion with --gpg-* and explicit-path key-parse validation
are enforced upstream in bootstrapValidate.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 14:40:43 +02:00
Hidde Beydals
a84934311a
Add SSH signing flags to bootstrap
Introduces four new persistent flags on flux bootstrap:
--ssh-signing-key-file, --ssh-signing-password, the hidden alias
--ssh-signing-passphrase, and the reuse boolean
--ssh-signing-reuse-private-key. They sit next to the existing
--gpg-key-ring / --gpg-passphrase / --gpg-key-id surface.

bootstrapValidate pre-flights the configured signing key for the
explicit GPG and SSH paths so malformed PEM, wrong passphrases, and
unsupported SSH algorithms surface before any clone runs. The GPG
pre-flight calls the now-exported SelectOpenPGPSigningEntity from
pkg/bootstrap directly, so the pre-flight cannot drift from the
bootstrap commit path. The reuse path's pre-flight runs inside each
subcommand's RunE (where the subcommand-local SSH transport password
is in scope) and lands with the wiring commits that follow.

A small effectiveSshSigningPassword helper resolves the
--ssh-signing-passphrase alias purely (returning the resolved value
or a mutual-exclusion error) instead of mutating the
package-scoped bootstrapArgs singleton inside bootstrapValidate.

Mutual exclusion is enforced between the GPG and SSH groups, and
between --ssh-signing-key-file and --ssh-signing-reuse-private-key.
--ssh-signing-reuse-private-key requires --private-key-file;
--ssh-signing-password requires --ssh-signing-key-file. The
--ssh-signing-passphrase alias is hidden in --help.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2026-06-18 14:40:43 +02:00
Dipti Pai
4e815ab5e2 Add DriftIgnoreRules support to flux diff kustomization
Signed-off-by: Dipti Pai <diptipai89@outlook.com>
Assisted-by: GitHub Copilot/Claude Opus 4.7
2026-06-17 09:51:02 -07:00
Matheus Pimenta
e31c1a4f7d
Fix breaking change from source-controller 1.9
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-06-17 14:52:00 +01:00
piny940
56166fd90c
Support specifing sparseCheckout in flux bootstrap
Signed-off-by: piny940 <83708535+piny940@users.noreply.github.com>
Assisted-by: claude/opus-4.7
2026-06-16 20:33:11 +09:00
Taras
5999cd4b9a
feat: add support of aws codecommit bootstrap
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
2026-06-04 19:02:56 +01:00
Stefan Prodan
3e21c27749
Update to Kubernetes 1.36 and Go 1.26
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2026-06-04 19:09:29 +03:00
vecil
22953596c6
refactor(api): migrate MakeDependsOn to shared apis/meta func
Signed-off-by: Vincent Dely <vincent.dely@ik.me>
2026-05-26 07:14:33 +02:00
Matheus Pimenta
4bfdb6d459
Introduce flux trigger receiver
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-05-23 01:44:07 +01:00
Immanuel Tikhonov
5425087730
Validate Helm source URL schemes
Reject HelmRepository source URLs with schemes unsupported by the
source-controller API before generating or applying the object.

Signed-off-by: Immanuel Tikhonov <pchpr.00@list.ru>
Assisted-by: codex/gpt-5
2026-05-22 08:56:53 +04:00
Jiri Tyr
c031d0c215 Respect kubeconfig context namespace
Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
2026-04-30 08:19:41 +01:00
iam-karan-suresh
df3878d36a feat: adding support digest pinning for flux plugin install
Signed-off-by: iam-karan-suresh <karansuresh.info@gmail.com>
2026-04-29 18:01:18 +05:30
Stefan Prodan
474efa09cf
Split plugin commands into individual files
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2026-04-20 21:42:42 +03:00
Stefan Prodan
8be056324a
Add plugin management commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2026-04-14 00:46:22 +03:00
rycli
e9bcccfede test: add 'flux diff ks' tests for cases that involve new namespaces
Signed-off-by: rycli <cyril@ryc.li>
Assisted-by: claude-code/claude-opus-4-6
2026-04-13 18:36:21 +02:00
rycli
d349ffe37d feat: add --ignore-not-found flag to 'flux diff ks' command
Signed-off-by: rycli <cyril@ryc.li>
Assisted-by: claude-code/claude-opus-4-6
2026-04-13 18:35:52 +02:00
rycli
e5128ea97e feat: add WithInMemoryBuild to use virtual FS for kustomize
Signed-off-by: rycli <cyril@ryc.li>
2026-04-10 21:36:45 +02:00
iam-karan-suresh
69e2c6bc7d fix: handle multiple symlinks to same target in build artifact
Signed-off-by: iam-karan-suresh <karansuresh.info@gmail.com>
2026-04-10 16:15:11 +05:30
Stefan Prodan
c601a212f6
Add --audience-claim for GCR Receivers
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2026-04-10 12:34:26 +03:00
Stefan Prodan
02734f28ba
Add flux create secret receiver command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2026-04-10 12:09:42 +03:00
Rafael Peroco
8a777bdd0f feat: add --show-source flag to flux get helmrelease
Signed-off-by: Rafael Peroco <rafaelperoco@gmail.com>
2026-04-09 18:20:43 -03:00
Rafael Peroco
e2af45aee4 feat: add --show-source flag to flux get kustomization
Fixes #2692

Signed-off-by: Rafael Peroco <rafaelperoco@gmail.com>
2026-04-08 21:49:15 -03:00
Ghassan Malke
457abed9f9
fix: validate --source flag in create kustomization command
Signed-off-by: Ghassan Malke <gmalke@shiftbase.com>
2026-03-30 13:20:31 +02:00
Rohan Sood
7bf0bda689 Add --resolve-symlinks flag to build and push artifact commands
This adds a --resolve-symlinks flag to the flux build artifact and flux push artifact
commands. When enabled, symlinks in the source directory are resolved (copied as regular
files/directories) before building the artifact. This includes:

- Recursive symlink resolution with cycle detection
- File permission preservation
- Proper handling of both single-file and directory symlink targets
- Comprehensive test coverage

Fixes #5055

Signed-off-by: Rohan Sood <56945243+rohansood10@users.noreply.github.com>
2026-03-20 11:47:27 -07:00
Aman-Cool
6a5e644798 fix: return error immediately on failed reconciliation status
Co-authored-by: Matheus Pimenta <matheuscscp@gmail.com>
Signed-off-by: Aman-Cool <aman017102007@gmail.com>
2026-03-13 15:34:12 +05:30
Matheus Pimenta
fd547dfe42
Bump minimum Kubernetes version to 1.33
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-02-24 12:06:45 +00:00
Matheus Pimenta
4eddf80724
Fix event listing ignoring pagination token
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-02-18 15:53:10 +00:00
Matheus Pimenta
2a2201fe56
Add 2.8 to supported versions for flux migrate -f
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-02-12 11:02:58 +00:00
Aman-Cool
8c041095ab Fix resume command logging success after reconciliation failure
Signed-off-by: Aman-Cool <aman017102007@gmail.com>
2026-01-25 04:53:17 +05:30
Matheus Pimenta
d57313ae2c
Introduce support for looking up GH app installation ID
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-01-19 12:03:08 +00:00
Sibasis Padhi
7dd9fde7ce fix: normalize paths to prevent concatenation on Windows
Fixes #5673

On Windows, when using absolute paths like C:\path\to\dir,
the path could be incorrectly concatenated, resulting in:
C:\working\dir\C:\path\to\dir\file

This fix applies filepath.Abs() and filepath.Clean() to normalize
the path before using it, ensuring absolute paths are handled
correctly on all platforms.

Changes:
- Apply filepath.Abs() to convert relative paths to absolute
- Apply filepath.Clean() to remove redundant separators and resolve ..
- Add tests for absolute paths, complex paths with .., and paths
  with redundant separators to verify normalization works correctly

The tests use actual 'flux build kustomization' commands with:
1. Absolute paths (prevents concatenation bugs)
2. Paths with parent directory (..) references
3. Paths with redundant separators (//)

All tests verify the command produces correct output, ensuring
the path normalization fix works as expected.

Signed-off-by: Sibasis Padhi <sibasis.padhi@gmail.com>
2026-01-13 10:25:59 -06:00
Jesper Axelsen
3fb05a604f fix: #5654 by check if both --chart and --chart-ref are set
Signed-off-by: Jesper Axelsen <jesperbaxelsen@gmail.com>
2025-12-10 22:08:31 +01:00
Anshuman Singh
0ba28f3f91
Allow option to skip tenant namespace creation
Add --skip-namespace flag to the 'create tenant' command to skip automatic
namespace creation when the namespace already exists.

Signed-off-by: Anshuman Singh <anshumanchauhan9@gmail.com>
2025-11-21 17:46:12 +05:30
Matheus Pimenta
69feb7214a
Fix panic on reconcile with source of ExternalArtifact kind
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-11-17 13:31:13 +00:00
Daniel Guns
cdc37c304a
Adding export source external
Signed-off-by: Daniel Guns <danbguns@gmail.com>
2025-10-24 14:52:36 -03:00
Akshat Sinha
5b37a6b04b fix(cli): handle error when writing password prompt and correct spelling (i) Add error handling for fmt.Fprint when writing password prompt to stdout (ii) Fixed : initalization to initialization in the commented region
Signed-off-by: Akshat Sinha <akshatsinhasramhardy@gmail.com>
2025-10-13 20:21:49 +05:30
Daniel Guns
1055f28524 Adding get source external-artifact
Signed-off-by: Daniel Guns <danbguns@gmail.com>
2025-10-09 08:45:01 -03:00
Matheus Pimenta
7c5fb2297c
Fix flux migrate -f not considering kind comments
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2025-10-04 14:26:54 +01:00