Skip to content
Merged
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
9 changes: 7 additions & 2 deletions vars/coreos.groovy
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
// Run the passed body in a pod respecting some parameters.
// Available parameters:
// image: string
// privileged: bool
// kvm: bool
// runAsUser: int
// privileged: bool (deprecated, equivalent to `runAsUser: 0`)
def pod(params, body) {
def podJSON = libraryResource 'com/github/coreos/pod.json'
def podObj = readJSON text: podJSON
podObj['spec']['containers'][1]['image'] = params['image']

if (params['privileged']) {
// Backwards compat, see https://github.com/projectatomic/rpm-ostree/pull/1899/commits/9c1709c363e94760f0e9461719b92a7a4aca6c63#r323256575
params['runAsUser'] = 0
}
if (params['runAsUser']) {
// XXX: tmp hack to get anyuid SCC; need to ask to get jenkins SA added
podObj['spec']['serviceAccountName'] = "papr"
podObj['spec']['containers'][1]['securityContext'] = [runAsUser: 0]
podObj['spec']['containers'][1]['securityContext'] = [runAsUser: params['runAsUser']]
}

if (params['kvm']) {
Expand Down