kubescape / storage

Apache License 2.0
1 stars 6 forks source link

Kubescape apiserver #1

Closed vladklokun closed 1 year ago

vladklokun commented 1 year ago

What this PR changes?

This PR adds an implementation of a Kubescape-specific Aggregated APIServer that serves SBOMs in the SPDX v2.3 format.

Additional notes for the reviewer

This implementation generates a clientset to use with the default Kubernetes Go client. To use the generated clientset, refer to the example from the official go-client repo.

However, in to import and use the Kubescape’s Aggregated APIServer clienset you would have to import the github.com/kubescape/storage/pkg/generated/clientset/versioned package.

import (
    "k8s.io/client-go/rest"
    metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

    spdxclient "github.com/kubescape/storage/pkg/generated/clientset/versioned`
)

func ExampleSPDX() {
    config, _ := rest.InClusterConfig()
    clientset, _ := spdxclient.NewForConfig(config)
    clientset.SpdxV1beta1().SBOMSPDXv2p3s("SOME_NAMESPACE").List(context.TODO(), metav1.ListOptions{})
    // ...
}