armometadata

package
v0.0.0-...-e286d75 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ArmoPrefix        string = "armo"
	ArmoUpdate        string = ArmoPrefix + ".last-update"
	ArmoWlid          string = ArmoPrefix + ".wlid"
	ArmoSid           string = ArmoPrefix + ".sid"
	ArmoJobID         string = ArmoPrefix + ".job"
	ArmoJobIDPath     string = ArmoJobID + "/id"
	ArmoJobParentPath string = ArmoJobID + "/parent"
	ArmoJobActionPath string = ArmoJobID + "/action"
)

annotations added to the workload

Variables

View Source
var DefaultConfigPath = "/etc/config/clusterData.json"
View Source
var NamespacesListToIgnore = make([]string, 0)

Functions

func GenerateConfigMapName

func GenerateConfigMapName(w string) string

func IfIgnoreNamespace

func IfIgnoreNamespace(ns string) bool

func IfKubeNamespace

func IfKubeNamespace(ns string) bool

func ParseCalicoSelector

func ParseCalicoSelector(value []byte) map[string]string

Types

type ClusterConfig

type ClusterConfig struct {
	ClusterName           string `json:"clusterName"`         // cluster name defined manually or from the cluster context
	AccountID             string `json:"accountID"`           // use accountID instead of customerGUID
	GatewayWebsocketURL   string `json:"gatewayWebsocketURL"` // in-cluster gateway component websocket url
	GatewayRestURL        string `json:"gatewayRestURL"`      // in-cluster gateway component REST API url
	ShieldvulnURL         string `json:"shieldvulnURL"`       // in-cluster shieldvuln component REST API url
	SeclogicURL           string `json:"seclogicURL"`         // in-cluster seclogic component REST API url
	ContinuousPostureScan bool   `json:"continuousPostureScan"`
	armotypes.InstallationData
}

func LoadConfig

func LoadConfig(configPath string) (*ClusterConfig, error)

LoadConfig load config from file

type ImageInfo

type ImageInfo struct {
	Registry     string `json:"registry"`
	VersionImage string `json:"versionImage"`
}

func ImageTagToImageInfo

func ImageTagToImageInfo(imageTag string) (*ImageInfo, error)

type Metadata

type Metadata struct {
	Annotations       map[string]string
	Labels            map[string]string
	OwnerReferences   map[string]string
	CreationTimestamp string
	ResourceVersion   string
	Kind              string
	ApiVersion        string
	Namespace         string

	// workloads
	PodSpecLabels map[string]string
	// network policies
	NetworkPolicyPodSelectorMatchLabels map[string]string
	HasEgressRules                      *bool
	HasIngressRules                     *bool

	// services
	ServicePodSelectorMatchLabels map[string]string
	// for role bindings
	Subjects []rbac.Subject
	RoleRef  *rbac.RoleRef
}

func ExtractMetadataFromJsonBytes

func ExtractMetadataFromJsonBytes(input []byte) (Metadata, error)

ExtractMetadataFromBytes extracts metadata from the JSON bytes of a Kubernetes object

Jump to

Keyboard shortcuts

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