mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 00:05:21 -04:00
cli: allow users to only upgrade measurements
In case only measurements are upgrades a confirmation is required. Alternatively, the `yes` flag can be used.
This commit is contained in:
parent
c21b32d440
commit
bb2b5e1bd1
5 changed files with 128 additions and 73 deletions
|
@ -224,7 +224,7 @@ func TestUpdateMeasurements(t *testing.T) {
|
|||
0: measurements.WithAllBytes(0xAA, measurements.Enforce),
|
||||
},
|
||||
},
|
||||
"trying to set warnOnly to true results in error": {
|
||||
"setting warnOnly to true is allowed": {
|
||||
updater: &stubStableClient{
|
||||
configMaps: map[string]*corev1.ConfigMap{
|
||||
constants.JoinConfigMap: newJoinConfigMap(`{"0":{"expected":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","warnOnly":false}}`),
|
||||
|
@ -233,7 +233,7 @@ func TestUpdateMeasurements(t *testing.T) {
|
|||
newMeasurements: measurements.M{
|
||||
0: measurements.WithAllBytes(0xAA, measurements.WarnOnly),
|
||||
},
|
||||
wantErr: true,
|
||||
wantUpdate: true,
|
||||
},
|
||||
"setting warnOnly to false is allowed": {
|
||||
updater: &stubStableClient{
|
||||
|
@ -271,7 +271,7 @@ func TestUpdateMeasurements(t *testing.T) {
|
|||
log: logger.NewTest(t),
|
||||
}
|
||||
|
||||
err := upgrader.updateMeasurements(context.Background(), tc.newMeasurements)
|
||||
err := upgrader.UpdateMeasurements(context.Background(), tc.newMeasurements)
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue