Skip to content

Commit e5bf768

Browse files
authored
Merge pull request #29 from instana/add-renovate-for-kubernetes-agent-versions
INSTA-19263: Add Renovate configuration for Argo CD agent version pinning
2 parents 506afb5 + 39b7fe7 commit e5bf768

4 files changed

Lines changed: 49 additions & 10 deletions

File tree

.github/workflows/sync-agent-version-to-main.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,58 @@ jobs:
2727
run: |
2828
echo "Showing content of current AgentBootstrap"
2929
cat instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
30+
31+
# Clean up any existing temp files
3032
rm -f /tmp/com.instana.agent.bootstrap.AgentBootstrap.cfg
31-
echo "Create temporary copy of the configuration file"
33+
rm -f /tmp/values.yaml
34+
rm -f /tmp/instana-agent.customresource.yaml
35+
36+
# Copy all relevant files to temp directory
37+
echo "Create temporary copies of the configuration files"
3238
cp instana/com.instana.agent.bootstrap.AgentBootstrap.cfg /tmp/
39+
cp kubernetes/instana/helm-chart/dynamic-agent/values.yaml /tmp/values.yaml
40+
cp kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml /tmp/instana-agent.customresource.yaml
41+
3342
echo "Checking out main branch"
3443
git fetch origin main
3544
git checkout main
3645
echo "Creating new branch from main"
3746
git checkout -b promote-test-to-main
38-
echo "Replace config file on main"
47+
48+
echo "Replace config files on main"
3949
rm -f instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
50+
rm -f kubernetes/instana/helm-chart/dynamic-agent/values.yaml
51+
rm -f kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml
52+
4053
cp -f /tmp/com.instana.agent.bootstrap.AgentBootstrap.cfg instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
41-
echo "Check if file was changed"
54+
cp -f /tmp/values.yaml kubernetes/instana/helm-chart/dynamic-agent/values.yaml
55+
cp -f /tmp/instana-agent.customresource.yaml kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml
56+
57+
echo "Check if files were changed"
4258
if [[ `git status --porcelain` ]]; then
43-
echo "The file has changed, continue to commit and push"
59+
echo "Files have changed, continue to commit and push"
4460
else
45-
echo "The file is unchanged, main is already in sync with test branch, no further action needed"
61+
echo "Files are unchanged, main is already in sync with test branch, no further action needed"
4662
exit 0
4763
fi
4864
4965
echo "Setting git author"
5066
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
5167
git config --global user.name "${GITHUB_ACTOR}"
52-
echo "Commiting change"
68+
echo "Commiting changes"
5369
git add instana/com.instana.agent.bootstrap.AgentBootstrap.cfg
54-
git commit -m "chore: Sync AgentBootstrap from current test branch"
70+
git add kubernetes/instana/helm-chart/dynamic-agent/values.yaml
71+
git add kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml
72+
git commit -m "chore: Sync Instana agent configurations from current test branch"
5573
echo "Push change to feature branch"
5674
git push origin -f promote-test-to-main
5775
UPDATED_VERSION=$(cat instana/com.instana.agent.bootstrap.AgentBootstrap.cfg | grep "version = " | grep -v "#" | cut -c11-)
5876
PR_TITLE="chore(deps): Update Instana Agent Production to v${UPDATED_VERSION}"
59-
echo "Automated sync of instana/com.instana.agent.bootstrap.AgentBootstrap.cfg from branch \"test\" to \"main\"." > body-file.txt
77+
echo "Automated sync of Instana agent configurations from branch \"test\" to \"main\"." > body-file.txt
78+
echo "Files updated:" >> body-file.txt
79+
echo "- instana/com.instana.agent.bootstrap.AgentBootstrap.cfg" >> body-file.txt
80+
echo "- kubernetes/instana/helm-chart/dynamic-agent/values.yaml" >> body-file.txt
81+
echo "- kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml" >> body-file.txt
6082
echo "Make sure that the test environment works as expected before approving and merging the change." >> body-file.txt
6183
echo "Merging will **trigger an production update including an agent restart**." >> body-file.txt
6284
echo "" >> body-file.txt

kubernetes/instana/helm-chart/dynamic-agent/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ agent:
9898
# use this to set additional environment variables for the instana agent
9999
# for example:
100100
env:
101-
INSTANA_AGENT_UPDATES_VERSION: 2024.10.28.1344 # check for available versions at https://github.com/instana/agent-updates/tags
101+
# This field specifies which version set of components should be used by the agent;
102+
# its value must be a valid tag from https://github.com/instana/agent-updates/tags
103+
# renovate: datasource=github-tags depName=instana/agent-updates versioning=loose
104+
INSTANA_AGENT_UPDATES_VERSION: 2024.10.28.1344
102105
# INSTANA_AGENT_UPDATES_TIME: 4:30 # no effect when version is pinned with INSTANA_AGENT_UPDATES_VERSION
103106
# INSTANA_AGENT_UPDATES_FREQUENCY: DAY # no effect when version is pinned with INSTANA_AGENT_UPDATES_VERSION
104107

kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ spec:
1111
endpointHost: ingress-red-saas.instana.io
1212
endpointPort: "443"
1313
env:
14-
INSTANA_AGENT_UPDATES_VERSION: 2024.10.28.1344 # check for available versions at https://github.com/instana/agent-updates/tags
14+
# This field specifies which version set of components should be used by the agent;
15+
# its value must be a valid tag from https://github.com/instana/agent-updates/tags
16+
# renovate: datasource=github-tags depName=instana/agent-updates versioning=loose
17+
INSTANA_AGENT_UPDATES_VERSION: 2024.10.28.1344
1518
# INSTANA_AGENT_UPDATES_TIME: 4:30 # no effect when version is pinned with INSTANA_AGENT_UPDATES_VERSION
1619
# INSTANA_AGENT_UPDATES_FREQUENCY: DAY # no effect when version is pinned with INSTANA_AGENT_UPDATES_VERSION

renovate.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
"# renovate: datasource=(?<datasource>[a-z-]+?)(?: depName=(?<depName>.*?))(?: versioning=(?<versioning>[a-z-]+?))?\\sversion\\s=\\s(?<currentValue>.+?)\\s"
1111
],
1212
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
13+
},
14+
{
15+
"customType": "regex",
16+
"fileMatch": [
17+
"kubernetes/instana/helm-chart/dynamic-agent/values.yaml",
18+
"kubernetes/instana/instana-agent-operator/dynamic-agent/instana-agent.customresource.yaml"
19+
],
20+
"matchStrings": [
21+
"# renovate: datasource=(?<datasource>[a-z-]+?)(?: depName=(?<depName>.*?))(?: versioning=(?<versioning>[a-z-]+?))?\\s+INSTANA_AGENT_UPDATES_VERSION:\\s+(?<currentValue>.+?)\\s+"
22+
],
23+
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
1324
}
1425
]
1526
}

0 commit comments

Comments
 (0)