@@ -115,6 +115,7 @@ func TestOCIChartRepository_Get(t *testing.T) {
115
115
New : helmgetter .NewOCIGetter ,
116
116
},
117
117
}
118
+ testURL := "oci://localhost:5000/my_repo"
118
119
119
120
testCases := []struct {
120
121
name string
@@ -126,43 +127,43 @@ func TestOCIChartRepository_Get(t *testing.T) {
126
127
{
127
128
name : "should return latest stable version" ,
128
129
version : "" ,
129
- url : "oci://localhost:5000/my_repo" ,
130
+ url : testURL ,
130
131
expected : "1.0.0" ,
131
132
},
132
133
{
133
134
name : "should return latest stable version (asterisk)" ,
134
135
version : "*" ,
135
- url : "oci://localhost:5000/my_repo" ,
136
+ url : testURL ,
136
137
expected : "1.0.0" ,
137
138
},
138
139
{
139
140
name : "should return latest stable version (semver range)" ,
140
141
version : ">=0.1.5" ,
141
- url : "oci://localhost:5000/my_repo" ,
142
+ url : testURL ,
142
143
expected : "1.0.0" ,
143
144
},
144
145
{
145
146
name : "should return 0.2.0 (semver range)" ,
146
147
version : "0.2.x" ,
147
- url : "oci://localhost:5000/my_repo" ,
148
+ url : testURL ,
148
149
expected : "0.2.0" ,
149
150
},
150
151
{
151
152
name : "should return a perfect match" ,
152
153
version : "0.1.0" ,
153
- url : "oci://localhost:5000/my_repo" ,
154
+ url : testURL ,
154
155
expected : "0.1.0" ,
155
156
},
156
157
{
157
158
name : "should return 0.10.0" ,
158
159
version : "0.*" ,
159
- url : "oci://localhost:5000/my_repo" ,
160
+ url : testURL ,
160
161
expected : "0.10.0" ,
161
162
},
162
163
{
163
164
name : "should an error for unfunfilled range" ,
164
165
version : ">2.0.0" ,
165
- url : "oci://localhost:5000/my_repo" ,
166
+ url : testURL ,
166
167
expectedErr : "could not locate a version matching provided version string >2.0.0" ,
167
168
},
168
169
{
0 commit comments