k8s

package
v0.0.0-...-488764c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCycloneDXSbom

func CreateCycloneDXSbom(metadata cdx.Metadata, dependencies []cdx.Dependency, components []cdx.Component) *cdx.BOM

func CurrentTimeStamp

func CurrentTimeStamp() string

func WriteOutput

func WriteOutput(clsuter *ClusterBom, bomType string, format string) error

func WritePkgBomOutput

func WritePkgBomOutput(clsuter *BomResult, bomType string, format string) error

Types

type BomResult

type BomResult struct {
	Target   string    `json:"Target"`
	Class    string    `json:"Class,omitempty"`
	Type     string    `json:"Type,omitempty"`
	Packages []Package `json:"Packages,omitempty"`
}

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

func NewCluster

func NewCluster(clientSet *kubernetes.Clientset, clientConfig clientcmd.ClientConfig) *Cluster

func (*Cluster) CollectNodes

func (cluster *Cluster) CollectNodes() []NodeInfo

func (*Cluster) CreateClusterBom

func (bom *Cluster) CreateClusterBom(metadata Metadata, components []Component, Addons []Component, nodeInfo []NodeInfo) *ClusterBom

func (*Cluster) CreateClusterSbom

func (cluster *Cluster) CreateClusterSbom() (*ClusterBom, error)

func (*Cluster) CreateComResult

func (cluster *Cluster) CreateComResult() (*ClusterBom, error)

func (*Cluster) CreatePkgBom

func (cluster *Cluster) CreatePkgBom() (*BomResult, error)

func (*Cluster) GetBaseComponent

func (bom *Cluster) GetBaseComponent(imageRef name.Reference, imageName name.Reference) (Component, error)

func (*Cluster) GetPackages

func (cluster *Cluster) GetPackages(metadata TargetMetadata, components []Component, Addons []Component, nodeInfo []NodeInfo) *BomResult

func (*Cluster) NodeInfoToPkg

func (cluster *Cluster) NodeInfoToPkg(nodesInfo []NodeInfo, version string) []Package

type ClusterBom

type ClusterBom struct {
	Metadata     Metadata     `json:"metadata,omitempty"`
	ControlPlane ControlPlane `json:"control_plane,omitempty"`
	NodesInfo    []NodeInfo   `json:"nodes,omitempty"`
	Addons       []Component  `json:"addons,omitempty"`
}

type Component

type Component struct {
	Type       string `json:"type,omitempty"`
	Name       string `json:"name,omitempty"`
	Version    string `json:"version,omitempty"`
	Repository string `json:"repository,omitempty"`
	Registry   string `json:"registry,omitempty"`
	Digest     string `json:"digest,omitempty"`
}

type ControlPlane

type ControlPlane struct {
	Components []Component `json:"components,omitempty"`
}

type KeyValue

type KeyValue struct {
	Name  string
	Value string
}

type Metadata

type Metadata struct {
	Timestamp string    `json:"timestamp,omitempty"`
	Component Component `json:"component,omitempty"`
	Tools     []Tool    `json:"tools,omitempty"`
}

type NodeInfo

type NodeInfo struct {
	NodeRole                string `json:"node_role,omitempty"`
	NodeName                string `json:"node_name,omitempty"`
	KubeletVersion          string `json:"kubelet_version,omitempty"`
	ContainerRuntimeVersion string `json:"container_runtime_version,omitempty"`
	OsImage                 string `json:"os_image,omitempty"`
	Hostname                string `json:"host_name,omitempty"`
	KernelVersion           string `json:"kernel_version,omitempty"`
	KubeProxyVersion        string `json:"kube_proxy_version,omitempty"`
	OperatingSystem         string `json:"operating_system,omitempty"`
	Architecture            string `json:"architecture,omitempty"`
}

type Package

type Package struct {
	ID         string     `json:",omitempty"`
	Name       string     `json:",omitempty"`
	Version    string     `json:",omitempty"`
	Properties []KeyValue `json:",omitempty"`
	DependsOn  []string   `json:",omitempty"`
	Digest     string     `json:",omitempty"`
}

type TargetMetadata

type TargetMetadata struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

type Tool

type Tool struct {
	Vendor  string `json:"vendor,omitempty"`
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL