-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add .apko.lock.json to APK control section #802
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,6 +243,14 @@ func (pc *PackageBuild) generateControlSection(ctx context.Context) ([]byte, err | |
return nil, fmt.Errorf("unable to build control FS: %w", err) | ||
} | ||
|
||
locked, err := json.Marshal(pc.Build.resolvedApkoConfig) | ||
if err != nil { | ||
return nil, fmt.Errorf("unable to marshal apko config: %w", err) | ||
} | ||
if err := fsys.WriteFile(".apko.lock.json", locked, 0644); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (i know this is a bike-shed, but...) WDYT about My thinking is that we use |
||
return nil, fmt.Errorf("unable to write .apko.lock.json: %w", err) | ||
} | ||
|
||
if pc.Scriptlets.Trigger.Script != "" { | ||
// #nosec G306 -- scriptlets must be executable | ||
if err := fsys.WriteFile(".trigger", []byte(pc.Scriptlets.Trigger.Script), 0755); err != nil { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine for now, but can I request that we hoist the resolution / locking logic into a shared place so that this and
tf-apko
and anywhere else we do this don't diverge?It'd actually also make a great
apko
sub-comment to produce the resolved config (I know we haveshow-packages
, but I'm thinking something focused around this logic specifically).