cloudmap

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package cloudmap is a generated GoMock package.

Package cloudmap is a generated GoMock package.

Index

Constants

View Source
const (
	// AttrAWSInstanceIPV4 is a special attribute expected by CloudMap.
	// See https://github.com/aws/aws-sdk-go/blob/fd304fe4cb2ea1027e7fc7e21062beb768915fcc/service/servicediscovery/api.go#L5161
	AttrAWSInstanceIPV4 = "AWS_INSTANCE_IPV4"

	// AttrAWSInstanceIPV6 is a special attribute expected by CloudMap.
	// See https://github.com/aws/aws-sdk-go/blob/fd304fe4cb2ea1027e7fc7e21062beb768915fcc/service/servicediscovery/api.go#L5170
	AttrAWSInstanceIPV6 = "AWS_INSTANCE_IPV6"

	// AttrAWSInstancePort is a special attribute expected by CloudMap.
	// See https://github.com/aws/aws-sdk-go/blob/fd304fe4cb2ea1027e7fc7e21062beb768915fcc/service/servicediscovery/api.go#L5161
	AttrAWSInstancePort = "AWS_INSTANCE_PORT"

	// AttrK8sPod is a custom attribute injected by app-mesh controller
	AttrK8sPod = "k8s.io/pod"
	// AttrK8sNamespace is a custom attribute injected by app-mesh controller
	AttrK8sNamespace = "k8s.io/namespace"
	// AttrK8sPodRegion is a custom attribute injected by app-mesh controller
	AttrK8sPodRegion = "REGION"
	// AttrK8sPodAZ is a custom attribute injected by app-mesh controller
	AttrK8sPodAZ = "AVAILABILITY_ZONE"

	AttrAppMeshMesh        = "appmesh.k8s.aws/mesh"
	AttrAppMeshVirtualNode = "appmesh.k8s.aws/virtualNode"

	IPv6 = "ipv6"
	IPv4 = "ipv4"
)

Variables

This section is empty.

Functions

func ArePodContainersReady

func ArePodContainersReady(pod *corev1.Pod) bool

func NewDefaultInstancesReconciler

func NewDefaultInstancesReconciler(k8sClient client.Client, cloudMapSDK services.CloudMap, log logr.Logger, stopChan <-chan struct{}, ipFamily string) *defaultInstancesReconciler

func NewDefaultVirtualNodeEndpointResolver

func NewDefaultVirtualNodeEndpointResolver(podsRepository k8s.PodsRepository, log logr.Logger) *defaultVirtualNodeEndpointResolver

func NewEnqueueRequestsForPodEvents

func NewEnqueueRequestsForPodEvents(k8sClient client.Client, log logr.Logger) *enqueueRequestsForPodEvents

func ReadyStatusChanged added in v1.5.1

func ReadyStatusChanged(pod1 *corev1.Pod, pod2 *corev1.Pod) bool

func ShouldPodBeInEndpoints

func ShouldPodBeInEndpoints(pod *corev1.Pod) bool

Types

type Config added in v1.1.1

type Config struct {
	//Specifies the DNS TTL value to be used while creating CloudMap services.
	CloudMapServiceTTL int64
}

func (*Config) BindEnv added in v1.1.1

func (cfg *Config) BindEnv() error

func (*Config) BindFlags added in v1.1.1

func (cfg *Config) BindFlags(fs *pflag.FlagSet)

func (*Config) Validate added in v1.1.1

func (cfg *Config) Validate() error

type InstancesReconciler

type InstancesReconciler interface {
	Reconcile(ctx context.Context, ms *appmesh.Mesh, vn *appmesh.VirtualNode, service serviceSummary,
		readyPods []*corev1.Pod, notReadyPods []*corev1.Pod, nodeInfoByName map[string]nodeAttributes) error
}

type MockInstancesReconciler added in v1.5.1

type MockInstancesReconciler struct {
	// contains filtered or unexported fields
}

MockInstancesReconciler is a mock of InstancesReconciler interface.

func NewMockInstancesReconciler added in v1.5.1

func NewMockInstancesReconciler(ctrl *gomock.Controller) *MockInstancesReconciler

NewMockInstancesReconciler creates a new mock instance.

func (*MockInstancesReconciler) EXPECT added in v1.5.1

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInstancesReconciler) Reconcile added in v1.5.1

func (m *MockInstancesReconciler) Reconcile(ctx context.Context, ms *v1beta2.Mesh, vn *v1beta2.VirtualNode, service serviceSummary, readyPods, notReadyPods []*v1.Pod, nodeInfoByName map[string]nodeAttributes) error

Reconcile mocks base method.

type MockInstancesReconcilerMockRecorder added in v1.5.1

type MockInstancesReconcilerMockRecorder struct {
	// contains filtered or unexported fields
}

MockInstancesReconcilerMockRecorder is the mock recorder for MockInstancesReconciler.

func (*MockInstancesReconcilerMockRecorder) Reconcile added in v1.5.1

func (mr *MockInstancesReconcilerMockRecorder) Reconcile(ctx, ms, vn, service, readyPods, notReadyPods, nodeInfoByName interface{}) *gomock.Call

Reconcile indicates an expected call of Reconcile.

type MockVirtualNodeEndpointResolver added in v1.5.1

type MockVirtualNodeEndpointResolver struct {
	// contains filtered or unexported fields
}

MockVirtualNodeEndpointResolver is a mock of VirtualNodeEndpointResolver interface.

func NewMockVirtualNodeEndpointResolver added in v1.5.1

func NewMockVirtualNodeEndpointResolver(ctrl *gomock.Controller) *MockVirtualNodeEndpointResolver

NewMockVirtualNodeEndpointResolver creates a new mock instance.

func (*MockVirtualNodeEndpointResolver) EXPECT added in v1.5.1

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockVirtualNodeEndpointResolver) Resolve added in v1.5.1

Resolve mocks base method.

type MockVirtualNodeEndpointResolverMockRecorder added in v1.5.1

type MockVirtualNodeEndpointResolverMockRecorder struct {
	// contains filtered or unexported fields
}

MockVirtualNodeEndpointResolverMockRecorder is the mock recorder for MockVirtualNodeEndpointResolver.

func (*MockVirtualNodeEndpointResolverMockRecorder) Resolve added in v1.5.1

func (mr *MockVirtualNodeEndpointResolverMockRecorder) Resolve(ctx, vn interface{}) *gomock.Call

Resolve indicates an expected call of Resolve.

type ResourceManager

type ResourceManager interface {
	// Reconcile will create/update AppMesh CloudMap Resources
	Reconcile(ctx context.Context, vn *appmesh.VirtualNode) error

	// Cleanup will delete AppMesh CloudMap resources created for VirtualNode.
	Cleanup(ctx context.Context, vn *appmesh.VirtualNode) error
}

func NewDefaultResourceManager

func NewDefaultResourceManager(
	k8sClient client.Client,
	cloudMapSDK services.CloudMap,
	referencesResolver references.Resolver,
	virtualNodeEndpointResolver VirtualNodeEndpointResolver,
	instancesReconciler InstancesReconciler,
	enableCustomHealthCheck bool,
	log logr.Logger,
	cfg Config,
	ipFamily string) ResourceManager

type VirtualNodeEndpointResolver

type VirtualNodeEndpointResolver interface {
	Resolve(ctx context.Context, vn *appmesh.VirtualNode) ([]*corev1.Pod, []*corev1.Pod, []*corev1.Pod, error)
}

Jump to

Keyboard shortcuts

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