@@ -89,7 +89,7 @@ func Test_AddRepo_Helm_3_3_2(t *testing.T) {
89
89
kubeContext : "dev" ,
90
90
runner : & mockRunner {},
91
91
}
92
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "cert.pem" , "key.pem" , "" , "" , "" , "" )
92
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "cert.pem" , "key.pem" , "" , "" , "" , "" , "" )
93
93
expected := `Adding repo myRepo https://repo.example.com/
94
94
exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --force-update --cert-file cert.pem --key-file key.pem
95
95
`
@@ -102,7 +102,7 @@ func Test_AddRepo(t *testing.T) {
102
102
var buffer bytes.Buffer
103
103
logger := NewLogger (& buffer , "debug" )
104
104
helm := MockExecer (logger , "dev" )
105
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "cert.pem" , "key.pem" , "" , "" , "" , "" )
105
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "cert.pem" , "key.pem" , "" , "" , "" , "" , "" )
106
106
expected := `Adding repo myRepo https://repo.example.com/
107
107
exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --cert-file cert.pem --key-file key.pem
108
108
`
@@ -111,7 +111,7 @@ exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --cert-f
111
111
}
112
112
113
113
buffer .Reset ()
114
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "ca.crt" , "" , "" , "" , "" , "" , "" )
114
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "ca.crt" , "" , "" , "" , "" , "" , "" , "" )
115
115
expected = `Adding repo myRepo https://repo.example.com/
116
116
exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --ca-file ca.crt
117
117
`
@@ -120,7 +120,7 @@ exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --ca-fil
120
120
}
121
121
122
122
buffer .Reset ()
123
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "" , "" , "" , "" )
123
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "" , "" , "" , "" , "" )
124
124
expected = `Adding repo myRepo https://repo.example.com/
125
125
exec: helm --kube-context dev repo add myRepo https://repo.example.com/
126
126
`
@@ -129,7 +129,7 @@ exec: helm --kube-context dev repo add myRepo https://repo.example.com/
129
129
}
130
130
131
131
buffer .Reset ()
132
- helm .AddRepo ("acrRepo" , "" , "" , "" , "" , "" , "" , "acr" , "" )
132
+ helm .AddRepo ("acrRepo" , "" , "" , "" , "" , "" , "" , "acr" , "" , "" )
133
133
expected = `Adding repo acrRepo (acr)
134
134
exec: az acr helm repo add --name acrRepo
135
135
exec: az acr helm repo add --name acrRepo:
@@ -139,15 +139,15 @@ exec: az acr helm repo add --name acrRepo:
139
139
}
140
140
141
141
buffer .Reset ()
142
- helm .AddRepo ("otherRepo" , "" , "" , "" , "" , "" , "" , "unknown" , "" )
142
+ helm .AddRepo ("otherRepo" , "" , "" , "" , "" , "" , "" , "unknown" , "" , "" )
143
143
expected = `ERROR: unknown type 'unknown' for repository otherRepo
144
144
`
145
145
if buffer .String () != expected {
146
146
t .Errorf ("helmexec.AddRepo()\n actual = %v\n expect = %v" , buffer .String (), expected )
147
147
}
148
148
149
149
buffer .Reset ()
150
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "example_user" , "example_password" , "" , "" )
150
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "example_user" , "example_password" , "" , "" , "" )
151
151
expected = `Adding repo myRepo https://repo.example.com/
152
152
exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --username example_user --password example_password
153
153
`
@@ -156,7 +156,7 @@ exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --userna
156
156
}
157
157
158
158
buffer .Reset ()
159
- helm .AddRepo ("" , "https://repo.example.com/" , "" , "" , "" , "" , "" , "" , "" )
159
+ helm .AddRepo ("" , "https://repo.example.com/" , "" , "" , "" , "" , "" , "" , "" , "" )
160
160
expected = `empty field name
161
161
162
162
`
@@ -165,14 +165,20 @@ exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --userna
165
165
}
166
166
167
167
buffer .Reset ()
168
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "example_user" , "example_password" , "" , "true" )
168
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "example_user" , "example_password" , "" , "true" , "" )
169
169
expected = `Adding repo myRepo https://repo.example.com/
170
170
exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --username example_user --password example_password --pass-credentials
171
171
`
172
172
if buffer .String () != expected {
173
173
t .Errorf ("helmexec.AddRepo()\n actual = %v\n expect = %v" , buffer .String (), expected )
174
174
}
175
175
176
+ buffer .Reset ()
177
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "" , "" , "" , "" , "true" )
178
+ expected = `Adding repo myRepo https://repo.example.com/
179
+ exec: helm --kube-context dev repo add myRepo https://repo.example.com/ --insecure-skip-tls-verify
180
+ `
181
+
176
182
}
177
183
178
184
func Test_UpdateRepo (t * testing.T ) {
@@ -516,7 +522,7 @@ func Test_LogLevels(t *testing.T) {
516
522
buffer .Reset ()
517
523
logger := NewLogger (& buffer , logLevel )
518
524
helm := MockExecer (logger , "" )
519
- helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "example_user" , "example_password" , "" , "" )
525
+ helm .AddRepo ("myRepo" , "https://repo.example.com/" , "" , "" , "" , "example_user" , "example_password" , "" , "" , "" )
520
526
if buffer .String () != expected {
521
527
t .Errorf ("helmexec.AddRepo()\n actual = %v\n expect = %v" , buffer .String (), expected )
522
528
}
0 commit comments