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

Allow to share/reuse Updatecli manifest using any OCI registry #1605

Merged
merged 65 commits into from
Oct 6, 2023

Conversation

olblak
Copy link
Member

@olblak olblak commented Sep 18, 2023

Fix #1600

TODO

  • Gate this feature behind the experimental flag
  • Show proper title when push/pull registry
  • Move the oras module update to a proper pullrequest

This pullrequest allows to:

  • Push an update policy to an OCI registry
  • Pull an update policy from an OCI registry
  • Apply/Show/Diff update policy from an OCI registry

A policy can be composed of manifest, values, and secrets files
values and secret files can be overridden at runtime similarly the current behavior
when we specify multiple --values or --secrets

I also did a few code cleanup:

  • I took the opportunity to split the engine package to split the main file which became huge to multiple one as it became very hard to read.
  • I updated oras-project/oras-go to 1.2.4. This dependency was needed for go-container-test and several other dependency in the container space like moby or helm. It potentially introduces a breaking change for older version of those dependencies. I had a quick look and it shouldn't affect the code we use. This version bump will also unblock PR like Update Golang module github.com/moby/buildkit #1578

Test

To test this pull request, you can run the following commands:

go build -o bin/updatecli
./bin/updatecli manifest push --config updatecli/updatecli.d/updatecli.yaml -t ghcr.io/olblak/policies/updatecli:latest .
./bin/updatecli manifest pull --disable-tls localhost:5000/myrepo:latest
./bin/updatecli manifest show --disable-tls ghcr.io/olblak/policies/updatecli:latest
./bin/updatecli diff --disable-tls ghcr.io/olblak/policies/updatecli:latest

Additional Information

This feature relies on the docker login to create the credential store, updatecli doesn't provide login mechanism

Secret or Values files specified at command execution will override default values publish on the registry.
Similar to doing updatecli diff --config manifest.yaml --values default.yaml --values override.yaml
File are not merged using deep merged

Tradeoff

Potential improvement

while looking at the cmd package, I realize how none consistent the command and I wonder if

updatecli diff should become updatecli pipeline diff
updatecli apply should become updatecli pipeline apply

or rename

updatecli diff should become updatecli policy diff
updatecli apply should become updatecli policy apply

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
allow to specify multiple config

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the enhancement New feature or request label Sep 18, 2023
@olblak olblak marked this pull request as draft September 18, 2023 19:02
olblak and others added 23 commits September 18, 2023 21:54
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak
Copy link
Member Author

olblak commented Sep 29, 2023

Well the oras library is bumped with the Helm dependency update in #1626

@olblak olblak mentioned this pull request Sep 30, 2023
1 task
@olblak olblak changed the title Allow to share/reuse Updatecli manifest to/from OCI registry Allow to share/reuse Updatecli manifest using any OCI registry Oct 1, 2023
olblak and others added 19 commits October 3, 2023 20:35
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
fix minor displaying issue

Use the correct image tag

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak merged commit f94fda1 into updatecli:main Oct 6, 2023
6 checks passed
@olblak olblak deleted the issue/1600 branch October 6, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow sharing Updatecli configuration using OCI registry such as ghcr.io
1 participant