Skip to content

Commit dedcc92

Browse files
committed
Merge branch 'master' into fix-git-write-back-override
2 parents 0c5761f + 972500f commit dedcc92

File tree

11 files changed

+17
-32
lines changed

11 files changed

+17
-32
lines changed

.github/actions/spelling/expect.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ bacd
55
CVE
66
credref
77
DEBU
8-
DEBU
98
dockerhub
109
eec
1110
fbd
1211
ffb
1312
gitlab
1413
jfrog
15-
JFrog
1614
mep
1715
mypass
1816
myregistry
@@ -24,7 +22,5 @@ someimage
2422
somerepo
2523
ssw
2624
wildcard
27-
wildcards
2825
wohoo
2926
yyyy
30-
YYYY

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FROM alpine:latest
1414

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

2929
USER 1000
3030

31-
ENTRYPOINT ["/usr/local/bin/argocd-image-updater"]
31+
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/argocd-image-updater"]

docs/basics/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Authentication in Argo CD Image Updater
22

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

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

@@ -207,7 +207,7 @@ echo "someuser:s0mep4ssw0rd"
207207

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

213213
For example, if above script would exist at `/usr/local/bin/creds.sh`, it

docs/basics/update-methods.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Overview
44

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

88
Currently, the following methods are supported:
99

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

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

165-
By default, Argo CD Imager Updater will checkout, commit, and push back to the
165+
By default, Argo CD Image Updater will checkout, commit, and push back to the
166166
same branch specified above. There are many scenarios where this is not
167167
desired or possible, such as when the default branch is protected. You can
168168
add a separate write-branch by modifying `argocd-image-updater.argoproj.io/git-branch`

docs/basics/update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The workflow of Argo CD Image Updater can be described as follows:
1818
annotation holds a list of image names that should be updated, and is a
1919
mandatory annotation for Argo CD Image Updater to indicate it should
2020
process this `Application`. Read more about the syntax expected in this
21-
annotations's value in the [marking images for update](#TODO)
21+
annotation's value in the [marking images for update](#TODO)
2222
section in this doc.
2323

2424
* For each image found in the list, Argo CD Image Updater will first check

docs/configuration/images.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ You can define the update strategy for each image independently by setting the
126126
following annotation to an appropriate value:
127127

128128
```yaml
129-
argocd-image-updater.argoproj.io/<image_name>.update-strategy: <strategy>
129+
argocd-image-updater.argoproj.io/<image_alias>.update-strategy: <strategy>
130130
```
131131

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

153153
```yaml
154-
argocd-image-updater.argoproj.io/<image_name>.allow-tags: <match_func>
154+
argocd-image-updater.argoproj.io/<image_alias>.allow-tags: <match_func>
155155
```
156156

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

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

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

189189
```yaml
190-
argocd-image-updater.argoproj.io/<image_name>.ignore-tags: "*"
190+
argocd-image-updater.argoproj.io/<image_alias>.ignore-tags: "*"
191191
```
192192

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

233233
```yaml
234-
argocd-image-updater.argoproj.io/<image_name>.pull-secret: <secret_ref>
234+
argocd-image-updater.argoproj.io/<image_alias>.pull-secret: <secret_ref>
235235
```
236236

237237
A configuration for an image will override what is configured for the registry,

docs/install/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Only process applications that have a valid annotation and match the given
123123
syntax of `key=value`. For e.g, `custom.label/name=xyz` would be a valid label
124124
that can be supplied through this parameter. Any applications carrying this
125125
exact label will be considered as candidates for image updates. This parameter
126-
currently does not support patten matching on label values (e.g `customer.label/name=*-staging`)
126+
currently does not support pattern matching on label values (e.g `customer.label/name=*-staging`)
127127
and only accepts a single label to match applications against.
128128

129129
**--max-concurrency *number* **

manifests/base/deployment/argocd-image-updater-deployment.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ spec:
1818
app.kubernetes.io/name: argocd-image-updater
1919
spec:
2020
containers:
21-
- command:
22-
- /usr/local/bin/argocd-image-updater
21+
- args:
2322
- run
2423
image: quay.io/argoprojlabs/argocd-image-updater:latest
2524
imagePullPolicy: Always

pkg/argocd/git.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,8 @@ var _ changeWriter = writeOverrides
300300
// writeKustomization writes any changes required for updating one or more images to a kustomization.yml
301301
func writeKustomization(app *v1alpha1.Application, wbc *WriteBackConfig, gitC git.Client) (err error, skip bool) {
302302
logCtx := log.WithContext().AddField("application", app.GetName())
303-
if oldDir, err := os.Getwd(); err != nil {
304-
return err, false
305-
} else {
306-
defer func() {
307-
_ = os.Chdir(oldDir)
308-
}()
309-
}
310303

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

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

pkg/registry/endpoints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ func SetRegistryEndpointCredentials(prefix, credentials string) error {
247247

248248
// ConfiguredEndpoints returns a list of prefixes that are configured
249249
func ConfiguredEndpoints() []string {
250-
r := []string{}
251250
registryLock.RLock()
252251
defer registryLock.RUnlock()
252+
r := make([]string, 0, len(registries))
253253
for _, v := range registries {
254254
r = append(r, v.RegistryPrefix)
255255
}

0 commit comments

Comments
 (0)