Skip to content

Conversation

@metacosm
Copy link
Collaborator

@metacosm metacosm commented Jan 25, 2025

Description

Fixes #6827

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

Copy link
Member

@andreaTP andreaTP left a comment

Choose a reason for hiding this comment

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

Looks like a great improvement!
Do you mind adding a test that shows how to use the feature on the user side?
It should be relatively easy here.

Also updating the docs to reflect the changes (not a blocker can be done later).

Side note that there should be something not aligned with the spotless configuration ...

@manusa
Copy link
Member

manusa commented Jan 29, 2025

^ @metacosm

@metacosm metacosm changed the title feat: process generated CRDs but before they are written out feat: process generated CRDs before they are written out Jan 29, 2025
@metacosm metacosm force-pushed the crd-post-processor branch 3 times, most recently from 6d3266a to 8c20f6a Compare February 21, 2025 14:32
}

/**
* @deprecated use {@link #emitCrd(HasMetadata, Set, CRDGenerationInfo, CRDPostProcessor)} instead
Copy link
Member

Choose a reason for hiding this comment

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

The new method is marked protected, users won't be able to transition.

On the other hand, why don't we make CRDPostProcessor a member variable (just as output, minQuotes, etc.) that defaults to the nullProcessor -> withCrdPostProcessor().
This way the method signature won't keep growing or changing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, that emitCRD method should probably not have been exposed in the first place and I don't think anyone is using it but the suggested change is a good one. Thank you!

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@manusa manusa added this to the 7.2.0 milestone Feb 27, 2025 — with automated-tasks
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

@manusa manusa merged commit 7600dd8 into main Feb 27, 2025
19 of 20 checks passed
@manusa manusa deleted the crd-post-processor branch February 27, 2025 10:31
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.

CRDGenerator: Add possibility to post-process CRDs after they are generated but before they are written out

5 participants