mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-31 12:04:27 -04:00
join: deprecate components migration fallback (#833)
This commit is contained in:
parent
16b002ec1d
commit
0297aed1ea
11 changed files with 33 additions and 205 deletions
|
@ -23,7 +23,6 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
kubeadmv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
|
||||
)
|
||||
|
||||
|
@ -81,16 +80,6 @@ func TestIssueJoinTicket(t *testing.T) {
|
|||
ca: stubCA{cert: testCert, nodeName: "node"},
|
||||
kubeClient: stubKubeClient{getComponentsVal: components},
|
||||
missingComponentsReferenceFile: true,
|
||||
},
|
||||
"worker node components reference missing and fallback fails": {
|
||||
kubeadm: stubTokenGetter{token: testJoinToken},
|
||||
kms: stubKeyGetter{dataKeys: map[string][]byte{
|
||||
uuid: testKey,
|
||||
attestation.MeasurementSecretContext: measurementSecret,
|
||||
}},
|
||||
ca: stubCA{cert: testCert, nodeName: "node"},
|
||||
kubeClient: stubKubeClient{createConfigMapErr: someErr},
|
||||
missingComponentsReferenceFile: true,
|
||||
wantErr: true,
|
||||
},
|
||||
"kubeclient fails": {
|
||||
|
@ -326,26 +315,15 @@ type stubKubeClient struct {
|
|||
getComponentsVal versions.ComponentVersions
|
||||
getComponentsErr error
|
||||
|
||||
createConfigMapErr error
|
||||
|
||||
addReferenceToK8sVersionConfigMapErr error
|
||||
addNodeToJoiningNodesErr error
|
||||
joiningNodeName string
|
||||
componentsHash string
|
||||
addNodeToJoiningNodesErr error
|
||||
joiningNodeName string
|
||||
componentsHash string
|
||||
}
|
||||
|
||||
func (s *stubKubeClient) GetComponents(ctx context.Context, configMapName string) (versions.ComponentVersions, error) {
|
||||
return s.getComponentsVal, s.getComponentsErr
|
||||
}
|
||||
|
||||
func (s *stubKubeClient) CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap) error {
|
||||
return s.createConfigMapErr
|
||||
}
|
||||
|
||||
func (s *stubKubeClient) AddReferenceToK8sVersionConfigMap(ctx context.Context, k8sVersionsConfigMapName string, componentsConfigMapName string) error {
|
||||
return s.addReferenceToK8sVersionConfigMapErr
|
||||
}
|
||||
|
||||
func (s *stubKubeClient) AddNodeToJoiningNodes(ctx context.Context, nodeName string, componentsHash string, isControlPlane bool) error {
|
||||
s.joiningNodeName = nodeName
|
||||
s.componentsHash = componentsHash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue