Skip to content

Commit

Permalink
Skip ensuring registry access for the analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
cormacpayne committed Nov 9, 2023
1 parent d7341a1 commit 31d4976
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ func (f *AnalyzerFactory) NewAnalyzer(
}

if f.platformAPI.AtLeast("0.7") {
if err := f.ensureRegistryAccess(additionalTags, cacheImageRef, outputImageRef, runImageRef, previousImageRef); err != nil {
return nil, err
}
// Temporarily skip ensuring registry access for the analyzer
} else {
if err := f.setBuildpacks(analyzer, legacyGroup, legacyGroupPath, logger); err != nil {
return nil, err
Expand Down Expand Up @@ -108,30 +106,6 @@ func (f *AnalyzerFactory) NewAnalyzer(
return analyzer, nil
}

func (f *AnalyzerFactory) ensureRegistryAccess(
additionalTags []string,
cacheImageRef string,
outputImageRef string,
runImageRef string,
previousImageRef string,
) error {
var readImages, writeImages []string
writeImages = append(writeImages, cacheImageRef)
if f.imageHandler.Kind() == image.RemoteKind {
readImages = append(readImages, previousImageRef, runImageRef)
writeImages = append(writeImages, outputImageRef)
writeImages = append(writeImages, additionalTags...)
}

if err := f.registryHandler.EnsureReadAccess(readImages...); err != nil {
return errors.Wrap(err, "validating registry read access")
}
if err := f.registryHandler.EnsureWriteAccess(writeImages...); err != nil {
return errors.Wrap(err, "validating registry write access")
}
return nil
}

func (f *AnalyzerFactory) setBuildpacks(analyzer *Analyzer, group buildpack.Group, path string, logger log.Logger) error {
if len(group.Group) > 0 {
analyzer.Buildpacks = group.Group
Expand Down

0 comments on commit 31d4976

Please sign in to comment.