@@ -67,6 +67,7 @@ type Release struct {
6767 SriovCni * ReleaseImageSpec
6868 SriovIbCni * ReleaseImageSpec
6969 Mofed * ReleaseImageSpec
70+ MofedStig * ReleaseImageSpec
7071 RdmaSharedDevicePlugin * ReleaseImageSpec
7172 SriovDevicePlugin * ReleaseImageSpec
7273 IbKubernetes * ReleaseImageSpec
@@ -185,19 +186,38 @@ func docaDriverTagsCheck(release *Release, docaDriverMatrix *string) {
185186 fmt .Printf ("Error: %v\n " , err )
186187 os .Exit (1 )
187188 }
188- if err := validateTags (config , tags , release .Mofed .Version ); err != nil {
189+ tagsStig , err := listTags (release .MofedStig .Repository , release .MofedStig .Image )
190+ if err != nil {
191+ fmt .Printf ("Error: %v\n " , err )
192+ os .Exit (1 )
193+ }
194+ // validate all non-STIG compliant tags
195+ if err := validateTags (config , tags , release .Mofed .Version , func (os string ) bool {
196+ return ! strings .HasSuffix (os , "-stig" )
197+ }); err != nil {
198+ fmt .Printf ("Error: %v\n " , err )
199+ os .Exit (1 )
200+ }
201+ // validate all STIG compliant tags
202+ if err := validateTags (config , tagsStig , release .MofedStig .Version , func (os string ) bool {
203+ return strings .HasSuffix (os , "-stig" )
204+ }); err != nil {
189205 fmt .Printf ("Error: %v\n " , err )
190206 os .Exit (1 )
191207 }
192208}
193209
194- func validateTags (config DocaDriverMatrix , tags []string , version string ) error {
210+ func validateTags (config DocaDriverMatrix , tags []string , version string ,
211+ shouldValidateOsFunction func (string ) bool ) error {
195212 // Build expected OS-arch combinations
196213 expectedCombinations := make (map [string ]struct {})
197214 for _ , entry := range config .DynamicallyCompiled {
198215 for _ , arch := range entry .Arches {
199- key := fmt .Sprintf ("%s-%s" , entry .OS , arch )
200- expectedCombinations [key ] = struct {}{}
216+ shouldValidateCurrentEntry := shouldValidateOsFunction (entry .OS )
217+ if shouldValidateCurrentEntry {
218+ key := fmt .Sprintf ("%s-%s" , entry .OS , arch )
219+ expectedCombinations [key ] = struct {}{}
220+ }
201221 }
202222 }
203223
0 commit comments