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

594 Commits

Author SHA1 Message Date
Stefan Prodan
f6c14c939d Add CRDs to flux check command
Verify that the Flux CRDs are registered on the cluster and print their version.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-09 09:17:15 +03:00
Stefan Prodan
998b763cf9 Add --kubeconfig-secret-ref to flux create ks|hr
Allow specifying the name of the Kubernetes Secret that contains a key with the kubeconfig file for connecting to a remote cluster.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-06-02 16:10:31 +03:00
Vipul Newaskar
0a30bc1024 allow http git repos connections while bootstrap
Updated misleading error message

Signed-off-by: Vipul Newaskar <vipulnewaskar7@gmail.com>
2022-06-02 10:32:58 +05:30
Vipul Newaskar
a55548de07 allow http git repos connections while bootstrap
This change will allow user to bootstrap with http git urls
But user must explicitely set --allow-insecure-http=true

Signed-off-by: Vipul Newaskar <vipulnewaskar7@gmail.com>
2022-06-02 10:32:58 +05:30
Max Jonas Werner
e19ea796b1 Add OCI support to create source helm
closes #2774

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-06-01 15:59:52 +02:00
Tarun Gupta Akirala
ed88e9dec5 feat: add --ignore-paths flag to flux create source (git|bucket)
A new --ignore-paths flag is added to following commands:

flux create source git --ignore-paths ...
flux create source bucket --ignore-paths ...

A StringSliceVar is used which supports specifying the flag multiple
times to populate a list or either a comma seperated string value

A unit test with a golden file is added to validate the flag

Signed-off-by: Tarun Gupta Akirala <takirala@users.noreply.github.com>
2022-05-27 09:45:25 -07:00
Hidde Beydals
5130a154e4 Ensure proper FS root is set while bootstrapping
This ensures relative paths to e.g. bases can be used.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-05-24 12:14:21 +02:00
Max Jonas Werner
e35da1c890 trim prefix from server version
It's not part of the `flux check` output.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-05-18 17:08:50 +02:00
Max Jonas Werner
9af6175302 fix e2e check test
The output of `kubectl version` has changed with newer kubectl version
from

```
{
  "serverVersion": ...,
  "clientVersion": ...
}
```

to

```
{
  "serverVersion": ...,
  "clientVersion": ...,
  "kustomizeVersion": ...
}
```

So the `kustomizeVersion` field is new which causes the JSON
unmarshaling to fail.

We now just unmarshal it to `map[string]interface{}` and peel the
server git version out of that map manually w/o unmarshalling the JSON
into a custom type.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-05-18 16:51:18 +02:00
Max Jonas Werner
e1def4f8ac make e2e test easier to debug
Signed-off-by: Max Jonas Werner <mail@makk.es>
2022-05-18 16:36:18 +02:00
Sanskar Jaiswal
7232ff9ea0 modify tmp dir generation to be absolute on all OSes
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-05-04 15:13:39 +05:30
Chen Anidam
a85ea59824 Read password of generic git bootstrap command from env or stdin
Signed-off-by: Chen Anidam <canidam@gmail.com>
2022-04-12 12:17:11 +03:00
Kingdon Barrett
7e2b63ea5d add detail to delete docs
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2022-04-07 08:29:57 -04:00
Soule BA
5536af9756 Add an option to diff with a local kustomization file
If implemented, users will be able to provide a local kustomization file
to `flux build/diff`.

Signed-off-by: Soule BA <soule@weave.works>
2022-04-05 17:21:11 +02:00
Somtochi Onyekwere
b80f32ce7d Add cli flags for chart interval and reconcile strategy
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-04-05 12:56:50 +01:00
Soule BA
1807852b6b Update pkg/kustomize to v0.1.0
If implemented this fixes a bug where retrieving the groupVersion.Group
of a kustomization were returning an empty string.

Signed-off-by: Soule BA <soule@weave.works>
2022-04-01 10:27:37 +02:00
Stefan Prodan
0d8194c800 Add the kube client qps and burst to the global args
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-25 10:43:59 +01:00
Stefan Prodan
5f74c7d294 Fix resume source bucket panic
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-23 15:33:57 +02:00
Hidde Beydals
3edcd16b62 fix: wait for Source objects observed generation
This ensures the command will wait for the object to report a Ready
Condition with an ObservedGeneration matching the Generation of the
resource. Ensuring that when a "create" is actually a mutation, it waits
instead of prematurely assuming the Source to be Ready.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-23 12:38:42 +01:00
Paulo Gomes
e5ede275f8 Update Source API to v1beta2
The creation of oldConditions, statusableConditions and
reconcilableConditions is an adhoc solution to deal with the upstream
changes on `pkg/apis/meta`, which are yet to be replicated across other
Flux API components.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-03-23 11:33:35 +01:00
Stefan Prodan
2e1000c31a Add components-extra example usage to CLI help
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-11 09:19:56 +02:00
Soule BA
7359e63960 Introduce a printer interface for flux resource
If implemented, there will a common interface to print flux resource.

We are adding new way to print resource information e.g. diff of
objects.

Signed-off-by: Soule BA <soule@weave.works>
2022-03-07 12:15:35 +01:00
cuishuang
1fda202cf9 all: fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-02 19:36:08 +08:00
Sunny
2c4c3fd749 test: ignore golden template files with -update
Add a template values check in the `assertGoldenTemplateFile()` function
to only update golden files if they aren't templates. A note is printed
when an update to a template golden file is needed and `-update` flag
can't update it.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-28 08:56:08 +05:30
Sunny
edaf6ca522 Add test flag -update to update the golden files
Test flag `-update` can be used to update all the golden files whenever
the CLI output changes.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-24 08:58:19 +05:30
Sunny
21f0d5d82c Move MESSAGE to the end of get subcommand output
Message content could be long compared to other fields. Moving it to
the end helps improve the visibility of the other fields.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-24 04:21:47 +05:30
Somtochi Onyekwere
9c76ba903b add wait flag to flux resume cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-21 11:07:55 +01:00
Somtochi Onyekwere
82a8697f28 Add gvk to rest of api type
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-21 10:40:35 +01:00
Soule BA
32ad462ebe Fix stringData Secret issue
This commit migrate to the last version of pkg/ssa v0.14.1 that contains a fix
for stringData secrets. The test case was changed accordingly to
    validate a stringData drift.

A progress-bar flag option has also been added in order to be able to
disable it.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-18 17:18:16 +01:00
Andrew Jenkins
437a7a2852 Fix failure in TestTrace/* when timezone isn't UTC
The TestTrace/Deployment and TestTrace/HelmRelease test cases fail in
environments where the timezone isn't UTC, because they compare a local time
string to the golden file, which has time in UTC.  Here is an example:

```
--- FAIL: TestTrace (0.12s)
    --- FAIL: TestTrace/Deployment (0.08s)
        main_test.go:337: Mismatch from golden file 'testdata/trace/deployment.golden': Mismatch from expected value (-want +got):
              strings.Join({
                ... // 88 identical bytes
                " Flux\n---\nHelmRelease:    podinfo\nNamespace:      podinfo-8\nRevi",
                "sion:       6.0.0\nStatus:         Last reconciled at 2021-07-16 ",
            -   "15:42:20 +0000 UTC",
            +   "09:42:20 -0600 MDT",
                "\nMessage:        Release reconciliation succeeded\n---\nHelmChart:",
                "      podinfo-podinfo\nNamespace:      flux-system-9\nChart:      ",
                "    podinfo\nVersion:        6.0.0\nRevision:       6.0.0\nStatus: ",
                "        Last reconciled at 2021-07-16 ",
            -   "15:32:09 +0000 UTC",
            +   "09:32:09 -0600 MDT",
                "\nMessage:        Fetched revision: 6.0.0\n---\nHelmRepository: pod",
                "info\nNamespace:      flux-system-9\nURL:            https://stefa",
                "nprodan.github.io/podinfo\nRevision:       8411f23d07d3701f0e96e7",
                "d9e503b7936d7e1d56\nStatus:         Last reconciled at 2021-07-",
            -   "1",
                "1",
            -   " 00:25:46 +0000 UTC",
            +   "0 18:25:46 -0600 MDT",
                "\nMessage:        Fetched revision: 8411f23d07d3701f0e96e7d9e503b",
                "7936d7e1d56\n",
              }, "")
```

This commit fixes the issue by converting the golden test times to local
time before comparing. The utility function toLocalTime() is added to
trace_test.go, and then it is used to provide localized times as
template parameters to the golden files.

Signed-off-by: Andrew Jenkins <andrew@aspenmesh.io>
2022-02-16 09:36:00 -07:00
Somtochi Onyekwere
d7129d6b55 Remove validation from sub-commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-16 11:04:05 +01:00
Somtochi Onyekwere
4a893b13f8 validate that object name adheres to RFC 1123 for flux create commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-16 10:51:03 +01:00
Somtochi Onyekwere
a30ffdb176 Use text/template
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-14 23:59:20 +01:00
Stefan Prodan
cbca583f4b Add GitRepository namespace arg to flux create image update
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-10 10:52:51 +02:00
Stefan Prodan
9d6a037935 Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-07 14:09:23 +02:00
Soule BA
2e9fd33ce5 Mask dockerconfigjson secret types and support StringData secrets
If implemented, flux diff kustomization will managed correctly sops
managed dockerconfigjson secrets.
Sops encrypted secret with stringData maps are supported too.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-07 09:45:38 +01:00
Somtochi Onyekwere
d3d271defe use client.Patch for suspend/resume operations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-04 12:06:39 +01:00
Robert Wittman
e33198e750 Replace github boostrap GPG options
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
2022-02-03 11:09:10 -05:00
Robert Wittman
e3f5a8fee3 Add GPG options to Gitlab and BitBucket bootstraps
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
2022-02-03 11:07:55 -05:00
Robert Wittman
f8b58f8be9 Add GPG signing to Github bootstrap
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
2022-02-03 11:03:35 -05:00
Soule BA
b86b195450 Add contextual error code for flux diff kustomization
If implemented, calling the diff command on kustomization will return 0,
1(if changes are identified), >1 for errors.

Signed-off-by: Soule BA <soule@weave.works>
2022-02-03 13:41:57 +01:00
Stefan Prodan
141d71c39d Use CrossNamespaceSourceReference for image automations
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-01 12:12:59 +02:00
Stefan Prodan
246af92386 Adapt diff test to match Kubernetes 1.23.3 API response
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-28 20:37:16 +02:00
leigh capili
57962347f2 Output Usage for flux get <sources|images>
Signed-off-by: leigh capili <leigh@null.net>
2022-01-26 16:03:22 -07:00
Stefan Prodan
f154326391 Set minimum supported version to Kubernetes 1.20.6
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-26 11:21:32 +02:00
Soule BA
306f8f5715 Add graceful shutdown when interrupted
If implemented this permit restoring a clean state in case of signal
interruption.

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 13:21:07 +01:00
Soule BA
f7d9ee90cd Add e2e tests for build/diff kustomization
Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 11:51:57 +01:00
Soule BA
9376c9a946 Add a diff kustomization feature
If implemented it will permit queriying the Kubernetes API to fetch the specified
Flux Kustomization, then uses the specified path to build the overlay.
It will then ssa-dry-run apply and output the diff using homeport/dyff

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 11:51:56 +01:00
Soule BA
70fb87bc93 Add a build kustomization feature
If implemented it will permit queriying the Kubernetes API to fetch the specified
Flux Kustomization, then uses the specified path to build
the overlay.

Signed-off-by: Soule BA <soule@weave.works>
2022-01-20 11:51:56 +01:00
Somtochi Onyekwere
1e2a497108 Shorten sha commit
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-01-20 11:13:25 +01:00