You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
committed by
GitHub
parent
c0e56d26e0
commit
09cd271415
@@ -6,7 +6,6 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/SAP/jenkins-library/pkg/buildpacks"
|
||||
"github.com/SAP/jenkins-library/pkg/buildsettings"
|
||||
@@ -21,7 +20,6 @@ import (
|
||||
"github.com/SAP/jenkins-library/pkg/log"
|
||||
"github.com/SAP/jenkins-library/pkg/piperutils"
|
||||
"github.com/SAP/jenkins-library/pkg/syft"
|
||||
|
||||
"github.com/SAP/jenkins-library/pkg/telemetry"
|
||||
"github.com/imdario/mergo"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
@@ -585,13 +583,7 @@ func runCnbBuild(config *cnbBuildOptions, telemetry *buildpacks.Telemetry, image
|
||||
}
|
||||
|
||||
creatorArgs = append(creatorArgs, fmt.Sprintf("%s:%s", containerImage, targetImage.ContainerImageTag))
|
||||
attr := &syscall.SysProcAttr{
|
||||
Credential: &syscall.Credential{
|
||||
Uid: uint32(uid),
|
||||
Gid: uint32(gid),
|
||||
NoSetGroups: true,
|
||||
},
|
||||
}
|
||||
attr := getSysProcAttr(uid, gid)
|
||||
|
||||
err = utils.RunExecutableWithAttrs(creatorPath, attr, creatorArgs...)
|
||||
if err != nil {
|
||||
|
17
cmd/cnbBuildAttr.go
Normal file
17
cmd/cnbBuildAttr.go
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build !windows
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func getSysProcAttr(uid int, gid int) *syscall.SysProcAttr {
|
||||
return &syscall.SysProcAttr{
|
||||
Credential: &syscall.Credential{
|
||||
Uid: uint32(uid),
|
||||
Gid: uint32(gid),
|
||||
NoSetGroups: true,
|
||||
},
|
||||
}
|
||||
}
|
11
cmd/cnbBuildAttr_windows.go
Normal file
11
cmd/cnbBuildAttr_windows.go
Normal file
@@ -0,0 +1,11 @@
|
||||
//go:build windows
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func getSysProcAttr(_ int, _ int) *syscall.SysProcAttr {
|
||||
return &syscall.SysProcAttr{}
|
||||
}
|
Reference in New Issue
Block a user