util

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

// Copyright 2020 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.

Modifies:

  • Remove imports: "errors", "strconv", "k8s.io/apimachinery/pkg/util/rand", "k8s.io/apimachinery/pkg/util/sets", "k8s.io/kubernetes/pkg/apis/core/v1/helper"
  • Remove consts: "IPv4ZeroCIDR", "IPv6ZeroCIDR"
  • Remove vars: "ErrAddressNotAllowed", "ErrNoAddresses"
  • Remove functions: "isValidEndpoint", "BuildPortsToEndpointsMap", "IsZeroCIDR", "IsProxyableIP", "isProxyableIP", "IsProxyableHostname", "IsLocalIP", "GetNodeAddresses".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterIncorrectCIDRVersion

func FilterIncorrectCIDRVersion(ipStrings []string, isIPv6Mode bool) ([]string, []string)

FilterIncorrectCIDRVersion filters out the incorrect IP version case from a slice of CIDR strings.

func FilterIncorrectIPVersion

func FilterIncorrectIPVersion(ipStrings []string, isIPv6Mode bool) ([]string, []string)

FilterIncorrectIPVersion filters out the incorrect IP version case from a slice of IP strings.

func IPPart

func IPPart(s string) string

IPPart returns just the IP part of an IP or IP:port or endpoint string. If the IP part is an IPv6 address enclosed in brackets (e.g. "[fd00:1::5]:9999"), then the brackets are stripped as well.

func LogAndEmitIncorrectIPVersionEvent

func LogAndEmitIncorrectIPVersionEvent(recorder record.EventRecorder, fieldName, fieldValue, svcNamespace, svcName string, svcUID types.UID)

LogAndEmitIncorrectIPVersionEvent logs and emits incorrect IP version event.

func NeedsHealthCheck

func NeedsHealthCheck(service *v1.Service) bool

NeedsHealthCheck checks if service needs health check.

func PortPart

func PortPart(s string) (int, error)

PortPart returns just the port part of an endpoint string.

func RequestsOnlyLocalTraffic

func RequestsOnlyLocalTraffic(service *v1.Service) bool

RequestsOnlyLocalTraffic checks if service requests OnlyLocal traffic.

func ShouldSkipService

func ShouldSkipService(svcName types.NamespacedName, service *v1.Service) bool

ShouldSkipService checks if a given service should skip proxying

Types

type Resolver

type Resolver interface {
	LookupIPAddr(ctx context.Context, host string) ([]net.IPAddr, error)
}

Resolver is an interface for net.Resolver

Jump to

Keyboard shortcuts

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