UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

Add basic values translation script, example 1.x defaults

Merged Micah Nagel requested to merge 2-0-translate-script into master
All threads resolved!

General MR

Summary

Provides a basic values translation script for the main key changes for package names. The approach taken is:

  • basic checks to validate the values file provided exists, gnu-sed is present
  • sed replacement of core packages, replacing the first match where the line starts with the old name.
  • sed replacement of addon packages, replacing the first match where the line starts with any number of spaces + the old name.

Other approaches considered:

  • yq usage: yq does not have a great way to change a key. Effectively you need to create a new key (set equal to the old one) then delete the new one. This has weird effects on order in the file, and combined with the way yq strips out extra lines it makes for a messy script that doesn't really work.
  • Some hybrid yq/sed approach: Initially I wanted more "smarts" around editing the specific key, rather than just a regex match of what I think is the key. yq provides a way to get the line number for a key which seemed promising, but because of the way yq strips blank lines this proved to not be effective either.
  • Something else entirely: I considered looking at other available tools/options but given that this was meant to be a simple script that helps in some situations I decided to just settle with the sed approach.

Also adds an example 1.x default core package values file.

Edited by Micah Nagel

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Micah Nagel resolved all threads

    resolved all threads

  • Micah Nagel added 1 commit

    added 1 commit

    • 592b1b93 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Micah Nagel added 1 commit
  • Ryan Garcia approved this merge request

    approved this merge request

  • Works for me on linux in this world of Darwin machines

  • merged

  • Micah Nagel mentioned in commit 3a0435ca

    mentioned in commit 3a0435ca

  • Please register or sign in to reply
    Loading