Skip to content

Commit 9424ffa

Browse files
author
Chanwit Kaewkasi
authored
Merge pull request #713 from weaveworks/fix-adding-finalizer-for-deleted-obj
[v0.14] add finalizer to the dep only if object is not being deleted
2 parents b203174 + 87e2dc1 commit 9424ffa

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ COPY utils/ utils/
2828
# Build
2929
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -gcflags=all="-N -l" -a -o tf-controller cmd/manager/main.go
3030

31-
FROM alpine:3.16.5
31+
FROM alpine:3.18
3232

3333
LABEL org.opencontainers.image.source="https://github.com/weaveworks/tf-controller"
3434

35-
RUN apk add --no-cache ca-certificates tini git openssh-client gnupg && \
35+
RUN apk update
36+
37+
RUN apk add --no-cache libcrypto3=3.1.1-r1 && \
38+
apk add --no-cache libssl3=3.1.1-r1 && \
39+
apk add --no-cache ca-certificates tini git openssh-client gnupg && \
3640
apk add --no-cache libretls && \
3741
apk add --no-cache busybox
3842

controllers/tf_controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ func (r *TerraformReconciler) checkDependencies(source sourcev1.Source, terrafor
504504
return fmt.Errorf("unable to get '%s' dependency: %w", dName, err)
505505
}
506506

507-
// add finalizer to the dependency
508-
if !controllerutil.ContainsFinalizer(&tf, dependantFinalizer) {
507+
// add finalizer to the dependency only if object is not being deleted
508+
if tf.ObjectMeta.DeletionTimestamp.IsZero() && !controllerutil.ContainsFinalizer(&tf, dependantFinalizer) {
509509
patch := client.MergeFrom(tf.DeepCopy())
510510
controllerutil.AddFinalizer(&tf, dependantFinalizer)
511511
if err := r.Patch(context.Background(), &tf, patch, client.FieldOwner(r.statusManager)); err != nil {

runner-azure.Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ ARG TF_VERSION=1.3.9
3232
ADD https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_${TARGETARCH}.zip /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip
3333
RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip
3434

35-
FROM alpine:3.16.5
35+
FROM alpine:3.18
3636

3737
LABEL org.opencontainers.image.source="https://github.com/weaveworks/tf-controller"
3838

39-
RUN apk add --no-cache ca-certificates tini git openssh-client gnupg && \
39+
RUN apk update
40+
41+
RUN apk add --no-cache libcrypto3=3.1.1-r1 && \
42+
apk add --no-cache libssl3=3.1.1-r1 && \
43+
apk add --no-cache ca-certificates tini git openssh-client gnupg && \
4044
apk add --no-cache libretls && \
4145
apk add --no-cache busybox
4246

runner.Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ ARG TF_VERSION=1.3.9
3232
ADD https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_${TARGETARCH}.zip /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip
3333
RUN unzip -q /terraform_${TF_VERSION}_linux_${TARGETARCH}.zip
3434

35-
FROM alpine:3.16.5
35+
FROM alpine:3.18
3636

3737
LABEL org.opencontainers.image.source="https://github.com/weaveworks/tf-controller"
3838

39-
RUN apk add --no-cache ca-certificates tini git openssh-client gnupg && \
39+
RUN apk update
40+
41+
RUN apk add --no-cache libcrypto3=3.1.1-r1 && \
42+
apk add --no-cache libssl3=3.1.1-r1 && \
43+
apk add --no-cache ca-certificates tini git openssh-client gnupg && \
4044
apk add --no-cache libretls && \
4145
apk add --no-cache busybox
4246

0 commit comments

Comments
 (0)