@@ -36,7 +36,7 @@ func TestNewConfigStore(t *testing.T) {
36
36
37
37
// Setup some config
38
38
cm .Data = map [string ]string {}
39
- cm .Data [taskrunFormatKey ] = "foo "
39
+ cm .Data [taskrunSignerKey ] = "pgp "
40
40
41
41
if cm , err = fakekubeclient .CoreV1 ().ConfigMaps (ns ).Update (ctx , cm , metav1.UpdateOptions {}); err != nil {
42
42
t .Errorf ("error updating configmap: %v" , err )
@@ -45,24 +45,24 @@ func TestNewConfigStore(t *testing.T) {
45
45
// It should be updated by then...
46
46
time .Sleep (100 * time .Millisecond )
47
47
// Test that the values are set!
48
- if diff := cmp .Diff ("foo " , cs .Config ().Artifacts .TaskRuns .Format ); diff != "" {
48
+ if diff := cmp .Diff ("pgp " , cs .Config ().Artifacts .TaskRuns .Signer ); diff != "" {
49
49
t .Error (diff )
50
50
}
51
51
52
52
// Change it again
53
- cm .Data [taskrunFormatKey ] = "bar "
53
+ cm .Data [taskrunSignerKey ] = "kms "
54
54
55
55
if _ , err := fakekubeclient .CoreV1 ().ConfigMaps (ns ).Update (ctx , cm , metav1.UpdateOptions {}); err != nil {
56
56
t .Errorf ("error updating configmap: %v" , err )
57
57
}
58
58
time .Sleep (100 * time .Millisecond )
59
59
// Test that the values are set!
60
- if diff := cmp .Diff ("bar " , cs .Config ().Artifacts .TaskRuns .Format ); diff != "" {
60
+ if diff := cmp .Diff ("kms " , cs .Config ().Artifacts .TaskRuns .Signer ); diff != "" {
61
61
t .Error (diff )
62
62
}
63
63
}
64
64
65
- func Test_parse (t * testing.T ) {
65
+ func TestParse (t * testing.T ) {
66
66
tests := []struct {
67
67
name string
68
68
data map [string ]string
@@ -73,30 +73,51 @@ func Test_parse(t *testing.T) {
73
73
data : map [string ]string {},
74
74
want : Config {
75
75
Artifacts : ArtifactConfigs {
76
- TaskRuns : Artifact {},
76
+ TaskRuns : Artifact {
77
+ Format : "tekton" ,
78
+ StorageBackend : "tekton" ,
79
+ Signer : "x509" ,
80
+ },
81
+ OCI : Artifact {
82
+ Format : "simplesigning" ,
83
+ StorageBackend : "oci" ,
84
+ Signer : "x509" ,
85
+ },
77
86
},
78
87
},
79
88
},
80
89
{
81
90
name : "single" ,
82
- data : map [string ]string {taskrunFormatKey : "foo " },
91
+ data : map [string ]string {taskrunSignerKey : "pgp " },
83
92
want : Config {
84
93
Artifacts : ArtifactConfigs {
85
94
TaskRuns : Artifact {
86
- Format : "foo" ,
87
- StorageBackend : "" ,
95
+ Format : "tekton" ,
96
+ Signer : "pgp" ,
97
+ StorageBackend : "tekton" ,
98
+ },
99
+ OCI : Artifact {
100
+ Format : "simplesigning" ,
101
+ StorageBackend : "oci" ,
102
+ Signer : "x509" ,
88
103
},
89
104
},
90
105
},
91
106
},
92
107
{
93
108
name : "extra" ,
94
- data : map [string ]string {taskrunFormatKey : "foo " , "other-key" : "foo" },
109
+ data : map [string ]string {taskrunSignerKey : "pgp " , "other-key" : "foo" },
95
110
want : Config {
96
111
Artifacts : ArtifactConfigs {
97
112
TaskRuns : Artifact {
98
- Format : "foo" ,
99
- StorageBackend : "" ,
113
+ Format : "tekton" ,
114
+ Signer : "pgp" ,
115
+ StorageBackend : "tekton" ,
116
+ },
117
+ OCI : Artifact {
118
+ Format : "simplesigning" ,
119
+ StorageBackend : "oci" ,
120
+ Signer : "x509" ,
100
121
},
101
122
},
102
123
},
0 commit comments