Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Init command #151

Merged
merged 2 commits into from
Sep 15, 2020
Merged

refactor: Init command #151

merged 2 commits into from
Sep 15, 2020

Conversation

danielpacak
Copy link
Contributor

@danielpacak danielpacak commented Sep 11, 2020

The goal here is to review and tidy up what we're doing in the init command and set the stage for implementing scanners config feature:

  • Renamed ServiceAccount to starboard
  • Run all scan Jobs as starboard SA (+ mount API token only if necessary)
  • Rename ConfigMap to starboard and make it generic. Introduce naming convention for keys, i.e. trivy. or polaris. to group configuration parameters by scanner. We'll introduce more config params in the future.
  • Provide YAML descriptors for all objects that we create in the init command. This is to integrate with other tools / frameworks which do not want to or cannot execute starboard init command:
    k apply -f kube/init/starboard-ns.yaml \
      -f kube/init/starboard-sa.yaml \
      -f kube/init/starboard-cm.yaml \
      -f kube/init/starboard-clusterrole.yaml \
      -f kube/init/starboard-clusterrolebinding.yaml
    

Signed-off-by: Daniel Pacak pacak.daniel@gmail.com

Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
@danielpacak danielpacak added this to the Release v0.4.0 milestone Sep 11, 2020
@codecov
Copy link

codecov bot commented Sep 11, 2020

Codecov Report

Merging #151 into master will decrease coverage by 3.41%.
The diff coverage is 49.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #151      +/-   ##
==========================================
- Coverage   39.08%   35.67%   -3.42%     
==========================================
  Files          33       33              
  Lines        1842     1766      -76     
==========================================
- Hits          720      630      -90     
- Misses       1034     1048      +14     
  Partials       88       88              
Impacted Files Coverage Δ
pkg/find/vulnerabilities/trivy/scanner.go 0.00% <0.00%> (ø)
pkg/kubebench/scanner.go 0.00% <0.00%> (ø)
pkg/polaris/scanner.go 0.00% <0.00%> (ø)
pkg/kube/cr_manager.go 55.29% <65.75%> (-15.10%) ⬇️
pkg/kubebench/crd/writer.go 88.23% <100.00%> (-0.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8927d9...c5a2cea. Read the comment docs.

@danielpacak danielpacak requested a review from lizrice September 11, 2020 14:42
Copy link
Contributor

@lizrice lizrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but I think you can delete some of the literals in the code in favour of the new ConfigMap?

pkg/kube/starboard.go Outdated Show resolved Hide resolved
pkg/kubebench/scanner.go Show resolved Hide resolved
pkg/cmd/init_test.go Show resolved Hide resolved
pkg/kube/cr_manager.go Show resolved Hide resolved
pkg/kube/cr_manager.go Show resolved Hide resolved
pkg/kube/cr_manager.go Show resolved Hide resolved
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
@danielpacak danielpacak merged commit 05e4ce5 into master Sep 15, 2020
@danielpacak danielpacak deleted the refactor_init branch September 15, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants