Skip to content

Conversation

@jiangzho
Copy link
Contributor

@jiangzho jiangzho commented Jul 8, 2025

What changes were proposed in this pull request?

This PR allows the generated yaml as latest version to be used by Helm charts, after merging with older versions

Why are the changes needed?

To avoid manually updating staged CRD yaml files when updating spark-operator-api

Does this PR introduce any user-facing change?

No

How was this patch tested?

CIs

Was this patch authored or co-authored using generative AI tooling?

No

### What changes were proposed in this pull request?

This PR allows the generated yaml as latest version to be used by Helm charts, after merging with older versions

### Why are the changes needed?

To avoid manually updating staged CRD yaml files when adding new fields to CRD

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

CIs

### Was this patch authored or co-authored using generative AI tooling?

No
yq eval-all '
select(fileIndex == 1) as $source
| select(fileIndex == 0)
| .spec.versions += [$source.spec.versions[0]]
Copy link
Member

Choose a reason for hiding this comment

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

Oh, is this general enough to handle all cases when we change the APIs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention was to:

  • keep old CRD version(s) that do not need new features in a template file, and
  • append new version at the end of the template, then move the full generated YAML to the proper location of the chart.

As we still want supporting v1alpha1 & v1beta1, I can remove them from the template. In the next commit we can do

  • keep a template file that includes an empty list of versions
    • deprecated version(s) can be move to it in future
  • keep a list of supported versions, generate latest YAML for them, then apply them to the template.

How does this sound ?

Copy link
Member

Choose a reason for hiding this comment

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

Is it a little over-engineering without much clear benefits, isn't it. If we leave it in the existing way,

  1. It's logically simple because only a PR (which changes the specs) will add minimal and required lines.
  2. For all CRDs (including the latest CRD), we can have a full traceability with Git too.

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 understand there's still concern about this auto-generation. The automation was intended to reduce potential human error in maintaining the large yaml file.

While this PR itself can be a bit big for that purpose, can we at least reduce this to a test scenario validating the automated generated yaml in build is fully contained in the checked-in CRD yaml?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

According to your other PR, we are changing the APIs at v1.

+ resourceRetainDurationMillis:
+   type: integer

Given that, let's not delete the old files. They should be identical always for v1alpha and v1beta. And I'm not sure this PR guarantees that. For me, this PR seems to hide those kind of changes.

WDYT, @jiangzho ?

@dongjoon-hyun
Copy link
Member

cc @peter-toth

@jiangzho
Copy link
Contributor Author

please refer the lightweight test at #283

@jiangzho jiangzho closed this Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants