mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-27 17:25:20 -04:00
cli: remove old migration steps and id-file references (#2440)
* Remove old migration steps and id-file references * Update codeowners file --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
9e1a0c06bf
commit
ab8a17e535
14 changed files with 95 additions and 581 deletions
|
@ -9,8 +9,6 @@ package state
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
|
||||
"github.com/edgelesssys/constellation/v2/internal/config"
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/file"
|
||||
"github.com/spf13/afero"
|
||||
|
@ -328,65 +326,3 @@ func TestMerge(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewFromIDFile(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
idFile clusterid.File
|
||||
cfg *config.Config
|
||||
expected *State
|
||||
}{
|
||||
"success": {
|
||||
idFile: clusterid.File{
|
||||
ClusterID: "test-cluster-id",
|
||||
UID: "test-uid",
|
||||
},
|
||||
cfg: config.Default(),
|
||||
expected: &State{
|
||||
Version: Version1,
|
||||
Infrastructure: Infrastructure{
|
||||
UID: "test-uid",
|
||||
Name: "constell-test-uid",
|
||||
},
|
||||
ClusterValues: ClusterValues{
|
||||
ClusterID: "test-cluster-id",
|
||||
},
|
||||
},
|
||||
},
|
||||
"empty id file": {
|
||||
idFile: clusterid.File{},
|
||||
cfg: config.Default(),
|
||||
expected: &State{Version: Version1, Infrastructure: Infrastructure{Name: "constell-"}},
|
||||
},
|
||||
"nested pointer": {
|
||||
idFile: clusterid.File{
|
||||
ClusterID: "test-cluster-id",
|
||||
UID: "test-uid",
|
||||
AttestationURL: "test-maaUrl",
|
||||
},
|
||||
cfg: config.Default(),
|
||||
expected: &State{
|
||||
Version: Version1,
|
||||
Infrastructure: Infrastructure{
|
||||
UID: "test-uid",
|
||||
Azure: &Azure{
|
||||
AttestationURL: "test-maaUrl",
|
||||
},
|
||||
Name: "constell-test-uid",
|
||||
},
|
||||
ClusterValues: ClusterValues{
|
||||
ClusterID: "test-cluster-id",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
state := NewFromIDFile(tc.idFile, tc.cfg)
|
||||
|
||||
assert.Equal(tc.expected, state)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue