Documentation ¶
Index ¶
- Constants
- func GenerateNode(name string, isWindows bool, isHealedAnnotationPresent bool, isHealed bool, ...) *apicorev1.Node
- func GenerateNodesLikeInHealedCluster() []*apicorev1.Node
- func GenerateNodesSimilarToInitialNonHealedCluster() []*apicorev1.Node
- func UpdateNodeCondition(node *apicorev1.Node, isReady bool)
- type KubernetesServiceMock
- func (m *KubernetesServiceMock) AddNodeAnnotation(nodeName string, annotationKey string, annotationValue string) error
- func (m *KubernetesServiceMock) CreatePod(pod *apicorev1.Pod) error
- func (m *KubernetesServiceMock) DeletePod(namespace string, name string) error
- func (m *KubernetesServiceMock) GetAllNodes() ([]*apicorev1.Node, error)
- type SnatMetricsRecorderMock
Constants ¶
View Source
const AksLinuxNode1 = "akslinux001"
View Source
const AksLinuxNode2 = "akslinux002"
View Source
const AksLinuxNode3 = "akslinux003"
View Source
const AksWindowsNode1 = "akswin001"
View Source
const AksWindowsNode2 = "akswin002"
View Source
const AksWindowsNode3NeverReady = "akswin003-never-ready"
Variables ¶
This section is empty.
Functions ¶
func GenerateNode ¶
func UpdateNodeCondition ¶
Types ¶
type KubernetesServiceMock ¶
type KubernetesServiceMock struct { services.KubernetesService // This is a fake in-memory representation of the cluster state, which can also be used in tests. This Mock // service will manipulate this state so that the tests can verify more on behaviours and effects, and less by checking // expected method calls. Set this before TestData_Nodes []*apicorev1.Node // TestData_Pods is the current collection of tracked pods created through this mock service. Key is the pod name. // Please do not set this field value yourself. TestData_Pods map[string]*apicorev1.Pod // TestData_DeletedPods is the collection of pod names deleted through this mock service. Key and the value are both the pod name. // Please do not set this field value yourself. TestData_DeletedPods map[string]string // Clock can be used to influence timestamps set in this mock service, which can be helpful to determine when test data was created / updated Clock clock.Clock // Error_CreatePod can be set to make CreatePod always return errors Error_CreatePod error }
func NewKubernetesServiceMock ¶
func NewKubernetesServiceMock(clock clock.Clock) *KubernetesServiceMock
func (*KubernetesServiceMock) AddNodeAnnotation ¶
func (m *KubernetesServiceMock) AddNodeAnnotation(nodeName string, annotationKey string, annotationValue string) error
func (*KubernetesServiceMock) CreatePod ¶
func (m *KubernetesServiceMock) CreatePod(pod *apicorev1.Pod) error
func (*KubernetesServiceMock) DeletePod ¶
func (m *KubernetesServiceMock) DeletePod(namespace string, name string) error
func (*KubernetesServiceMock) GetAllNodes ¶
func (m *KubernetesServiceMock) GetAllNodes() ([]*apicorev1.Node, error)
type SnatMetricsRecorderMock ¶
type SnatMetricsRecorderMock struct { mock.Mock metrics.SnatMetrics }
func (*SnatMetricsRecorderMock) IncHealAttemptsCounter ¶
func (m *SnatMetricsRecorderMock) IncHealAttemptsCounter()
func (*SnatMetricsRecorderMock) IncNumberOfNotReadyNodesSeen ¶
func (m *SnatMetricsRecorderMock) IncNumberOfNotReadyNodesSeen()
Click to show internal directories.
Click to hide internal directories.