utils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamespacedName

func GetNamespacedName(podNamespace string, podName string) string

func Include

func Include(target string, values []string) bool

Include checks if a string existing in a string slice and returns true or false.

func NewRateLimitedClient

func NewRateLimitedClient(qps int, burst int) (*http.Client, error)

NewRateLimitedClient returns a new HTTP client with rate limiter.

func RemoveDuplicatedSg

func RemoveDuplicatedSg(list []string) []string

RemoveDuplicatedSg removes duplicated items from a string slice. It returns a no duplicates string slice.

Types

type K8sCacheHelper

type K8sCacheHelper interface {
	GetPodSecurityGroups(pod *corev1.Pod) ([]string, error)
	GetSecurityGroupsFromPod(podId types.NamespacedName) ([]string, error)
}

func NewK8sCacheHelper

func NewK8sCacheHelper(client client.Client, log logr.Logger) K8sCacheHelper

NewK8sCacheHelper creates and returns a controller-runtime cache operator.

Jump to

Keyboard shortcuts

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