Skip to content

Conversation

@Zenithar
Copy link
Contributor

@Zenithar Zenithar commented Feb 6, 2021

Context

Generate a BundlePatch from bundle diff oplog using the flag --patch.

Samples

Symmetry property

Generate a patch from differences between 2 bundles, apply the patch on b1 then check that the patched bundle match b2.

$ harp bundle diff --old b1.bundle --new b2.bundle --patch \
   | harp bundle patch --spec - --in b1.bundle \
   | harp bundle diff --old b2.bundle --new -
[]

Remove package

Generate a patch from a bundle difference set

harp bundle filter --exclude product/ece/v1.0.0/artifact/signature/key --in b1.bundle \
  | harp bundle diff --old b1.bundle --new - --patch > patch.yml
api_version: harp.elastic.co/v1
kind: BundlePatch
meta:
  description: Patch generated from oplog
  name: autogenerated-patch
spec:
  rules:
  - package:
      remove: true
    selector:
      matchPath:
        strict: product/ece/v1.0.0/artifact/signature/key

Apply the patch and view the oplog

$ harp bundle patch --spec patch.yml --in b1.bundle \
  | harp bundle diff --old b1.bundle --new -
[{"op":"remove","type":"package","path":"product/ece/v1.0.0/artifact/signature/key"}]

@Zenithar Zenithar self-assigned this Feb 6, 2021
@Zenithar Zenithar merged commit 78f4360 into elastic:main Feb 6, 2021
@Zenithar Zenithar deleted the feat_bundle_oplog branch February 6, 2021 14:26
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.

1 participant