-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feature/image state update action #49
Feature/image state update action #49
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #49 +/- ##
==========================================
+ Coverage 73.19% 73.30% +0.11%
==========================================
Files 13 15 +2
Lines 1134 1195 +61
==========================================
+ Hits 830 876 +46
- Misses 262 275 +13
- Partials 42 44 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
688a7e8
to
5c65348
Compare
action: | ||
type: image-update-task | ||
properties: | ||
cmd: [/bin/sh, -c, "echo Image: ${SOURCE_NAME} in namespace: ${SOURCE_NAMESPACE} has been successfully rebased at $(date)"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
But I don't quite get the usage of this image-update-task
job. It seems like in your example, this action will only echo a message in a created job, am I understanding it correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I just added added a simple echo command as an example 😬
The image-update-task
definition is the more important part.
I could update the example if you have any suggestions though.
The intention is to have some sort of action taken when an image is rebased, since the change in the Image resource itself can be triggered by change in another resource like ClusterStack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! In general, the image-update-task
will just use job to handle some tasks. Why not we change the name from image-update-task
to task
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that makes sense. I was so caught up in using it to react to Image resources that I didn't see its actually a generic action. I'll update the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FogDong Updated the file and the definition name. Thanks for the suggestion :)
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
e083f56
to
a6fbe7c
Compare
Description of your changes
Adds
trigger-action
definition and a correspondingTriggerSerivce
example.I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
After applying the
trigger-action
definition and theTriggerService
example, respectively, the TriggerService will monitor all the kpackImage
type resources on the cluster and deploy aJob
as an action when anyImage
is successfully rebased. The Job's pod will log the name and the namespace of the sourceImage
that triggered the action.Special notes for your reviewer
The definition can be applied without any issues but creating the TriggerService would fail if
kpack
is not installed on the cluster.