Skip to content

Commit

Permalink
Merge pull request #8455 from deads2k/image-auditor
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Apr 12, 2016
2 parents ced29a2 + 7f6db1f commit ee377dc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cmd/server/bootstrappolicy/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const (
RegistryViewerRoleName = "registry-viewer"
RegistryEditorRoleName = "registry-editor"

ImageAuditorRoleName = "system:image-auditor"
ImagePullerRoleName = "system:image-puller"
ImagePusherRoleName = "system:image-pusher"
ImageBuilderRoleName = "system:image-builder"
Expand Down
13 changes: 13 additions & 0 deletions pkg/cmd/server/bootstrappolicy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/openshift/origin/pkg/api"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
imageapi "github.com/openshift/origin/pkg/image/api"
)

func GetBootstrapOpenshiftRoles(openshiftNamespace string) []authorizationapi.Role {
Expand Down Expand Up @@ -302,6 +303,18 @@ func GetBootstrapClusterRoles() []authorizationapi.ClusterRole {
},
},
},
{
ObjectMeta: kapi.ObjectMeta{
Name: ImageAuditorRoleName,
},
Rules: []authorizationapi.PolicyRule{
{
APIGroups: []string{imageapi.GroupName},
Verbs: sets.NewString("get", "list", "watch", "patch", "update"),
Resources: sets.NewString("images"),
},
},
},
{
ObjectMeta: kapi.ObjectMeta{
Name: ImagePullerRoleName,
Expand Down
17 changes: 17 additions & 0 deletions test/fixtures/bootstrappolicy/bootstrap_cluster_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,23 @@ items:
resources: []
verbs:
- get
- apiVersion: v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: system:image-auditor
rules:
- apiGroups:
- ""
attributeRestrictions: null
resources:
- images
verbs:
- get
- list
- patch
- update
- watch
- apiVersion: v1
kind: ClusterRole
metadata:
Expand Down

0 comments on commit ee377dc

Please sign in to comment.