Skip to content

Commit 605a97d

Browse files
author
OpenShift Bot
committed
Merge pull request #9066 from deads2k/let-builder-make-image-streams
Merged by openshift-bot
2 parents eac6144 + 3973054 commit 605a97d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

pkg/cmd/server/bootstrappolicy/policy.go

+2
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ func GetBootstrapClusterRoles() []authorizationapi.ClusterRole {
372372
Rules: []authorizationapi.PolicyRule{
373373
// push and pull images
374374
authorizationapi.NewRule("get", "update").Groups(imageGroup).Resources("imagestreams/layers").RuleOrDie(),
375+
// allow auto-provisioning when pushing an image that doesn't have an imagestream yet
376+
authorizationapi.NewRule("create").Groups(imageGroup).Resources("imagestreams").RuleOrDie(),
375377
authorizationapi.NewRule("update").Groups(buildGroup).Resources("builds/details").RuleOrDie(),
376378
},
377379
},

test/end-to-end/core.sh

+2
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ os::cmd::try_until_text 'oc get events -n node-selector' 'pod-with-node-name.+No
338338

339339
# Image pruning
340340
echo "[INFO] Validating image pruning"
341+
# builder service account should have the power to create new image streams: prune in this case
342+
os::cmd::expect_success "docker login -u e2e-user -p $(oc sa get-token builder -n cache) -e [email protected] ${DOCKER_REGISTRY}"
341343
os::cmd::expect_success 'docker pull busybox'
342344
os::cmd::expect_success 'docker pull gcr.io/google_containers/pause'
343345
os::cmd::expect_success 'docker pull openshift/hello-openshift'

test/fixtures/bootstrappolicy/bootstrap_cluster_roles.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,13 @@ items:
12211221
verbs:
12221222
- get
12231223
- update
1224+
- apiGroups:
1225+
- ""
1226+
attributeRestrictions: null
1227+
resources:
1228+
- imagestreams
1229+
verbs:
1230+
- create
12241231
- apiGroups:
12251232
- ""
12261233
attributeRestrictions: null

0 commit comments

Comments
 (0)