Skip to content

Commit

Permalink
Merge branch 'main' into 10k
Browse files Browse the repository at this point in the history
  • Loading branch information
matthyx authored Mar 11, 2024
2 parents 41dee83 + 71986bd commit 948e59a
Show file tree
Hide file tree
Showing 60 changed files with 677 additions and 6,601 deletions.
16 changes: 0 additions & 16 deletions artifacts/configurationscansummaries/01-example.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions artifacts/configurationscansummaries/02-example.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions artifacts/configurationscansummaries/03-example.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions artifacts/configurationscansummaries/04-example.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions artifacts/sbomsummaries/01-example.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions artifacts/vulnerabilitymanifestsummaries/01-example.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/apis/softwarecomposition/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,14 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&SBOMSPDXv2p3FilteredList{},
&VulnerabilityManifest{},
&VulnerabilityManifestList{},
&SBOMSummary{},
&SBOMSummaryList{},
&VulnerabilityManifestSummary{},
&VulnerabilityManifestSummaryList{},
&WorkloadConfigurationScan{},
&WorkloadConfigurationScanList{},
&WorkloadConfigurationScanSummary{},
&WorkloadConfigurationScanSummaryList{},
&ConfigurationScanSummary{},
&ConfigurationScanSummaryList{},
&VulnerabilitySummary{},
&VulnerabilitySummaryList{},
&ApplicationProfile{},
&ApplicationProfileList{},
&ApplicationProfileSummary{},
&ApplicationProfileSummaryList{},
&ApplicationActivity{},
&ApplicationActivityList{},
&NetworkNeighbors{},
Expand Down
117 changes: 2 additions & 115 deletions pkg/apis/softwarecomposition/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ limitations under the License.
package softwarecomposition

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"strings"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -70,36 +71,6 @@ type SBOMSPDXv2p3 struct {
Status SBOMSPDXv2p3Status
}

// SBOMSummarySpec is the spec for the SBOM summary
//
// Since the summary spec is supposed to hold no data, only used as a low
// footprint way to watch for heavy full-sized SBOMs, the spec is supposed to be
// empty on purpose.
type SBOMSummarySpec struct{}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// SBOMSummary is a summary of an SBOM. It is not meant to be changed and only
// works as a lightweight facade for watching proper SBOMs.
type SBOMSummary struct {
metav1.TypeMeta
metav1.ObjectMeta

Spec SBOMSummarySpec
Status SBOMSPDXv2p3Status
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// SBOMSummaryList is a list of SBOM summaries
type SBOMSummaryList struct {
metav1.TypeMeta
metav1.ListMeta

Items []SBOMSummary
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

Expand Down Expand Up @@ -204,63 +175,6 @@ type VulnerabilitiesComponents struct {
WorkloadVulnerabilitiesObj VulnerabilitiesObjScope
}

type VulnerabilityManifestSummarySpec struct {
Severities SeveritySummary
Vulnerabilities VulnerabilitiesComponents
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VulnerabilityManifestSummary is a summary of a VulnerabilityManifest.
type VulnerabilityManifestSummary struct {
metav1.TypeMeta
metav1.ObjectMeta

Spec VulnerabilityManifestSummarySpec
Status VulnerabilityManifestStatus
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VulnerabilityManifestSummaryList is a list of VulnerabilityManifest summaries.
type VulnerabilityManifestSummaryList struct {
metav1.TypeMeta
metav1.ListMeta

Items []VulnerabilityManifestSummary
}

type VulnerabilitySummarySpec struct {
Severities SeveritySummary
WorkloadVulnerabilitiesObj []VulnerabilitiesObjScope
}

type VulnerabilitySummaryStatus struct {
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VulnerabilitySummary is a summary of a vulnerabilities for a given scope.
type VulnerabilitySummary struct {
metav1.TypeMeta
metav1.ObjectMeta

Spec VulnerabilitySummarySpec
Status VulnerabilitySummaryStatus
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VulnerabilitySummaryList is a list of VulnerabilitySummaries.
type VulnerabilitySummaryList struct {
metav1.TypeMeta
metav1.ListMeta

Items []VulnerabilitySummary
}

func (c *VulnerabilityCounters) Add(counters *VulnerabilityCounters) {
c.All += counters.All
c.Relevant += counters.Relevant
Expand All @@ -275,16 +189,6 @@ func (s *SeveritySummary) Add(severities *SeveritySummary) {
s.Unknown.Add(&severities.Unknown)
}

func (v *VulnerabilitySummary) Merge(vulnManifestSumm *VulnerabilityManifestSummary) {
v.Spec.Severities.Add(&vulnManifestSumm.Spec.Severities)
workloadVulnerabilitiesObj := VulnerabilitiesObjScope{
Name: vulnManifestSumm.Name,
Namespace: vulnManifestSumm.Namespace,
Kind: "vulnerabilitymanifestsummary",
}
v.Spec.WorkloadVulnerabilitiesObj = append(v.Spec.WorkloadVulnerabilitiesObj, workloadVulnerabilitiesObj)
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

Expand Down Expand Up @@ -361,23 +265,6 @@ type ApplicationProfileList struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ApplicationProfileSummary struct {
metav1.TypeMeta
metav1.ObjectMeta
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ApplicationProfileSummaryList struct {
metav1.TypeMeta
metav1.ListMeta

Items []ApplicationProfileSummary
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ApplicationActivity struct {
metav1.TypeMeta
metav1.ObjectMeta
Expand Down
Loading

0 comments on commit 948e59a

Please sign in to comment.