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

1888 - Template Component Fields into Components on Zarf.yaml #1923

Merged
merged 30 commits into from
Aug 2, 2023
Merged

Conversation

cmwylie19
Copy link
Contributor

@cmwylie19 cmwylie19 commented Jul 26, 2023

Description

This PR allows for templating component name during package create and give the ability to template with more fields in the component struct.

While the PR is roughly similar to FindYamlTemplates there is extra complexity in components that required a new function FindComponentTemplatesAndReload. Each component may have a different name that the string map would overwrite. Due to this nature, the straightforward path was a new function to mutate in place, FindComponentTemplatesAndReload. It operates on the ZarfPackage object passed in by interface by iterating over the Components and mutating by updating the templated files. This opens up the possibility to template more fields in components rather than just component names.

Currently there is a place-holder example of Component-Name-Template which will need to be changed before removing draft status from PR.

This PR is in a holding pattern while waiting from feedback from @Racer159

Related Issue

Fixes

Relates to #1888

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
@netlify
Copy link

netlify bot commented Jul 26, 2023

Deploy Preview for zarf-docs ready!

Name Link
🔨 Latest commit fd10125
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/64c9eb0d5166f00008c5f95d
😎 Deploy Preview https://deploy-preview-1923--zarf-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@cmwylie19 cmwylie19 added the needs-tests PR Label - Tests required to merge label Jul 26, 2023
@cmwylie19 cmwylie19 removed the needs-tests PR Label - Tests required to merge label Jul 26, 2023
Signed-off-by: Case Wylie <[email protected]>
@cmwylie19 cmwylie19 marked this pull request as ready for review July 27, 2023 12:36
cmwylie19 added 15 commits July 27, 2023 08:54
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
Signed-off-by: Case Wylie <[email protected]>
src/test/e2e/51_oci_compose_test.go Outdated Show resolved Hide resolved
src/test/packages/51-import-everything/zarf.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@Noxsios Noxsios left a comment

Choose a reason for hiding this comment

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

lgtm

@Noxsios Noxsios enabled auto-merge (squash) August 2, 2023 05:35
@Noxsios Noxsios merged commit aa5f541 into main Aug 2, 2023
@Noxsios Noxsios deleted the 1888 branch August 2, 2023 06:10
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.

2 participants