utils

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap added in v1.1.0

func CopyMap(original map[string]string) map[string]string

func Difference added in v1.1.0

func Difference(a, b []string) (diff []string)

Difference returns a-b, elements present in a and not in b

func GetKeyValSlice added in v1.1.0

func GetKeyValSlice(m map[string]string) (key []string, val []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 SecurityGroupForPods added in v1.1.0

type SecurityGroupForPods struct {
	Client client.Client
	Log    logr.Logger
}

func (*SecurityGroupForPods) GetMatchingSecurityGroupForPods added in v1.1.0

func (s *SecurityGroupForPods) GetMatchingSecurityGroupForPods(pod *corev1.Pod) ([]string, error)

GetMatchingSecurityGroupForPods returns the list of security groups that should be associated with the Pod by matching against all the SecurityGroupPolicy

type SecurityGroupForPodsAPI added in v1.1.0

type SecurityGroupForPodsAPI interface {
	GetMatchingSecurityGroupForPods(pod *corev1.Pod) ([]string, error)
}

func NewSecurityGroupForPodsAPI added in v1.1.0

func NewSecurityGroupForPodsAPI(client client.Client, log logr.Logger) SecurityGroupForPodsAPI

NewSecurityGroupForPodsAPI returns the SecurityGroupForPod APIs for common operations on objects Using Security Group Policy

Jump to

Keyboard shortcuts

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