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

targets: Handle OrigUri and OrigUriApps when adding targets #442

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/foundries.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ type TufCustom struct {
OverridesSha string `json:"meta-subscriber-overrides-sha,omitempty"`
Uri string `json:"uri,omitempty"`
OrigUri string `json:"origUri,omitempty"`
OrigUriApps string `json:"origUriApps,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
LmpVer string `json:"lmp-ver,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions subcommands/targets/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ func createAppTargets(factory string, tags []string, srcTag string, appUris []st
return deriveTargets(factory, nil, srcTag, func(target *client.Target) error {
target.Custom.Tags = tags
target.Custom.ComposeApps = newTargetApps
if target.Custom.OrigUri == "" {
target.Custom.OrigUri = target.Custom.Uri
}
target.Custom.Uri = ""
target.Custom.OrigUriApps = ""
return nil
})
}
Expand Down Expand Up @@ -134,6 +139,11 @@ func createOstreeTarget(factory string, tags []string, srcTag string, hwIdToHash
return deriveTargets(factory, hwIdToHash, srcTag, func(target *client.Target) error {
target.Custom.Tags = tags
err := target.SetHash(hwIdToHash[target.HardwareId()].(string))
if target.Custom.OrigUriApps == "" {
target.Custom.OrigUriApps = target.Custom.Uri
}
target.Custom.Uri = ""
target.Custom.OrigUri = ""
return err
})
}
Expand Down
Loading