Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drift Correction Failed - gitlab-rails-secret-bb patch failure #89

Open
p1-bot-repo-sync bot opened this issue Jan 23, 2025 · 1 comment
Open

Comments

@p1-bot-repo-sync
Copy link

Bug

Description

From PB Engineer on MM:

Describe the problem, what were you doing when you noticed the bug?

Troubleshooting a complaint that Flux has... We have drift detection enabled on our clusters. And it keeps choking on this:

  Warning  DriftCorrectionFailed  14m (x124 over 23h)  helm-controller  Failed to correct cluster state of release bigbang/bigbang.v8:                                                                                      
Secret/gitlab/gitlab-rails-secret-bb patch failure: illegal base64 data at input byte 0                                                                                                                                     

If we delete the secret it gets created juuuuust fine but something about the patch operation angers Flux. Looking at it, there's a newline / blank line at the top of the secret that I suspect is making some validator mad. In the BB chart, that secret is created with this as the data:
{{ .Values.addons.gitlab.railsSecret | nindent 4 | b64enc }}

nindent is what's inserting that empty line. So the secret ends up looking like (I have removed Base64 encoding in this output to show the newline) :

data:
  secrets.yml: |
    
    somesecret

Anyone know why nindent is used so widely in the BB charts instead of just indent? Have you encountered this before / happen to have a workaround?

Also worth mentioning that at this point I'm just suspicious of the newline. Since the complaint is about byte 0 and the first character is a newline.... It's entirely possible I'm barking up the wrong tree, but I'm still curious why nindent is used.

Our workaround will probably be managing this outside of BB, which is always a crappy workaround.

This does appear to be the only place that combines nindent with b64enc.

Template Link:
https://repo1.dso.mil/big-bang/bigbang/-/blob/master/chart/templates/gitlab/secret-rails.yaml?ref_type=heads#L10

BigBang Version

2.41.0

@p1-bot-repo-sync
Copy link
Author

afarasoteemo commented:

Closing this ticket because the issue could not be reproduced and there was no response from customer when contacted. The ticket can be reopened at the customer's request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

0 participants