Commit Graph

472 Commits (9ec8e717ae02eeca62541a09b841c23cf1072353)

Author SHA1 Message Date
fluxcdbot be361a44d5
Update toolkit components
- helm-controller to v0.28.1
  https://github.com/fluxcd/helm-controller/blob/v0.28.1/CHANGELOG.md
- notification-controller to v0.30.2
  https://github.com/fluxcd/notification-controller/blob/v0.30.2/CHANGELOG.md

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan f9e69089ea
Update CLI commands to Notification API v1beta2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Somtochi Onyekwere d79e49f80b fix path on flux push
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Soule BA 2c1085d9ce
Fix dry-run still loading kubeconfig issue
If this is implemented, it will not assume that access to a kubeconfig
is guaranteed even if just for retrieving configured namespace.

Signed-off-by: Soule BA <soule@weave.works>
2 years ago
Somtochi Onyekwere 0bd78ca80c read manifests from stdin
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Sanskar Jaiswal 28feb8b1d7 bootstrap: fallback to default known_hosts
Use default known_hosts and ssh configuration when no private key file
is provided while bootstraping using ssh.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2 years ago
Boris Kreitchman c01023d8f8 Process getVersion error in bootstrap
Signed-off-by: Boris Kreitchman <bkreitch@gmail.com>
2 years ago
Sanskar Jaiswal 35e1b5cbb9 add aws codecommit example and validation; azure devops example
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2 years ago
Sanskar Jaiswal 0a5048a56b refactor bootstrap process to use fluxcd/pkg/git
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2 years ago
Soule BA ad5daee004
Add a dry-run mode to flux build kustomization
If implemented user will be able to use `flux build kustomization`
without any connection to the cluster.

Signed-off-by: Soule BA <soule@weave.works>
2 years ago
Philip Laine a4734d7e30 Remove file reading from bootstrap package
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2 years ago
fluxcdbot 4643f8383e
Update toolkit components
- helm-controller to v0.26.0
  https://github.com/fluxcd/helm-controller/blob/v0.26.0/CHANGELOG.md
- kustomize-controller to v0.30.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.30.0/CHANGELOG.md
- source-controller to v0.31.0
  https://github.com/fluxcd/source-controller/blob/v0.31.0/CHANGELOG.md
- notification-controller to v0.28.0
  https://github.com/fluxcd/notification-controller/blob/v0.28.0/CHANGELOG.md
- image-reflector-controller to v0.22.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.22.1/CHANGELOG.md
- image-automation-controller to v0.26.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.26.1/CHANGELOG.md

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Philip Laine 0343575146 Move bootstrap package from internal to pkg
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2 years ago
Batuhan Apaydın c3d7cad53e
feat: diff artifact capability added
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2 years ago
Philip Laine 80b87729b6 Move uninstall code to pkg
Signed-off-by: Philip Laine <philip.laine@gmail.com>
2 years ago
Batuhan Apaydın d49b77c8d2
chore: bump the pkg/oci package to v0.12.0
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2 years ago
Somtochi Onyekwere 1f57cf3d31 Update oci golden file
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan cad251444c
Update OCI golden files
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan d7dadb4425
e2e: Update bootstrap test to Kubernetes 1.25.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Carlos Nunez 45a00a0170
Maintain original scheme when using --token-auth
If you're using an HTTP-based Git server with Flux, you need to provide `--token-auth` to avoid triggering an SSH host key check (see [here](https://github.com/fluxcd/flux2/issues/2825#issuecomment-1151355914)). Unfortunately, doing this forces the URL in the `GitRepository` resource created during bootstrapping to always use `https`. This will cause Kustomization reconcile errors for servers that do not have HTTPS enabled or do not have the appropriate certs installed or available.

This pull request fixes this by keeping the repository URL scheme intact when using `--token-auth`.

Signed-off-by: Carlos Nunez <75340335+carlosonunez-vmw@users.noreply.github.com>
2 years ago
Stefan Prodan d5262404f3
Add insecure flag to `flux create source oci`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Adrien Fillon 0694a9582f
Support logging in directly to the provider when pushing OCI artifacts
I've noticed during CI, that the current command
already expected a configured Docker client to
push artifacts to authenticated registries.

Some users might not want to have the Docker client
in their process (like a CI job) or build an handcrafted
config.json file.

This would allow this kind of behavior:

```
flux push artifact oci://my-registry.dev/foo:v1 \
  --source xxx \
  --revision xxx \
  --path . \
  --creds $TOKEN # Authenticate via "Bearer $TOKEN" Authorization header
```

Or via Autologin:

```
flux push artifact oci://012345678901.dkr.ecr.us-east-1.amazonaws.com/foo:v1 \
  --source xxx \
  --revision xxx \
  --path . \
  --provider aws
```

This has been implemented for:

* flux push artifact
* flux list artifact
* flux tag artifact
* flux pull artifact

This will require another PR in https://github.com/fluxcd/pkg/pull/352

Signed-off-by: Adrien Fillon <adrien.fillon@manomano.com>
2 years ago
Somtochi Onyekwere 11dd0d918c remove finalizers for notification controllers
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan e777947539
Remove finalizers for OCI repositories on uninstall
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Daniel Holbach c57afa1e56 Revert "Fix broken "edit this page" links in Flux CLI section"
Signed-off-by: Daniel Holbach <daniel@weave.works>
2 years ago
Somtochi Onyekwere 7b95e90a33 Update flux logs to accomodate the new format
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan a5a9158a24
Add provider to Helm OCI tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Sven Nebel 2c9ef85f6d Fix broken "edit this page" links in Flux CLI section #2203
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>
2 years ago
Somtochi Onyekwere ad0f3373b6 Improve error message in get cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan 8a0fd6ddf9
Add version validation to install commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Somtochi Onyekwere 96d1c1b2bd Add --filter-semver and regex flags to list artifact
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan 40717fa4f4
Exclude VCS files by default from OCI artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 899a1fffca
Add `--ignore-paths` arg to `flux build|push artifact`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Somtochi Onyekwere 5dcd599612 reset cmd flags
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Max Jonas Werner b810aea6cc
Make `flux trace` work with OCIRepository
* Added support for OCIRepositories to `flux trace`
* Changed indentation to compensate new, longer field name "Source
  Revision"
* Added unit tests for the new output

closes #2970

Signed-off-by: Max Jonas Werner <max@e13.dev>
2 years ago
Stefan Prodan 75a879c770
OCI docs improvements
Co-authored-by: Kingdon Barrett <kingdon@weave.works>
Co-authored-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan d4718f6ff4
Improve artifact commands docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan ac9b3d193d
Update controllers with OCI support
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 7c7e76f9f0
Use fluxcd/pkg/oci/client
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 08401f62b2
Add OCI provider arg
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Kingdon Barrett 69e26ca1d9
Pull artifact not push artifact
Fixup docs string to match pull command

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2 years ago
Somtochi Onyekwere fcd38c9395
Fix cli description
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Somtochi Onyekwere fe4b65972a
Update cli description
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Somtochi Onyekwere 4c576bf599
Add create oci secret command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan 70d30fd52e
Update golden files to latest digest
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Somtochi Onyekwere 9e76787e9f
working golden files
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan 6b98590461
Add `--cert-ref` to `flux create source oci`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 8049634e4d
Add `oci://` prefix
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Somtochi Onyekwere adc7981f22
Add tests for source oci command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Stefan Prodan 2f35367a7f
Add list artifacts command
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 2d8db4f20d
Implement OCIRepository commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Stefan Prodan 9503ecafb1
Add artifact commands
Implement build, push, pull and tag artifact commands.
For authentication purposes, all `flux <verb> artifact` commands are using the '~/.docker/config.json' config file and the Docker credential helpers.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2 years ago
Paulo Gomes c45536723c
add validation to namespace flag
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2 years ago
Paulo Gomes fb1de8c649
remove unused func
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2 years ago
Somtochi Onyekwere 1889b64b4e remove print statement
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Somtochi Onyekwere 0cfdc5d674 move struct definition
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
Somtochi Onyekwere 96afee996a Add unit tests for flux logs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2 years ago
TianZong48 c24e738973 logs: write into writer from io.Pipe instead os.Stdout
Signed-off-by: TianZong48 <tianzong48@gmail.com>
3 years ago
David Harris 95eb7aede0
add branch to basic auth example
Without a reference specified, the create command will fail. 

Signed-off-by: David Harris <david.harris@weave.works>
3 years ago
Stefan Prodan 724c93c23d
Remove image finalizers on uninstall
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Hidde Beydals d12e697769 logs: select manager container when multiple exist
This sets the container to `manager` which is used by all Flux
controllers as the container name.

The other options I thought about were selecting the first, or doing
something with image detection. But both can be sensitive to either
users adding their patch as a first entry, or e.g. mirroring the image
to a different name.

Signed-off-by: Hidde Beydals <hello@hidde.co>
3 years ago
Somtochi Onyekwere 1894b90d84 Accept multiple valuesFrom for create_helmrelease
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere 7346b1a762 Return a different success message for helm oci
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Stefan Prodan 443e5b5539
Fail check if no controllers or crds are found
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
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>
3 years ago
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>
3 years ago
Vipul Newaskar 0a30bc1024 allow http git repos connections while bootstrap
Updated misleading error message

Signed-off-by: Vipul Newaskar <vipulnewaskar7@gmail.com>
3 years ago
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>
3 years ago
Max Jonas Werner e19ea796b1
Add OCI support to `create source helm`
closes #2774

Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
Max Jonas Werner e1def4f8ac
make e2e test easier to debug
Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
Sanskar Jaiswal 7232ff9ea0 modify tmp dir generation to be absolute on all OSes
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
3 years ago
Chen Anidam a85ea59824 Read password of generic git bootstrap command from env or stdin
Signed-off-by: Chen Anidam <canidam@gmail.com>
3 years ago
Kingdon Barrett 7e2b63ea5d
add detail to delete docs
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
3 years ago
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>
3 years ago
Somtochi Onyekwere b80f32ce7d Add cli flags for chart interval and reconcile strategy
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
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>
3 years ago
Stefan Prodan 0d8194c800 Add the kube client qps and burst to the global args
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 5f74c7d294
Fix resume source bucket panic
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
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>
3 years ago
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>
3 years ago
Stefan Prodan 2e1000c31a
Add components-extra example usage to CLI help
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
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>
3 years ago
cuishuang 1fda202cf9 all: fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
3 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
Somtochi Onyekwere 9c76ba903b add wait flag to flux resume cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere 82a8697f28 Add gvk to rest of api type
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
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>
3 years ago
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>
3 years ago
Somtochi Onyekwere d7129d6b55 Remove validation from sub-commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere 4a893b13f8 validate that object name adheres to RFC 1123 for flux create commands
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere a30ffdb176 Use text/template
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Stefan Prodan cbca583f4b
Add GitRepository namespace arg to `flux create image update`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 9d6a037935
Update dependencies
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
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>
3 years ago
Somtochi Onyekwere d3d271defe use client.Patch for suspend/resume operations
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Robert Wittman e33198e750
Replace github boostrap GPG options
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
3 years ago
Robert Wittman e3f5a8fee3
Add GPG options to Gitlab and BitBucket bootstraps
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
3 years ago
Robert Wittman f8b58f8be9 Add GPG signing to Github bootstrap
Signed-off-by: Robert Wittman <robkwittman@gmail.com>
3 years ago
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>
3 years ago
Stefan Prodan 141d71c39d
Use CrossNamespaceSourceReference for image automations
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 246af92386
Adapt diff test to match Kubernetes 1.23.3 API response
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
leigh capili 57962347f2
Output Usage for `flux get <sources|images>`
Signed-off-by: leigh capili <leigh@null.net>
3 years ago
Stefan Prodan f154326391
Set minimum supported version to Kubernetes 1.20.6
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
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>
3 years ago
Soule BA f7d9ee90cd
Add e2e tests for build/diff kustomization
Signed-off-by: Soule BA <soule@weave.works>
3 years ago
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>
3 years ago
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>
3 years ago
Somtochi Onyekwere 1e2a497108 Shorten sha commit
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Stefan Prodan 8c67708829
Update dependencies
- sigs.k8s.io/cli-utils v0.27.0
- github.com/fluxcd/pkg/ssa v0.10.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Jakob Schrettenbrunner d3c56eb3d3 trace: fix lint warning
Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
3 years ago
Jakob Schrettenbrunner b10eee87ee Simplify arguments of flux trace command
It now accepts arguments in the forms <resource>/<name>
and <resource> <name> instead of requiring api version and
kind as flags.

Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
3 years ago
Alby Hernández c190d80d4a Avoid overwriting the host port on http requests
Remove the overwrite of the repositoryURL.Host variable to include Git
servers deployed on non-standard https ports

Co-authored-by: Sebastián Vargas <develolux@gmail.com>

Signed-off-by: Alby Hernández <me@achetronic.com>
Signed-off-by: Alby Hernández <alby.hernandez@system73.com>
3 years ago
Aurel Canciu f3d143e5ee
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
3 years ago
Jakob Schrettenbrunner ca7d2e783f Use k8s.io/cli-runtime for kubernetes flags
Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
3 years ago
Hidde Beydals c13de6089a cmd: start trace short description with T
This fixes a styling issue:

```
$ flux --help

Command line utility for assembling Kubernetes CD pipelines the GitOps
way.

Usage:
  flux [command]

...

Available Commands:
  ...
  suspend     Suspend resources
  trace       trace an in-cluster object throughout the GitOps delivery
pipeline
  uninstall   Uninstall Flux and its custom resource definitions
...
```

