validator-labs / validator

validator monitors ValidationResults created by one or more validator plugins and uploads them to a configurable sink.
https://validator-labs.github.io/docs
Apache License 2.0
17 stars 3 forks source link

🏗 Reconciliation frequency configuration via annotations #358

Open TylerGillson opened 3 months ago

TylerGillson commented 3 months ago

Summary

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

ADorigi commented 2 months ago

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

TylerGillson commented 2 months ago

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 commented 2 months ago

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:

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

TylerGillson commented 2 months ago

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 commented 1 month ago

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

ADorigi commented 1 month ago

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