GitRepository authentication required but secretRef set #4994
-
Hello 👋 I want to add a GitRepository resource linked to a repository self-hosted GitLab instance but I encountered an error The setup:
Secret: ---
apiVersion: v1
kind: Secret
metadata:
name: gitlab-authentication
namespace: flux-system
type: Opaque
data:
username: <username in base64>
password: <password in base64>
ca.crt: <ca-chain in base64> GitRepository ---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: myapp
namespace: flux-system
spec:
interval: 10m0s
ref:
branch: main
secretRef:
name: gitlab-authentication
url: https://gitlab.domain/myapp.git I was able to setup it right in the past but today I having hard time to find where I've made a mistake. If you have any idea, thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
stefanprodan
Sep 22, 2024
Replies: 1 comment 2 replies
-
It could be that the base64 username or password contain some \n encoded. You can generate the secret with the Flux CLI like this:
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Nemergal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It could be that the base64 username or password contain some \n encoded. You can generate the secret with the Flux CLI like this: