File tree Expand file tree Collapse file tree 5 files changed +37
-23
lines changed Expand file tree Collapse file tree 5 files changed +37
-23
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,8 @@ End {
237
237
- Version $windowsVersion `
238
238
- ImageName $ImageName `
239
239
- LinuxVersion $linuxVersion `
240
- - BaseRepositry $Repository
240
+ - BaseRepositry $Repository `
241
+ - Strict:$CheckForDuplicateTags.IsPresent
241
242
242
243
$nameForMessage = Split-Path - Leaf - Path $dockerFileName
243
244
$message = " Channel: $nameForMessage does not exist. Not every image exists in every channel. Skipping."
@@ -276,7 +277,9 @@ End {
276
277
- LinuxVersion $linuxVersion `
277
278
- TagData $allMeta.TagData `
278
279
- BaseImage $actualTagData.ActualTags [0 ] `
279
- - BaseRepositry $Repository
280
+ - BaseRepositry $Repository `
281
+ - Strict:$CheckForDuplicateTags.IsPresent
282
+
280
283
281
284
$toBuild += $subImageAllMeta
282
285
}
Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ $repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath
11
11
$modulePath = Join-Path - Path $repoRoot - ChildPath ' tools\getDockerTags'
12
12
Import-Module $modulePath
13
13
14
- Get-DockerTags - ShortTags $shortTags - Image " debian" - FullTagFilter ' stretch-\d{8}[\.\d{1}]?-slim' - AlternativeShortTag ' 9'
14
+ Get-DockerTags - ShortTags $shortTags - Image " debian" - FullTagFilter ' stretch-\d{8}[\.\d{1}]?-slim' - AlternativeShortTag ' 9' - SkipShortTagFilter
Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ $repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath
11
11
$modulePath = Join-Path - Path $repoRoot - ChildPath ' tools\getDockerTags'
12
12
Import-Module $modulePath
13
13
14
- Get-DockerTags - ShortTags $shortTags - Image " debian" - FullTagFilter ' stretch-\d{8}[\.\d{1}]?-slim' - AlternativeShortTag ' 9'
14
+ Get-DockerTags - ShortTags $shortTags - Image " debian" - FullTagFilter ' stretch-\d{8}[\.\d{1}]?-slim' - AlternativeShortTag ' 9' - SkipShortTagFilter
Original file line number Diff line number Diff line change @@ -370,7 +370,10 @@ function Get-DockerImageMetaDataWrapper
370
370
$BaseImage ,
371
371
372
372
[string ]
373
- $BaseRepositry
373
+ $BaseRepositry ,
374
+
375
+ [switch ]
376
+ $Strict
374
377
)
375
378
376
379
$imagePath = Join-Path - Path $ChannelPath - ChildPath $dockerFileName
@@ -405,6 +408,12 @@ function Get-DockerImageMetaDataWrapper
405
408
{
406
409
# Get the tag data for the image
407
410
$tagDataFromScript = @ (& $scriptPath - CI:$CI.IsPresent @getTagsExtraParams | Where-Object {$_.FromTag })
411
+ Write-Verbose " tdfs count:$ ( $tagDataFromScript.count ) -$ ( $Strict.IsPresent ) "
412
+ if ($tagDataFromScript.count -eq 0 -and $Strict.IsPresent )
413
+ {
414
+ throw " Did not get tag data from script for $scriptPath !"
415
+ }
416
+
408
417
if ($TagFilter )
409
418
{
410
419
$tagDataFromScript = @ ($tagDataFromScript | Where-Object { $_.FromTag -match $TagFilter })
@@ -597,7 +606,6 @@ function Get-TestParams
597
606
}
598
607
}
599
608
600
- Write-Verbose " ac: $actualChannel " - Verbose
601
609
$testArgs = @ {
602
610
tags = $actualTagData.ActualTags
603
611
BuildArgs = $buildArgs
Original file line number Diff line number Diff line change @@ -114,30 +114,33 @@ function Get-DockerTags
114
114
Sort-Object - Descending |
115
115
Select-Object - First 1
116
116
117
- # Return the short form of the tag
118
- $results += [UpstreamDockerTagData ] @ {
119
- Type = ' Short'
120
- Tag = $shortTag
121
- FromTag = $fullTag
122
- }
123
-
124
- if ($AlternativeShortTag )
117
+ if ($fullTag )
125
118
{
126
119
# Return the short form of the tag
127
120
$results += [UpstreamDockerTagData ] @ {
128
121
Type = ' Short'
129
- Tag = $AlternativeShortTag
122
+ Tag = $shortTag
130
123
FromTag = $fullTag
131
124
}
132
- }
133
125
134
- if (! $OnlyShortTags.IsPresent )
135
- {
136
- # Return the full form of the tag
137
- $results += [UpstreamDockerTagData ] @ {
138
- Type = ' Full'
139
- Tag = $fullTag
140
- FromTag = $fullTag
126
+ if ($AlternativeShortTag )
127
+ {
128
+ # Return the short form of the tag
129
+ $results += [UpstreamDockerTagData ] @ {
130
+ Type = ' Short'
131
+ Tag = $AlternativeShortTag
132
+ FromTag = $fullTag
133
+ }
134
+ }
135
+
136
+ if (! $OnlyShortTags.IsPresent )
137
+ {
138
+ # Return the full form of the tag
139
+ $results += [UpstreamDockerTagData ] @ {
140
+ Type = ' Full'
141
+ Tag = $fullTag
142
+ FromTag = $fullTag
143
+ }
141
144
}
142
145
}
143
146
}
You can’t perform that action at this time.
0 commit comments