util

package
v0.0.0-...-5fe0a05 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package util implements utility functions and types for language detection feature.

For more information about the language detection and library injection feature, refer to this document.

Index

Constants

View Source
const (
	// KindDeployment represents the deployment resource kind
	KindDeployment = "Deployment"
	// KindReplicaset represents the replicaset resource kind
	KindReplicaset = "ReplicaSet"
)

Variables

View Source
var SupportedBaseOwners = map[string]struct{}{
	KindDeployment: {},
}

SupportedBaseOwners is the set of owner resource types supported by language detection Currently only deployments are supported For KindReplicaset, we use the parent deployment

Functions

func GetGVR

func GetGVR(namespacedOwnerRef *NamespacedOwnerReference) (schema.GroupVersionResource, error)

GetGVR returns the GroupVersionResource of the ownerRef

Types

type NamespacedOwnerReference

type NamespacedOwnerReference struct {
	Name       string
	APIVersion string
	Kind       string
	Namespace  string
}

NamespacedOwnerReference defines an owner reference bound to a namespace

func GetNamespacedBaseOwnerReference

func GetNamespacedBaseOwnerReference(podDetails *pbgo.PodLanguageDetails) NamespacedOwnerReference

GetNamespacedBaseOwnerReference creates a new namespaced owner reference object representing the base owner of the pod In case the first owner's kind is replicaset, it returns an owner reference to the parent deployment of the replicaset

func NewNamespacedOwnerReference

func NewNamespacedOwnerReference(apiVersion string, kind string, name string, namespace string) NamespacedOwnerReference

NewNamespacedOwnerReference returns a new namespaced owner reference

Jump to

Keyboard shortcuts

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