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

Add update compose command #1643

Merged
merged 8 commits into from
Oct 10, 2023
Merged

Add update compose command #1643

merged 8 commits into from
Oct 10, 2023

Conversation

olblak
Copy link
Member

@olblak olblak commented Sep 30, 2023

Fix #1622
Doc updatecli/website#1173

Requirements:

This pullrquest add the support for a new configuration that allows to "compose" multiple policies.
A compose file looks like

update-compose.yaml
# Policies defines a list policies to enforce when running 
# `updatecli compose apply`
# `updatecli compose diff`
# `updatelci compose show`
#
configs:
  default:
    config:
      - updatecli.d
    values: 
      - values.yaml
    secrets:
      - secrets.yaml

policies: 
  - policy: ghcr.io/olblak/policies/updatecli:latest
  
    # The following policies are just examples and won't work as is
  - policy: ghcr.io/olblak/policies/golang:v2.1.1
  - policy: ghcr.io/olblak/policies/readme:v0.1.3

This file can be used using one of the three following commands

  • updatecli compose diff : similar to updatecli diff but for multiple policies at once
  • updatecli compose apply: similar to updatecli apply but for multiple policies at once
  • updatecli compose show : similar to updatecli show but for multiple policies at once

Test

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

go build -o bin/updatecli
./bin/updatecli compose diff -f update-compose.yaml

Additional Information

Tradeoff

Potential improvement

  • Generating a jsonschema and publish on the jsonschema store

@olblak olblak marked this pull request as draft September 30, 2023 14:37
@olblak
Copy link
Member Author

olblak commented Sep 30, 2023

Remark, in the initial idea, I was considering to use a map for the policies but after additional thoughts I think an array is better

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak marked this pull request as ready for review October 7, 2023 18:13
@olblak olblak added update-compose All things related to update compose enhancement New feature or request labels Oct 7, 2023
@olblak olblak merged commit d300b27 into updatecli:main Oct 10, 2023
6 checks passed
@olblak olblak deleted the issue/1622 branch October 10, 2023 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request update-compose All things related to update compose
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow to compose Updatecli policies
1 participant