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

fix fluxcd catalog #7132

Closed
wants to merge 2 commits into from
Closed

fix fluxcd catalog #7132

wants to merge 2 commits into from

Conversation

kvaps
Copy link
Contributor

@kvaps kvaps commented Nov 26, 2023

Description of the change

Fluxcd's HelmRepository v1beta2 has no status.artifact.checksum field

Benefits

Possible drawbacks

Applicable issues

fixes #6863
regression introduced by #4506

Additional information

Copy link

netlify bot commented Nov 26, 2023

Deploy Preview for kubeapps-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d2dbd5e
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/656635d97aa73f0009ea99af
😎 Deploy Preview https://deploy-preview-7132--kubeapps-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vmwclabot
Copy link

@kvaps, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link

@kvaps, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

@absoludity
Copy link
Contributor

Thanks @kvaps for jumping in and looking for a solution!

Description of the change

Fluxcd's HelmRepository v1beta2 has no status.artifact.checksum field

[...]

fixes #6863 regression introduced by #4506

That's interesting! Actually, checking, I don't think it was introduced by #4506 as, at the time the v1beta2 API was released, it was still using checksum, as you can see in the related Flux source controller v0.22.0 docs. Even just prior to the 1.0.0 release, in the 0.36.1 release they still included the checksum field, but had also introduced Digest by then. But yes, with the first 1.0 release candidate checksum has been removed.

Now in our CI, it's clear that we haven't been able to prioritise work on the fluxcd support for some time, with the version being used in CI still at v0.37.0 (of fluxcd, not source-controller) and that release still uses v0.32.1 of source-controller, well before the checksum field was removed which is why the code still works in CI. And in fact, from the v0.32.1 docs it is before the digest field was added.

I say all that only to show why it might require a little more work than just changing the lines over to use digest that you've done here (which won't pass CI with the version of fluxcd used in our integration tests). If you are keen to have a go, great! but no pressure, otherwise we'll take a look as it gets prioritised. My guess is that the following will need doing in this PR as well:

At a minimum:

We can then let your PR here run against the CI tests. It could be that it passes as is, but more likely:

  • there are likely to be CI/integration tests which also make the same assumption (though I can't see any from a quick grep - so we could be lucky)
  • there could be other changes introduced in the newer fluxcd version which may break assumptions in the existing Kubeapps/fluxcd integration (but again, we could be lucky).

So for now, if you can update FLUX_VERSION to the latest stable fluxcd, and we can then run our integration/CI tests with your change and see. No pressure to fix it if there's a lot of fall-out, but great if you're keen :)

Cheers

@vmwclabot
Copy link

@kvaps, VMware has approved your signed contributor license agreement.

@kvaps
Copy link
Contributor Author

kvaps commented Nov 27, 2023

@absoludity thank you for feedback PR rebased

@absoludity
Copy link
Contributor

Thanks @kvaps . So

  • there are likely to be CI/integration tests which also make the same assumption (though I can't see any from a quick grep - so we could be lucky)

in the above test_go in the CI runs, there's an error:

failed due to: internal: expected field status.artifact.digest not found on HelmRepository

We'll need to update the versions in the go.mod too, so the code is using the newer fluxcd versions.

Fluxcd's HelmRepository v1beta2 has no status.artifact.checksum field,
it uses status.artifact.digest instead.

Bump fluxcd version in e2e test to cover this case.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@absoludity
Copy link
Contributor

Thanks @kvaps . I'll run CI with those changes, but I see you had to (?) update the k8s libraries, which unfortunately won't work yet, I don't think (we'd been holding off the k8s client-go (and friends) 0.26->0.28 upgrade because it needs some manual work. So we may need to pause this PR until that work is done. Let's see when I run.

@kvaps
Copy link
Contributor Author

kvaps commented Nov 29, 2023

Yup, because:

go: github.com/fluxcd/pkg/oci@upgrade (v0.33.0) requires k8s.io/api@v0.28.4, not k8s.io/api@v0.26.7

Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Automatic label to stale issues due inactivity to be closed if no further action label Dec 15, 2023
@antgamdia antgamdia removed the stale Automatic label to stale issues due inactivity to be closed if no further action label Dec 15, 2023
@antgamdia
Copy link
Contributor

I've been putting together some upgrades (mainly for triggering CI and checking it effectively works) at #7219. I'd like to upgrade the CI first and perform a IRL check everything works as expected first. Let's see if after holidays we can finally merge it and get flux our flux plugin up to date again.

antgamdia added a commit that referenced this pull request Jan 9, 2024
#7219)

### Description of the change

This PR is bumping up some dependencies together, as they are somehow
coupled. Besides, it performs some changes on the Flux resources
(including the changes performed in
#7132 from @kvaps; thank
you for the PR!) to make it compatible with their v2.0.0 release
onwards.

As pointed out in
#7132 (comment),
some additional changes were required, namely:

- Effectively use latest Flux version in CI, for identifying the issue.
- Replace `PollInfinite` with `PollUntilContextCancel` bc of a k8s
deprecation.
- Rename fluxcd imports to `sourcev1beta2` to clearly identify which
version we are using.
- Add TODOs for using `CertSecretRef` in the future (upcoming
deprecation, but it will be addressed in a separate PR).
- Minor change in method signature because of the kapp-ctrl upgrade.

### Benefits

We'll be able again to get dependabot's upgrades in these dependencies
and, more importantly, Kubeapps will work again with latest FluxCD
releases.

### Possible drawbacks

Conversely, Kubeapps will likely fail with Flux2 version prior to 2.0.0.
See more information and migration guide at:
https://github.com/fluxcd/flux2/releases/tag/v2.0.0


### Applicable issues

- fixes #6863

### Additional information

N/A

---------

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia
Copy link
Contributor

Hi @kvaps, thank you for reporting the issue and sending the fix. As it turned out to be a more complex change, involving several deps, CI changes, etc. I ended up addressing everything together at #7219.

There's still some pending work (like migrating to CertSecretRef for future releases), but the issue you reported should be now fully addressed.

Let me close the PR, but please feel free to contribute again. Thanks again!

@antgamdia antgamdia closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty catalog using fluxcd
4 participants