mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-03 23:04:53 -04:00
k8supdates: label nodes with k8s component hash
This commit is contained in:
parent
1466c12972
commit
a1161ae05d
30 changed files with 869 additions and 18 deletions
|
@ -90,6 +90,25 @@ func TestInitCluster(t *testing.T) {
|
|||
wantErr: false,
|
||||
k8sVersion: versions.Default,
|
||||
},
|
||||
"kubeadm init fails when annotating itself": {
|
||||
clusterUtil: stubClusterUtil{},
|
||||
kubeconfigReader: &stubKubeconfigReader{
|
||||
kubeconfig: []byte("someKubeconfig"),
|
||||
},
|
||||
kubeAPIWaiter: stubKubeAPIWaiter{},
|
||||
providerMetadata: &stubProviderMetadata{
|
||||
selfResp: metadata.InstanceMetadata{
|
||||
Name: nodeName,
|
||||
ProviderID: providerID,
|
||||
VPCIP: privateIP,
|
||||
AliasIPRanges: []string{aliasIPRange},
|
||||
},
|
||||
getLoadBalancerEndpointResp: loadbalancerIP,
|
||||
},
|
||||
kubectl: stubKubectl{annotateNodeErr: someErr},
|
||||
wantErr: true,
|
||||
k8sVersion: versions.Default,
|
||||
},
|
||||
"kubeadm init fails when retrieving metadata self": {
|
||||
clusterUtil: stubClusterUtil{},
|
||||
kubeconfigReader: &stubKubeconfigReader{
|
||||
|
@ -574,6 +593,7 @@ type stubKubectl struct {
|
|||
addTNodeSelectorsToDeploymentErr error
|
||||
waitForCRDsErr error
|
||||
listAllNamespacesErr error
|
||||
annotateNodeErr error
|
||||
|
||||
listAllNamespacesResp *corev1.NamespaceList
|
||||
}
|
||||
|
@ -594,6 +614,10 @@ func (s *stubKubectl) AddNodeSelectorsToDeployment(ctx context.Context, selector
|
|||
return s.addTNodeSelectorsToDeploymentErr
|
||||
}
|
||||
|
||||
func (s *stubKubectl) AnnotateNode(ctx context.Context, nodeName, annotationKey, annotationValue string) error {
|
||||
return s.annotateNodeErr
|
||||
}
|
||||
|
||||
func (s *stubKubectl) WaitForCRDs(ctx context.Context, crds []string) error {
|
||||
return s.waitForCRDsErr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue