Commit Graph

22 Commits (45876a723c28382756f275b979e9262427f099d3)

Author SHA1 Message Date
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
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
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
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 5249d17a95 Use proper GPG terminology
Signed-off-by: Hidde Beydals <hello@hidde.co>
3 years ago
Somtochi Onyekwere 0beab87f5b Add gpg key path and passphrase as args
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Somtochi Onyekwere 1849e1768a Set username when it isn't default
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
3 years ago
Max Jonas Werner 2e6ca16a4a
chore: use os.ReadFile instead of deprecated ioutil.ReadFile
Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
Max Jonas Werner e98f1142a6
feat: enable bootstrap with custom CA locally
When a user provided the `--ca-file` flag to the `bootstrap` command,
the given CA file wasn't taken into account for cloning the repository
locally. It was just passed along to the CR that is created so Flux
can make use of it when cloning the repository in-cluster.

However, users may not want to add a custom CA to their local host's
trust chain and may expect the `--ca-file` flag to be respected also
for cloning the repository locally. This is what this commit
accomplishes.

closes #1775

Signed-off-by: Max Jonas Werner <mail@makk.es>
3 years ago
Dmitry Rybin 7f425efa6b chore: remove deprecated io/ioutil
Signed-off-by: Dmitry Rybin <ayrowa@yandex.ru>
4 years ago
Stefan Prodan 6b179aa7d9
Allow disabling the deploy key prompt for bootstrap git
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
4 years ago
Hidde Beydals 465ea5ccfd Update go-git to v5.4.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Hidde Beydals fbe7050cb8 Switch to `crypto/ssh` for parsing of private keys
This changes the logic for the parsing of private keys, as already
done for the source-controller, so that it is able to recognize and
work with a wider range of key formats instead of returning a vague
error:

```console
$ flux bootstrap git [..]
✗ ssh: this private key is passphrase protected
```

A patch for this was already submitted and merged in `go-git/go-git`,
but is not made available in a release yet:
https://github.com/go-git/go-git/pull/298

Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Tobias Jakobsson ea62cb5fc9 Use proper Host configuration for SSH
This removes the usage of Hostname() which does not honor configured SSH
port to be used.

Resolves: #1377
See also: #1101, #1102

Signed-off-by: Tobias Jakobsson <jakobsson.tobias@gmail.com>
4 years ago
Somtochi Onyekwere 328d403507 Set password in secret
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
4 years ago
Hidde Beydals 3aa45e72e7 Use slash target path in Git bootstrap sync opts
As otherwise (comparisons to) cluster configuration will fail due to
Separator differences. Was already fixed for provider implementations.

Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Hidde Beydals e0dd12505f Normalize paths to forward slashes
Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Hidde Beydals 7bd6aedb73 Take PK from file into account in Git bootstrap
Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Stefan Prodan b872e595ae
Add recurse submodules arg to bootstrap cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
4 years ago
Hidde Beydals 7f0bc2ada2 Provide option to add appendix to commit messages
Using the `--commit-message-appendix` flag a string can be added to the
commit messages made by the bootstrapper process to for example skip CI
actions from executing using e.g. `[skip ci]`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Hidde Beydals 96c373d045 Properly configure sync URL based on auth settings
Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago
Hidde Beydals 22648cae3b Add command to bootstrap to generic Git server
This command makes it possible to bootstrap to a generic Git server
using the local SSH agent, or a given password or private key file.

If a private key is generated, the user is prompted to give the
generated key access to the repository.

Signed-off-by: Hidde Beydals <hello@hidde.co>
4 years ago