Skip to content

Commit

Permalink
Merge branch 'master' into fix-git-write-back-override
Browse files Browse the repository at this point in the history
  • Loading branch information
ks-yim committed Jul 8, 2023
2 parents 0c5761f + 972500f commit dedcc92
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 32 deletions.
4 changes: 0 additions & 4 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ bacd
CVE
credref
DEBU
DEBU
dockerhub
eec
fbd
ffb
gitlab
jfrog
JFrog
mep
mypass
myregistry
Expand All @@ -24,7 +22,5 @@ someimage
somerepo
ssw
wildcard
wildcards
wohoo
yyyy
YYYY
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FROM alpine:latest

RUN apk update && \
apk upgrade && \
apk add ca-certificates git openssh-client python3 py3-pip && \
apk add ca-certificates git openssh-client python3 py3-pip tini && \
pip3 install --upgrade pip && \
pip3 install awscli && \
rm -rf /var/cache/apk/*
Expand All @@ -28,4 +28,4 @@ COPY hack/git-ask-pass.sh /usr/local/bin/git-ask-pass.sh

USER 1000

ENTRYPOINT ["/usr/local/bin/argocd-image-updater"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/argocd-image-updater"]
4 changes: 2 additions & 2 deletions docs/basics/authentication.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Authentication in Argo CD Image Updater

There are several scenarios where Argo CD Image Updater needs to authenticate
to external systems in order to fulfil its duties.
to external systems in order to fulfill its duties.

## <a name="auth-kubernetes"></a>Authentication to Kubernetes

Expand Down Expand Up @@ -207,7 +207,7 @@ echo "someuser:s0mep4ssw0rd"

When executing on Kubernetes, the script to be executed must exist in the
Image Updater container's file system. You can either mount the script from
a config map, or use an init container to copy it. Make sure that the script
a configmap, or use an init container to copy it. Make sure that the script
is executable.

For example, if above script would exist at `/usr/local/bin/creds.sh`, it
Expand Down
4 changes: 2 additions & 2 deletions docs/basics/update-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Overview

Argo CD Image Updater supports several methods to propagate new versions of the
images to Argo CD. These methods are also refered to as *write back methods*.
images to Argo CD. These methods are also referred to as *write back methods*.

Currently, the following methods are supported:

Expand Down Expand Up @@ -162,7 +162,7 @@ argocd-image-updater.argoproj.io/git-branch: main

### <a name="method-git-base-commit-branch"></a>Specifying a separate base and commit branch

By default, Argo CD Imager Updater will checkout, commit, and push back to the
By default, Argo CD Image Updater will checkout, commit, and push back to the
same branch specified above. There are many scenarios where this is not
desired or possible, such as when the default branch is protected. You can
add a separate write-branch by modifying `argocd-image-updater.argoproj.io/git-branch`
Expand Down
2 changes: 1 addition & 1 deletion docs/basics/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The workflow of Argo CD Image Updater can be described as follows:
annotation holds a list of image names that should be updated, and is a
mandatory annotation for Argo CD Image Updater to indicate it should
process this `Application`. Read more about the syntax expected in this
annotations's value in the [marking images for update](#TODO)
annotation's value in the [marking images for update](#TODO)
section in this doc.

* For each image found in the list, Argo CD Image Updater will first check
Expand Down
10 changes: 5 additions & 5 deletions docs/configuration/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ You can define the update strategy for each image independently by setting the
following annotation to an appropriate value:

```yaml
argocd-image-updater.argoproj.io/<image_name>.update-strategy: <strategy>
argocd-image-updater.argoproj.io/<image_alias>.update-strategy: <strategy>
```

If no update strategy is given, or an invalid value was used, the default
Expand All @@ -151,7 +151,7 @@ only consider tags that you are generally interested in.
You can define a tag filter by using the following annotation:

```yaml
argocd-image-updater.argoproj.io/<image_name>.allow-tags: <match_func>
argocd-image-updater.argoproj.io/<image_alias>.allow-tags: <match_func>
```

The following match functions are currently available:
Expand All @@ -175,7 +175,7 @@ can define a comma separated list of glob-like patterns using the following
annotation:

```yaml
argocd-image-updater.argoproj.io/<image_name>.ignore-tags: <pattern1>[, <pattern2>, ...]
argocd-image-updater.argoproj.io/<image_alias>.ignore-tags: <pattern1>[, <pattern2>, ...]
```

You can use glob patterns as described in this
Expand All @@ -187,7 +187,7 @@ preventing the image updater to consider any of the tags returned from the
registry:

```yaml
argocd-image-updater.argoproj.io/<image_name>.ignore-tags: "*"
argocd-image-updater.argoproj.io/<image_alias>.ignore-tags: "*"
```

Please note that regular expressions are not supported to be used for patterns.
Expand Down Expand Up @@ -231,7 +231,7 @@ container registry (as described [here](../registries/)), or you can specify
the pull secret to use for a given image using the annotation

```yaml
argocd-image-updater.argoproj.io/<image_name>.pull-secret: <secret_ref>
argocd-image-updater.argoproj.io/<image_alias>.pull-secret: <secret_ref>
```

A configuration for an image will override what is configured for the registry,
Expand Down
2 changes: 1 addition & 1 deletion docs/install/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Only process applications that have a valid annotation and match the given
syntax of `key=value`. For e.g, `custom.label/name=xyz` would be a valid label
that can be supplied through this parameter. Any applications carrying this
exact label will be considered as candidates for image updates. This parameter
currently does not support patten matching on label values (e.g `customer.label/name=*-staging`)
currently does not support pattern matching on label values (e.g `customer.label/name=*-staging`)
and only accepts a single label to match applications against.

**--max-concurrency *number* **
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ spec:
app.kubernetes.io/name: argocd-image-updater
spec:
containers:
- command:
- /usr/local/bin/argocd-image-updater
- args:
- run
image: quay.io/argoprojlabs/argocd-image-updater:latest
imagePullPolicy: Always
Expand Down
10 changes: 0 additions & 10 deletions pkg/argocd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,8 @@ var _ changeWriter = writeOverrides
// writeKustomization writes any changes required for updating one or more images to a kustomization.yml
func writeKustomization(app *v1alpha1.Application, wbc *WriteBackConfig, gitC git.Client) (err error, skip bool) {
logCtx := log.WithContext().AddField("application", app.GetName())
if oldDir, err := os.Getwd(); err != nil {
return err, false
} else {
defer func() {
_ = os.Chdir(oldDir)
}()
}

base := filepath.Join(gitC.Root(), wbc.KustomizeBase)
if err := os.Chdir(base); err != nil {
return err, false
}

logCtx.Infof("updating base %s", base)

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ func SetRegistryEndpointCredentials(prefix, credentials string) error {

// ConfiguredEndpoints returns a list of prefixes that are configured
func ConfiguredEndpoints() []string {
r := []string{}
registryLock.RLock()
defer registryLock.RUnlock()
r := make([]string, 0, len(registries))
for _, v := range registries {
r = append(r, v.RegistryPrefix)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tag/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (il ImageTagList) Add(tag *ImageTag) {

// SortByName returns an array of ImageTag objects, sorted by the tag's name
func (il ImageTagList) SortAlphabetically() SortableImageTagList {
sil := SortableImageTagList{}
sil := make(SortableImageTagList, 0, len(il.items))
for _, v := range il.items {
sil = append(sil, v)
}
Expand All @@ -136,7 +136,7 @@ func (il ImageTagList) SortAlphabetically() SortableImageTagList {

// SortByDate returns a SortableImageTagList, sorted by the tag's date
func (il ImageTagList) SortByDate() SortableImageTagList {
sil := SortableImageTagList{}
sil := make(SortableImageTagList, 0, len(il.items))
for _, v := range il.items {
sil = append(sil, v)
}
Expand Down

0 comments on commit dedcc92

Please sign in to comment.