Skip to content

Commit f6206c6

Browse files
zioufburnb
authored andcommitted
fix: filter images by image-list annotation
Signed-off-by: Cyril MARIN <marin.cyril@gmail.com> Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
1 parent 7c1a9f7 commit f6206c6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ RUN apk update && \
1717
apk add ca-certificates git openssh-client aws-cli tini && \
1818
rm -rf /var/cache/apk/*
1919

20-
RUN mkdir -p /usr/local/bin
21-
RUN mkdir -p /app/config
20+
RUN mkdir -p /usr/local/bin /app/config
2221
RUN adduser --home "/app" --disabled-password --uid 1000 argocd
2322

2423
COPY --from=builder /src/argocd-image-updater/dist/argocd-image-updater /usr/local/bin/

pkg/argocd/argocd.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,16 @@ func SetKustomizeImage(app *v1alpha1.Application, newImage *image.ContainerImage
481481
return nil
482482
}
483483

484+
// ImageIsAllowed checks whether img is declared in image-list annotation
485+
func ImageIsAllowed(img *image.ContainerImage, list *image.ContainerImageList) bool {
486+
for _, i := range *list {
487+
if i.ImageName == img.ImageName {
488+
return true
489+
}
490+
}
491+
return false
492+
}
493+
484494
// GetImagesFromApplication returns the list of known images for the given application
485495
func GetImagesFromApplication(app *v1alpha1.Application) image.ContainerImageList {
486496
images := make(image.ContainerImageList, 0)

0 commit comments

Comments
 (0)