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

Implement automation type and controller, at the local minima #1

Merged
merged 11 commits into from
Jul 23, 2020

Conversation

squaremo
Copy link
Member

This PR introduces the main type for automation, ImageUpdateAutomation, with the easiest usable feature -- update the image ref from a named ImagePolicy.

@squaremo squaremo marked this pull request as ready for review July 23, 2020 15:57
    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.
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.
@squaremo squaremo merged commit a0e26ce into master Jul 23, 2020
hiddeco pushed a commit to hiddeco/image-automation-controller that referenced this pull request Jul 31, 2020
@stefanprodan stefanprodan deleted the automation-type branch June 22, 2021 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant