istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/test/framework/components/istio/ingress/interface.go (about)

     1  // Copyright Istio Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package ingress
    16  
    17  import (
    18  	"net/netip"
    19  
    20  	"istio.io/istio/pkg/test/framework/components/cluster"
    21  	"istio.io/istio/pkg/test/framework/components/echo"
    22  )
    23  
    24  type Instances []Instance
    25  
    26  func (i Instances) Callers() echo.Callers {
    27  	var out echo.Callers
    28  	for _, instance := range i {
    29  		out = append(out, instance)
    30  	}
    31  	return out
    32  }
    33  
    34  // Instance represents a deployed Ingress Gateway instance.
    35  type Instance interface {
    36  	echo.Caller
    37  	// HTTPAddresses returns the external HTTP (80) address of the ingress gateway ((or the NodePort address,
    38  	// when in an environment that doesn't support LoadBalancer).
    39  	HTTPAddresses() ([]string, []int)
    40  	// HTTPSAddresses returns the external HTTPS (443) address of the ingress gateway (or the NodePort address,
    41  	// when in an environment that doesn't support LoadBalancer).
    42  	HTTPSAddresses() ([]string, []int)
    43  	// TCPAddresses returns the external TCP (31400) address of the ingress gateway (or the NodePort address,
    44  	// when in an environment that doesn't support LoadBalancer).
    45  	TCPAddresses() ([]string, []int)
    46  	// DiscoveryAddresses returns the external XDS (15012) address on the ingress gateway (or the NodePort address,
    47  	// when in an environment that doesn't support LoadBalancer).
    48  	DiscoveryAddresses() []netip.AddrPort
    49  	// AddressesForPort returns the external address of the ingress gateway (or the NodePort address,
    50  	// when in an environment that doesn't support LoadBalancer) for the given port.
    51  	AddressesForPort(port int) ([]string, []int)
    52  
    53  	// PodID returns the name of the ingress gateway pod of index i. Returns error if failed to get the pod
    54  	// or the index is out of boundary.
    55  	PodID(i int) (string, error)
    56  
    57  	// Cluster the ingress is deployed to
    58  	Cluster() cluster.Cluster
    59  
    60  	// Namespace of the ingress
    61  	Namespace() string
    62  }