You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnimageLayers, errorutils.CheckErrorf("failed to get repository configuration for '%s': %w", originalRepo, err)
160
+
}
161
+
162
+
// If it's not a virtual repository, return all layers unchanged
163
+
ifrepoConfig==nil||repoConfig.Rclass!="virtual" {
164
+
log.Debug("Repository", originalRepo, "is not virtual, proceeding with all layers")
165
+
returnimageLayers, nil
166
+
}
167
+
168
+
// If it's a virtual repository but has no default deployment repo, return all layers
169
+
ifrepoConfig.DefaultDeploymentRepo=="" {
170
+
log.Debug("Virtual repository", originalRepo, "has no default deployment repository, proceeding with all layers")
171
+
returnimageLayers, nil
172
+
}
173
+
174
+
// Filter layers to only include those from the default deployment repository
175
+
varfilteredLayers []utils.ResultItem
176
+
for_, layer:=rangeimageLayers {
177
+
iflayer.Repo==repoConfig.DefaultDeploymentRepo {
178
+
filteredLayers=append(filteredLayers, layer)
179
+
}
180
+
}
181
+
182
+
iflen(filteredLayers) ==0 {
183
+
log.Warn(fmt.Sprintf(`No layers found in default deployment repository '%s' for virtual repository '%s'.
184
+
This may indicate that image layers exist in other repositories but not in the default deployment repository.
185
+
Properties will not be set to maintain consistency with virtual repository configuration.
186
+
To fix this, consider pushing the image directly to the virtual repository to ensure it lands in the default deployment repository.`, repoConfig.DefaultDeploymentRepo, originalRepo))
returnimageLayers, errorutils.CheckErrorf("failed to get repository configuration for virtual repository '%s': %w", originalRepo, err)
198
+
}
199
+
200
+
// If it's a virtual repository but has no default deployment repo, return all layers
201
+
ifrepoConfig.DefaultDeploymentRepo=="" {
202
+
log.Debug("Virtual repository", originalRepo, "has no default deployment repository, proceeding with all layers")
203
+
returnimageLayers, nil
204
+
}
205
+
206
+
// Filter layers to only include those from the default deployment repository
207
+
varfilteredLayers []utils.ResultItem
208
+
for_, layer:=rangeimageLayers {
209
+
iflayer.Repo==repoConfig.DefaultDeploymentRepo {
210
+
filteredLayers=append(filteredLayers, layer)
211
+
}
212
+
}
213
+
214
+
iflen(filteredLayers) ==0 {
215
+
log.Warn(fmt.Sprintf(`No layers found in default deployment repository '%s' for virtual repository '%s'.
216
+
This may indicate that image layers exist in other repositories but not in the default deployment repository.
217
+
Properties will not be set to maintain consistency with virtual repository configuration.
218
+
To fix this, consider pushing the image directly to the virtual repository to ensure it lands in the default deployment repository.`, repoConfig.DefaultDeploymentRepo, originalRepo))
0 commit comments