-
Notifications
You must be signed in to change notification settings - Fork 76
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
Implement automation type and controller, at the local minima #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1d98c55
to
7bdbe7e
Compare
kubebuilder create api --group image --version v1alpha1 \ --kind ImageUpdateAutomation
This adds the field GitRepository in the ImageUpdateAutomation, for referring to the git repository in which to make updates.
220a907
to
884ed25
Compare
This is enough to clone the repo that's referenced in the ImageUpdateAutomation resource. It reproduces a bunch of code from the source-controller which is internal there, to avoid writing it from scratch.
Just to get points on the board, this gives ImageUpdateAutomation an `update` field into which you can plug the name of an ImagePolicy resource (from the image reflector controller). The idea is that the automation will then replace the image in the policy, anywhere it's used, with its latest version.
It's now exported, so I can use that instead of copypesto.
This makes the controller commit changes and push to the origin, when it's run the update. There's some new fields in the ImageUpdateAutomation type for specifying the commit message and author.
- start a test git server (thanks Stefan and Hidde!) - initialise it from a fixture (directory with repo contents) This is the basics to build on.
This adds a test for the controller, checking that it will commit and push a change, with the given commit message. I think checking it made the right change will need a bit of rejigging tests elsewhere, so I can compare directory contents (as with pkg/update tests).
This factors out the function that checks directories for equivalence, and uses it to check that the upstream repo has the expected update when the controller has pushed its commit.
884ed25
to
7c6e87d
Compare
hiddeco
pushed a commit
to hiddeco/image-automation-controller
that referenced
this pull request
Jul 31, 2020
Create LICENSE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the main type for automation,
ImageUpdateAutomation
, with the easiest usable feature -- update the image ref from a namedImagePolicy
.