Compare commits

..

86 Commits

Author SHA1 Message Date
Muneeb Aijaz
ca09e243a3 Merge pull request #799 from stakater/chart-rel-1.2.0
Update helm chart - 1.2.0
2024-11-20 13:22:19 +05:00
MuneebAijaz
22f6c3e461 separate out workflows 2024-11-20 12:31:26 +05:00
MuneebAijaz
d784b552ee separate out workflows 2024-11-20 12:30:49 +05:00
MuneebAijaz
33710457ef separate out workflows 2024-11-20 12:27:53 +05:00
MuneebAijaz
f3bf76bb9d Update helm chart - 1.2.0 2024-11-20 12:07:35 +05:00
Muneeb Aijaz
e9811bf166 Merge pull request #788 from stakater/helm-chart-rel
Add workflow for helm chart push
2024-11-19 10:59:10 +05:00
Muneeb Aijaz
93e7aca146 Update push-helm-chart.yaml 2024-11-19 10:43:04 +05:00
Muneeb Aijaz
ff7c5c0f74 Merge pull request #784 from tom1299/master
fix: Remove obsolete permissions for apiGroup `extensions` from helm templates
2024-11-18 17:07:33 +05:00
Muneeb Aijaz
1ffef1a1d4 Merge pull request #792 from stakater/remove-bump-chart
Remove chart bump from init release since its not relevant
2024-11-18 16:32:32 +05:00
MuneebAijaz
c9b919f2f4 Remove chart bump from init release since its not relevant 2024-11-18 16:18:29 +05:00
Muneeb Aijaz
b4cc5420ac Merge pull request #789 from stakater/MuneebAijaz-patch-1
Pin version for checkout action
2024-11-18 15:06:23 +05:00
Muneeb Aijaz
865a985bcd Pin version for checkout action 2024-11-18 15:04:39 +05:00
MuneebAijaz
2cd4f2397a Add workflow for helm chart push 2024-11-18 11:11:34 +05:00
lochan_2112
53b650ac80 Provide annotations to exclude reloading resources (#764)
* Provide annotations to exclude reloading resources

* update test case

* undo commented tests

* remove sleep
2024-11-16 20:36:27 +01:00
Muneeb Aijaz
32d5bb877f Merge pull request #778 from stakater/branch-release-strat
Branch based release strategy
2024-11-15 20:36:17 +05:00
MuneebAijaz
60a2f26976 fix base in values 2024-11-14 21:25:41 +05:00
MuneebAijaz
01205e70df update action version 2024-11-14 21:20:50 +05:00
MuneebAijaz
785cc49374 add version file 2024-11-14 17:52:55 +05:00
renovate[bot]
489a900a20 chore(deps): update stakater/.github action to v0.0.98 (#785)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 10:19:15 +01:00
tom1299
394707a7f8 Remove obsolete permissions for apiGroup extensions 2024-11-10 07:21:13 +01:00
MuneebAijaz
242fd80209 revert 2024-11-07 22:12:31 +05:00
MuneebAijaz
fa09ff7e76 check failure 2024-11-07 21:52:45 +05:00
MuneebAijaz
12826023d4 add PR validation for helm chart 2024-11-07 21:33:22 +05:00
MuneebAijaz
ba6cc12daf cleanup 2024-11-06 22:15:02 +05:00
MuneebAijaz
ec5586fcb7 fix manifest workflow 2024-11-06 22:15:02 +05:00
Muneeb Aijaz
edf57bc94c Merge branch 'master' into branch-release-strat 2024-11-06 22:02:45 +05:00
MuneebAijaz
f2a0e81ad1 fix manifest workflow 2024-11-06 22:01:28 +05:00
MuneebAijaz
a461080c05 add helm workflow 2024-11-06 21:32:25 +05:00
Muneeb Aijaz
2a239d4667 Merge pull request #747 from sausrivastava/comtech/fix-image-issue
Added the ability to separately configure the image registry
2024-11-06 14:41:12 +05:00
Muneeb Aijaz
eaae123248 Merge pull request #768 from stakater/renovate/github.com-prometheus-client_golang-1.x
fix(deps): update module github.com/prometheus/client_golang to v1.20.5
2024-11-06 14:19:03 +05:00
MuneebAijaz
28b70651fd test positive 2024-11-06 09:24:41 +05:00
MuneebAijaz
595841cf3f test workflow for semver update 2024-11-06 09:19:59 +05:00
MuneebAijaz
79bc824c7d test workflow for semver update 2024-11-06 09:17:34 +05:00
MuneebAijaz
99bb4da3d4 test workflow for semver update 2024-11-06 09:14:57 +05:00
MuneebAijaz
c6e7c328c6 add flow to push pr image on labels 2024-10-30 20:50:44 +05:00
MuneebAijaz
41cf1056a6 fix kubectl 2024-10-30 20:37:46 +05:00
MuneebAijaz
db80cc755d updates 2024-10-30 20:35:30 +05:00
MuneebAijaz
6aef0ccc1b updates 2024-10-30 20:29:27 +05:00
MuneebAijaz
3862d808e9 branch based release strategy 2024-10-30 20:27:06 +05:00
renovate[bot]
7068d00345 chore(deps): update stakater/.github action to v0.0.97 (#776)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-30 10:25:10 +01:00
renovate[bot]
aaf53097c5 fix(deps): update module github.com/prometheus/client_golang to v1.20.5 2024-10-25 10:54:00 +00:00
sausrivastava
3981623ec2 Update values.yaml for base 2024-10-24 09:48:21 +05:30
renovate[bot]
b0b2b58afd chore(deps): update dependency stakater/vale-package to v0.0.40 (#775)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 12:50:08 +02:00
renovate[bot]
735a621e02 chore(deps): update dependency stakater/vale-package to v0.0.36 (#758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 10:16:11 +02:00
renovate[bot]
8cfc992cfc chore(deps): update stakater/.github action to v0.0.95 (#765)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-23 10:15:47 +02:00
Muneeb Aijaz
325515f805 Merge pull request #687 from dabcoder/db/-/log-level
feat(log-level): add option to set logLevel in chart
2024-10-22 23:52:00 +05:00
Muneeb Aijaz
ca95a7f4e8 Merge pull request #772 from stakater/helm-updates
Renovate update for Helm Chart values file
2024-10-22 14:50:58 +05:00
Karl Johan Grahn
19d88dbe0c update 2024-10-21 23:24:29 +02:00
Muneeb Aijaz
a2d23f8ea5 Merge pull request #763 from stakater/tagging
Update release process
2024-10-15 15:20:51 +05:00
Karl Johan Grahn
e210ea62fe update 2024-10-15 08:25:23 +02:00
Karl Johan Grahn
7a9bb4fcbc update 2024-10-15 00:00:46 +02:00
Karl Johan Grahn
208a55f995 update 2024-10-14 23:59:38 +02:00
Karl Johan Grahn
6bf4620b1b update 2024-10-09 14:55:38 +02:00
Karl Johan Grahn
ba2ffcd561 update 2024-10-09 14:54:36 +02:00
renovate[bot]
b1cb6df1fa chore(deps): update stakater/.github action to v0.0.94 (#759)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-09 13:45:52 +02:00
Muhammad Sheryar Butt
17ce721ddc Update base image to UBI9 and refine build file lists for amd64 and arm64 (#762) 2024-10-09 13:27:07 +02:00
Muneeb Aijaz
53ab40a201 Update Go version to 1.23.1 (#761)
* Update Go version to 1.22.7 and ubi to ubi9

* Update Go version to 1.23.1 and ubi to ubi9

* revert change for ubi

* case
2024-10-08 17:21:46 +02:00
Karl Johan Grahn
968855335d Modify trigger events for Reloader Enterprise (#756)
* update

* update
2024-10-02 15:07:36 +02:00
renovate[bot]
7789dc96f5 chore(deps): update stakater/.github action to v0.0.93 (#750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-30 22:15:49 +02:00
renovate[bot]
2791a00de9 chore(deps): update docker/build-push-action action to v6 (#694)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-23 10:39:09 +02:00
renovate[bot]
9d9196e9ba chore(deps): update dependency stakater/vale-package to v0.0.35 (#752)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-19 10:55:04 +02:00
Bharath Nallapeta
f0caad4f38 Merge pull request #748 from stakater/renovate/github.com-prometheus-client_golang-1.x
fix(deps): update module github.com/prometheus/client_golang to v1.20.4
2024-09-18 13:53:47 +05:30
Bharath Nallapeta
f1e2d21105 Merge pull request #746 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.91
2024-09-18 13:51:01 +05:30
Karl Johan Grahn
13b6d2a878 update (#749) 2024-09-17 17:55:08 +02:00
renovate[bot]
7bf23a55c1 fix(deps): update module github.com/prometheus/client_golang to v1.20.4 2024-09-17 09:36:36 +00:00
sausrivastava
bd3e8b0d09 Support global.imageRegistry for reloader image 2024-09-17 12:19:51 +05:30
renovate[bot]
bb57e8429a chore(deps): update stakater/.github action to v0.0.91 2024-09-11 09:10:59 +00:00
Muneeb Aijaz
21552a102a Merge pull request #744 from stakater/deps
Dependencies upgrade
2024-09-11 14:10:26 +05:00
Muneeb Aijaz
74a6bee9da Merge pull request #708 from stakater/renovate/stakater-.github-0.x
chore(deps): update stakater/.github action to v0.0.90
2024-09-11 13:26:54 +05:00
Muneeb Aijaz
0c5a8a5c1f Merge pull request #743 from stakater/renovate/stakater-vale-package-0.x
chore(deps): update dependency stakater/vale-package to v0.0.34
2024-09-11 13:06:58 +05:00
renovate[bot]
8eb86c671c chore(deps): update dependency stakater/vale-package to v0.0.34 2024-09-11 08:05:57 +00:00
Muneeb Aijaz
515f416a70 Merge pull request #731 from stakater/renovate/github.com-argoproj-argo-rollouts-1.x
fix(deps): update module github.com/argoproj/argo-rollouts to v1.7.2
2024-09-11 13:05:46 +05:00
Muneeb Aijaz
fcced46c6a Merge pull request #741 from stakater/renovate/github.com-prometheus-client_golang-1.x
fix(deps): update module github.com/prometheus/client_golang to v1.20.3
2024-09-11 13:05:24 +05:00
Bharath Nallapeta
9a7c9cb1b1 Merge pull request #742 from halkeye/patch-1
Make sure GOMAXPROCS and GOMEMLIMIT has a divisor set
2024-09-10 09:59:31 +05:30
Gavin Mogan
81c1b79203 Make sure GOMAXPROCS and GOMEMLIMIT has a divisor set 2024-09-09 09:18:45 -07:00
renovate[bot]
a262d734b7 fix(deps): update module github.com/prometheus/client_golang to v1.20.3 2024-09-05 15:30:34 +00:00
Bharath Nallapeta
5ddb07b1c1 Merge pull request #739 from dubek/patch-1
docs: Fix resource type in Verify-Reloader-Working
2024-09-04 13:42:28 +05:30
Dov Murik
57e33facd7 docs: Fix resource type in Verify-Reloader-Working
I believe that test-object refers to a secret or configmap, and not as currently stated.
2024-08-30 09:04:42 -04:00
Muneeb Aijaz
34a6870fa9 Merge pull request #736 from stakater/increase-mem
Increase memory for plain manifest
2024-08-28 17:00:36 +05:00
MuneebAijaz
354d348481 Increase memory for plain manifest 2024-08-28 16:54:29 +05:00
renovate[bot]
c4d314210e fix(deps): update module github.com/argoproj/argo-rollouts to v1.7.2 2024-08-22 21:00:40 +00:00
renovate[bot]
1442f92e68 chore(deps): update stakater/.github action to v0.0.90 2024-08-21 06:42:52 +00:00
David B.
5a53a39500 Merge branch 'master' into db/-/log-level 2024-08-09 14:26:06 +02:00
David B.
08f16d133a Merge branch 'master' into db/-/log-level 2024-07-30 10:36:43 +02:00
daboucha
9b21bf36b6 fix(logLevel): typo 2024-06-13 13:50:37 +02:00
daboucha
fe2c34c451 feat(logLevel): add option to the chart to set the log level 2024-06-13 13:47:07 +02:00
34 changed files with 975 additions and 423 deletions

View File

@@ -0,0 +1,68 @@
name: Init Release
on:
workflow_dispatch:
inputs:
TARGET_BRANCH:
description: 'TARGET_BRANCH on which release will be based'
required: true
type: string
TARGET_VERSION:
description: 'TARGET_VERSION to build kubernetes manifests with using Kustomize'
required: true
type: string
permissions: {}
jobs:
prepare-release:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
name: Automatically generate version and manifests on ${{ inputs.TARGET_BRANCH }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.TARGET_BRANCH }}
- name: Check if TARGET_VERSION is well formed.
run: |
set -xue
# Target version must not contain 'v' prefix
if echo "${{ inputs.TARGET_VERSION }}" | grep -e '^v'; then
echo "::error::Target version '${{ inputs.TARGET_VERSION }}' should not begin with a 'v' prefix, refusing to continue." >&2
exit 1
fi
- name: Create VERSION information
run: |
set -ue
echo "Bumping version from $(cat VERSION) to ${{ inputs.TARGET_VERSION }}"
echo "${{ inputs.TARGET_VERSION }}" > VERSION
- name: Replace latest tag with version from input
run: |
set -ue
VERSION=${{ inputs.TARGET_VERSION }} make update-manifests-version
git diff
- name: Generate new set of manifests
run: |
set -ue
make k8s-manifests
git diff
- name: Create pull request
uses: peter-evans/create-pull-request@v7.0.5
with:
commit-message: "Bump version to ${{ inputs.TARGET_VERSION }}"
title: "Bump version to ${{ inputs.TARGET_VERSION }} on ${{ inputs.TARGET_BRANCH }} branch"
body: Updating VERSION and manifests to ${{ inputs.TARGET_VERSION }}
branch: update-version
branch-suffix: random
signoff: true
labels: release

View File

@@ -0,0 +1,72 @@
name: Pull Request Workflow for Helm Chart changes
on:
pull_request:
branches:
- master
paths:
- 'deployments/kubernetes/chart/reloader/**'
env:
DOCKER_FILE_PATH: Dockerfile
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.30.0"
KIND_VERSION: "0.23.0"
REGISTRY: ghcr.io
jobs:
helm-validation:
permissions:
contents: read
runs-on: ubuntu-latest
name: Helm Chart Validation
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
fetch-depth: 0
# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3
- name: Helm chart unit tests
uses: d3adb5/helm-unittest-action@v2
with:
charts: deployments/kubernetes/chart/reloader
- name: Add Stakater Helm Repo
run: |
helm repo add stakater https://stakater.github.io/stakater-charts
- name: Get version for chart from helm repo
id: chart_eval
run: |
current_chart_version=$(helm search repo stakater/reloader | tail -n 1 | awk '{print $2}')
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
- name: Get Updated Chart version from Chart.yaml
uses: mikefarah/yq@master
id: new_chart_version
with:
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
- name: Check Version
uses: aleoyakas/check-semver-increased-action@v1
id: check-version
with:
current-version: ${{ steps.new_chart_version.outputs.result }}
previous-version: ${{ steps.chart_eval.outputs.CURRENT_CHART_VERSION }}
- name: Fail if Helm Chart version isnt updated
if: steps.check-version.outputs.is-version-increased != 'true'
run: |
echo "Helm Chart Version wasnt updated"
exit 1

View File

@@ -1,9 +1,10 @@
name: Pull Request
name: Pull Request Workflow for Code changes
on:
pull_request:
branches:
- master
- 'v**'
paths:
- '**'
- '!.markdownlint.yaml'
@@ -13,17 +14,18 @@ on:
- '!docs/**'
- '!theme_common'
- '!theme_override'
- '!deployments/kubernetes/chart/reloader/**'
env:
DOCKER_FILE_PATH: Dockerfile
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.19.0"
KIND_VERSION: "0.17.0"
KUBERNETES_VERSION: "1.30.0"
KIND_VERSION: "0.23.0"
REGISTRY: ghcr.io
jobs:
qa:
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.82
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.98
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: README.md
@@ -46,6 +48,8 @@ jobs:
# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3
- name: Helm chart unit tests
uses: d3adb5/helm-unittest-action@v2
@@ -86,8 +90,7 @@ jobs:
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
sudo install ./kubectl /usr/local/bin/ && rm kubectl
kubectl version --short --client
kubectl version --short --client | grep -q ${KUBERNETES_VERSION}
kubectl version --client=true
- name: Install Kind
run: |
@@ -124,9 +127,9 @@ jobs:
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
# To identify any broken changes in dockerfiles or dependencies
- name: Build Docker Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -143,7 +146,7 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
- name: Build Docker UBI Image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
@@ -160,23 +163,3 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
# - name: Comment on PR
# uses: mshick/add-pr-comment@v2
# if: always()
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# message-success: '@${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
# message-failure: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
# allow-repeats: true
# - name: Notify Slack
# uses: 8398a7/action-slack@v3
# if: always() # Pick up events even if the job fails or is canceled.
# with:
# status: ${{ job.status }}
# fields: repo,author,action,eventName,ref,workflow
# env:
# GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
# SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

View File

@@ -15,7 +15,7 @@ on:
jobs:
qa:
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.82
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.98
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: docs

105
.github/workflows/push-helm-chart.yaml vendored Normal file
View File

@@ -0,0 +1,105 @@
name: Push Helm Chart
on:
pull_request:
types:
- closed
branches:
- master
paths:
- 'deployments/kubernetes/chart/reloader/**'
env:
HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts"
REGISTRY: ghcr.io
jobs:
build:
permissions:
contents: read
packages: write # to push artifacts to `ghcr.io`
name: Build
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.PUBLISH_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
submodules: recursive
# Setting up helm binary
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3
- name: Add Stakater Helm Repo
run: |
helm repo add stakater https://stakater.github.io/stakater-charts
- name: Get version for chart from helm repo
id: chart_eval
run: |
current_chart_version=$(helm search repo stakater/reloader | tail -n 1 | awk '{print $2}')
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
- name: Get Updated Chart version from Chart.yaml
uses: mikefarah/yq@master
id: new_chart_version
with:
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
- name: Check Version
uses: aleoyakas/check-semver-increased-action@v1
id: check-version
with:
current-version: ${{ steps.new_chart_version.outputs.result }}
previous-version: ${{ steps.chart_eval.outputs.CURRENT_CHART_VERSION }}
- name: Fail if Helm Chart version isnt updated
if: steps.check-version.outputs.is-version-increased != 'true'
run: |
echo "Helm Chart Version wasnt updated"
exit 1
- name: Login to GHCR Registry
uses: docker/login-action@v2
with:
registry: ghcr.io/stakater
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Publish Helm chart to ghcr.io
run: |
helm package ./deployments/kubernetes/chart/reloader --destination ./packaged-chart
helm push ./packaged-chart/*.tgz oci://ghcr.io/stakater/charts
rm -rf ./packaged-chart
- name: Publish Helm chart to gh-pages
uses: stefanprodan/helm-gh-pages@master
with:
branch: master
repository: stakater-charts
target_dir: docs
token: ${{ secrets.PUBLISH_TOKEN }}
charts_dir: deployments/kubernetes/chart/
charts_url: ${{ env.HELM_REGISTRY_URL }}
owner: stakater
linting: on
commit_username: stakater-user
commit_email: stakater@gmail.com
- name: Notify Slack
uses: 8398a7/action-slack@v3
if: always() # Pick up events even if the job fails or is canceled.
with:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

86
.github/workflows/push-pr-image.yaml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: Push PR Image on Label
on:
pull_request:
branches:
- master
types: [ labeled ]
env:
DOCKER_FILE_PATH: Dockerfile
REGISTRY: ghcr.io
jobs:
build-and-push-pr-image:
permissions:
contents: read
runs-on: ubuntu-latest
name: Build and Push PR Image
if: ${{ github.event.label.name == 'build-and-push-pr-image' }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Install Dependencies
run: |
make install
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v5
with:
version: latest
only-new-issues: false
args: --timeout 10m
- name: Generate Tags
id: generate_tag
run: |
sha=${{ github.event.pull_request.head.sha }}
tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}"
echo "GIT_TAG=$(echo ${tag})" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate image repository path for ghcr registry
run: |
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Login to ghcr registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: stakater-user
password: ${{secrets.GITHUB_TOKEN}}
- name: Build Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
tags: |
${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}

View File

@@ -6,12 +6,13 @@ on:
- closed
branches:
- master
- 'v**'
env:
DOCKER_FILE_PATH: Dockerfile
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.19.0"
KIND_VERSION: "0.17.0"
KUBERNETES_VERSION: "1.30.0"
KIND_VERSION: "0.23.0"
HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts"
REGISTRY: ghcr.io
@@ -30,7 +31,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
token: ${{ secrets.PUBLISH_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
submodules: recursive
@@ -62,8 +63,7 @@ jobs:
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
sudo install ./kubectl /usr/local/bin/ && rm kubectl
kubectl version --short --client
kubectl version --short --client | grep -q ${KUBERNETES_VERSION}
kubectl version --client=true
- name: Install Kind
run: |
@@ -97,7 +97,7 @@ jobs:
echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to Docker registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -110,11 +110,10 @@ jobs:
${{ env.DOCKER_IMAGE_REPOSITORY }}:merge-${{ github.event.number }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to Docker registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
@@ -129,7 +128,6 @@ jobs:
${{ env.DOCKER_IMAGE_REPOSITORY }}:merge-${{ github.event.number }}-ubi
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Login to ghcr registry
@@ -144,7 +142,7 @@ jobs:
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to ghcr registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -157,11 +155,10 @@ jobs:
${{ env.GHCR_IMAGE_REPOSITORY }}:merge-${{ github.event.number }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to ghcr registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
@@ -176,7 +173,6 @@ jobs:
${{ env.GHCR_IMAGE_REPOSITORY }}:merge-${{ github.event.number }}-ubi
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- uses: dorny/paths-filter@v3
@@ -196,7 +192,7 @@ jobs:
# run only if 'docs' files were changed
- name: Build and Push Docker Image for Docs to ghcr registry
if: steps.filter.outputs.docs == 'true'
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile-docs
@@ -209,85 +205,14 @@ jobs:
${{ env.GHCR_IMAGE_REPOSITORY }}/docs:merge-${{ github.event.number }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
##############################
## Add steps to generate required artifacts for a release here(helm chart, operator manifest etc.)
##############################
# Skip pushing plain manifests till we decide what to do with them
# - name: Helm Template
# run: |
# helm template reloader deployments/kubernetes/chart/reloader/ \
# --set reloader.deployment.resources.limits.cpu=150m \
# --set reloader.deployment.resources.limits.memory=512Mi \
# --set reloader.deployment.resources.requests.cpu=10m \
# --set reloader.deployment.resources.requests.memory=128Mi > deployments/kubernetes/reloader.yaml
# helm template reloader deployments/kubernetes/chart/reloader/ --output-dir deployments/kubernetes/manifests && mv deployments/kubernetes/manifests/reloader/templates/* deployments/kubernetes/manifests/ && rm -r deployments/kubernetes/manifests/reloader
# - name: Remove labels and annotations from manifests
# run: make remove-labels-annotations
# Charts are to be pushed to a separate repo with a separate release cycle
# # Publish helm chart
# - name: Login to ghcr via helm
# run: |
# echo ${{secrets.GITHUB_TOKEN}} | helm registry login ghcr.io/stakater --username stakater-user --password-stdin
# - name: Publish Helm chart to ghcr.io
# run: |
# helm package ./deployments/kubernetes/chart/reloader --destination ./packaged-chart
# helm push ./packaged-chart/*.tgz oci://ghcr.io/stakater/charts
# rm -rf ./packaged-chart
# - name: Publish Helm chart to gh-pages
# uses: stefanprodan/helm-gh-pages@master
# with:
# branch: master
# repository: stakater-charts
# target_dir: docs
# token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
# charts_dir: deployments/kubernetes/chart/
# charts_url: ${{ env.HELM_REGISTRY_URL }}
# owner: stakater
# linting: on
# commit_username: stakater-user
# commit_email: stakater@gmail.com
# # Commit back changes
# - name: Log info about `.git` directory permissions
# run: |
# # Debug logging
# echo "Disk usage: "
# df -H
# echo ".git files not owned by current user or current group:"
# find .git ! -user $(id -u) -o ! -group $(id -g) | xargs ls -lah
# - name: Commit files
# run: |
# git config --local user.email "stakater@gmail.com"
# git config --local user.name "stakater-user"
# git status
# git add .
# git commit -m "[skip-ci] Update artifacts" -a
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
# branch: ${{ github.ref }}
# - name: Push Latest Tag
# uses: anothrNick/github-tag-action@1.70.0
# env:
# GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
# WITH_V: true
# DEFAULT_BUMP: patch
- name: Push Latest Tag
uses: anothrNick/github-tag-action@1.71.0
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
WITH_V: false
CUSTOM_TAG: merge-${{ github.event.number }}
- name: Notify Slack
uses: 8398a7/action-slack@v3
@@ -296,5 +221,5 @@ jobs:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

View File

@@ -1,16 +1,14 @@
name: Release Go project
on:
push:
tags:
# restricting it to only Major Versions 0,1,2
- 'v[012].[0-9]+.[0-9]+'
release:
types: [published]
env:
DOCKER_FILE_PATH: Dockerfile
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
KUBERNETES_VERSION: "1.19.0"
KIND_VERSION: "0.17.0"
KUBERNETES_VERSION: "1.30.0"
KIND_VERSION: "0.23.0"
REGISTRY: ghcr.io
jobs:
@@ -27,7 +25,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.STAKATER_GITHUB_TOKEN }}
token: ${{ secrets.PUBLISH_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
submodules: recursive
@@ -59,8 +57,7 @@ jobs:
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v${KUBERNETES_VERSION}/bin/linux/amd64/kubectl"
sudo install ./kubectl /usr/local/bin/ && rm kubectl
kubectl version --short --client
kubectl version --short --client | grep -q ${KUBERNETES_VERSION}
kubectl version --client=true
- name: Install Kind
run: |
@@ -98,7 +95,7 @@ jobs:
echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to Docker registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -114,7 +111,7 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to Docker registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
@@ -144,7 +141,7 @@ jobs:
# tag this image as latest as it will be used in plain manifests
- name: Build and Push Docker Image to ghcr registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
@@ -160,7 +157,7 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to ghcr registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
@@ -178,7 +175,7 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker Image for Docs to ghcr registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile-docs
@@ -218,7 +215,7 @@ jobs:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
- name: Notify Slack
uses: 8398a7/action-slack@v3
@@ -227,5 +224,5 @@ jobs:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

View File

@@ -1,9 +1,8 @@
name: Dispatch Event Reloader Enterprise
name: Dispatch event for published release
on:
push:
branches:
- master
release:
types: [published]
jobs:
dispatch:
@@ -15,4 +14,4 @@ jobs:
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.STAKATER_AB_TOKEN_FOR_RLDR }}" \
https://api.github.com/repos/stakater-ab/reloader-enterprise/dispatches \
-d '{"event_type":"trigger-event"}'
-d '{"event_type":"release-published"}'

View File

@@ -0,0 +1,17 @@
name: Dispatch event for unpublished release
on:
release:
types: [unpublished ]
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Trigger target repository workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.STAKATER_AB_TOKEN_FOR_RLDR }}" \
https://api.github.com/repos/stakater-ab/reloader-enterprise/dispatches \
-d '{"event_type":"release-unpublished "}'

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@ styles/
site/
/mkdocs.yml
yq
bin

View File

@@ -1,7 +1,7 @@
StylesPath = styles
MinAlertLevel = warning
Packages = https://github.com/stakater/vale-package/releases/download/v0.0.33/Stakater.zip
Packages = https://github.com/stakater/vale-package/releases/download/v0.0.40/Stakater.zip
Vocab = Stakater
# Only check MarkDown files

View File

@@ -2,7 +2,7 @@ ARG BUILDER_IMAGE
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE:-golang:1.21.12} as builder
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE:-golang:1.23.1} AS builder
ARG TARGETOS
ARG TARGETARCH

View File

@@ -1,9 +1,9 @@
ARG BUILDER_IMAGE
ARG BASE_IMAGE
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} as SRC
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE} AS SRC
FROM ${BASE_IMAGE:-registry.access.redhat.com/ubi8/ubi:latest} as ubi
FROM ${BASE_IMAGE:-registry.access.redhat.com/ubi9/ubi:latest} AS ubi
ARG TARGETARCH
@@ -20,8 +20,7 @@ RUN mkdir /image && \
COPY ubi-build-files-${TARGETARCH}.txt /tmp
# Copy all the required files from the base UBI image into the image directory
# As the go binary is not statically compiled this includes everything needed for CGO to work, cacerts, tzdata and RH release files
RUN tar cf /tmp/files.tar -T /tmp/ubi-build-files-${TARGETARCH}.txt && tar xf /tmp/files.tar -C /image/ \
&& strip --strip-unneeded /image/usr/lib64/*[0-9].so
RUN tar cf /tmp/files.tar -T /tmp/ubi-build-files-${TARGETARCH}.txt && tar xf /tmp/files.tar -C /image/
# Generate a rpm database which contains all the packages that you said were needed in ubi-build-files-*.txt
RUN rpm --root /image --initdb \

View File

@@ -24,6 +24,75 @@ LDFLAGS =
GOPROXY ?=
GOPRIVATE ?=
## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
YQ ?= $(LOCALBIN)/yq
## Tool Versions
KUSTOMIZE_VERSION ?= v5.3.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
ENVTEST_VERSION ?= release-0.17
GOLANGCI_LINT_VERSION ?= v1.57.2
YQ_VERSION ?= v4.27.5
YQ_DOWNLOAD_URL = "https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$(OS)_$(ARCH)"
.PHONY: yq
yq: $(YQ) ## Download YQ locally if needed
$(YQ):
@test -d $(LOCALBIN) || mkdir -p $(LOCALBIN)
@curl --retry 3 -fsSL $(YQ_DOWNLOAD_URL) -o $(YQ) || { \
echo "Failed to download yq from $(YQ_DOWNLOAD_URL). Please check the URL and your network connection."; \
exit 1; \
}
@chmod +x $(YQ)
@echo "yq downloaded successfully to $(YQ)."
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v5,$(KUSTOMIZE_VERSION))
.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN): $(LOCALBIN)
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,$(CONTROLLER_TOOLS_VERSION))
.PHONY: envtest
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
$(ENVTEST): $(LOCALBIN)
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION})
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary (ideally with version)
# $2 - package url which can be installed
# $3 - specific version of package
define go-install-tool
@[ -f $(1) ] || { \
set -e; \
package=$(2)@$(3) ;\
echo "Downloading $${package}" ;\
GOBIN=$(LOCALBIN) go install $${package} ;\
mv "$$(echo "$(1)" | sed "s/-$(3)$$//")" $(1) ;\
}
endef
default: build test
install:
@@ -80,9 +149,16 @@ apply:
deploy: binary-image push apply
.PHONY: k8s-manifests
k8s-manifests: $(KUSTOMIZE) ## Generate k8s manifests using Kustomize from 'manifests' folder
$(KUSTOMIZE) build ./deployments/kubernetes/ -o ./deployments/kubernetes/reloader.yaml
.PHONY: update-manifests-version
update-manifests-version: ## Generate k8s manifests using Kustomize from 'manifests' folder
sed -i 's/image:.*/image: \"ghcr.io\/stakater\/reloader:v$(VERSION)"/g' deployments/kubernetes/manifests/deployment.yaml
# Bump Chart
bump-chart:
sed -i "s/^version:.*/version: $(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: v$(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml
sed -i "s/tag:.*/tag: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml
sed -i "s/version:.*/version: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml
@@ -98,13 +174,3 @@ yq-install:
@curl -sL $(YQ_DOWNLOAD_URL) -o $(YQ_BIN)
@chmod +x $(YQ_BIN)
@echo "yq $(YQ_VERSION) installed at $(YQ_BIN)"
remove-labels-annotations: yq-install
@for file in $$(find deployments/kubernetes/manifests -type f -name '*.yaml'); do \
echo "Processing $$file"; \
$(YQ_BIN) eval 'del(.metadata.labels, .metadata.annotations)' -i "$$file"; \
done
$(YQ_BIN) eval 'del(.spec.template.metadata.labels)' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval 'del(.spec.selector.matchLabels)' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval '.spec.selector.matchLabels.app = "reloader-reloader"' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval '.spec.template.metadata.labels.app = "reloader-reloader"' -i deployments/kubernetes/manifests/deployment.yaml

View File

@@ -442,6 +442,14 @@ PRs are welcome. In general, we follow the "fork-and-pull" Git workflow.
**NOTE:** Be sure to merge the latest from "upstream" before making a pull request!
## Release Processes
_Repository GitHub releases_: As requested by the community in [issue 685](https://github.com/stakater/Reloader/issues/685), Reloader is now based on a manual release process. Releases are no longer done on every merged PR to the main branch, but manually on request. When a GitHub release is made, the corresponding image is built and pushed to the registry.
_Repository git tagging_: The Reloader repository is tagged on every push to main. The creation of a tag does not trigger anything else, it just acts as a pointer to a commit on main.
_Helm chart versioning_: The Reloader Helm chart release process is still [work in progress](https://github.com/stakater/Reloader/issues/684). This page will be updated when the process is settled. As a heads-up, to address the issues that are inherent in the current process the chart will most probably be relocated to the [Stakater charts repository](https://github.com/stakater/charts/). This setup is common in open-source repositories. When a GitHub release has been manually created in this repository, an image will be built, and Renovate in the charts repository will update the Helm chart to use it.
## Changelog
View our closed [Pull Requests](https://github.com/stakater/Reloader/pulls?q=is%3Apr+is%3Aclosed).

1
VERSION Normal file
View File

@@ -0,0 +1 @@
1.1.0

View File

@@ -3,8 +3,8 @@
apiVersion: v1
name: reloader
description: Reloader chart that runs on kubernetes
version: 1.0.121
appVersion: v1.0.121
version: 1.2.0
appVersion: v1.2.0
keywords:
- Reloader
- kubernetes

View File

@@ -76,16 +76,6 @@ rules:
- get
- update
- patch
- apiGroups:
- "extensions"
resources:
- deployments
- daemonsets
verbs:
- list
- get
- update
- patch
- apiGroups:
- "batch"
resources:

View File

@@ -73,7 +73,11 @@ spec:
priorityClassName: {{ .Values.reloader.deployment.priorityClassName }}
{{- end }}
containers:
{{- if $.Values.global.imageRegistry }}
- image: "{{ $.Values.global.imageRegistry }}/{{ .Values.reloader.deployment.image.base }}:{{ .Values.reloader.deployment.image.tag }}"
{{- else }}
- image: "{{ .Values.reloader.deployment.image.name }}:{{ .Values.reloader.deployment.image.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.reloader.deployment.image.pullPolicy }}
name: {{ template "reloader-fullname" . }}
env:
@@ -84,6 +88,7 @@ spec:
valueFrom:
resourceFieldRef:
resource: limits.cpu
divisor: '1'
{{- end }}
- name: GOMEMLIMIT
{{- if .Values.reloader.deployment.gomemlimitOverride }}
@@ -92,6 +97,7 @@ spec:
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: '1'
{{- end }}
{{- range $name, $value := .Values.reloader.deployment.env.open }}
{{- if not (empty $value) }}
@@ -188,11 +194,14 @@ spec:
{{- . | toYaml | nindent 10 }}
{{- end }}
{{- end }}
{{- if or (.Values.reloader.logFormat) (.Values.reloader.ignoreSecrets) (.Values.reloader.ignoreNamespaces) (.Values.reloader.namespaceSelector) (.Values.reloader.resourceLabelSelector) (.Values.reloader.ignoreConfigMaps) (.Values.reloader.custom_annotations) (eq .Values.reloader.isArgoRollouts true) (eq .Values.reloader.reloadOnCreate true) (eq .Values.reloader.reloadOnDelete true) (ne .Values.reloader.reloadStrategy "default") (.Values.reloader.enableHA) (.Values.reloader.autoReloadAll)}}
{{- if or (.Values.reloader.logFormat) (.Values.reloader.logLevel) (.Values.reloader.ignoreSecrets) (.Values.reloader.ignoreNamespaces) (.Values.reloader.namespaceSelector) (.Values.reloader.resourceLabelSelector) (.Values.reloader.ignoreConfigMaps) (.Values.reloader.custom_annotations) (eq .Values.reloader.isArgoRollouts true) (eq .Values.reloader.reloadOnCreate true) (eq .Values.reloader.reloadOnDelete true) (ne .Values.reloader.reloadStrategy "default") (.Values.reloader.enableHA) (.Values.reloader.autoReloadAll)}}
args:
{{- if .Values.reloader.logFormat }}
- "--log-format={{ .Values.reloader.logFormat }}"
{{- end }}
{{- if .Values.reloader.logLevel }}
- "--log-level={{ .Values.reloader.logLevel }}"
{{- end }}
{{- if .Values.reloader.ignoreSecrets }}
- "--resources-to-ignore=secrets"
{{- end }}
@@ -204,10 +213,10 @@ spec:
{{- end }}
{{- if .Values.reloader.namespaceSelector }}
- "--namespace-selector={{ .Values.reloader.namespaceSelector }}"
{{- end }}
{{- end }}
{{- if .Values.reloader.resourceLabelSelector }}
- "--resource-label-selector={{ .Values.reloader.resourceLabelSelector }}"
{{- end }}
{{- end }}
{{- if .Values.reloader.custom_annotations }}
{{- if .Values.reloader.custom_annotations.configmap }}
- "--configmap-annotation"
@@ -228,7 +237,7 @@ spec:
{{- if .Values.reloader.custom_annotations.configmap_auto }}
- "--configmap-auto-annotation"
- "{{ .Values.reloader.custom_annotations.configmap_auto }}"
{{- end }}
{{- end }}
{{- if .Values.reloader.custom_annotations.search }}
- "--auto-search-annotation"
- "{{ .Values.reloader.custom_annotations.search }}"

View File

@@ -3,6 +3,7 @@ global:
## Reference to one or more secrets to be used when pulling images
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
imageRegistry: ""
imagePullSecrets: []
kubernetes:
@@ -24,7 +25,8 @@ reloader:
ignoreNamespaces: "" # Comma separated list of namespaces to ignore
namespaceSelector: "" # Comma separated list of k8s label selectors for namespaces selection
resourceLabelSelector: "" # Comma separated list of k8s label selectors for configmap/secret selection
logFormat: "" #json
logFormat: "" # json
logLevel: info # Log level to use (trace, debug, info, warning, error, fatal and panic)
watchGlobally: true
# Set to true to enable leadership election allowing you to run multiple replicas
enableHA: false
@@ -92,10 +94,11 @@ reloader:
labels:
provider: stakater
group: com.stakater.platform
version: v1.0.121
version: v1.2.0
image:
name: ghcr.io/stakater/reloader
tag: v1.0.121
base: stakater/reloader
tag: v1.2.0
pullPolicy: IfNotPresent
# Support for extra environment variables.
env:
@@ -153,6 +156,7 @@ reloader:
gomemlimitOverride: ""
service: {}
# labels: {}
# annotations: {}
# port: 9090

View File

@@ -17,7 +17,7 @@ spec:
app: reloader-reloader
spec:
containers:
- image: "ghcr.io/stakater/reloader:latest"
- image: "ghcr.io/stakater/reloader:v1.1.0"
imagePullPolicy: IfNotPresent
name: reloader-reloader
env:
@@ -25,10 +25,12 @@ spec:
valueFrom:
resourceFieldRef:
resource: limits.cpu
divisor: '1'
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: '1'
ports:
- name: http
containerPort: 9090
@@ -51,6 +53,13 @@ spec:
successThreshold: 1
initialDelaySeconds: 10
securityContext: {}
resources:
limits:
cpu: "1"
memory: 512Mi
requests:
cpu: 10m
memory: 512Mi
securityContext:
runAsNonRoot: true
runAsUser: 65534

View File

@@ -1,127 +1,81 @@
---
# Source: reloader/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader
namespace: default
---
# Source: reloader/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role
rules:
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- list
- get
- watch
- apiGroups:
- "apps"
resources:
- deployments
- daemonsets
- statefulsets
verbs:
- list
- get
- update
- patch
- apiGroups:
- "extensions"
resources:
- deployments
- daemonsets
verbs:
- list
- get
- update
- patch
- apiGroups:
- "batch"
resources:
- cronjobs
verbs:
- list
- get
- apiGroups:
- "batch"
resources:
- jobs
verbs:
- create
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- list
- get
- watch
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- statefulsets
verbs:
- list
- get
- update
- patch
- apiGroups:
- extensions
resources:
- deployments
- daemonsets
verbs:
- list
- get
- update
- patch
- apiGroups:
- batch
resources:
- cronjobs
verbs:
- list
- get
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
# Source: reloader/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: reloader-reloader-role
subjects:
- kind: ServiceAccount
name: reloader-reloader
namespace: default
- kind: ServiceAccount
name: reloader-reloader
namespace: default
---
# Source: reloader/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: latest
name: reloader-reloader
namespace: default
spec:
@@ -130,64 +84,56 @@ spec:
selector:
matchLabels:
app: reloader-reloader
release: "reloader"
template:
metadata:
labels:
app: reloader-reloader
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: latest
spec:
containers:
- image: "ghcr.io/stakater/reloader:latest"
imagePullPolicy: IfNotPresent
name: reloader-reloader
env:
- env:
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
divisor: "1"
resource: limits.cpu
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
divisor: "1"
resource: limits.memory
ports:
- name: http
containerPort: 9090
image: "ghcr.io/stakater/reloader:latest"
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 5
httpGet:
path: /live
port: http
timeoutSeconds: 5
failureThreshold: 5
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
timeoutSeconds: 5
name: reloader-reloader
ports:
- containerPort: 9090
name: http
readinessProbe:
failureThreshold: 5
httpGet:
path: /metrics
port: http
timeoutSeconds: 5
failureThreshold: 5
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
securityContext:
{}
timeoutSeconds: 5
resources:
limits:
cpu: "1"
memory: 128Mi
memory: 512Mi
requests:
cpu: 10m
memory: 128Mi
securityContext:
memory: 512Mi
securityContext: {}
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:

View File

@@ -16,7 +16,7 @@ Below are the details that explain these logs:
### `test-object`
`test-object` is the name of a `secret` or a `deployment` in which change has been detected.
`test-object` is the name of a `secret` or a `configmap` in which change has been detected.
### `SECRET`

6
go.mod
View File

@@ -1,13 +1,13 @@
module github.com/stakater/Reloader
go 1.21.12
go 1.23.1
require (
github.com/argoproj/argo-rollouts v1.7.1
github.com/argoproj/argo-rollouts v1.7.2
github.com/openshift/api v0.0.0-20240131175612-92fe66c75e8f
github.com/openshift/client-go v0.0.0-20231110140829-a6ca51f6d5ba
github.com/parnurzeal/gorequest v0.3.0
github.com/prometheus/client_golang v1.20.2
github.com/prometheus/client_golang v1.20.5
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.1
k8s.io/api v0.29.3

10
go.sum
View File

@@ -3,8 +3,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/argoproj/argo-rollouts v1.7.1 h1:KWStvHPRrNTbDTclogiYC/s4eKbdS45KkgXiorDzKG0=
github.com/argoproj/argo-rollouts v1.7.1/go.mod h1:Te4HrUELxKiBpK8lgk77o4gTa3mv8pXCd8xdPprKrbs=
github.com/argoproj/argo-rollouts v1.7.2 h1:faDUH/qePerYRwsrHfVzNQkhjGBgXIiVYdVK8824kMo=
github.com/argoproj/argo-rollouts v1.7.2/go.mod h1:Te4HrUELxKiBpK8lgk77o4gTa3mv8pXCd8xdPprKrbs=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -175,8 +175,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=

View File

@@ -199,6 +199,9 @@ func PerformAction(clients kube.Clients, config util.Config, upgradeFuncs callba
searchAnnotationValue, foundSearchAnn := annotations[options.AutoSearchAnnotation]
reloaderEnabledValue, foundAuto := annotations[options.ReloaderAutoAnnotation]
typedAutoAnnotationEnabledValue, foundTypedAuto := annotations[config.TypedAutoAnnotation]
excludeConfigmapAnnotationValue, foundExcludeConfigmap := annotations[options.ConfigmapExcludeReloaderAnnotation]
excludeSecretAnnotationValue, foundExcludeSecret := annotations[options.SecretExcludeReloaderAnnotation]
if !found && !foundAuto && !foundTypedAuto && !foundSearchAnn {
annotations = upgradeFuncs.PodAnnotationsFunc(i)
annotationValue = annotations[config.Annotation]
@@ -206,6 +209,24 @@ func PerformAction(clients kube.Clients, config util.Config, upgradeFuncs callba
reloaderEnabledValue = annotations[options.ReloaderAutoAnnotation]
typedAutoAnnotationEnabledValue = annotations[config.TypedAutoAnnotation]
}
isResourceExcluded := false
switch config.Type {
case constants.ConfigmapEnvVarPostfix:
if foundExcludeConfigmap {
isResourceExcluded = checkIfResourceIsExcluded(config.ResourceName, excludeConfigmapAnnotationValue)
}
case constants.SecretEnvVarPostfix:
if foundExcludeSecret {
isResourceExcluded = checkIfResourceIsExcluded(config.ResourceName, excludeSecretAnnotationValue)
}
}
if isResourceExcluded {
continue
}
result := constants.NotUpdated
reloaderEnabled, _ := strconv.ParseBool(reloaderEnabledValue)
typedAutoAnnotationEnabled, _ := strconv.ParseBool(typedAutoAnnotationEnabledValue)
@@ -275,6 +296,21 @@ func PerformAction(clients kube.Clients, config util.Config, upgradeFuncs callba
return nil
}
func checkIfResourceIsExcluded(resourceName, excludedResources string) bool {
if excludedResources == "" {
return false
}
excludedResourcesList := strings.Split(excludedResources, ",")
for _, excludedResource := range excludedResourcesList {
if strings.TrimSpace(excludedResource) == resourceName {
return true
}
}
return false
}
func getVolumeMountName(volumes []v1.Volume, mountType string, volumeName string) string {
for i := range volumes {
if mountType == constants.ConfigmapEnvVarPostfix {

View File

@@ -26,48 +26,52 @@ import (
var (
clients = kube.Clients{KubernetesClient: testclient.NewSimpleClientset()}
arsNamespace = "test-handler-" + testutil.RandSeq(5)
arsConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
arsSecretName = "testsecret-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
arsProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
arsConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
arsSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
arsProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
arsConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
arsSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
arsSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
arsSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
arsConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
arsConfigMapWithNonAnnotatedDeployment = "testconfigmapNonAnnotatedDeployment-handler-" + testutil.RandSeq(5)
arsSecretWithSecretAutoAnnotation = "testsecretwithsecretautoannotationdeployment-handler-" + testutil.RandSeq(5)
arsConfigmapWithConfigMapAutoAnnotation = "testconfigmapwithconfigmapautoannotationdeployment-handler-" + testutil.RandSeq(5)
arsNamespace = "test-handler-" + testutil.RandSeq(5)
arsConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
arsSecretName = "testsecret-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
arsProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
arsConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
arsSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
arsProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
arsProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
arsConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
arsSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
arsConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
arsSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
arsSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
arsConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
arsConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
arsConfigMapWithNonAnnotatedDeployment = "testconfigmapNonAnnotatedDeployment-handler-" + testutil.RandSeq(5)
arsSecretWithSecretAutoAnnotation = "testsecretwithsecretautoannotationdeployment-handler-" + testutil.RandSeq(5)
arsConfigmapWithConfigMapAutoAnnotation = "testconfigmapwithconfigmapautoannotationdeployment-handler-" + testutil.RandSeq(5)
arsSecretWithExcludeSecretAnnotation = "testsecretwithsecretexcludeannotationdeployment-handler-" + testutil.RandSeq(5)
arsConfigmapWithExcludeConfigMapAnnotation = "testconfigmapwithconfigmapexcludeannotationdeployment-handler-" + testutil.RandSeq(5)
ersNamespace = "test-handler-" + testutil.RandSeq(5)
ersConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
ersSecretName = "testsecret-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
ersProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
ersConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
ersSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
ersProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
ersConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
ersSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
ersSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
ersSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
ersConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
ersSecretWithSecretAutoAnnotation = "testsecretwithsecretautoannotationdeployment-handler-" + testutil.RandSeq(5)
ersConfigmapWithConfigMapAutoAnnotation = "testconfigmapwithconfigmapautoannotationdeployment-handler-" + testutil.RandSeq(5)
ersNamespace = "test-handler-" + testutil.RandSeq(5)
ersConfigmapName = "testconfigmap-handler-" + testutil.RandSeq(5)
ersSecretName = "testsecret-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapName = "testprojectedconfigmap-handler-" + testutil.RandSeq(5)
ersProjectedSecretName = "testprojectedsecret-handler-" + testutil.RandSeq(5)
ersConfigmapWithInitContainer = "testconfigmapInitContainerhandler-" + testutil.RandSeq(5)
ersSecretWithInitContainer = "testsecretWithInitContainer-handler-" + testutil.RandSeq(5)
ersProjectedConfigMapWithInitContainer = "testProjectedConfigMapWithInitContainer-handler" + testutil.RandSeq(5)
ersProjectedSecretWithInitContainer = "testProjectedSecretWithInitContainer-handler" + testutil.RandSeq(5)
ersConfigmapWithInitEnv = "configmapWithInitEnv-" + testutil.RandSeq(5)
ersSecretWithInitEnv = "secretWithInitEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvName = "testconfigmapWithEnv-handler-" + testutil.RandSeq(5)
ersConfigmapWithEnvFromName = "testconfigmapWithEnvFrom-handler-" + testutil.RandSeq(5)
ersSecretWithEnvName = "testsecretWithEnv-handler-" + testutil.RandSeq(5)
ersSecretWithEnvFromName = "testsecretWithEnvFrom-handler-" + testutil.RandSeq(5)
ersConfigmapWithPodAnnotations = "testconfigmapPodAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapWithBothAnnotations = "testconfigmapBothAnnotations-handler-" + testutil.RandSeq(5)
ersConfigmapAnnotated = "testconfigmapAnnotated-handler-" + testutil.RandSeq(5)
ersSecretWithSecretAutoAnnotation = "testsecretwithsecretautoannotationdeployment-handler-" + testutil.RandSeq(5)
ersConfigmapWithConfigMapAutoAnnotation = "testconfigmapwithconfigmapautoannotationdeployment-handler-" + testutil.RandSeq(5)
ersSecretWithSecretExcludeAnnotation = "testsecretwithsecretexcludeannotationdeployment-handler-" + testutil.RandSeq(5)
ersConfigmapWithConfigMapExcludeAnnotation = "testconfigmapwithconfigmapexcludeannotationdeployment-handler-" + testutil.RandSeq(5)
)
func TestMain(m *testing.M) {
@@ -196,6 +200,18 @@ func setupArs() {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating secret used with secret auto annotation
_, err = testutil.CreateSecret(clients.KubernetesClient, arsNamespace, arsSecretWithExcludeSecretAnnotation, data)
if err != nil {
logrus.Errorf("Error in secret creation: %v", err)
}
// Creating configmap used with configmap auto annotation
_, err = testutil.CreateConfigMap(clients.KubernetesClient, arsNamespace, arsConfigmapWithExcludeConfigMapAnnotation, "www.google.com")
if err != nil {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating Deployment with configmap
_, err = testutil.CreateDeployment(clients.KubernetesClient, arsConfigmapName, arsNamespace, true)
if err != nil {
@@ -309,6 +325,18 @@ func setupArs() {
logrus.Errorf("Error in Deployment with configmap and with configmap auto annotation: %v", err)
}
// Creating Deployment with secret and exclude secret annotation
_, err = testutil.CreateDeploymentWithExcludeAnnotation(clients.KubernetesClient, arsSecretWithExcludeSecretAnnotation, arsNamespace, testutil.SecretResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with secret and with secret exclude annotation: %v", err)
}
// Creating Deployment with secret and exclude configmap annotation
_, err = testutil.CreateDeploymentWithExcludeAnnotation(clients.KubernetesClient, arsConfigmapWithExcludeConfigMapAnnotation, arsNamespace, testutil.ConfigmapResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with configmap and with configmap exclude annotation: %v", err)
}
// Creating DaemonSet with configmap
_, err = testutil.CreateDaemonSet(clients.KubernetesClient, arsConfigmapName, arsNamespace, true)
if err != nil {
@@ -510,6 +538,18 @@ func teardownArs() {
logrus.Errorf("Error while deleting deployment with configmap auto annotation %v", deploymentError)
}
// Deleting Deployment with secret and exclude secret annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, arsNamespace, arsSecretWithExcludeSecretAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with secret auto annotation %v", deploymentError)
}
// Deleting Deployment with configmap and exclude configmap annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, arsNamespace, arsConfigmapWithExcludeConfigMapAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with configmap auto annotation %v", deploymentError)
}
// Deleting DaemonSet with configmap
daemonSetError := testutil.DeleteDaemonSet(clients.KubernetesClient, arsNamespace, arsConfigmapName)
if daemonSetError != nil {
@@ -683,6 +723,18 @@ func teardownArs() {
logrus.Errorf("Error while deleting the configmap used with configmap auto annotations: %v", err)
}
// Deleting Secret used with exclude secret annotation
err = testutil.DeleteSecret(clients.KubernetesClient, arsNamespace, arsSecretWithExcludeSecretAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the secret used with secret auto annotations: %v", err)
}
// Deleting ConfigMap used with exclude configmap annotation
err = testutil.DeleteConfigMap(clients.KubernetesClient, arsNamespace, arsConfigmapWithExcludeConfigMapAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the configmap used with configmap auto annotations: %v", err)
}
// Deleting namespace
testutil.DeleteNamespace(arsNamespace, clients.KubernetesClient)
@@ -787,6 +839,18 @@ func setupErs() {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating secret used with secret exclude annotation
_, err = testutil.CreateSecret(clients.KubernetesClient, ersNamespace, ersSecretWithSecretExcludeAnnotation, data)
if err != nil {
logrus.Errorf("Error in secret creation: %v", err)
}
// Creating configmap used with configmap exclude annotation
_, err = testutil.CreateConfigMap(clients.KubernetesClient, ersNamespace, ersConfigmapWithConfigMapExcludeAnnotation, "www.google.com")
if err != nil {
logrus.Errorf("Error in configmap creation: %v", err)
}
// Creating Deployment with configmap
_, err = testutil.CreateDeployment(clients.KubernetesClient, ersConfigmapName, ersNamespace, true)
if err != nil {
@@ -894,6 +958,18 @@ func setupErs() {
logrus.Errorf("Error in Deployment with configmap and with configmap auto annotation: %v", err)
}
// Creating Deployment with secret and with secret exclude annotation
_, err = testutil.CreateDeploymentWithExcludeAnnotation(clients.KubernetesClient, ersSecretWithSecretExcludeAnnotation, ersNamespace, testutil.SecretResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with secret and with secret exclude annotation: %v", err)
}
// Creating Deployment with secret and with secret exclude annotation
_, err = testutil.CreateDeploymentWithExcludeAnnotation(clients.KubernetesClient, ersConfigmapWithConfigMapExcludeAnnotation, ersNamespace, testutil.ConfigmapResourceType)
if err != nil {
logrus.Errorf("Error in Deployment with configmap and with configmap exclude annotation: %v", err)
}
// Creating DaemonSet with configmap
_, err = testutil.CreateDaemonSet(clients.KubernetesClient, ersConfigmapName, ersNamespace, true)
if err != nil {
@@ -1094,6 +1170,18 @@ func teardownErs() {
logrus.Errorf("Error while deleting deployment with configmap auto annotation %v", deploymentError)
}
// Deleting Deployment with secret and secret exclude annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, ersNamespace, ersSecretWithSecretExcludeAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with secret exclude annotation %v", deploymentError)
}
// Deleting Deployment with configmap and configmap exclude annotation
deploymentError = testutil.DeleteDeployment(clients.KubernetesClient, ersNamespace, ersConfigmapWithConfigMapExcludeAnnotation)
if deploymentError != nil {
logrus.Errorf("Error while deleting deployment with configmap exclude annotation %v", deploymentError)
}
// Deleting DaemonSet with configmap
daemonSetError := testutil.DeleteDaemonSet(clients.KubernetesClient, ersNamespace, ersConfigmapName)
if daemonSetError != nil {
@@ -1267,6 +1355,18 @@ func teardownErs() {
logrus.Errorf("Error while deleting the configmap used with configmap auto annotation: %v", err)
}
// Deleting Secret used with secret exclude annotation
err = testutil.DeleteSecret(clients.KubernetesClient, ersNamespace, ersSecretWithSecretExcludeAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the secret used with secret exclude annotation: %v", err)
}
// Deleting ConfigMap used with configmap exclude annotation
err = testutil.DeleteConfigMap(clients.KubernetesClient, ersNamespace, ersConfigmapWithConfigMapExcludeAnnotation)
if err != nil {
logrus.Errorf("Error while deleting the configmap used with configmap exclude annotation: %v", err)
}
// Deleting namespace
testutil.DeleteNamespace(ersNamespace, clients.KubernetesClient)
@@ -1337,8 +1437,8 @@ func TestRollingUpgradeForDeploymentWithConfigmapUsingArs(t *testing.T) {
if promtestutil.ToFloat64(collectors.Reloaded.With(labelSucceeded)) != 1 {
t.Errorf("Counter was not increased")
}
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
@@ -1403,9 +1503,9 @@ func TestRollingUpgradeForDeploymentWithConfigmapWithoutReloadAnnotationButWithA
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapInProjectedVolumeUsingArs(t *testing.T) {
@@ -1432,11 +1532,11 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectedVolumeUsingArs(t *te
t.Errorf("Counter was not increased")
}
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationUsingArs(t *testing.T) {
@@ -1468,7 +1568,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationUsingArs(t *
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationNoTriggersUsingArs(t *testing.T) {
@@ -1575,7 +1675,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInInitContainerUsingArs(t *test
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapInProjectVolumeInInitContainerUsingArs(t *testing.T) {
@@ -1607,7 +1707,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectVolumeInInitContainerU
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarUsingArs(t *testing.T) {
@@ -1639,7 +1739,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarUsingArs(t *testing.T)
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarInInitContainerUsingArs(t *testing.T) {
@@ -1670,8 +1770,8 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarInInitContainerUsingArs
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarFromUsingArs(t *testing.T) {
@@ -1703,7 +1803,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarFromUsingArs(t *testing
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretUsingArs(t *testing.T) {
@@ -1735,7 +1835,7 @@ func TestRollingUpgradeForDeploymentWithSecretUsingArs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeUsingArs(t *testing.T) {
@@ -1767,7 +1867,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeUsingArs(t *testi
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretinInitContainerUsingArs(t *testing.T) {
@@ -1799,7 +1899,7 @@ func TestRollingUpgradeForDeploymentWithSecretinInitContainerUsingArs(t *testing
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeinInitContainerUsingArs(t *testing.T) {
@@ -1831,7 +1931,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeinInitContainerUs
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretAsEnvVarUsingArs(t *testing.T) {
@@ -1863,7 +1963,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarUsingArs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretAsEnvVarFromUsingArs(t *testing.T) {
@@ -1926,7 +2026,28 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingArs(t
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretExcludeAnnotationUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
envVarPostfix := constants.SecretEnvVarPostfix
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, arsNamespace, arsSecretWithExcludeSecretAnnotation, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(envVarPostfix, arsSecretWithExcludeSecretAnnotation, shaData, "", options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformAction(clients, config, deploymentFuncs, collectors, nil, invokeReloadStrategy)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with Secret")
}
logrus.Infof("Verifying deployment did not update")
updated := testutil.VerifyResourceAnnotationUpdate(clients, config, deploymentFuncs)
if updated {
t.Errorf("Deployment which had to be exluded was updated")
}
}
func TestRollingUpgradeForDeploymentWithSecretAutoAnnotationUsingArs(t *testing.T) {
@@ -1958,9 +2079,29 @@ func TestRollingUpgradeForDeploymentWithSecretAutoAnnotationUsingArs(t *testing.
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithExcludeConfigMapAnnotationUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
envVarPostfix := constants.ConfigmapEnvVarPostfix
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, arsNamespace, arsConfigmapWithExcludeConfigMapAnnotation, "www.facebook.com")
config := getConfigWithAnnotations(envVarPostfix, arsConfigmapWithExcludeConfigMapAnnotation, shaData, "", options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformAction(clients, config, deploymentFuncs, collectors, nil, invokeReloadStrategy)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with exclude ConfigMap")
}
logrus.Infof("Verifying deployment did update")
updated := testutil.VerifyResourceAnnotationUpdate(clients, config, deploymentFuncs)
if updated {
t.Errorf("Deployment which had to be excluded was updated")
}
}
func TestRollingUpgradeForDeploymentWithConfigMapAutoAnnotationUsingArs(t *testing.T) {
options.ReloadStrategy = constants.AnnotationsReloadStrategy
envVarPostfix := constants.ConfigmapEnvVarPostfix
@@ -1990,7 +2131,7 @@ func TestRollingUpgradeForDeploymentWithConfigMapAutoAnnotationUsingArs(t *testi
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithConfigmapUsingArs(t *testing.T) {
@@ -2021,8 +2162,8 @@ func TestRollingUpgradeForDaemonSetWithConfigmapUsingArs(t *testing.T) {
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": arsNamespace})) != 1 {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithConfigmapInProjectedVolumeUsingArs(t *testing.T) {
@@ -2054,7 +2195,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapInProjectedVolumeUsingArs(t *tes
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithConfigmapAsEnvVarUsingArs(t *testing.T) {
@@ -2118,7 +2259,7 @@ func TestRollingUpgradeForDaemonSetWithSecretUsingArs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithSecretInProjectedVolumeUsingArs(t *testing.T) {
@@ -2150,7 +2291,7 @@ func TestRollingUpgradeForDaemonSetWithSecretInProjectedVolumeUsingArs(t *testin
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithConfigmapUsingArs(t *testing.T) {
@@ -2182,7 +2323,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapUsingArs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithConfigmapInProjectedVolumeUsingArs(t *testing.T) {
@@ -2214,7 +2355,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapInProjectedVolumeUsingArs(t *t
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithSecretUsingArs(t *testing.T) {
@@ -2246,7 +2387,7 @@ func TestRollingUpgradeForStatefulSetWithSecretUsingArs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithSecretInProjectedVolumeUsingArs(t *testing.T) {
@@ -2278,7 +2419,7 @@ func TestRollingUpgradeForStatefulSetWithSecretInProjectedVolumeUsingArs(t *test
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyArs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithPodAnnotationsUsingArs(t *testing.T) {
@@ -2437,7 +2578,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInProjectedVolumeUsingErs(t *te
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationUsingErs(t *testing.T) {
@@ -2469,7 +2610,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationUsingErs(t *
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapViaSearchAnnotationNoTriggersUsingErs(t *testing.T) {
@@ -2576,7 +2717,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapInInitContainerUsingErs(t *test
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapInProjectVolumeInInitContainerUsingErs(t *testing.T) {
@@ -2640,7 +2781,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarUsingErs(t *testing.T)
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarInInitContainerUsingErs(t *testing.T) {
@@ -2704,7 +2845,7 @@ func TestRollingUpgradeForDeploymentWithConfigmapAsEnvVarFromUsingErs(t *testing
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretUsingErs(t *testing.T) {
@@ -2736,7 +2877,7 @@ func TestRollingUpgradeForDeploymentWithSecretUsingErs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeUsingErs(t *testing.T) {
@@ -2800,7 +2941,7 @@ func TestRollingUpgradeForDeploymentWithSecretinInitContainerUsingErs(t *testing
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeinInitContainerUsingErs(t *testing.T) {
@@ -2832,7 +2973,7 @@ func TestRollingUpgradeForDeploymentWithSecretInProjectedVolumeinInitContainerUs
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretAsEnvVarUsingErs(t *testing.T) {
@@ -2864,7 +3005,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarUsingErs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretAsEnvVarFromUsingErs(t *testing.T) {
@@ -2896,7 +3037,7 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarFromUsingErs(t *testing.T)
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingErs(t *testing.T) {
@@ -2928,7 +3069,29 @@ func TestRollingUpgradeForDeploymentWithSecretAsEnvVarInInitContainerUsingErs(t
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithSecretExcludeAnnotationUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
envVarPostfix := constants.SecretEnvVarPostfix
shaData := testutil.ConvertResourceToSHA(testutil.SecretResourceType, ersNamespace, ersSecretWithSecretExcludeAnnotation, "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy")
config := getConfigWithAnnotations(envVarPostfix, ersSecretWithSecretExcludeAnnotation, shaData, "", options.SecretReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformAction(clients, config, deploymentFuncs, collectors, nil, invokeReloadStrategy)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with exclude Secret")
}
logrus.Infof("Verifying deployment did not update")
updated := testutil.VerifyResourceEnvVarUpdate(clients, config, envVarPostfix, deploymentFuncs)
if updated {
t.Errorf("Deployment that had to be excluded was updated")
}
}
func TestRollingUpgradeForDeploymentWithSecretAutoAnnotationUsingErs(t *testing.T) {
@@ -2956,12 +3119,33 @@ func TestRollingUpgradeForDeploymentWithSecretAutoAnnotationUsingErs(t *testing.
t.Errorf("Counter was not increased")
}
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": ersNamespace})) != 1 {
if promtestutil.ToFloat64(collectors.ReloadedByNamespace.With(prometheus.Labels{"success": "true", "namespace": ersNamespace})) != 1 {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithConfigMapExcludeAnnotationUsingErs(t *testing.T) {
options.ReloadStrategy = constants.EnvVarsReloadStrategy
envVarPostfix := constants.ConfigmapEnvVarPostfix
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, ersNamespace, ersConfigmapWithConfigMapExcludeAnnotation, "www.facebook.com")
config := getConfigWithAnnotations(envVarPostfix, ersConfigmapWithConfigMapExcludeAnnotation, shaData, "", options.ConfigmapReloaderAutoAnnotation)
deploymentFuncs := GetDeploymentRollingUpgradeFuncs()
collectors := getCollectors()
err := PerformAction(clients, config, deploymentFuncs, collectors, nil, invokeReloadStrategy)
time.Sleep(5 * time.Second)
if err != nil {
t.Errorf("Rolling upgrade failed for Deployment with exclude ConfigMap")
}
logrus.Infof("Verifying deployment did not update")
updated := testutil.VerifyResourceEnvVarUpdate(clients, config, envVarPostfix, deploymentFuncs)
if updated {
t.Errorf("Deployment which had to be excluded was updated")
}
}
func TestRollingUpgradeForDeploymentWithConfigMapAutoAnnotationUsingErs(t *testing.T) {
@@ -2993,7 +3177,7 @@ func TestRollingUpgradeForDeploymentWithConfigMapAutoAnnotationUsingErs(t *testi
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, deploymentFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithConfigmapUsingErs(t *testing.T) {
@@ -3025,7 +3209,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapUsingErs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithConfigmapInProjectedVolumeUsingErs(t *testing.T) {
@@ -3057,7 +3241,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapInProjectedVolumeUsingErs(t *tes
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithConfigmapAsEnvVarUsingErs(t *testing.T) {
@@ -3089,7 +3273,7 @@ func TestRollingUpgradeForDaemonSetWithConfigmapAsEnvVarUsingErs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithSecretUsingErs(t *testing.T) {
@@ -3121,7 +3305,7 @@ func TestRollingUpgradeForDaemonSetWithSecretUsingErs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDaemonSetWithSecretInProjectedVolumeUsingErs(t *testing.T) {
@@ -3153,7 +3337,7 @@ func TestRollingUpgradeForDaemonSetWithSecretInProjectedVolumeUsingErs(t *testin
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, daemonSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithConfigmapUsingErs(t *testing.T) {
@@ -3185,7 +3369,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapUsingErs(t *testing.T) {
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithConfigmapInProjectedVolumeUsingErs(t *testing.T) {
@@ -3217,7 +3401,7 @@ func TestRollingUpgradeForStatefulSetWithConfigmapInProjectedVolumeUsingErs(t *t
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForStatefulSetWithSecretUsingErs(t *testing.T) {
@@ -3281,7 +3465,7 @@ func TestRollingUpgradeForStatefulSetWithSecretInProjectedVolumeUsingErs(t *test
t.Errorf("Counter by namespace was not increased")
}
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
testRollingUpgradeInvokeDeleteStrategyErs(t, clients, config, statefulSetFuncs, collectors, envVarPostfix)
}
func TestRollingUpgradeForDeploymentWithPodAnnotationsUsingErs(t *testing.T) {

View File

@@ -17,6 +17,10 @@ var (
ConfigmapReloaderAutoAnnotation = "configmap.reloader.stakater.com/auto"
// SecretReloaderAutoAnnotation is an annotation to detect changes in secrets
SecretReloaderAutoAnnotation = "secret.reloader.stakater.com/auto"
// ConfigmapReloaderAutoAnnotation is a comma separated list of configmaps that excludes detecting changes on cms
ConfigmapExcludeReloaderAnnotation = "configmaps.exclude.reloader.stakater.com/reload"
// SecretExcludeReloaderAnnotation is a comma separated list of secrets that excludes detecting changes on secrets
SecretExcludeReloaderAnnotation = "secrets.exclude.reloader.stakater.com/reload"
// AutoSearchAnnotation is an annotation to detect changes in
// configmaps or triggers with the SearchMatchAnnotation
AutoSearchAnnotation = "reloader.stakater.com/search"

View File

@@ -503,6 +503,37 @@ func GetDeploymentWithTypedAutoAnnotation(namespace string, deploymentName strin
}
}
func GetDeploymentWithExcludeAnnotation(namespace string, deploymentName string, resourceType string) *appsv1.Deployment {
replicaset := int32(1)
annotation := map[string]string{}
if resourceType == SecretResourceType {
annotation[options.SecretExcludeReloaderAnnotation] = deploymentName
} else if resourceType == ConfigmapResourceType {
annotation[options.ConfigmapExcludeReloaderAnnotation] = deploymentName
}
return &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: deploymentName,
Namespace: namespace,
Labels: map[string]string{"firstLabel": "temp"},
Annotations: annotation,
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{"secondLabel": "temp"},
},
Replicas: &replicaset,
Strategy: appsv1.DeploymentStrategy{
Type: appsv1.RollingUpdateDeploymentStrategyType,
},
Template: getPodTemplateSpecWithVolumes(deploymentName),
},
}
}
// GetDaemonSet provides daemonset for testing
func GetDaemonSet(namespace string, daemonsetName string) *appsv1.DaemonSet {
return &appsv1.DaemonSet{
@@ -773,6 +804,15 @@ func CreateDeploymentWithTypedAutoAnnotation(client kubernetes.Interface, deploy
return deployment, err
}
// CreateDeploymentWithExcludeAnnotation creates a deployment in given namespace and returns the Deployment with typed auto annotation
func CreateDeploymentWithExcludeAnnotation(client kubernetes.Interface, deploymentName string, namespace string, resourceType string) (*appsv1.Deployment, error) {
logrus.Infof("Creating Deployment")
deploymentClient := client.AppsV1().Deployments(namespace)
deploymentObj := GetDeploymentWithExcludeAnnotation(namespace, deploymentName, resourceType)
deployment, err := deploymentClient.Create(context.TODO(), deploymentObj, metav1.CreateOptions{})
return deployment, err
}
// CreateDaemonSet creates a deployment in given namespace and returns the DaemonSet
func CreateDaemonSet(client kubernetes.Interface, daemonsetName string, namespace string, volumeMount bool) (*appsv1.DaemonSet, error) {
logrus.Infof("Creating DaemonSet")

View File

@@ -22,6 +22,17 @@
"https:\/\/github\\.com\/(?<depName>.*)\/releases\/download\/(?<currentValue>.*)\/.*\\.zip"
],
"datasourceTemplate": "github-releases"
},
{
"customType": "regex",
"description": "Update Helm Chart values file",
"fileMatch": [
"values\\.yaml$"
],
"matchStrings": [
"image:\\s*name: (?<depName>[a-zA-Z0-9\\.\\/]*)\\s*tag: (?<currentValue>[a-zA-Z0-9\\.\\/]*)"
],
"datasourceTemplate": "docker"
}
]
}

View File

@@ -3,13 +3,8 @@ root/buildinfo
etc/ssl/certs
etc/redhat-release
usr/share/zoneinfo
usr/lib64/ld-2.28.so
usr/lib64/ld-linux-x86-64.so.2
usr/lib64/libc-2.28.so
usr/lib64/libc.so.6
usr/lib64/libdl-2.28.so
usr/lib64/libdl.so.2
usr/lib64/libpthread-2.28.so
usr/lib64/libpthread.so.0
usr/lib64/libm-2.28.so
usr/lib64/libm.so.6
usr/lib64/libm.so.6

View File

@@ -3,13 +3,8 @@ root/buildinfo
etc/ssl/certs
etc/redhat-release
usr/share/zoneinfo
usr/lib64/ld-2.28.so
usr/lib64/ld-linux-aarch64.so.1
usr/lib64/libc-2.28.so
usr/lib/ld-linux-aarch64.so.1
usr/lib64/libc.so.6
usr/lib64/libdl-2.28.so
usr/lib64/libdl.so.2
usr/lib64/libpthread-2.28.so
usr/lib64/libpthread.so.0
usr/lib64/libm-2.28.so
usr/lib64/libm.so.6
usr/lib64/libm.so.6