Skip to content

Commit

Permalink
Revert "Do not emit rpm scripts when target is container"
Browse files Browse the repository at this point in the history
This reverts commit 45a72c7.

This is probably not needed, since most specs destined for a container
will not have systemd scripts anyway.

Signed-off-by: Peter Engelbert <[email protected]>
  • Loading branch information
pmengelbert committed Jun 26, 2024
1 parent 45a72c7 commit a8b04bf
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions frontend/rpm/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
)

const gomodsName = "__gomods"
const containerSuffix = "/container"

var specTmpl = template.Must(template.New("spec").Parse(strings.TrimSpace(`
Summary: {{.Description}}
Expand Down Expand Up @@ -303,10 +302,6 @@ func (w *specWrapper) PreUn() fmt.Stringer {
return b
}

if strings.HasSuffix(w.Target, containerSuffix) {
return b
}

b.WriteString("%preun\n")
keys := dalec.SortMapKeys(w.Spec.Artifacts.Systemd.Units)
for _, servicePath := range keys {
Expand All @@ -328,10 +323,6 @@ func (w *specWrapper) Post() fmt.Stringer {
return b
}

if strings.HasSuffix(w.Target, containerSuffix) {
return b
}

b.WriteString("%post\n")
// TODO: can inject other post install steps here in the future

Expand All @@ -355,10 +346,6 @@ func (w *specWrapper) PostUn() fmt.Stringer {
return b
}

if strings.HasSuffix(w.Target, containerSuffix) {
return b
}

b.WriteString("%postun\n")
keys := dalec.SortMapKeys(w.Spec.Artifacts.Systemd.Units)
for _, servicePath := range keys {
Expand Down

0 comments on commit a8b04bf

Please sign in to comment.