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

🏗 Reconciliation frequency configuration via annotations #358

Open
TylerGillson opened this issue Jul 31, 2024 · 6 comments · Fixed by #422
Open

🏗 Reconciliation frequency configuration via annotations #358

TylerGillson opened this issue Jul 31, 2024 · 6 comments · Fixed by #422
Assignees
Labels

Comments

@TylerGillson
Copy link
Member

TylerGillson commented Jul 31, 2024

Summary

Today, all validator plugin custom resources are re-reconciled every 2m. This value should be configurable.

@TylerGillson TylerGillson added the new-feature Net-new feature label Jul 31, 2024
@dosubot dosubot bot added the enhancement Enhancement to an existing feature label Jul 31, 2024
@TylerGillson TylerGillson added epic and removed enhancement Enhancement to an existing feature new-feature Net-new feature labels Aug 6, 2024
@TylerGillson TylerGillson changed the title ✨ Reconciliation frequency configuration via annotations 🏗 Reconciliation frequency configuration via annotations Aug 6, 2024
@ADorigi
Copy link
Contributor

ADorigi commented Sep 6, 2024

Hi @TylerGillson, I would be willing to work on this issue.

@TylerGillson
Copy link
Member Author

Hey @ADorigi. That would be fantastic! Contributions are very welcome. Let me know if you have any questions about how to get started. This epic requires a PR for all official plugins.

@ADorigi
Copy link
Contributor

ADorigi commented Sep 7, 2024

Thank you @TylerGillson

I will be starting with the validator-plugin-oci plugin and working towards the other plugins.

After addition of the annotation, a simple resource definition of kind OciValidator would look like:

apiVersion: validation.spectrocloud.labs/v1alpha1
kind: OciValidator
metadata:
  name: ocivalidator-sample-public-oci-registries
  namespace: validator
  annotations:
    reconciliation-frequency: "120"
spec:
  ociRegistryRules:
    - name: "public oci registry with tag"
      host: "docker.io"
      validationType: "none" 
      artifacts:
        - ref: "library/redis:7.2.4"

I have taken the following points into consideration:

  • The annotation's key is reconciliation-frequency. Let me know if there should be a specific DNS subdomain as the prefix for the key.
  • The value is in seconds

I will be working towards implementing the above. Please advise if the approach needs to be modified.

@TylerGillson
Copy link
Member Author

Please use validation.validator.labs/reconciliation-frequency for the annotation. It is good practice to prefix annotations with the API group of the associated resource to avoid naming conflicts across the ecosystem. Thanks for verifying that.

Your approach looks good!

@ADorigi
Copy link
Contributor

ADorigi commented Sep 17, 2024

Hello @TylerGillson
I have created a pull request for validator-plugin-oci at validator-labs/validator-plugin-oci#297.

@ADorigi
Copy link
Contributor

ADorigi commented Oct 1, 2024

Hello @TylerGillson
I have created the PR at #422 with the suggested changes. Please have a look.

TylerGillson added a commit that referenced this issue Oct 8, 2024
## Issue
partially resolves
#358

## Description
- A constant was added to define the annotation key
`validation.validator.labs/reconciliation-frequency`.
- Function `FrequencyFromAnnotations` which accepts annotation map and
returns `ctrl.Result`.
- Tests for `FrequencyFromAnnotations` function.

---------

Signed-off-by: Adnan Gulegulzar <[email protected]>
Signed-off-by: Tyler Gillson <[email protected]>
Co-authored-by: Tyler Gillson <[email protected]>
@TylerGillson TylerGillson reopened this Oct 8, 2024
TylerGillson pushed a commit to validator-labs/validator-plugin-oci that referenced this issue Nov 27, 2024
## Issue
Integrates annotation helper function from validator-labs/validator#358

## Description
- annotation for defining reconciliation frequency can now be specified.
- providing the annotation is optional
- example added to `config/samples/`

## Notes
I tested the changes with a kind cluster. I had to remove `-
"--metrics-bind-address=127.0.0.1:8080"` from the manager's arguments in
`config/default/manager_auth_proxy_patch.yaml`. However, I reverted the
change for this PR.

---------

Signed-off-by: Adnan Gulegulzar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants