Skip to content

Commit 0c92c8f

Browse files
committed
fix Allow drift detection for new objects in drift-detection mode flux-iac#1370
1 parent 6e54e9e commit 0c92c8f

File tree

78 files changed

+15678
-16822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+15678
-16822
lines changed

.github/dependabot.yaml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,30 @@ version: 2
22

33
updates:
44
- package-ecosystem: "gomod"
5-
directories:
6-
- "/"
7-
- "/api"
8-
- "/tfctl"
5+
directory: "/"
96
labels: ["area/ci", "dependencies"]
107
schedule:
118
interval: "weekly"
9+
# Project maintainers and the Wild Watermelon team
10+
reviewers:
11+
- "weaveworks/wild-watermelon"
12+
# Only do security updates not version updates.
13+
open-pull-requests-limit: 0
1214
groups:
13-
go-patch:
14-
update-types:
15-
- "patch"
16-
go-minor:
17-
update-types:
18-
- "minor"
19-
go-major:
20-
update-types:
21-
- "major"
15+
# Group all updates together, so that they are all applied in a single PR.
16+
# Grouped updates are currently in beta and is subject to change.
17+
# xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
18+
ci:
19+
patterns:
20+
- "*"
21+
2222

23+
# maintain dependencies for github actions
2324
- package-ecosystem: "github-actions"
2425
directory: "/"
2526
schedule:
2627
interval: "weekly"
27-
groups:
28-
gh-patch:
29-
update-types:
30-
- "patch"
31-
gh-minor:
32-
update-types:
33-
- "minor"
34-
gh-major:
35-
update-types:
36-
- "major"
37-
28+
reviewers:
29+
- "weaveworks/wild-watermelon"
30+
# Only do security updates not version updates.
31+
open-pull-requests-limit: 0
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Wild Watermelon Blocked Issue Reminder on Slack
2+
on:
3+
workflow_dispatch:
4+
# schedule:
5+
# # Poke on Monday to kick off the week, and on Thu so we have time to poke
6+
# # others on Fri.
7+
# - cron: '0 15 * * 1,4'
8+
9+
permissions:
10+
issues: read # for actions/github-script to query issues
11+
12+
jobs:
13+
issue-list:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: List Issues
17+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
18+
id: list-issues
19+
with:
20+
script: |
21+
// Use the label that filters down issues the most in the
22+
// initial query.
23+
const baseLabel = 'blocked';
24+
25+
// "AND" logic, so all labels has to be on the issue.
26+
// This is required because the GrqphQL API uses "OR" if we
27+
// specify more than one label in the query.
28+
const extraLabels = ['team/wild-watermelon'];
29+
30+
const query = `query($owner:String!, $name:String!, $label:String!) {
31+
repository(owner:$owner, name:$name){
32+
issues(first:100, labels: [$label], states: [OPEN]) {
33+
nodes {
34+
title, number, url,
35+
labels(first: 20) {
36+
nodes { name id }
37+
}
38+
}
39+
}
40+
}
41+
}`;
42+
const variables = {
43+
owner: context.repo.owner,
44+
name: context.repo.repo,
45+
label: baseLabel
46+
}
47+
const result = await github.graphql(query, variables)
48+
49+
const lines = result.repository.issues.nodes.map(issue => {
50+
const labels = issue.labels.nodes.map(label => label.name)
51+
52+
const matchingLabels = labels.filter(label => {
53+
return extraLabels.indexOf(label) !== -1;
54+
});
55+
56+
if (matchingLabels.length !== extraLabels.length) {
57+
return null;
58+
}
59+
60+
return [
61+
" * ",
62+
"<", issue.url, "|", issue.title.replace(/[<>]/g, ''), ">",
63+
" (", labels.map(n => '`'+n+'`').join(", "), ")"
64+
].join('')
65+
}).filter(line => line !== null)
66+
67+
if (lines.length < 1) {
68+
return ""
69+
}
70+
71+
const header = [
72+
":old-man-yells-at-cloud: All issues on", "`" + context.repo.owner + "/" + context.repo.repo + "`",
73+
"marked with:", [baseLabel, ...extraLabels].map(n => '`'+n+'`').join(", ")
74+
].join(" ")
75+
76+
return [header, lines.join("\n")].join("\n\n")
77+
result-encoding: string
78+
- name: Send issues to Slack
79+
uses: archive/github-actions-slack@d9dae40827adf93bddf939db6552d1e392259d7d # v2.7.0
80+
if: ${{ steps.list-issues.outputs.result != '' }}
81+
with:
82+
slack-bot-user-oauth-access-token: ${{ secrets.WEAVEWORKS_SLACK_GENERICBOT_TOKEN }}
83+
slack-channel: C0586V3N0BG # team-wild-watermelon
84+
slack-text: ${{steps.list-issues.outputs.result}}
85+
slack-optional-icon_url: "https://avatars.githubusercontent.com/u/9976052"

.github/workflows/build-and-publish.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
env:
1212
CONTROLLER: ${{ github.event.repository.name }}
13-
LIBCRYPTO_VERSION: "3.1.6-r2"
13+
LIBCRYPTO_VERSION: "3.1.4-r5"
1414

1515
jobs:
1616
test:
@@ -20,11 +20,11 @@ jobs:
2020
packages: write # needed for ghcr access
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0
23+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2424
- name: Setup Go
25-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
25+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2626
with:
27-
go-version-file: go.mod
27+
go-version: 1.20.x
2828
- name: Setup Terraform
2929
run: |
3030
export TF_VERSION=1.3.9
@@ -37,10 +37,10 @@ jobs:
3737
with:
3838
version: 4.14.1
3939
- name: Setup Kustomize
40-
uses: fluxcd/pkg/actions/kustomize@1bfad582060d2d6e464756fbd5d7a2b2fa4f75b9 # main
40+
uses: fluxcd/pkg/actions/kustomize@6c0b4426ba7809a9406c1a4e07aa4be4984ea72f # main
4141
- name: Get branch names
4242
id: branch-name
43-
uses: tj-actions/branch-names@6871f53176ad61624f978536bbf089c574dc19a2 # v8.0.1
43+
uses: tj-actions/branch-names@033f2358d95522973eee35810e35a86fae4a71d8 # v7.0.5
4444
- name: Prepare
4545
id: prep
4646
run: |
@@ -62,17 +62,17 @@ jobs:
6262
platforms: all
6363
- name: Setup Docker Buildx
6464
id: buildx
65-
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
65+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
6666
with:
6767
buildkitd-flags: "--debug"
6868
- name: Login to GitHub Container Registry
69-
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
69+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
7070
with:
7171
registry: ghcr.io
7272
username: ${{ github.actor }}
7373
password: ${{ secrets.GITHUB_TOKEN }}
7474
- name: Publish multi-arch tf-controller container image
75-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
75+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
7676
with:
7777
push: true
7878
builder: ${{ steps.buildx.outputs.name }}
@@ -91,7 +91,7 @@ jobs:
9191
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
9292
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
9393
- name: Build multi-arch tf-runner base image
94-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
94+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
9595
with:
9696
push: true
9797
builder: ${{ steps.buildx.outputs.name }}
@@ -112,7 +112,7 @@ jobs:
112112
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
113113
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
114114
- name: Publish multi-arch tf-runner container image
115-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
115+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
116116
with:
117117
push: true
118118
builder: ${{ steps.buildx.outputs.name }}
@@ -131,7 +131,7 @@ jobs:
131131
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
132132
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
133133
- name: Publish multi-arch branch-planner container image
134-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
134+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
135135
with:
136136
push: true
137137
builder: ${{ steps.buildx.outputs.name }}

.github/workflows/docs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
permissions:
1818
contents: write
1919
steps:
20-
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0
21-
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
20+
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
21+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
2222
with:
2323
python-version: 3.x
2424
- name: Install mkdocs
2525
run: pip install mkdocs-material
2626
- name: Generate docs artifacts
2727
run: mkdocs build -d /tmp/docs
28-
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0
28+
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2929
with:
3030
ref: gh-pages
3131
path: gh-pages

.github/workflows/e2e.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,36 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0
24+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
2525
- name: Setup YQ
2626
uses: frenck/action-setup-yq@c4b5be8b4a215c536a41d436757d9feb92836d4f # v1.0.2
2727
with:
2828
version: 4.14.2
2929
- name: Setup Go
30-
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
30+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3131
with:
32-
go-version-file: go.mod
32+
go-version: 1.20.x
3333
cache-dependency-path: |
3434
**/go.sum
3535
**/go.mod
3636
- name: Cache Docker layers
37-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
37+
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
3838
id: cache
3939
with:
4040
path: /tmp/.buildx-cache
4141
key: ${{ runner.os }}-buildx-ghcache-${{ github.sha }}
4242
restore-keys: |
4343
${{ runner.os }}-buildx-ghcache-
4444
- name: Setup Kubernetes
45-
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
45+
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
4646
with:
4747
version: v0.18.0
4848
node_image: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
4949
cluster_name: kind
5050
- name: Setup Kustomize
51-
uses: fluxcd/pkg/actions/kustomize@1bfad582060d2d6e464756fbd5d7a2b2fa4f75b9 # main
51+
uses: fluxcd/pkg/actions/kustomize@6c0b4426ba7809a9406c1a4e07aa4be4984ea72f # main
5252
- name: Setup Kubectl
53-
uses: fluxcd/pkg/actions/kubectl@1bfad582060d2d6e464756fbd5d7a2b2fa4f75b9 # main
53+
uses: fluxcd/pkg/actions/kubectl@847b2c031da93421f6dccca226d591198437a47f # main
5454
- name: Check if working tree is dirty
5555
run: |
5656
if [[ $(git diff --stat) != '' ]]; then

.github/workflows/helm-release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ jobs:
1313
id-token: write # needed for keyless signing
1414
packages: write # needed for ghcr access
1515
steps:
16-
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0
16+
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
1717
- name: Publish Helm chart in GitHub Pages
1818
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
1919
with:
2020
token: ${{ secrets.GITHUB_TOKEN }}
2121
- name: Login to GitHub Container Registry
22-
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
22+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
2323
with:
2424
registry: ghcr.io
2525
username: ${{ github.actor }}
2626
password: ${{ secrets.GITHUB_TOKEN }}
2727
- name: Publish Helm OCI
2828
run: |
29-
VERSION=$(yq e '.version' charts/tofu-controller/Chart.yaml)
29+
VERSION=$(yq e '.version' charts/tf-controller/Chart.yaml)
3030
mkdir helm-release
31-
helm package charts/tofu-controller/ -d helm-release
32-
helm push helm-release/tofu-controller-${VERSION}.tgz oci://ghcr.io/flux-iac/charts
31+
helm package charts/tf-controller/ -d helm-release
32+
helm push helm-release/tf-controller-${VERSION}.tgz oci://ghcr.io/flux-iac/charts

.github/workflows/helm-test.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- 'main'
66
paths:
7-
- 'charts/tofu-controller/**'
7+
- 'charts/tf-controller/**'
88
- '.github/workflows/helm-test.yaml'
99

1010
permissions: read-all
@@ -14,16 +14,16 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.0.0
17+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
1818
with:
1919
fetch-depth: 0
2020

2121
- name: Set up Helm
22-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v3.5.0
22+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5.0
2323
with:
2424
version: latest
2525

26-
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
26+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
2727
with:
2828
python-version: "3.10"
2929

@@ -55,24 +55,24 @@ jobs:
5555
run: ct lint --check-version-increment=false --config ct.yaml
5656
if: steps.list-changed.outputs.changed == 'true'
5757

58-
- name: Build the tofu-controller container image
58+
- name: Build the tf-controller container image
5959
run: |
60-
make docker-buildx MANAGER_IMG=test/tofu-controller RUNNER_IMG=test/tf-runner TAG=ct \
60+
make docker-buildx MANAGER_IMG=test/tf-controller RUNNER_IMG=test/tf-runner TAG=ct \
6161
BUILD_ARGS="--load"
6262
if: steps.list-changed.outputs.changed == 'true'
6363

6464
- name: Create kind cluster
65-
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
65+
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
6666
if: steps.list-changed.outputs.changed == 'true'
6767

6868
- name: Load test images into KIND
6969
run: |
70-
kind load docker-image --name=chart-testing test/tofu-controller:ct
70+
kind load docker-image --name=chart-testing test/tf-controller:ct
7171
kind load docker-image --name=chart-testing test/tf-runner:ct
7272
if: steps.list-changed.outputs.changed == 'true'
7373

7474
- name: Install Flux CLI
75-
uses: fluxcd/flux2/action@896e0fa46d5107a05e953dd0a5261d78a145ec8c # main
75+
uses: fluxcd/flux2/action@3b42b200d376430f0e24d35f1a600447d92da531 # main
7676
if: steps.list-changed.outputs.changed == 'true'
7777

7878
- name: Install Source controller

0 commit comments

Comments
 (0)