Documentation ¶
Index ¶
- Constants
- Variables
- func CeilDivision(x, y int) int
- func CopyMap(original map[string]string) map[string]string
- func DeconstructIPsFromPrefix(prefix string) ([]string, error)
- func Difference[T comparable](a, b []T) (diff []T)
- func GetKeyValSlice(m map[string]string) (key []string, val []string)
- func GetSourceAcctAndArn(roleARN, region, clusterName string) (string, string, string, error)
- func GetTagKeyValueMap(tagSet []*ec2.Tag) map[string]string
- func IntPower(n, m int) int
- func IsNitroInstance(instanceType string) (bool, error)
- func MaxOf[T constraints.Ordered](vars ...T) T
- func Maximum[T constraints.Ordered](a, b T) T
- func MinOf[T constraints.Ordered](vars ...T) T
- func Minimum[T constraints.Ordered](a, b T) T
- func NewRateLimitedClient(qps int, burst int) (*http.Client, error)
- func PodHasENIRequest(pod *corev1.Pod) bool
- func RemoveDuplicatedSg(list []string) []string
- func SendBroadcastNodeEvent(client k8s.K8sWrapper, reason, msg, eventType string, logger logr.Logger)
- func SendNodeEventWithNodeName(client k8s.K8sWrapper, nodeName, reason, msg, eventType string, ...)
- func SendNodeEventWithNodeObject(client k8s.K8sWrapper, node *v1.Node, reason, msg, eventType string, ...)
- func ShouldRetryOnError(err error) bool
- type SecurityGroupForPods
- type SecurityGroupForPodsAPI
Constants ¶
const ( UnsupportedInstanceTypeReason = "Unsupported" InsufficientCidrBlocksReason = "InsufficientCidrBlocks" CNINodeCreatedReason = "CNINodeCreation" NodeTrunkInitiatedReason = "NodeTrunkInitiated" NodeTrunkFailedInitializationReason = "NodeTrunkFailedInit" EniConfigNameNotFoundReason = "EniConfigNameNotFound" VersionNotice = "ControllerVersionNotice" BranchENICoolDownUpdateReason = "BranchENICoolDownPeriodUpdated" )
const ( PartitionIndex = 1 AccountIndex = 4 )
Variables ¶
var ( ErrNotFound = errors.New("resource was not found") ErrInsufficientCidrBlocks = errors.New("InsufficientCidrBlocks: The specified subnet does not have enough free cidr blocks to satisfy the request") ErrMsgProviderAndPoolNotFound = "cannot find the instance provider and pool from the cache" NotRetryErrors = []string{InsufficientCidrBlocksReason} PauseHealthCheckErrors = []string{"RequestLimitExceeded"} )
Functions ¶
func CeilDivision ¶ added in v1.1.8
CeilDivision returns the ceiling result of numerator x divided by denominator y. y should be non-zero
func DeconstructIPsFromPrefix ¶ added in v1.1.8
DeconstructIPsFromPrefix deconstructs a IPv4 prefix into a list of /32 IPv4 addresses
func Difference ¶ added in v1.1.0
func Difference[T comparable](a, b []T) (diff []T)
Difference returns a-b, elements present in a and not in b
func GetKeyValSlice ¶ added in v1.1.0
func GetSourceAcctAndArn ¶ added in v1.3.1
GetSourceAcctAndArn constructs source acct and arn and return them for use
func GetTagKeyValueMap ¶ added in v1.5.0
func IntPower ¶ added in v1.1.8
IntPower calculates n to the mth power. m should be a non-negative power to have an int return value
func IsNitroInstance ¶ added in v1.1.8
func MaxOf ¶ added in v1.1.5
func MaxOf[T constraints.Ordered](vars ...T) T
func Maximum ¶ added in v1.1.5
func Maximum[T constraints.Ordered](a, b T) T
func MinOf ¶ added in v1.1.5
func MinOf[T constraints.Ordered](vars ...T) T
func Minimum ¶ added in v1.1.5
func Minimum[T constraints.Ordered](a, b T) T
func NewRateLimitedClient ¶
NewRateLimitedClient returns a new HTTP client with rate limiter.
func PodHasENIRequest ¶ added in v1.6.0
PodHasENIRequest will return true if first container of pod spec has request for eni indicating it needs trunk interface from vpc-rc
func RemoveDuplicatedSg ¶
RemoveDuplicatedSg removes duplicated items from a string slice. It returns a no duplicates string slice.
func SendBroadcastNodeEvent ¶ added in v1.3.4
func SendBroadcastNodeEvent(client k8s.K8sWrapper, reason, msg, eventType string, logger logr.Logger)
func SendNodeEventWithNodeName ¶ added in v1.1.8
func SendNodeEventWithNodeName(client k8s.K8sWrapper, nodeName, reason, msg, eventType string, logger logr.Logger)
func SendNodeEventWithNodeObject ¶ added in v1.1.8
func ShouldRetryOnError ¶ added in v1.1.8
ShouldRetryOnError returns true if the error is retryable, else returns false
Types ¶
type SecurityGroupForPods ¶ added in v1.1.0
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