Skip to content

Commit 8ef3417

Browse files
authored
Kh add comparator (#38)
* add comparator Signed-off-by: kaizhe <[email protected]> * comparator with result Signed-off-by: kaizhe <[email protected]> * minor fix Signed-off-by: kaizhe <[email protected]> * make changes to build Signed-off-by: kaizhe <[email protected]> * remove unused modules Signed-off-by: kaizhe <[email protected]> * add JSON output Signed-off-by: kaizhe <[email protected]> * minor changes Signed-off-by: kaizhe <[email protected]> * increase version to 1.6.0 Signed-off-by: kaizhe <[email protected]>
1 parent d952209 commit 8ef3417

File tree

16 files changed

+1189
-123
lines changed

16 files changed

+1189
-123
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ VERSION=$(shell cat version)
77
test:
88
@echo "+ $@"
99
./scripts/test
10+
unit-test:
11+
@echo "+ $@"
12+
go test ./...
1013
example:
1114
@echo "+ $@"
1215
./scripts/example

advisor/processor/generate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (p *Processor) GeneratePSP(cssList []types.ContainerSecuritySpec, pssList [
6262
}
6363

6464
// GeneratePSPGrant generates Pod Security Policies, Roles, RoleBindings for service accounts to use PSP
65-
func (p *Processor) GeneratePSPGrant(cssList []types.ContainerSecuritySpec, pssList []types.PodSecuritySpec) ([]types.PSPGrant, string) {
65+
func (p *Processor) GeneratePSPGrant(cssList []types.ContainerSecuritySpec, pssList []types.PodSecuritySpec) (types.PSPGrantList, string) {
6666
saSecuritySpecMap := map[string]*types.SASecuritySpec{}
6767
pspGrantList := []types.PSPGrant{}
6868
grantWarnings := ""
@@ -96,6 +96,8 @@ func (p *Processor) GeneratePSPGrant(cssList []types.ContainerSecuritySpec, pssL
9696
if !s.IsDefaultServiceAccount() {
9797
pspGrant := types.PSPGrant{
9898
Comment: s.GenerateComment(),
99+
ServiceAccount: s.ServiceAccount,
100+
Namespace: s.Namespace,
99101
Role: s.GenerateRole(),
100102
RoleBinding: s.GenerateRoleBinding(),
101103
PodSecurityPolicy: p.gen.GeneratePSPWithName(s.ContainerSecuritySpecList, s.PodSecuritySpecList, s.Namespace, p.serverGitVersion, s.GeneratePSPName()),

advisor/processor/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

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

8-
"k8s.io/api/core/v1"
8+
v1 "k8s.io/api/core/v1"
99
v1meta "k8s.io/apimachinery/pkg/apis/meta/v1"
1010
)
1111

0 commit comments

Comments
 (0)