Skip to content

Conversation

@osmman
Copy link
Collaborator

@osmman osmman commented Jul 17, 2025

Summary by Sourcery

Enable user customization of Rekor Search UI pods by extending the CRDs, API types, and deployment logic to support affinity, tolerations, resource requirements, and replica count, and update the operator’s CSV descriptors to expose these options in the UI.

New Features:

  • Allow configuring nodeAffinity, podAffinity, and podAntiAffinity for the Rekor Search UI pods via the CRD
  • Add support for defining tolerations, CPU/memory resource requests and limits, and replica count in the Rekor Search UI spec

Enhancements:

  • Embed PodRequirements in the RekorSearchUI API type and update the deployment controller to apply user-specified PodRequirements instead of hardcoded defaults

Deployment:

  • Add CSV specDescriptors to expose the new PodRequirements fields in the OLM UI

Signed-off-by: Tomas Turek <tturek@redhat.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Jul 17, 2025

Reviewer's Guide

This PR extends the Rekor Search UI and SecureSigns operator to support configurable PodRequirements—namely replicas, resources, affinity, and tolerations—by updating the CRD schemas, API model, UI descriptors, and controller deployment logic.

ER diagram for new PodRequirements fields in RekorSearchUI CRD

erDiagram
    REKORSEARCHUI {
        BOOL enabled
        INT replicas
    }
    PODREQUIREMENTS {
        INT replicas
        JSON affinity
        JSON tolerations
        JSON resources
    }
    REKORSEARCHUI ||--o| PODREQUIREMENTS : has
    PODREQUIREMENTS }o--|| AFFINITY : contains
    PODREQUIREMENTS }o--|| TOLERATION : contains
    PODREQUIREMENTS }o--|| RESOURCEREQUIREMENTS : contains
    RESOURCEREQUIREMENTS }o--|| RESOURCECLAIM : contains
Loading

Class diagram for updated RekorSearchUI with PodRequirements

classDiagram
    class RekorSearchUI {
        +bool* Enabled
        +PodRequirements (inlined)
    }
    class PodRequirements {
        +Affinity affinity
        +Toleration[] tolerations
        +ResourceRequirements resources
        +int replicas
    }
    class Affinity {
        +NodeAffinity nodeAffinity
        +PodAffinity podAffinity
        +PodAntiAffinity podAntiAffinity
    }
    class Toleration {
        +string key
        +string operator
        +string value
        +string effect
        +int tolerationSeconds
    }
    class ResourceRequirements {
        +object limits
        +object requests
        +ResourceClaim[] claims
    }
    class NodeAffinity
    class PodAffinity
    class PodAntiAffinity
    class ResourceClaim {
        +string name
        +string request
    }
    RekorSearchUI --|> PodRequirements : inlined
    PodRequirements o-- Affinity
    PodRequirements o-- Toleration
    PodRequirements o-- ResourceRequirements
    Affinity o-- NodeAffinity
    Affinity o-- PodAffinity
    Affinity o-- PodAntiAffinity
    ResourceRequirements o-- ResourceClaim
Loading

File-Level Changes

Change Details Files
Extended CRD schemas to include PodRequirements fields
  • Added affinity, tolerations, resources, and replicas definitions to securesigns and rekors CRD YAMLs
config/crd/bases/rhtas.redhat.com_securesigns.yaml
config/crd/bases/rhtas.redhat.com_rekors.yaml
Exposed new fields in the Operator CSV UI
  • Created rekor_descriptors.yaml with descriptors for replicas, resource requirements, and affinities
  • Added patch reference to kustomization.yaml
config/manifests/patches/rekor_descriptors.yaml
config/manifests/kustomization.yaml
Inlined PodRequirements in the API and updated deepcopy logic
  • Embedded PodRequirements struct into RekorSearchUI type
  • Invoked PodRequirements.DeepCopyInto in generated deepcopy
api/v1alpha1/rekor_types.go
api/v1alpha1/zz_generated.deepcopy.go
Updated controller to apply PodRequirements dynamically
  • Imported ensure/deployment package
  • Replaced hardcoded default replicas with deployment.PodRequirements invocation
internal/controller/rekor/actions/ui/deployment.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@red-hat-konflux
Copy link
Contributor

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
operator-v1-0 no kind "ProjectDevelopmentStream" is registered for version "projctl.konflux.dev/v1beta1" in scheme "k8s.io/client-go/kubernetes/scheme/register.go:83"
operator no kind "Project" is registered for version "projctl.konflux.dev/v1beta1" in scheme "k8s.io/client-go/kubernetes/scheme/register.go:83"
operator-template no kind "ProjectDevelopmentStreamTemplate" is registered for version "projctl.konflux.dev/v1beta1" in scheme "k8s.io/client-go/kubernetes/scheme/register.go:83"

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @osmman - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@osmman osmman requested review from JasonPowr and bouskaJ July 17, 2025 09:40
@osmman osmman merged commit 9b96198 into main Jul 18, 2025
27 of 28 checks passed
@osmman osmman deleted the tturek/rekor-pod-requirements branch July 18, 2025 09:11
@osmman osmman added the enhancement New feature or request label Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants