utils

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright 2021 The Hybridnet 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 2021 The Hybridnet 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.

Index

Constants

View Source
const (
	KubeAPIQPS   = 20.0
	KubeAPIBurst = 30
)

Variables

This section is empty.

Functions

func BuildClusterConfig added in v0.3.0

func BuildClusterConfig(rc *networkingv1.RemoteCluster) (*restclient.Config, error)

func CheckStringSliceDifferent added in v0.3.0

func CheckStringSliceDifferent(a, b []string) bool

CheckStringSliceDifferent returns if two string slice contains different item, return true for two string slices are different.

func GenRemoteSubnetName added in v0.3.0

func GenRemoteSubnetName(clusterName string, subnetName string) string

func GenRemoteVtepName added in v0.3.0

func GenRemoteVtepName(clusterName string, nodeName string) string

func GetUUID added in v0.3.0

func GetUUID(client kubernetes.Interface) (types.UID, error)

func GetUUIDFromRemoteCluster added in v0.3.0

func GetUUIDFromRemoteCluster(rc *networkingv1.RemoteCluster) (types.UID, error)

func Intersect added in v0.3.0

func Intersect(rangeA *networkingv1.AddressRange, rangeB *networkingv1.AddressRange) bool

Intersect returns if ip address range of rangeA is overlapped with rangeB.

func LastIP added in v0.3.0

func LastIP(subnet *net.IPNet) net.IP

LastIP Determine the last IP of a subnet, excluding the broadcast if IPv4

func NewRemoteVtep added in v0.3.0

func NewRemoteVtep(clusterName string, uid types.UID, vtepIP string, macAddr string, nodeLocalVxlanIPList string, nodeName string, endpointIPList []string) *networkingv1.RemoteVtep

func NormalizedIP

func NormalizedIP(ip string) string

NormalizedIP If IP is valid, return itself otherwise empty string

func ParseBoolOrDefault

func ParseBoolOrDefault(in string, defaultValue bool) bool

func PickFirstNonEmptyString

func PickFirstNonEmptyString(ss ...string) string

func SelectorClusterName added in v0.3.0

func SelectorClusterName(clusterName string) labels.Selector

func StringSliceToMap

func StringSliceToMap(in []string) (out map[string]struct{})

func StringToIPNet

func StringToIPNet(in string) *net.IPNet

func ToJSONString added in v0.3.0

func ToJSONString(i interface{}) string

Types

type RemoteSubnetName added in v0.3.0

type RemoteSubnetName string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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