Signed-off-by: Hidde Beydals <hello@hidde.co>
3 years ago
Somtochi Onyekwere a26dd05c49 Remove extra space
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere a03574f8c3 Add caBundle to bitbucket
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere 43c6a1531a Add caBundle to gogit provider config
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Stefan Prodan 8731f00347
Remove deprecated `io/ioutil` from `flux tree`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Soule BA 46f9fc194c Add stash provider bootstrap support
The new command set is:
  flux bootstrap bitbucket-server --owner=<project> --username=<user> --repository=<repository name> --hostname=<domain> --token-auth

There is a parity in the capabilities with the other providers.

Signed-off-by: Soule BA <soule@weave.works>
3 years ago
Somtochi Onyekwere e96652bdaa Update keys to ECDSA format
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere b7007a35d7 update test files to use ecdsa key
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Jack Evans 05b053e2e9
remove trailing --- for install and bootstrap consistency
Signed-off-by: Jack Evans <jack.evans1@ibm.com>
3 years ago
Stefan Prodan f03c24565f
Skip remote clusters in flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Jack Evans 923a5882de
make flux bootstrap and install generation more consistent
Signed-off-by: Jack Evans <jack.evans1@ibm.com>
3 years ago
Max Jonas Werner be1ce74dc5
fix: trim CRLF from password read from stdin
bufio's reader.ReadString includes any CRLF characters and we don't
want these in the resulting token because this leads to errors in the
authentication like this:

```
✗ failed to get Git repository
"https://github.com/kingdon-ci/jenkins-infra": Get
"https://api.github.com/repos/kingdon-ci/jenkins-infra": net/http:
invalid header field value "Bearer gho_NNNNNsecrettokenMMMMM\n" for
key Authorization
```

Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
Max Jonas Werner 31771f3575
fix: improve wording
Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
Max Jonas Werner ffcd7d8059
feat: prompt for access tokens in 'bootstrap' command
This change adds functionality to both, `bootstrap github` and
`bootstrap gitlab` to prompt the user for the personal access tokens
if those can't be derived from the shell environment. Echoing is
turned off for better privacy.

Instead of having to interactively type the token or manually paste it
from the clipboard, users can also pipe it to Flux which comes in
handy e.g. when executing Flux remotely over an SSH connection:

```
$ echo 'asdf' | flux bootstrap github
```

Otherwise, Flux will prompt the user:

```
$ flux bootstrap github
Please type your GitHub personal access token:
```

closes #2011

Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
Stefan Prodan 4621576f40
Set ECDSA as the default algorithm for `flux create source git`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 4f2ebd78be
Set ECDSA as the default algorithm for `flux create secret git`
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 88dacebc94
bootstrap: Set ECDSA as the default SSH key algorithm
Motivation: RSA SHA-1 SSH keys are no longer accepted by GitHub https://github.blog/2021-09-01-improving-git-protocol-security-github/.
Given this we are switching the default from RSA to ECDSA for `git`, `github` and `gitlab` variants of `flux bootstrap`.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan d5d8c340c8
Switch to app.kubernetes.io/part-of label selector
Use `app.kubernetes.io/part-of: flux` label instead of `app.kubernetes.io/instance` to select the in-cluster objects used in flux version, check, logs and uninstall commands.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 61be0775af
Add fetch timeout arg to create source commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan f2de7e04b8
Set default ns with FLUX_SYSTEM_NAMESPACE env var
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 37746023c1
Enable completion for flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Somtochi Onyekwere eb69083ef5 Add unit tests for export
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Kingdon Barrett 94b7917679 Fix quoting around reconciliation error message
While fixing an unrelated issue, I noticed:
    ✗ GitRepository reconciliation failed: ''PGP public keys secret error: expected pointer, but got nil

the single quote should surround the readyCond.Message

Signed-off-by: Kingdon Barrett <yebyen@gmail.com>
3 years ago
Stefan Prodan d9bb4c631e
Add flux tree to e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 722962c138
Expand Helm releases in flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 078cfe92c2
Add JSON and YAML output options to flux tree cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 80ef184b60
Add flux tree command
The `flux tree kustomization` command prints the resources reconciled by the given Kustomization.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Somtochi Onyekwere 67b393ce09 Add test for create secret
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Stefan Prodan cd52a0eef3
Add poll interval flag to flux check cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Stefan Prodan 77aa81a064
Add wait flag to create kustomization cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago