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

actions/recipe.go: Add custom function map for generating v5 UUID #434

Merged
merged 4 commits into from
Jan 15, 2024

Conversation

venkata-pyla
Copy link
Contributor

Dear Maintainer,

This PR add a custom function in debos recipes for generating v5 UUID values for fielsystem images, this function can be used for the users who are intrestead in reproducible UUID's.

Kindly review the change and provide your feedback.

Thanks
Venkata

Copy link
Member

@sjoerdsimons sjoerdsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good modulo some small comments; Could you also add a test that uses this function? (e.g. in tests/partitioning)

actions/image_partition_action.go Outdated Show resolved Hide resolved
actions/image_partition_action.go Outdated Show resolved Hide resolved
@venkata-pyla venkata-pyla force-pushed the v5-uuid-function branch 3 times, most recently from 895182b to 777804d Compare November 30, 2023 19:12
@venkata-pyla
Copy link
Contributor Author

Hi @sjoerdsimons, i have added your change requested in this PR, could you please check again and provide your feedback.

@obbardc
Copy link
Member

obbardc commented Jan 10, 2024

@venkata-pyla This needs manually rebasing. Otherwise, looks good to me.

venkata-pyla and others added 4 commits January 13, 2024 15:05
This custom function helps user to generate version-5 UUID's with in the
debos itself and use it for preparing reproducible filesystems, this can
also be generated outside the debos but having as function inside the
debos will simplify user recipes for passing reproducible UUID values.

Usage:
  - action: image-partition
    description: "Creating partitions"
    imagename: test.img
    imagesize: 1GiB
    partitiontype: gpt
    ptuuid: {{ $ptuuid }}
    partitions:
      - name: ROOTFS
          fs: ext4
          start: {{ $rootfs_start }}
          end: {{ $rootfs_end }}
          partuuid: {{ uuid5 $rootfs_partuuid $sw_ver }}
          fsuuid: {{ uuid5 $rootfs_fsuuid $sw_ver }}

Signed-off-by: venkata pyla <[email protected]>
Test uuid5 generates same value with given same input and vice-versa

Signed-off-by: venkata pyla <[email protected]>
Setting up the test fixtures takes quite some time, so merge the uuid5
tests into the templating tests. Also simplify it somewhat by just using
`test` rather then diff

Signed-off-by: Sjoerd Simons <[email protected]>
@obbardc obbardc added this pull request to the merge queue Jan 15, 2024
Merged via the queue into go-debos:main with commit d1ce1bf Jan 15, 2024
31 checks passed
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.

3 participants