Skip to content

Commit

Permalink
Kh add comparator (#38)
Browse files Browse the repository at this point in the history
* add comparator

Signed-off-by: kaizhe <derek0405@gmail.com>

* comparator with result

Signed-off-by: kaizhe <derek0405@gmail.com>

* minor fix

Signed-off-by: kaizhe <derek0405@gmail.com>

* make changes to build

Signed-off-by: kaizhe <derek0405@gmail.com>

* remove unused modules

Signed-off-by: kaizhe <derek0405@gmail.com>

* add JSON output

Signed-off-by: kaizhe <derek0405@gmail.com>

* minor changes

Signed-off-by: kaizhe <derek0405@gmail.com>

* increase version to 1.6.0

Signed-off-by: kaizhe <derek0405@gmail.com>
  • Loading branch information
Kaizhe authored Feb 1, 2020
1 parent d952209 commit 8ef3417
Show file tree
Hide file tree
Showing 16 changed files with 1,189 additions and 123 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ VERSION=$(shell cat version)
test:
@echo "+ $@"
./scripts/test
unit-test:
@echo "+ $@"
go test ./...
example:
@echo "+ $@"
./scripts/example
Expand Down
4 changes: 3 additions & 1 deletion advisor/processor/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (p *Processor) GeneratePSP(cssList []types.ContainerSecuritySpec, pssList [
}

// GeneratePSPGrant generates Pod Security Policies, Roles, RoleBindings for service accounts to use PSP
func (p *Processor) GeneratePSPGrant(cssList []types.ContainerSecuritySpec, pssList []types.PodSecuritySpec) ([]types.PSPGrant, string) {
func (p *Processor) GeneratePSPGrant(cssList []types.ContainerSecuritySpec, pssList []types.PodSecuritySpec) (types.PSPGrantList, string) {
saSecuritySpecMap := map[string]*types.SASecuritySpec{}
pspGrantList := []types.PSPGrant{}
grantWarnings := ""
Expand Down Expand Up @@ -96,6 +96,8 @@ func (p *Processor) GeneratePSPGrant(cssList []types.ContainerSecuritySpec, pssL
if !s.IsDefaultServiceAccount() {
pspGrant := types.PSPGrant{
Comment: s.GenerateComment(),
ServiceAccount: s.ServiceAccount,
Namespace: s.Namespace,
Role: s.GenerateRole(),
RoleBinding: s.GenerateRoleBinding(),
PodSecurityPolicy: p.gen.GeneratePSPWithName(s.ContainerSecuritySpecList, s.PodSecuritySpecList, s.Namespace, p.serverGitVersion, s.GeneratePSPName()),
Expand Down
2 changes: 1 addition & 1 deletion advisor/processor/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/sysdiglabs/kube-psp-advisor/advisor/types"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
v1meta "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
Loading

0 comments on commit 8ef3417

Please sign in to comment.