Skip to content

Plain Git bootstrap fails when run in a non-interactive session and --silent is not present #5660

@carlosonunez-redhat

Description

@carlosonunez-redhat

Describe the bug

Pretty much the subject. The error is also confusing. See below:

+ flux bootstrap git --url=ssh://git@gitserver/git-server/repos/platform --path=./clusters/prod --branch master --private-key-file=/keys/id_rsa --context kind-cluster-prod --author-email clusterops@example.com --author-name 'Cluster Ops Bot' --log-level debug
+ podman run --rm -v /Users/cn/src/cncf-weekly-guides/flux/keys:/keys -v /Users/cn/src/cncf-weekly-guides/flux/.kube:/.kube --network=kind fluxcd/flux-cli:v2.7.5 bootstrap git --url=ssh://git@gitserver/git-server/repos/platform --path=./clusters/prod --branch master --private-key-file=/keys/id_rsa --context kind-cluster-prod --author-email clusterops@example.com --author-name 'Cluster Ops Bot' --log-level debug
► cloning branch "master" from Git repository "ssh://git@gitserver/git-server/repos/platform"
✔ cloned repository
► generating component manifests
✔ generated component manifests
✔ committed component manifests to "master" ("2a2328d94c880fbd5a9364899ad428b29d9eed90")
► pushing component manifests to "ssh://git@gitserver/git-server/repos/platform"
► installing components in "flux-system" namespace
✔ installed components
✔ reconciled components
► determining if source secret "flux-system/flux-system" exists
► generating source secret
✔ public key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8muLwdDiC6+CAyeszTDgKi2U8FVjNT2UTnqOa7m0xRUale82fvwhNa5ukGos6F66ugippja9v4xku/m/bQweWQwqAYQmJWJTWnaJGeFkD1wg/pVrty2t39+ZoupuIlxAbhkBwS8Xsu9znEyZEh+4cJ2LKdpzgSRsfvzaaIMcq+mb/8m0O8kBfdw5wQEtH3UDe08rKUXravdNNrzNpNnVy7yQsykncavngv/rQ7gZhw0Vc8qxHbg67DjxwbdIeymgktV+LaPpTLyO44NR56mpGAHm1i1vjg1KcSgJA76HIEGe7bJJBmk1DkZ3V2X0B9rQhxtBViefOvi/Xaf01TTqjn2X5rt+klote+j2zSqdgadZMcI0/UhbRrSBOD+INP5w226QlHNYpUAMM+eDOvAw0nuUtOAbr/ZXHQgD/YxH0ecJs4EWoJQ8cD7czimW7FY2LjzEk08DZbgJ3+fLidj1L+YaKPsdCON6/j6iciUmHgXa94vNiFw57qANmryt6W8M=

✗ aborting

Steps to reproduce

  1. Create a SSH keypair
  2. Create a local Git server in SSH mode serving out of tcp/2222 and add those SSH keys into its authorized_keys file.
  3. Run docker run --rm -v "$HOME/.kube:/.kube" bootstrap git --url=ssh://git@localhost:2222/git-server/repos/platform --path=./clusters/prod --branch master --private-key-file=/keys/id_rsa --context kind-cluster-prod --author-email clusterops@example.com --author-name 'Cluster Ops Bot'

Expected behavior

The bootstrap process continues or I get an error telling me why the process aborted.

Screenshots and recordings

No response

OS / Distro

Alpine 3.24

Flux version

2.7.5

Flux check

$: podman run --rm --network=kind -v "$PWD/.kube:/.kube" fluxcd/flux-cli:v2.7.5 check
► checking prerequisites
✔ Kubernetes 1.34.0 >=1.32.0-0
► checking version in cluster
✔ distribution: flux-v0.0.0-dev.0
✔ bootstrapped: false
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v1.4.5
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.7.3
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.7.5
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.7.4
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta3
✔ buckets.source.toolkit.fluxcd.io/v1
✔ externalartifacts.source.toolkit.fluxcd.io/v1
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1
✔ helmreleases.helm.toolkit.fluxcd.io/v2
✔ helmrepositories.source.toolkit.fluxcd.io/v1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1
✔ providers.notification.toolkit.fluxcd.io/v1beta3
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

Git

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions