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

Extract Baremetal Operator CRDs into dedicated package #64

Conversation

Kristian-ZH
Copy link
Contributor

@Kristian-ZH Kristian-ZH commented Dec 14, 2023

Extract Baremetal Operator CRDs into a dedicated package.
In this way, we will have a manual version control of both packages

Closes #55

description: Beremetal Operator CRDs
name: baremetal-operator-crds
type: application
version: 0.3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should perhaps version this to align with the baremetal-operator release? e.g currently the image used is 0.4.0 which is derived from the upstream 0.4.0 release

This has the advantage of making it very clear where the CRDs come from, but the potential disadvantage is we might end up copying the CRDs chart without any changes if there are BMO releases which don't modify any CRDs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the appVersion the one we want to modify here? IIRC version holds only a temporary value distinguishing our (pre-) alpha versions and will be changed to 3.0.0 for the Edge release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense
/cc @hardys WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to be corrected, but IIUC version is the chart version used for management of dependencies, and appVersion is optional and indicates the version of whatever thing you're installing (e.g it's redundant in the case where the chart version can be exactly coupled to the deployed artefact, which in this case it can?)

It raises the question of where appVersion: 1.16.0 came from though - AFAICS that version doesn't relate to anything and could probably be removed?

Copy link
Contributor

@hardys hardys Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct on both version and appVersion definitions. I meant that we can use the appVersion to indicate that the CRDs are coming from the 0.4.0 version Metal3.

Some projects choose to match the version of the chart (version) to the version of the application (appVersion). However, in our case, version will later be set to 3.0.0 anyway (with an appropriate suffix if backports are necessary) as per the internal documentation we were discussing few months ago.

Side note - appVersion: 1.16.0 is the default one when a chart is generated via Helm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying @atanasdinov and thinking about it, there's one scenario where the simple versioning doesn't work - if we had to fix an issue in the chart (unrelated to a new BMO release) we'd want to bump version but not appVersion

So, if I'm understanding correctly that means the new chart should be e.g version: 0.1.0 and appVersion: 0.4.0 @Kristian-ZH what are your thoughts?

Copy link
Contributor

@atanasdinov atanasdinov Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we had to fix an issue in the chart (unrelated to a new BMO release) we'd want to bump version but not appVersion

This is exactly the approach I've went with for the KubeVirt chart. version: 0.1.0 is the one which Sylva identified not suitable for their environments and I "froze" it and made all improvements (>5 separate PRs) in version: 0.2.0 instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that making the appVersion to 0.4.0 sounds reasonable. In this way, we will use the appVersion to track versions from the upstream. For the version field I am not sure what would fit best here. For now I think that it is ok to iterate over it for our chart modification because this is also the version that is used from chart-build-script to crate the chart versioning. So making it 0.1.0 for now is probably OK. We can continue with that strategy and to update the versions only on the dependencies that are changed, and stop updating all as we currently do (all are with versions 0.4.0). Probably after each dependency version update, we will have to update the parent chart version as well.

@Kristian-ZH Kristian-ZH force-pushed the extract-baremetal-operator-crds branch 2 times, most recently from 9652a5b to 77f23ce Compare December 15, 2023 07:53
packages/baremetal-operator-crds/charts/Chart.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,6 @@
apiVersion: v2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain why the chart is in both packages/baremetal-operator-crds and packages/baremetal-operator/charts/charts/baremetal-operator-crds?

This isn't the case for MetalLB for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly IDK...
This is the result from make prepare.
The diffs between both components are that:

  1. Metallb is released chart until BarametalOperator not because it is part of the Metal3 chart.
  2. MetalLB is a root chart, until BaremetalOperator is a subchart (We have Metal3 -> BaremetalOperator -> BaremetalOperatorCRDs)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to run make clean to get rid of this "working copy" according to the development docs.

@Kristian-ZH Kristian-ZH force-pushed the extract-baremetal-operator-crds branch from 77f23ce to 32b1855 Compare December 15, 2023 12:57
@Kristian-ZH Kristian-ZH marked this pull request as draft December 15, 2023 14:51
@Kristian-ZH
Copy link
Contributor Author

As we still have no strong opinion what is the best way to keep the CRDs, I will close this PR for now and the topic will be discussed again after the holidays

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.

Move Metal3 BMO CRDs into separate package
3 participants