-
Notifications
You must be signed in to change notification settings - Fork 197
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: Embed vulnerabilityreports CRD #484
Conversation
@@ -12,6 +12,9 @@ spec: | |||
storage: true | |||
schema: | |||
openAPIV3Schema: | |||
description: | | |||
VulnerabilityReport summarizes vulnerabilities in application dependencies and operating system packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to check that kubectl explain vulnerabilityreports
command displays description. We have #409 to document the report schema.
$ kubectl explain vulnerabilityreports
KIND: VulnerabilityReport
VERSION: aquasecurity.github.io/v1alpha1
DESCRIPTION:
VulnerabilityReport summarizes vulnerabilities in application dependencies
and operating system packages built into container images.
FIELDS:
apiVersion <string> -required-
APIVersion defines the versioned schema of this representation of an
object. Servers should convert recognized schemas to the latest internal
value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind <string> -required-
Kind is a string value representing the REST resource this object
represents. Servers may infer this from the endpoint the client submits
requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata <Object> -required-
Standard object's metadata. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
report <Object> -required-
Codecov Report
@@ Coverage Diff @@
## main #484 +/- ##
==========================================
+ Coverage 69.95% 70.10% +0.14%
==========================================
Files 62 62
Lines 3988 3990 +2
==========================================
+ Hits 2790 2797 +7
+ Misses 899 895 -4
+ Partials 299 298 -1
Continue to review full report at Codecov.
|
) | ||
|
||
var ( | ||
//go:embed deploy/crd/vulnerabilityreports.crd.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot use relative path that start with . or ./.., therefore this embedded.go is in the top level starboard package
@@ -17,208 +11,6 @@ const ( | |||
VulnerabilityReportListKind = "VulnerabilityReportList" | |||
) | |||
|
|||
var ( | |||
// TODO Once we migrate to Go 1.16 we can use the embed package to load the CRD from ./deploy/crd/vulnerabilityreports.crd.yaml | |||
VulnerabilityReportsCRD = apiextensionsv1.CustomResourceDefinition{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Go struct literal was a duplicate of deploy/crd/vulnerabilityreports.crd.yaml
0e843c0
to
583ab45
Compare
This change required bumping up Go from v1.15 to v1.16 to take advantage of embed package. Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
583ab45
to
4483ed9
Compare
This change required bumping up Go from v1.15 to v1.16
to take advantage of embed package.
Signed-off-by: Daniel Pacak pacak.daniel@gmail.com