k8s.io/kubernetes@v1.29.3/pkg/proxy/ipvs/testing/util.go (about) 1 /* 2 Copyright 2017 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package testing 18 19 import ( 20 utilipset "k8s.io/kubernetes/pkg/proxy/ipvs/ipset" 21 ) 22 23 // ExpectedVirtualServer is the expected ipvs rules with VirtualServer and RealServer 24 // VSNum is the expected ipvs virtual server number 25 // IP:Port protocol is the expected ipvs vs info 26 // RS is the RealServer of this expected VirtualServer 27 type ExpectedVirtualServer struct { 28 VSNum int 29 IP string 30 Port uint16 31 Protocol string 32 RS []ExpectedRealServer 33 } 34 35 // ExpectedRealServer is the expected ipvs RealServer 36 type ExpectedRealServer struct { 37 IP string 38 Port uint16 39 } 40 41 // ExpectedIptablesChain is a map of expected iptables chain and jump rules 42 type ExpectedIptablesChain map[string][]ExpectedIptablesRule 43 44 // ExpectedIptablesRule is the expected iptables rules with jump chain and match ipset name 45 type ExpectedIptablesRule struct { 46 SourceAddress string 47 JumpChain string 48 MatchSet string 49 } 50 51 // ExpectedIPSet is the expected ipset with set name and entries name 52 type ExpectedIPSet map[string][]*utilipset.Entry