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

feat(rule): Adding a general tag rule #233

Merged
merged 8 commits into from
Oct 29, 2019

Conversation

jeyrschabu
Copy link
Contributor

@jeyrschabu jeyrschabu commented Jul 23, 2019

  • added ExpiredResourceRule to apply to resources that are tagged with a ttl.
  • rule evaluates if resource has expired.

@aravindmd
Copy link
Contributor

Nice ! , do you think adding a @conditional or something else like a kill switch to safeguard this would make sense ?

Copy link
Contributor

@emjburns emjburns left a comment

Choose a reason for hiding this comment

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

Overall this looks great to me. My one request always is to include more verbose class comments that explain how to use something or give an example (I've added one comment in the specific area on this PR).

For things that are exposed via config, I find it super helpful to have an example in the class comments for when I'm trying to easily understand how to enable a feature. I think this is arguably worse than actual documentation, but it is easy and more likely to get changed as functionality changes 😆

@aravindmd
Copy link
Contributor

aravindmd commented Jul 25, 2019

Overall this looks great to me. My one request always is to include more verbose class comments that explain how to use something or give an example (I've added one comment in the specific area on this PR).

For things that are exposed via config, I find it super helpful to have an example in the class comments for when I'm trying to easily understand how to enable a feature. I think this is arguably worse than actual documentation, but it is easy and more likely to get changed as functionality changes 😆

  • 1 , the comments of test controller are really helpful.

@jeyrschabu
Copy link
Contributor Author

Keeping it simple. BasicRule was a bit over engineered, so removing that for now and keeping the rule to apply when a resource has expired. The expiration time is determined by inspecting the tags on the resource.

- will match defined tag values in config to the ones on the resource
- if matched and calculated age is older than today, the resource is marked
- make tags a distinct object on the resource for convenience
- temporal tags are managed internally
- fix a bug on ttl calculation
- renamed TemporalThresholdRule to ExpiredResourceRule
- Updated to use a clock to determine if resource is expired
- clean up test
@jeyrschabu jeyrschabu added the ready to merge Reviewed and ready for merge label Oct 29, 2019
@mergify mergify bot added the auto merged label Oct 29, 2019
@mergify mergify bot merged commit 70f12bd into spinnaker:master Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged ready to merge Reviewed and ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants