Skip to content

Conversation

@Zenithar
Copy link
Contributor

Context

Patch was initially designed to apply modification on existing packages. I recently added the ability to remove a package via patch (initial purpose of filter) so symmetrically I add the ability to create packages.

This feature will only work with the strict path matcher to use the given path as package name.

Sample

apiVersion: harp.elastic.co/v1
kind: BundlePatch
meta:
  name: "package-creator"
  owner: security@elastic.co
  description: "Create a targeted package"
spec:
  rules:
    - selector:
        matchPath:
          strict: "application/created-package"
      package:
        # Flag to be created if not exists
        create: true

        # On package annotation
        annotations:
            # Update annotation value with new secret
            update:
                secret-service.elstc.co/encryptionKey: |-
                    UcbPlrEJ9jZEQX06n8oMln_mCl3EU2zl2ZVc-obb7Dw=

        # On package data
        data:
            # Update annotations
            annotations:
                # Update annotation value with new secret
                update:
                    secret-service.elstc.co/encryptionKey: |-
                        DrZ-0yEA18iS7A4xaR_pd-relh9KMtTw2q11nBEJykg=
            kv:
                add:
                    "key": "value"

@Zenithar Zenithar self-assigned this Feb 16, 2021
@Zenithar Zenithar added the enhancement New feature or request label Feb 16, 2021
@Zenithar Zenithar merged commit e9156cb into elastic:main Feb 16, 2021
@Zenithar Zenithar deleted the feat_patch_package_creation branch February 16, 2021 17:29
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.

1 participant