Compare commits
24 Commits
v2.0.1
...
ksm-dashbo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dbe870455 | ||
|
|
44d69d6fc0 | ||
|
|
4d76ff4e6a | ||
|
|
1eaf259e52 | ||
|
|
bca1fa0968 | ||
|
|
bd79884d84 | ||
|
|
3b42b200d3 | ||
|
|
dad4a20fa7 | ||
|
|
90d95988aa | ||
|
|
e88577fe52 | ||
|
|
6fa495b843 | ||
|
|
3311bfd3ca | ||
|
|
cfd4d285da | ||
|
|
c751bf6bdb | ||
|
|
6f94844a35 | ||
|
|
f74d097837 | ||
|
|
0a58b0cdad | ||
|
|
6f94ec728f | ||
|
|
e3747209eb | ||
|
|
36b39a50a4 | ||
|
|
d9c7ff8685 | ||
|
|
625d865625 | ||
|
|
00c6bd0240 | ||
|
|
506da2466b |
29
.github/workflows/action.yaml
vendored
Normal file
29
.github/workflows/action.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: test-gh-action
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'action/**'
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'action/**'
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'release/**'
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
actions:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.version }}
|
||||||
|
name: action on ${{ matrix.version }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
- name: Setup flux
|
||||||
|
uses: ./action
|
||||||
3
.github/workflows/backport.yaml
vendored
3
.github/workflows/backport.yaml
vendored
@@ -8,7 +8,8 @@ jobs:
|
|||||||
pull-request:
|
pull-request:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
|
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged && (github.event_name != 'labeled' || startsWith('backport:', github.event.label.name))
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
2
.github/workflows/e2e-bootstrap.yaml
vendored
2
.github/workflows/e2e-bootstrap.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
**/go.sum
|
**/go.sum
|
||||||
**/go.mod
|
**/go.mod
|
||||||
- name: Setup Kubernetes
|
- name: Setup Kubernetes
|
||||||
uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
||||||
with:
|
with:
|
||||||
version: v0.20.0
|
version: v0.20.0
|
||||||
cluster_name: kind
|
cluster_name: kind
|
||||||
|
|||||||
2
.github/workflows/e2e.yaml
vendored
2
.github/workflows/e2e.yaml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
**/go.sum
|
**/go.sum
|
||||||
**/go.mod
|
**/go.mod
|
||||||
- name: Setup Kubernetes
|
- name: Setup Kubernetes
|
||||||
uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0
|
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
|
||||||
with:
|
with:
|
||||||
version: v0.20.0
|
version: v0.20.0
|
||||||
cluster_name: kind
|
cluster_name: kind
|
||||||
|
|||||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@16c0bc4a6e6ada2cfd8afd41d22d95379cf7c32a # v2.8.0
|
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
|
||||||
- name: Setup Syft
|
- name: Setup Syft
|
||||||
uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3
|
uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3
|
||||||
- name: Setup Cosign
|
- name: Setup Cosign
|
||||||
@@ -94,10 +94,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
hashes=$(echo $ARTIFACTS | jq --raw-output '.[] | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {digest} + {name} | join(" ") | sub("^sha256:";"")' | base64 -w0)
|
hashes=$(echo -E $ARTIFACTS | jq --raw-output '.[] | {name, "digest": (.extra.Digest // .extra.Checksum)} | select(.digest) | {digest} + {name} | join(" ") | sub("^sha256:";"")' | base64 -w0)
|
||||||
echo "hashes=$hashes" >> $GITHUB_OUTPUT
|
echo "hashes=$hashes" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
image_url=fluxcd/flux-cli:${{ steps.prep.outputs.version }}
|
image_url=fluxcd/flux-cli:$GITHUB_REF_NAME
|
||||||
echo "image_url=$image_url" >> $GITHUB_OUTPUT
|
echo "image_url=$image_url" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
image_digest=$(docker buildx imagetools inspect ${image_url} --format '{{json .}}' | jq -r .manifest.digest)
|
image_digest=$(docker buildx imagetools inspect ${image_url} --format '{{json .}}' | jq -r .manifest.digest)
|
||||||
|
|||||||
212
action/README.md
212
action/README.md
@@ -1,216 +1,22 @@
|
|||||||
# Flux GitHub Action
|
# Flux GitHub Action
|
||||||
|
|
||||||
Usage:
|
To install the latest Flux CLI on Linux, macOS or Windows GitHub runners:
|
||||||
|
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- name: Setup Flux CLI
|
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
- name: Run Flux commands
|
|
||||||
run: flux -v
|
|
||||||
```
|
|
||||||
|
|
||||||
The latest stable version of the `flux` binary is downloaded from
|
|
||||||
GitHub [releases](https://github.com/fluxcd/flux2/releases)
|
|
||||||
and placed at `/usr/local/bin/flux`.
|
|
||||||
|
|
||||||
Note that this action can only be used on GitHub **Linux** runners.
|
|
||||||
You can change the arch (defaults to `amd64`) with:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Flux CLI
|
- name: Setup Flux CLI
|
||||||
uses: fluxcd/flux2/action@main
|
uses: fluxcd/flux2/action@main
|
||||||
with:
|
with:
|
||||||
arch: arm64 # can be amd64, arm64 or arm
|
version: 'latest'
|
||||||
|
- name: Run Flux CLI
|
||||||
|
run: flux version --client
|
||||||
```
|
```
|
||||||
|
|
||||||
You can download a specific version with:
|
The Flux GitHub Action can be used to automate various tasks in CI, such as:
|
||||||
|
|
||||||
```yaml
|
- [Automate Flux upgrades on clusters via Pull Requests](https://fluxcd.io/flux/flux-gh-action/#automate-flux-updates)
|
||||||
steps:
|
- [Push Kubernetes manifests to container registries](https://fluxcd.io/flux/flux-gh-action/#push-kubernetes-manifests-to-container-registries)
|
||||||
- name: Setup Flux CLI
|
- [Run end-to-end testing with Flux and Kubernetes Kind](https://fluxcd.io/flux/flux-gh-action/#end-to-end-testing)
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
with:
|
|
||||||
version: 0.32.0
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also authenticate against the GitHub API using GitHub Actions' `GITHUB_TOKEN` secret.
|
For more information, please see the [Flux GitHub Action documentation](/flux/flux-gh-action.md).
|
||||||
|
|
||||||
For more information, please [read about the GitHub token secret](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret).
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- name: Setup Flux CLI
|
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
```
|
|
||||||
|
|
||||||
This is useful if you are seeing failures on shared runners, those failures are usually API limits being hit.
|
|
||||||
|
|
||||||
### Automate Flux updates
|
|
||||||
|
|
||||||
Example workflow for updating Flux's components generated with `flux bootstrap --path=clusters/production`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: update-flux
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 * * * *"
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
components:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Flux CLI
|
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
- name: Check for updates
|
|
||||||
id: update
|
|
||||||
run: |
|
|
||||||
flux install \
|
|
||||||
--export > ./clusters/production/flux-system/gotk-components.yaml
|
|
||||||
|
|
||||||
VERSION="$(flux -v)"
|
|
||||||
echo "flux_version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
- name: Create Pull Request
|
|
||||||
uses: peter-evans/create-pull-request@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
branch: update-flux
|
|
||||||
commit-message: Update to ${{ steps.update.outputs.flux_version }}
|
|
||||||
title: Update to ${{ steps.update.outputs.flux_version }}
|
|
||||||
body: |
|
|
||||||
${{ steps.update.outputs.flux_version }}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Push Kubernetes manifests to container registries
|
|
||||||
|
|
||||||
Example workflow for publishing Kubernetes manifests bundled as OCI artifacts to GitHub Container Registry:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: push-artifact-staging
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
packages: write # needed for ghcr.io access
|
|
||||||
|
|
||||||
env:
|
|
||||||
OCI_REPO: "oci://ghcr.io/my-org/manifests/${{ github.event.repository.name }}"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
kubernetes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Flux CLI
|
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
- name: Login to GHCR
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Generate manifests
|
|
||||||
run: |
|
|
||||||
kustomize build ./manifests/staging > ./deploy/app.yaml
|
|
||||||
- name: Push manifests
|
|
||||||
run: |
|
|
||||||
flux push artifact $OCI_REPO:$(git rev-parse --short HEAD) \
|
|
||||||
--path="./deploy" \
|
|
||||||
--source="$(git config --get remote.origin.url)" \
|
|
||||||
--revision="$(git branch --show-current)@sha1:$(git rev-parse HEAD)"
|
|
||||||
- name: Deploy manifests to staging
|
|
||||||
run: |
|
|
||||||
flux tag artifact $OCI_REPO:$(git rev-parse --short HEAD) --tag staging
|
|
||||||
```
|
|
||||||
|
|
||||||
### Push and sign Kubernetes manifests to container registries
|
|
||||||
|
|
||||||
Example workflow for publishing Kubernetes manifests bundled as OCI artifacts
|
|
||||||
which are signed with Cosign and GitHub OIDC:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: push-sign-artifact
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
packages: write # needed for ghcr.io access
|
|
||||||
id-token: write # needed for keyless signing
|
|
||||||
|
|
||||||
env:
|
|
||||||
OCI_REPO: "oci://ghcr.io/my-org/manifests/${{ github.event.repository.name }}"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
kubernetes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Flux CLI
|
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
- name: Setup Cosign
|
|
||||||
uses: sigstore/cosign-installer@main
|
|
||||||
- name: Login to GHCR
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Push and sign manifests
|
|
||||||
run: |
|
|
||||||
digest_url=$(flux push artifact \
|
|
||||||
$OCI_REPO:$(git rev-parse --short HEAD) \
|
|
||||||
--path="./manifests" \
|
|
||||||
--source="$(git config --get remote.origin.url)" \
|
|
||||||
--revision="$(git branch --show-current)@sha1:$(git rev-parse HEAD)" |\
|
|
||||||
jq -r '. | .repository + "@" + .digest')
|
|
||||||
|
|
||||||
cosign sign $digest_url
|
|
||||||
```
|
|
||||||
|
|
||||||
### End-to-end testing
|
|
||||||
|
|
||||||
Example workflow for running Flux in Kubernetes Kind:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: e2e
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
kubernetes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Flux CLI
|
|
||||||
uses: fluxcd/flux2/action@main
|
|
||||||
- name: Setup Kubernetes Kind
|
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
|
||||||
- name: Install Flux in Kubernetes Kind
|
|
||||||
run: flux install
|
|
||||||
```
|
|
||||||
|
|
||||||
A complete e2e testing workflow is available here
|
|
||||||
[flux2-kustomize-helm-example](https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/.github/workflows/e2e.yaml)
|
|
||||||
|
|||||||
@@ -1,64 +1,120 @@
|
|||||||
name: Setup Flux CLI
|
name: Setup Flux CLI
|
||||||
description: A GitHub Action for running Flux commands
|
description: A GitHub Action for installing the Flux CLI
|
||||||
author: Stefan Prodan
|
author: Flux project
|
||||||
branding:
|
branding:
|
||||||
color: blue
|
color: blue
|
||||||
icon: command
|
icon: command
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: "Flux version e.g. 0.8.0 (defaults to latest stable release)"
|
description: "Flux version e.g. 2.0.0 (defaults to latest stable release)"
|
||||||
required: false
|
required: false
|
||||||
arch:
|
arch:
|
||||||
description: "arch can be amd64, arm64 or arm"
|
description: "arch can be amd64, arm64 or arm"
|
||||||
required: true
|
required: false
|
||||||
default: "amd64"
|
deprecationMessage: "No longer required, action will now detect runner arch."
|
||||||
bindir:
|
bindir:
|
||||||
description: "Optional location of the Flux binary. Will not use sudo if set. Updates System Path."
|
description: "Alternative location for the Flux binary, defaults to path relative to $RUNNER_TOOL_CACHE."
|
||||||
required: false
|
required: false
|
||||||
token:
|
token:
|
||||||
description: "GitHub Token used to authentication against the API (generally only needed to prevent quota limit errors)"
|
description: "Token used to authentication against the GitHub.com API. Defaults to the token from the GitHub context of the workflow."
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: "Download flux binary to tmp"
|
- name: "Download the binary to the runner's cache dir"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
ARCH=${{ inputs.arch }}
|
|
||||||
VERSION=${{ inputs.version }}
|
VERSION=${{ inputs.version }}
|
||||||
|
|
||||||
TOKEN=${{ inputs.token }}
|
TOKEN=${{ inputs.token }}
|
||||||
|
if [[ -z "$TOKEN" ]]; then
|
||||||
|
TOKEN=${{ github.token }}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "${VERSION}" ]; then
|
if [[ -z "$VERSION" ]] || [[ "$VERSION" = "latest" ]]; then
|
||||||
if [ -n "${TOKEN}" ]; then
|
VERSION=$(curl -fsSL -H "Authorization: token ${TOKEN}" https://api.github.com/repos/fluxcd/flux2/releases/latest | grep tag_name | cut -d '"' -f 4)
|
||||||
VERSION_SLUG=$(curl https://api.github.com/repos/fluxcd/flux2/releases/latest --silent --location --header "Authorization: token ${TOKEN}" | grep tag_name)
|
fi
|
||||||
|
if [[ -z "$VERSION" ]]; then
|
||||||
|
echo "Unable to determine Flux CLI version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ $VERSION = v* ]]; then
|
||||||
|
VERSION="${VERSION:1}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
OS=$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ "$OS" == "macos" ]]; then
|
||||||
|
OS="darwin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ARCH=$(echo "${RUNNER_ARCH}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [[ "$ARCH" == "x64" ]]; then
|
||||||
|
ARCH="amd64"
|
||||||
|
elif [[ "$ARCH" == "x86" ]]; then
|
||||||
|
ARCH="386"
|
||||||
|
fi
|
||||||
|
|
||||||
|
FLUX_EXEC_FILE="flux"
|
||||||
|
if [[ "$OS" == "windows" ]]; then
|
||||||
|
FLUX_EXEC_FILE="${FLUX_EXEC_FILE}.exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
FLUX_TOOL_DIR=${{ inputs.bindir }}
|
||||||
|
if [[ -z "$FLUX_TOOL_DIR" ]]; then
|
||||||
|
FLUX_TOOL_DIR="${RUNNER_TOOL_CACHE}/flux2/${VERSION}/${OS}/${ARCH}"
|
||||||
|
fi
|
||||||
|
if [[ ! -x "$FLUX_TOOL_DIR/FLUX_EXEC_FILE" ]]; then
|
||||||
|
DL_DIR="$(mktemp -dt flux2-XXXXXX)"
|
||||||
|
trap 'rm -rf $DL_DIR' EXIT
|
||||||
|
|
||||||
|
echo "Downloading flux ${VERSION} for ${OS}/${ARCH}"
|
||||||
|
FLUX_TARGET_FILE="flux_${VERSION}_${OS}_${ARCH}.tar.gz"
|
||||||
|
if [[ "$OS" == "windows" ]]; then
|
||||||
|
FLUX_TARGET_FILE="flux_${VERSION}_${OS}_${ARCH}.zip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
FLUX_CHECKSUMS_FILE="flux_${VERSION}_checksums.txt"
|
||||||
|
|
||||||
|
FLUX_DOWNLOAD_URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/"
|
||||||
|
|
||||||
|
curl -fsSL -o "$DL_DIR/$FLUX_TARGET_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_TARGET_FILE"
|
||||||
|
curl -fsSL -o "$DL_DIR/$FLUX_CHECKSUMS_FILE" "$FLUX_DOWNLOAD_URL/$FLUX_CHECKSUMS_FILE"
|
||||||
|
|
||||||
|
echo "Verifying checksum"
|
||||||
|
sum=""
|
||||||
|
if command -v openssl > /dev/null; then
|
||||||
|
sum=$(openssl sha256 "$DL_DIR/$FLUX_TARGET_FILE" | awk '{print $2}')
|
||||||
|
elif command -v sha256sum > /dev/null; then
|
||||||
|
sum=$(sha256sum "$DL_DIR/$FLUX_TARGET_FILE" | awk '{print $1}')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$sum" ]]; then
|
||||||
|
echo "Neither openssl nor sha256sum found. Cannot calculate checksum."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
expected_sum=$(grep " $FLUX_TARGET_FILE\$" "$DL_DIR/$FLUX_CHECKSUMS_FILE" | awk '{print $1}')
|
||||||
|
if [ "$sum" != "$expected_sum" ]; then
|
||||||
|
echo "SHA sum of ${FLUX_TARGET_FILE} does not match. Aborting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing flux to ${FLUX_TOOL_DIR}"
|
||||||
|
mkdir -p "$FLUX_TOOL_DIR"
|
||||||
|
|
||||||
|
if [[ "$OS" == "windows" ]]; then
|
||||||
|
unzip "$DL_DIR/$FLUX_TARGET_FILE" "$FLUX_EXEC_FILE" -d "$FLUX_TOOL_DIR"
|
||||||
else
|
else
|
||||||
# With no GITHUB_TOKEN you will experience occasional failures due to rate limiting
|
tar xzf "$DL_DIR/$FLUX_TARGET_FILE" -C "$FLUX_TOOL_DIR" $FLUX_EXEC_FILE
|
||||||
# Ref: https://github.com/fluxcd/flux2/issues/3509#issuecomment-1400820992
|
|
||||||
VERSION_SLUG=$(curl https://api.github.com/repos/fluxcd/flux2/releases/latest --silent --location | grep tag_name)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=$(echo "${VERSION_SLUG}" | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 2-)
|
chmod +x "$FLUX_TOOL_DIR/$FLUX_EXEC_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BIN_URL="https://github.com/fluxcd/flux2/releases/download/v${VERSION}/flux_${VERSION}_linux_${ARCH}.tar.gz"
|
echo "Adding flux to path"
|
||||||
curl --silent --fail --location "${BIN_URL}" --output /tmp/flux.tar.gz
|
echo "$FLUX_TOOL_DIR" >> "$GITHUB_PATH"
|
||||||
mkdir -p /tmp/flux
|
|
||||||
tar -C /tmp/flux/ -zxvf /tmp/flux.tar.gz
|
- name: "Print installed flux version"
|
||||||
- name: "Copy Flux binary to execute location"
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
BINDIR=${{ inputs.bindir }}
|
|
||||||
if [ -z "${BINDIR}" ]; then
|
|
||||||
sudo cp /tmp/flux/flux /usr/local/bin
|
|
||||||
else
|
|
||||||
cp /tmp/flux/flux "${BINDIR}"
|
|
||||||
echo "${BINDIR}" >> $GITHUB_PATH
|
|
||||||
fi
|
|
||||||
- name: "Cleanup tmp"
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
rm -rf /tmp/flux/ /tmp/flux.tar.gz
|
|
||||||
- name: "Verify correct installation of binary"
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
flux -v
|
flux -v
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ spec:
|
|||||||
tmpl := map[string]string{
|
tmpl := map[string]string{
|
||||||
"fluxns": allocateNamespace("flux-system"),
|
"fluxns": allocateNamespace("flux-system"),
|
||||||
}
|
}
|
||||||
|
setup(t, tmpl)
|
||||||
|
|
||||||
testEnv.CreateObjectFile("./testdata/build-kustomization/podinfo-source.yaml", tmpl, t)
|
testEnv.CreateObjectFile("./testdata/build-kustomization/podinfo-source.yaml", tmpl, t)
|
||||||
|
|
||||||
|
|||||||
20
go.mod
20
go.mod
@@ -7,28 +7,28 @@ replace github.com/go-git/go-git/v5 => github.com/go-git/go-git/v5 v5.7.1-0.2023
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Masterminds/semver/v3 v3.2.1
|
github.com/Masterminds/semver/v3 v3.2.1
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20230626094100-7e9e0395ebec
|
github.com/ProtonMail/go-crypto v0.0.0-20230710112148-e01326fd72eb
|
||||||
github.com/cyphar/filepath-securejoin v0.2.3
|
github.com/cyphar/filepath-securejoin v0.2.3
|
||||||
github.com/distribution/distribution/v3 v3.0.0-20230629214736-bac7f02e02a1
|
github.com/distribution/distribution/v3 v3.0.0-20230711080520-40ef2353fa4f
|
||||||
github.com/fluxcd/go-git-providers v0.18.0
|
github.com/fluxcd/go-git-providers v0.18.0
|
||||||
github.com/fluxcd/helm-controller/api v0.35.0
|
github.com/fluxcd/helm-controller/api v0.35.0
|
||||||
github.com/fluxcd/image-automation-controller/api v0.35.0
|
github.com/fluxcd/image-automation-controller/api v0.35.0
|
||||||
github.com/fluxcd/image-reflector-controller/api v0.29.0
|
github.com/fluxcd/image-reflector-controller/api v0.29.1
|
||||||
github.com/fluxcd/kustomize-controller/api v1.0.0
|
github.com/fluxcd/kustomize-controller/api v1.0.1
|
||||||
github.com/fluxcd/notification-controller/api v1.0.0
|
github.com/fluxcd/notification-controller/api v1.0.0
|
||||||
github.com/fluxcd/pkg/apis/event v0.5.1
|
github.com/fluxcd/pkg/apis/event v0.5.1
|
||||||
github.com/fluxcd/pkg/apis/meta v1.1.1
|
github.com/fluxcd/pkg/apis/meta v1.1.1
|
||||||
github.com/fluxcd/pkg/git v0.12.3
|
github.com/fluxcd/pkg/git v0.12.3
|
||||||
github.com/fluxcd/pkg/git/gogit v0.12.1
|
github.com/fluxcd/pkg/git/gogit v0.12.1
|
||||||
github.com/fluxcd/pkg/kustomize v1.3.4
|
github.com/fluxcd/pkg/kustomize v1.3.4
|
||||||
github.com/fluxcd/pkg/oci v0.28.0
|
github.com/fluxcd/pkg/oci v0.29.0
|
||||||
github.com/fluxcd/pkg/runtime v0.40.0
|
github.com/fluxcd/pkg/runtime v0.40.0
|
||||||
github.com/fluxcd/pkg/sourceignore v0.3.4
|
github.com/fluxcd/pkg/sourceignore v0.3.4
|
||||||
github.com/fluxcd/pkg/ssa v0.28.2
|
github.com/fluxcd/pkg/ssa v0.28.2
|
||||||
github.com/fluxcd/pkg/ssh v0.8.0
|
github.com/fluxcd/pkg/ssh v0.8.0
|
||||||
github.com/fluxcd/pkg/tar v0.2.0
|
github.com/fluxcd/pkg/tar v0.2.0
|
||||||
github.com/fluxcd/pkg/version v0.2.2
|
github.com/fluxcd/pkg/version v0.2.2
|
||||||
github.com/fluxcd/source-controller/api v1.0.0
|
github.com/fluxcd/source-controller/api v1.0.1
|
||||||
github.com/go-git/go-git/v5 v5.7.0
|
github.com/go-git/go-git/v5 v5.7.0
|
||||||
github.com/go-logr/logr v1.2.4
|
github.com/go-logr/logr v1.2.4
|
||||||
github.com/gonvenience/bunt v1.3.5
|
github.com/gonvenience/bunt v1.3.5
|
||||||
@@ -45,8 +45,8 @@ require (
|
|||||||
github.com/spf13/cobra v1.7.0
|
github.com/spf13/cobra v1.7.0
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/theckman/yacspin v0.13.12
|
github.com/theckman/yacspin v0.13.12
|
||||||
golang.org/x/crypto v0.10.0
|
golang.org/x/crypto v0.11.0
|
||||||
golang.org/x/term v0.9.0
|
golang.org/x/term v0.10.0
|
||||||
k8s.io/api v0.27.3
|
k8s.io/api v0.27.3
|
||||||
k8s.io/apiextensions-apiserver v0.27.3
|
k8s.io/apiextensions-apiserver v0.27.3
|
||||||
k8s.io/apimachinery v0.27.3
|
k8s.io/apimachinery v0.27.3
|
||||||
@@ -202,8 +202,8 @@ require (
|
|||||||
golang.org/x/net v0.11.0 // indirect
|
golang.org/x/net v0.11.0 // indirect
|
||||||
golang.org/x/oauth2 v0.7.0 // indirect
|
golang.org/x/oauth2 v0.7.0 // indirect
|
||||||
golang.org/x/sync v0.3.0 // indirect
|
golang.org/x/sync v0.3.0 // indirect
|
||||||
golang.org/x/sys v0.9.0 // indirect
|
golang.org/x/sys v0.10.0 // indirect
|
||||||
golang.org/x/text v0.10.0 // indirect
|
golang.org/x/text v0.11.0 // indirect
|
||||||
golang.org/x/time v0.3.0 // indirect
|
golang.org/x/time v0.3.0 // indirect
|
||||||
golang.org/x/tools v0.10.0 // indirect
|
golang.org/x/tools v0.10.0 // indirect
|
||||||
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
|
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
|
||||||
|
|||||||
40
go.sum
40
go.sum
@@ -23,8 +23,8 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v
|
|||||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
||||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
||||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20230626094100-7e9e0395ebec h1:vV3RryLxt42+ZIVOFbYJCH1jsZNTNmj2NYru5zfx+4E=
|
github.com/ProtonMail/go-crypto v0.0.0-20230710112148-e01326fd72eb h1:RU+Ff2vE68zFQSoBqlb/LChFztEWWJ9EZ8LU4gA3ubU=
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20230626094100-7e9e0395ebec/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
github.com/ProtonMail/go-crypto v0.0.0-20230710112148-e01326fd72eb/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
||||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs=
|
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs=
|
||||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
|
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
|
||||||
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
|
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
|
||||||
@@ -105,8 +105,8 @@ github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG
|
|||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/distribution/distribution/v3 v3.0.0-20230629214736-bac7f02e02a1 h1:yRwt9RluqBtKyDLRY7J0Cf/TVqvG56vKx2Eyndy8qNQ=
|
github.com/distribution/distribution/v3 v3.0.0-20230711080520-40ef2353fa4f h1:Df8k7piYnfycy7zSBLkN2oQaoIz1vw+msSgajUA+yKE=
|
||||||
github.com/distribution/distribution/v3 v3.0.0-20230629214736-bac7f02e02a1/go.mod h1:+fqBJ4vPYo4Uu1ZE4d+bUtTLRXfdSL3NvCZIZ9GHv58=
|
github.com/distribution/distribution/v3 v3.0.0-20230711080520-40ef2353fa4f/go.mod h1:+fqBJ4vPYo4Uu1ZE4d+bUtTLRXfdSL3NvCZIZ9GHv58=
|
||||||
github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
|
github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
|
||||||
github.com/docker/cli v23.0.5+incompatible h1:ufWmAOuD3Vmr7JP2G5K3cyuNC4YZWiAsuDEvFVVDafE=
|
github.com/docker/cli v23.0.5+incompatible h1:ufWmAOuD3Vmr7JP2G5K3cyuNC4YZWiAsuDEvFVVDafE=
|
||||||
github.com/docker/cli v23.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
github.com/docker/cli v23.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||||
@@ -155,10 +155,10 @@ github.com/fluxcd/helm-controller/api v0.35.0 h1:UyhKXPni5z69DzPW7GtECGGdUwKsB+O
|
|||||||
github.com/fluxcd/helm-controller/api v0.35.0/go.mod h1:CdHMtr5wM0xgDt/PS147H7QQS+zDxAFgDW3ZN8MnUlU=
|
github.com/fluxcd/helm-controller/api v0.35.0/go.mod h1:CdHMtr5wM0xgDt/PS147H7QQS+zDxAFgDW3ZN8MnUlU=
|
||||||
github.com/fluxcd/image-automation-controller/api v0.35.0 h1:B7yJdAbnx0hwI6ffVu0YAyc3d3sqjXrv6ySK++g3t28=
|
github.com/fluxcd/image-automation-controller/api v0.35.0 h1:B7yJdAbnx0hwI6ffVu0YAyc3d3sqjXrv6ySK++g3t28=
|
||||||
github.com/fluxcd/image-automation-controller/api v0.35.0/go.mod h1:67HbnrXDy550zJKZZbzAZ0yfzL0Ge1O18yn/shcgy0Y=
|
github.com/fluxcd/image-automation-controller/api v0.35.0/go.mod h1:67HbnrXDy550zJKZZbzAZ0yfzL0Ge1O18yn/shcgy0Y=
|
||||||
github.com/fluxcd/image-reflector-controller/api v0.29.0 h1:Epzq0b2sYxgSwKPBN0BWEInQwMLsvU7sjqKJuzGtyIg=
|
github.com/fluxcd/image-reflector-controller/api v0.29.1 h1:mnFaO60b8WyCxpc72utmAJ7J1ZtZjGGThH9NdxVeEyo=
|
||||||
github.com/fluxcd/image-reflector-controller/api v0.29.0/go.mod h1:aYwq15SpkAD/urQme2iEsNouTscfR1Qo39KBlJ+0EW8=
|
github.com/fluxcd/image-reflector-controller/api v0.29.1/go.mod h1:aYwq15SpkAD/urQme2iEsNouTscfR1Qo39KBlJ+0EW8=
|
||||||
github.com/fluxcd/kustomize-controller/api v1.0.0 h1:BVz6lEpfGbny0ppQ82LloLSK0OoEGC51YQaw31j4vT8=
|
github.com/fluxcd/kustomize-controller/api v1.0.1 h1:zz9zx4Mc7rw9gqdgdhMWX1uDM2uR1x7WBUujKs4mdx8=
|
||||||
github.com/fluxcd/kustomize-controller/api v1.0.0/go.mod h1:rYUovoofr3bVPgQowWj/CSGw73qoH0tOCopJ3oNh7lM=
|
github.com/fluxcd/kustomize-controller/api v1.0.1/go.mod h1:rYUovoofr3bVPgQowWj/CSGw73qoH0tOCopJ3oNh7lM=
|
||||||
github.com/fluxcd/notification-controller/api v1.0.0 h1:WiXS116pwhFp7Qe/Fc1GmKCfLBRnZu+rYCeIn07cO+4=
|
github.com/fluxcd/notification-controller/api v1.0.0 h1:WiXS116pwhFp7Qe/Fc1GmKCfLBRnZu+rYCeIn07cO+4=
|
||||||
github.com/fluxcd/notification-controller/api v1.0.0/go.mod h1:uamWZwmhSHE7xdJkgRhH4Eo5/SKKILFI4o+CoQjlczc=
|
github.com/fluxcd/notification-controller/api v1.0.0/go.mod h1:uamWZwmhSHE7xdJkgRhH4Eo5/SKKILFI4o+CoQjlczc=
|
||||||
github.com/fluxcd/pkg/apis/acl v0.1.0 h1:EoAl377hDQYL3WqanWCdifauXqXbMyFuK82NnX6pH4Q=
|
github.com/fluxcd/pkg/apis/acl v0.1.0 h1:EoAl377hDQYL3WqanWCdifauXqXbMyFuK82NnX6pH4Q=
|
||||||
@@ -176,8 +176,8 @@ github.com/fluxcd/pkg/git/gogit v0.12.1/go.mod h1:Z4Ysp8VifKTvWpjJMKncJsgb2iBqHu
|
|||||||
github.com/fluxcd/pkg/gittestserver v0.8.4 h1:rA/QUZnfH77ZZG+5xfMqjgEHJdzeeE6Nn1o8cops/bU=
|
github.com/fluxcd/pkg/gittestserver v0.8.4 h1:rA/QUZnfH77ZZG+5xfMqjgEHJdzeeE6Nn1o8cops/bU=
|
||||||
github.com/fluxcd/pkg/kustomize v1.3.4 h1:+XA4umfhkFqrNYQp3ZmKSJy4i3LWjbgoi6H4PllkkkA=
|
github.com/fluxcd/pkg/kustomize v1.3.4 h1:+XA4umfhkFqrNYQp3ZmKSJy4i3LWjbgoi6H4PllkkkA=
|
||||||
github.com/fluxcd/pkg/kustomize v1.3.4/go.mod h1:nsbsNGe6nQY6DGYYPowFGQlhxFRcaRFvbwqhCbwAQuE=
|
github.com/fluxcd/pkg/kustomize v1.3.4/go.mod h1:nsbsNGe6nQY6DGYYPowFGQlhxFRcaRFvbwqhCbwAQuE=
|
||||||
github.com/fluxcd/pkg/oci v0.28.0 h1:E8VvMFzU/+9vgM4IFbiwmCwaMPCq1WXPiKUmHtDVSbc=
|
github.com/fluxcd/pkg/oci v0.29.0 h1:LACJNooDB4ZWVqRkB+V5MSPE04327DBbI/8BdWFzP8Y=
|
||||||
github.com/fluxcd/pkg/oci v0.28.0/go.mod h1:eFP5sQH4yWghFbcLWxdo0eI6wZ4h3HiTW0UoG33S2pg=
|
github.com/fluxcd/pkg/oci v0.29.0/go.mod h1:x91ESIQjUimZSElpJTVRx3yPFBmimvulni9iBsCwXlw=
|
||||||
github.com/fluxcd/pkg/runtime v0.40.0 h1:uGiiEbMZwd7xmbKaVmcH7iilCFW9betWbz0r1taK3G0=
|
github.com/fluxcd/pkg/runtime v0.40.0 h1:uGiiEbMZwd7xmbKaVmcH7iilCFW9betWbz0r1taK3G0=
|
||||||
github.com/fluxcd/pkg/runtime v0.40.0/go.mod h1:BqHEOVrZmt19p0q1OlGFWAYh3rZ28+IBpxLB2yPjjQ4=
|
github.com/fluxcd/pkg/runtime v0.40.0/go.mod h1:BqHEOVrZmt19p0q1OlGFWAYh3rZ28+IBpxLB2yPjjQ4=
|
||||||
github.com/fluxcd/pkg/sourceignore v0.3.4 h1:0cfS2Pj7xp2qpaerMjYqOBr82LC+/mGHl6v6pRbi5hs=
|
github.com/fluxcd/pkg/sourceignore v0.3.4 h1:0cfS2Pj7xp2qpaerMjYqOBr82LC+/mGHl6v6pRbi5hs=
|
||||||
@@ -190,8 +190,8 @@ github.com/fluxcd/pkg/tar v0.2.0 h1:HEUHgONQYsJGeZZ4x6h5nQU9Aox1I4T3bOp1faWTqf8=
|
|||||||
github.com/fluxcd/pkg/tar v0.2.0/go.mod h1:w0/TOC7kwBJhnSJn7TCABkc/I7ib1f2Yz6vOsbLBnhw=
|
github.com/fluxcd/pkg/tar v0.2.0/go.mod h1:w0/TOC7kwBJhnSJn7TCABkc/I7ib1f2Yz6vOsbLBnhw=
|
||||||
github.com/fluxcd/pkg/version v0.2.2 h1:ZpVXECeLA5hIQMft11iLp6gN3cKcz6UNuVTQPw/bRdI=
|
github.com/fluxcd/pkg/version v0.2.2 h1:ZpVXECeLA5hIQMft11iLp6gN3cKcz6UNuVTQPw/bRdI=
|
||||||
github.com/fluxcd/pkg/version v0.2.2/go.mod h1:NGnh/no8S6PyfCDxRFrPY3T5BUnqP48MxfxNRU0z8C0=
|
github.com/fluxcd/pkg/version v0.2.2/go.mod h1:NGnh/no8S6PyfCDxRFrPY3T5BUnqP48MxfxNRU0z8C0=
|
||||||
github.com/fluxcd/source-controller/api v1.0.0 h1:lPjmCXmEiI3tY4pReeVQBMuyLgdH8462W5ewUa9kgYM=
|
github.com/fluxcd/source-controller/api v1.0.1 h1:nycylbNBnQd+EO4UHpqXqAQJ1cGAPxgBbrfERCQ1pp8=
|
||||||
github.com/fluxcd/source-controller/api v1.0.0/go.mod h1:rAY5FRFGZUKpIFNyYANHIgPgJPvbALBHWsq/zHw/cXQ=
|
github.com/fluxcd/source-controller/api v1.0.1/go.mod h1:rAY5FRFGZUKpIFNyYANHIgPgJPvbALBHWsq/zHw/cXQ=
|
||||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
@@ -525,8 +525,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
|
|||||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||||
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
|
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
|
||||||
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
|
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
@@ -605,16 +605,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|||||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
|
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
|
||||||
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||||
golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28=
|
golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
|
||||||
golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
|
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
@@ -624,8 +624,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|||||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||||
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
|
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
|
||||||
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||||
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
|
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
|
||||||
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
|||||||
@@ -204,19 +204,36 @@ func NewBuilder(name, resources string, opts ...BuilderOptionFunc) (*Builder, er
|
|||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Builder) resolveKustomization(liveKus *kustomizev1.Kustomization) (k *kustomizev1.Kustomization, err error) {
|
||||||
|
// local kustomization file takes precedence over live kustomization
|
||||||
|
if b.kustomizationFile != "" {
|
||||||
|
k, err = b.unMarshallKustomization()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !b.dryRun && liveKus != nil && liveKus.Status.Inventory != nil {
|
||||||
|
// merge the live kustomization status with the local kustomization in order to get the
|
||||||
|
// live resources status
|
||||||
|
k.Status = *liveKus.Status.DeepCopy()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
k = liveKus
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Builder) getKustomization(ctx context.Context) (*kustomizev1.Kustomization, error) {
|
func (b *Builder) getKustomization(ctx context.Context) (*kustomizev1.Kustomization, error) {
|
||||||
|
liveKus := &kustomizev1.Kustomization{}
|
||||||
namespacedName := types.NamespacedName{
|
namespacedName := types.NamespacedName{
|
||||||
Namespace: b.namespace,
|
Namespace: b.namespace,
|
||||||
Name: b.name,
|
Name: b.name,
|
||||||
}
|
}
|
||||||
|
err := b.client.Get(ctx, namespacedName, liveKus)
|
||||||
k := &kustomizev1.Kustomization{}
|
|
||||||
err := b.client.Get(ctx, namespacedName, k)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return k, nil
|
return liveKus, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build builds the yaml manifests from the kustomization object
|
// Build builds the yaml manifests from the kustomization object
|
||||||
@@ -251,19 +268,18 @@ func (b *Builder) build() (m resmap.ResMap, err error) {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
// Get the kustomization object
|
// Get the kustomization object
|
||||||
var k *kustomizev1.Kustomization
|
liveKus := &kustomizev1.Kustomization{}
|
||||||
if b.kustomizationFile != "" {
|
if !b.dryRun {
|
||||||
k, err = b.unMarshallKustomization()
|
liveKus, err = b.getKustomization(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, fmt.Errorf("failed to get kustomization object: %w", err)
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
k, err = b.getKustomization(ctx)
|
k, err := b.resolveKustomization(liveKus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("failed to get kustomization object: %w", err)
|
err = fmt.Errorf("failed to get kustomization object: %w", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// store the kustomization object
|
// store the kustomization object
|
||||||
b.kustomization = k
|
b.kustomization = k
|
||||||
|
|||||||
@@ -17,10 +17,15 @@ limitations under the License.
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
|
||||||
|
"github.com/fluxcd/pkg/apis/meta"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"sigs.k8s.io/kustomize/api/resource"
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
"sigs.k8s.io/kustomize/kyaml/yaml"
|
"sigs.k8s.io/kustomize/kyaml/yaml"
|
||||||
)
|
)
|
||||||
@@ -215,3 +220,135 @@ func Test_unMarshallKustomization(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_ResolveKustomization(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
localKsFile string
|
||||||
|
liveKustomization *kustomizev1.Kustomization
|
||||||
|
dryrun bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "valid kustomization",
|
||||||
|
localKsFile: "testdata/local-kustomization/valid.yaml",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "local and live kustomization",
|
||||||
|
localKsFile: "testdata/local-kustomization/valid.yaml",
|
||||||
|
liveKustomization: &kustomizev1.Kustomization{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: "podinfo",
|
||||||
|
Namespace: "flux-system",
|
||||||
|
},
|
||||||
|
Spec: kustomizev1.KustomizationSpec{
|
||||||
|
Interval: metav1.Duration{Duration: time.Minute * 5},
|
||||||
|
Path: "./testdata/local-kustomization/valid.yaml",
|
||||||
|
},
|
||||||
|
Status: kustomizev1.KustomizationStatus{
|
||||||
|
Conditions: []metav1.Condition{
|
||||||
|
{
|
||||||
|
Type: meta.ReadyCondition,
|
||||||
|
Status: metav1.ConditionTrue,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Inventory: &kustomizev1.ResourceInventory{
|
||||||
|
Entries: []kustomizev1.ResourceRef{
|
||||||
|
{
|
||||||
|
ID: "flux-system_podinfo_v1_service_podinfo",
|
||||||
|
Version: "v1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "local and live kustomization with dryrun",
|
||||||
|
localKsFile: "testdata/local-kustomization/valid.yaml",
|
||||||
|
liveKustomization: &kustomizev1.Kustomization{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: "podinfo",
|
||||||
|
Namespace: "flux-system",
|
||||||
|
},
|
||||||
|
Spec: kustomizev1.KustomizationSpec{
|
||||||
|
Interval: metav1.Duration{Duration: time.Minute * 5},
|
||||||
|
Path: "./testdata/local-kustomization/valid.yaml",
|
||||||
|
},
|
||||||
|
Status: kustomizev1.KustomizationStatus{
|
||||||
|
Conditions: []metav1.Condition{
|
||||||
|
{
|
||||||
|
Type: meta.ReadyCondition,
|
||||||
|
Status: metav1.ConditionTrue,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Inventory: &kustomizev1.ResourceInventory{
|
||||||
|
Entries: []kustomizev1.ResourceRef{
|
||||||
|
{
|
||||||
|
ID: "flux-system_podinfo_v1_service_podinfo",
|
||||||
|
Version: "v1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dryrun: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "live kustomization",
|
||||||
|
liveKustomization: &kustomizev1.Kustomization{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: "podinfo",
|
||||||
|
Namespace: "flux-system",
|
||||||
|
},
|
||||||
|
Spec: kustomizev1.KustomizationSpec{
|
||||||
|
Interval: metav1.Duration{Duration: time.Minute * 5},
|
||||||
|
Path: "./testdata/local-kustomization/valid.yaml",
|
||||||
|
},
|
||||||
|
Status: kustomizev1.KustomizationStatus{
|
||||||
|
Conditions: []metav1.Condition{
|
||||||
|
{
|
||||||
|
Type: meta.ReadyCondition,
|
||||||
|
Status: metav1.ConditionTrue,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Inventory: &kustomizev1.ResourceInventory{
|
||||||
|
Entries: []kustomizev1.ResourceRef{
|
||||||
|
{
|
||||||
|
ID: "flux-system_podinfo_v1_service_podinfo",
|
||||||
|
Version: "v1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
b := &Builder{}
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
b.kustomizationFile = tt.localKsFile
|
||||||
|
b.dryRun = tt.dryrun
|
||||||
|
ks, err := b.resolveKustomization(tt.liveKustomization)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("unexpected err '%s'", err)
|
||||||
|
}
|
||||||
|
if !tt.dryrun {
|
||||||
|
if b.kustomizationFile == "" {
|
||||||
|
if cmp.Diff(ks, tt.liveKustomization) != "" {
|
||||||
|
t.Errorf("expected kustomization to match live kustomization")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if tt.liveKustomization != nil && cmp.Diff(ks.Status, tt.liveKustomization.Status) != "" {
|
||||||
|
t.Errorf("expected kustomization status to match live kustomization status")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ks.Status.Inventory != nil {
|
||||||
|
fmt.Println(ks.Status.Inventory)
|
||||||
|
t.Errorf("expected kustomization status to be nil")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -136,11 +136,14 @@ func (b *Builder) Diff() (string, bool, error) {
|
|||||||
if b.kustomization.Spec.Prune && len(diffErrs) == 0 {
|
if b.kustomization.Spec.Prune && len(diffErrs) == 0 {
|
||||||
oldStatus := b.kustomization.Status.DeepCopy()
|
oldStatus := b.kustomization.Status.DeepCopy()
|
||||||
if oldStatus.Inventory != nil {
|
if oldStatus.Inventory != nil {
|
||||||
diffObjects, err := diffInventory(oldStatus.Inventory, newInventory)
|
staleObjects, err := diffInventory(oldStatus.Inventory, newInventory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", createdOrDrifted, err
|
return "", createdOrDrifted, err
|
||||||
}
|
}
|
||||||
for _, object := range diffObjects {
|
if len(staleObjects) > 0 {
|
||||||
|
createdOrDrifted = true
|
||||||
|
}
|
||||||
|
for _, object := range staleObjects {
|
||||||
output.WriteString(writeString(fmt.Sprintf("► %s deleted\n", ssa.FmtUnstructured(object)), bunt.OrangeRed))
|
output.WriteString(writeString(fmt.Sprintf("► %s deleted\n", ssa.FmtUnstructured(object)), bunt.OrangeRed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/image-reflector-controller/releases/download/v0.29.0/image-reflector-controller.crds.yaml
|
- https://github.com/fluxcd/image-reflector-controller/releases/download/v0.29.1/image-reflector-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/image-reflector-controller/releases/download/v0.29.0/image-reflector-controller.deployment.yaml
|
- https://github.com/fluxcd/image-reflector-controller/releases/download/v0.29.1/image-reflector-controller.deployment.yaml
|
||||||
- account.yaml
|
- account.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- labels.yaml
|
- labels.yaml
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.0.0/kustomize-controller.crds.yaml
|
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.0.1/kustomize-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.0.0/kustomize-controller.deployment.yaml
|
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.0.1/kustomize-controller.deployment.yaml
|
||||||
- account.yaml
|
- account.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- labels.yaml
|
- labels.yaml
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0/source-controller.crds.yaml
|
- https://github.com/fluxcd/source-controller/releases/download/v1.0.1/source-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0/source-controller.deployment.yaml
|
- https://github.com/fluxcd/source-controller/releases/download/v1.0.1/source-controller.deployment.yaml
|
||||||
- account.yaml
|
- account.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- labels.yaml
|
- labels.yaml
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- https://github.com/fluxcd/source-controller/releases/download/v1.0.0/source-controller.crds.yaml
|
- https://github.com/fluxcd/source-controller/releases/download/v1.0.1/source-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.0.0/kustomize-controller.crds.yaml
|
- https://github.com/fluxcd/kustomize-controller/releases/download/v1.0.1/kustomize-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/helm-controller/releases/download/v0.35.0/helm-controller.crds.yaml
|
- https://github.com/fluxcd/helm-controller/releases/download/v0.35.0/helm-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/notification-controller/releases/download/v1.0.0/notification-controller.crds.yaml
|
- https://github.com/fluxcd/notification-controller/releases/download/v1.0.0/notification-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/image-reflector-controller/releases/download/v0.29.0/image-reflector-controller.crds.yaml
|
- https://github.com/fluxcd/image-reflector-controller/releases/download/v0.29.1/image-reflector-controller.crds.yaml
|
||||||
- https://github.com/fluxcd/image-automation-controller/releases/download/v0.35.0/image-automation-controller.crds.yaml
|
- https://github.com/fluxcd/image-automation-controller/releases/download/v0.35.0/image-automation-controller.crds.yaml
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ spec:
|
|||||||
interval: 5m
|
interval: 5m
|
||||||
chart:
|
chart:
|
||||||
spec:
|
spec:
|
||||||
version: "45.x"
|
version: "48.x"
|
||||||
chart: kube-prometheus-stack
|
chart: kube-prometheus-stack
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
@@ -31,6 +31,249 @@ spec:
|
|||||||
podMonitorSelector:
|
podMonitorSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/component: monitoring
|
app.kubernetes.io/component: monitoring
|
||||||
|
grafana:
|
||||||
|
defaultDashboardsEnabled: false
|
||||||
|
kube-state-metrics:
|
||||||
|
collectors: []
|
||||||
|
extraArgs:
|
||||||
|
- --custom-resource-state-only=true
|
||||||
|
rbac:
|
||||||
|
extraRules:
|
||||||
|
- apiGroups:
|
||||||
|
- source.toolkit.fluxcd.io
|
||||||
|
- kustomize.toolkit.fluxcd.io
|
||||||
|
- helm.toolkit.fluxcd.io
|
||||||
|
- image.toolkit.fluxcd.io
|
||||||
|
- notification.toolkit.fluxcd.io
|
||||||
|
resources:
|
||||||
|
- gitrepositories
|
||||||
|
- buckets
|
||||||
|
- helmrepositories
|
||||||
|
- helmcharts
|
||||||
|
- ocirepositories
|
||||||
|
- kustomizations
|
||||||
|
- helmreleases
|
||||||
|
- imagerepositories
|
||||||
|
- imagepolicies
|
||||||
|
- imageupdateautomations
|
||||||
|
- alerts
|
||||||
|
- providers
|
||||||
|
- receivers
|
||||||
|
verbs: ["list", "watch"]
|
||||||
|
customResourceState:
|
||||||
|
enabled: true
|
||||||
|
config:
|
||||||
|
spec:
|
||||||
|
resources:
|
||||||
|
- groupVersionKind:
|
||||||
|
group: source.toolkit.fluxcd.io
|
||||||
|
version: "v1"
|
||||||
|
kind: GitRepository
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: source.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: Bucket
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: source.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: HelmRepository
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
type: [spec, type]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: source.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: HelmChart
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: source.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: OCIRepository
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: kustomize.toolkit.fluxcd.io
|
||||||
|
version: "v1"
|
||||||
|
kind: Kustomization
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: helm.toolkit.fluxcd.io
|
||||||
|
version: "v2beta1"
|
||||||
|
kind: HelmRelease
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: image.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: ImageRepository
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: image.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: ImagePolicy
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: image.toolkit.fluxcd.io
|
||||||
|
version: "v1beta1"
|
||||||
|
kind: ImageUpdateAutomation
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: notification.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: Alert
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: notification.toolkit.fluxcd.io
|
||||||
|
version: "v1beta2"
|
||||||
|
kind: Provider
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
|
- groupVersionKind:
|
||||||
|
group: notification.toolkit.fluxcd.io
|
||||||
|
version: "v1"
|
||||||
|
kind: Receiver
|
||||||
|
metricNamePrefix: gotk
|
||||||
|
metrics:
|
||||||
|
- name: "resource_info"
|
||||||
|
help: "The current state of a GitOps Toolkit resource."
|
||||||
|
each:
|
||||||
|
type: Info
|
||||||
|
info:
|
||||||
|
labelsFromPath:
|
||||||
|
name: [metadata, name]
|
||||||
|
labelsFromPath:
|
||||||
|
exported_namespace: [metadata, namespace]
|
||||||
|
ready: [status, conditions, "[type=Ready]", status]
|
||||||
postRenderers:
|
postRenderers:
|
||||||
- kustomize:
|
- kustomize:
|
||||||
patches:
|
patches:
|
||||||
|
|||||||
@@ -30,18 +30,23 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"editable": true,
|
"editable": true,
|
||||||
"gnetId": null,
|
"fiscalYearStartMonth": 0,
|
||||||
"graphTooltip": 0,
|
"graphTooltip": 0,
|
||||||
"iteration": 1652337714814,
|
"id": 5,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
"liveNow": false,
|
||||||
"panels": [
|
"panels": [
|
||||||
{
|
{
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"decimals": 0,
|
"decimals": 0,
|
||||||
"mappings": [],
|
"mappings": [],
|
||||||
|
"noValue": "0",
|
||||||
"thresholds": {
|
"thresholds": {
|
||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -81,28 +86,37 @@
|
|||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "value"
|
"textMode": "value"
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"datasource": {
|
||||||
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})",
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"exemplar": false,
|
||||||
|
"expr": "count(gotk_resource_info{exported_namespace=~\"$namespace\", customresource_kind=~\"Kustomization|HelmRelease\"})",
|
||||||
|
"instant": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"legendFormat": "",
|
"legendFormat": "",
|
||||||
|
"range": false,
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Cluster Reconcilers",
|
"title": "Cluster Reconcilers",
|
||||||
"type": "stat"
|
"type": "stat"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"decimals": 0,
|
"decimals": 0,
|
||||||
"mappings": [],
|
"mappings": [],
|
||||||
|
"noValue": "0",
|
||||||
"thresholds": {
|
"thresholds": {
|
||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -138,28 +152,37 @@
|
|||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "value"
|
"textMode": "value"
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"datasource": {
|
||||||
"expr": "sum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"})",
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"exemplar": false,
|
||||||
|
"expr": "count(gotk_resource_info{exported_namespace=~\"$namespace\", customresource_kind=~\"Kustomization|HelmRelease\", ready=\"False\"})",
|
||||||
|
"instant": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"legendFormat": "",
|
"legendFormat": "",
|
||||||
|
"range": false,
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Failing Reconcilers",
|
"title": "Failing Reconcilers",
|
||||||
"type": "stat"
|
"type": "stat"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"decimals": 0,
|
"decimals": 0,
|
||||||
"mappings": [],
|
"mappings": [],
|
||||||
|
"noValue": "0",
|
||||||
"thresholds": {
|
"thresholds": {
|
||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -199,28 +222,37 @@
|
|||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "value"
|
"textMode": "value"
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"datasource": {
|
||||||
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"GitRepository|HelmRepository|Bucket\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"GitRepository|HelmRepository|Bucket\"})",
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"exemplar": false,
|
||||||
|
"expr": "count(gotk_resource_info{exported_namespace=~\"$namespace\", customresource_kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\"})",
|
||||||
|
"instant": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"legendFormat": "",
|
"legendFormat": "",
|
||||||
|
"range": false,
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Kubernetes Manifests Sources",
|
"title": "Kubernetes Manifests Sources",
|
||||||
"type": "stat"
|
"type": "stat"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"decimals": 0,
|
"decimals": 0,
|
||||||
"mappings": [],
|
"mappings": [],
|
||||||
|
"noValue": "0",
|
||||||
"thresholds": {
|
"thresholds": {
|
||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -256,18 +288,23 @@
|
|||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "value"
|
"textMode": "value"
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"datasource": {
|
||||||
"expr": "sum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|HelmRepository|Bucket\"})",
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
|
"exemplar": false,
|
||||||
|
"expr": "count(gotk_resource_info{exported_namespace=~\"$namespace\", customresource_kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\", ready=\"False\"})",
|
||||||
|
"instant": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"legendFormat": "",
|
"legendFormat": "",
|
||||||
|
"range": false,
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Failing Sources",
|
"title": "Failing Sources",
|
||||||
"type": "stat"
|
"type": "stat"
|
||||||
},
|
},
|
||||||
@@ -318,9 +355,10 @@
|
|||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
"showUnfilled": true,
|
"showUnfilled": true,
|
||||||
"text": {}
|
"text": {},
|
||||||
|
"valueMode": "color"
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"exemplar": true,
|
||||||
@@ -330,8 +368,6 @@
|
|||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Reconciler ops avg. duration",
|
"title": "Reconciler ops avg. duration",
|
||||||
"type": "bargauge"
|
"type": "bargauge"
|
||||||
},
|
},
|
||||||
@@ -382,20 +418,19 @@
|
|||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
"showUnfilled": true,
|
"showUnfilled": true,
|
||||||
"text": {}
|
"text": {},
|
||||||
|
"valueMode": "color"
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"exemplar": true,
|
||||||
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)",
|
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\"}[5m])) by (kind)",
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"legendFormat": "{{kind}}",
|
"legendFormat": "{{kind}}",
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Source ops avg. duration",
|
"title": "Source ops avg. duration",
|
||||||
"type": "bargauge"
|
"type": "bargauge"
|
||||||
},
|
},
|
||||||
@@ -414,23 +449,33 @@
|
|||||||
"type": "row"
|
"type": "row"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"custom": {
|
"custom": {
|
||||||
"displayMode": "auto",
|
"align": "auto",
|
||||||
|
"cellOptions": {
|
||||||
|
"type": "auto"
|
||||||
|
},
|
||||||
"filterable": true,
|
"filterable": true,
|
||||||
"inspect": false
|
"inspect": false
|
||||||
},
|
},
|
||||||
"mappings": [
|
"mappings": [
|
||||||
{
|
{
|
||||||
"options": {
|
"options": {
|
||||||
"0": {
|
"False": {
|
||||||
"text": "Ready"
|
"color": "red",
|
||||||
},
|
"index": 1,
|
||||||
"1": {
|
|
||||||
"text": "Not Ready"
|
"text": "Not Ready"
|
||||||
|
},
|
||||||
|
"True": {
|
||||||
|
"color": "blue",
|
||||||
|
"index": 0,
|
||||||
|
"text": "Ready"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "value"
|
"type": "value"
|
||||||
@@ -440,16 +485,8 @@
|
|||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
{
|
{
|
||||||
"color": "blue",
|
"color": "transparent",
|
||||||
"value": null
|
"value": null
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "blue",
|
|
||||||
"value": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "red",
|
|
||||||
"value": 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -457,13 +494,16 @@
|
|||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"matcher": {
|
"matcher": {
|
||||||
"id": "byName",
|
"id": "byType",
|
||||||
"options": "Status"
|
"options": "string"
|
||||||
},
|
},
|
||||||
"properties": [
|
"properties": [
|
||||||
{
|
{
|
||||||
"id": "custom.displayMode",
|
"id": "custom.cellOptions",
|
||||||
"value": "color-background"
|
"value": {
|
||||||
|
"mode": "basic",
|
||||||
|
"type": "color-background"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -477,7 +517,9 @@
|
|||||||
},
|
},
|
||||||
"id": 33,
|
"id": 33,
|
||||||
"options": {
|
"options": {
|
||||||
|
"cellHeight": "sm",
|
||||||
"footer": {
|
"footer": {
|
||||||
|
"countRows": false,
|
||||||
"fields": "",
|
"fields": "",
|
||||||
"reducer": [
|
"reducer": [
|
||||||
"sum"
|
"sum"
|
||||||
@@ -492,11 +534,16 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
"exemplar": true,
|
"exemplar": true,
|
||||||
"expr": "gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"}",
|
"expr": "gotk_resource_info{exported_namespace=~\"$namespace\", customresource_kind=~\"Kustomization|HelmRelease\"}",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
@@ -504,8 +551,6 @@
|
|||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Cluster reconciliation readiness ",
|
"title": "Cluster reconciliation readiness ",
|
||||||
"transformations": [
|
"transformations": [
|
||||||
{
|
{
|
||||||
@@ -513,11 +558,16 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"excludeByName": {
|
"excludeByName": {
|
||||||
"Time": true,
|
"Time": true,
|
||||||
|
"Value": true,
|
||||||
"__name__": true,
|
"__name__": true,
|
||||||
"app": true,
|
"app": true,
|
||||||
"container": true,
|
"container": true,
|
||||||
|
"customresource_group": true,
|
||||||
|
"customresource_kind": false,
|
||||||
|
"customresource_version": true,
|
||||||
"endpoint": true,
|
"endpoint": true,
|
||||||
"exported_namespace": false,
|
"exported_namespace": false,
|
||||||
|
"gotk_type": true,
|
||||||
"instance": true,
|
"instance": true,
|
||||||
"job": true,
|
"job": true,
|
||||||
"kubernetes_namespace": true,
|
"kubernetes_namespace": true,
|
||||||
@@ -525,16 +575,36 @@
|
|||||||
"namespace": true,
|
"namespace": true,
|
||||||
"pod": true,
|
"pod": true,
|
||||||
"pod_template_hash": true,
|
"pod_template_hash": true,
|
||||||
|
"service": true,
|
||||||
"status": true,
|
"status": true,
|
||||||
"type": true
|
"type": true
|
||||||
},
|
},
|
||||||
"indexByName": {},
|
"indexByName": {
|
||||||
|
"Time": 0,
|
||||||
|
"Value": 15,
|
||||||
|
"__name__": 1,
|
||||||
|
"container": 2,
|
||||||
|
"customresource_group": 4,
|
||||||
|
"customresource_kind": 5,
|
||||||
|
"customresource_version": 6,
|
||||||
|
"endpoint": 7,
|
||||||
|
"exported_namespace": 3,
|
||||||
|
"instance": 8,
|
||||||
|
"job": 9,
|
||||||
|
"name": 10,
|
||||||
|
"namespace": 11,
|
||||||
|
"pod": 12,
|
||||||
|
"ready": 13,
|
||||||
|
"service": 14
|
||||||
|
},
|
||||||
"renameByName": {
|
"renameByName": {
|
||||||
"Value": "Status",
|
"Value": "",
|
||||||
|
"customresource_kind": "Kind",
|
||||||
"exported_namespace": "Namespace",
|
"exported_namespace": "Namespace",
|
||||||
"kind": "Kind",
|
"kind": "Kind",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"namespace": "Operator Namespace"
|
"namespace": "Operator Namespace",
|
||||||
|
"ready": "Status"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -542,23 +612,36 @@
|
|||||||
"type": "table"
|
"type": "table"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "${DS_PROMETHEUS}"
|
||||||
|
},
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "thresholds"
|
||||||
|
},
|
||||||
"custom": {
|
"custom": {
|
||||||
"displayMode": "auto",
|
"align": "auto",
|
||||||
|
"cellOptions": {
|
||||||
|
"type": "auto"
|
||||||
|
},
|
||||||
"filterable": true,
|
"filterable": true,
|
||||||
"inspect": false
|
"inspect": false
|
||||||
},
|
},
|
||||||
"mappings": [
|
"mappings": [
|
||||||
{
|
{
|
||||||
"options": {
|
"options": {
|
||||||
"0": {
|
"False": {
|
||||||
"text": "Ready"
|
"color": "red",
|
||||||
},
|
"index": 1,
|
||||||
"1": {
|
|
||||||
"text": "Not Ready"
|
"text": "Not Ready"
|
||||||
|
},
|
||||||
|
"True": {
|
||||||
|
"color": "blue",
|
||||||
|
"index": 0,
|
||||||
|
"text": "Ready"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "value"
|
"type": "value"
|
||||||
@@ -568,21 +651,28 @@
|
|||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
{
|
{
|
||||||
"color": "blue",
|
"color": "transparent",
|
||||||
"value": null
|
"value": null
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "blue",
|
|
||||||
"value": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "red",
|
|
||||||
"value": 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
|
{
|
||||||
|
"matcher": {
|
||||||
|
"id": "byType",
|
||||||
|
"options": "string"
|
||||||
|
},
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"id": "custom.cellOptions",
|
||||||
|
"value": {
|
||||||
|
"mode": "basic",
|
||||||
|
"type": "color-background"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"matcher": {
|
"matcher": {
|
||||||
"id": "byName",
|
"id": "byName",
|
||||||
@@ -590,8 +680,15 @@
|
|||||||
},
|
},
|
||||||
"properties": [
|
"properties": [
|
||||||
{
|
{
|
||||||
"id": "custom.displayMode",
|
"id": "noValue",
|
||||||
"value": "color-background"
|
"value": "Ready"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "color",
|
||||||
|
"value": {
|
||||||
|
"fixedColor": "blue",
|
||||||
|
"mode": "fixed"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -605,7 +702,9 @@
|
|||||||
},
|
},
|
||||||
"id": 34,
|
"id": 34,
|
||||||
"options": {
|
"options": {
|
||||||
|
"cellHeight": "sm",
|
||||||
"footer": {
|
"footer": {
|
||||||
|
"countRows": false,
|
||||||
"fields": "",
|
"fields": "",
|
||||||
"reducer": [
|
"reducer": [
|
||||||
"sum"
|
"sum"
|
||||||
@@ -620,11 +719,16 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"editorMode": "code",
|
||||||
"exemplar": true,
|
"exemplar": true,
|
||||||
"expr": "gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|HelmRepository|Bucket\"}",
|
"expr": "gotk_resource_info{exported_namespace=~\"$namespace\", customresource_kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\"}",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
@@ -632,8 +736,6 @@
|
|||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeFrom": null,
|
|
||||||
"timeShift": null,
|
|
||||||
"title": "Source acquisition readiness ",
|
"title": "Source acquisition readiness ",
|
||||||
"transformations": [
|
"transformations": [
|
||||||
{
|
{
|
||||||
@@ -641,11 +743,16 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"excludeByName": {
|
"excludeByName": {
|
||||||
"Time": true,
|
"Time": true,
|
||||||
|
"Value": true,
|
||||||
"__name__": true,
|
"__name__": true,
|
||||||
"app": true,
|
"app": true,
|
||||||
"container": true,
|
"container": true,
|
||||||
|
"customresource_group": true,
|
||||||
|
"customresource_kind": false,
|
||||||
|
"customresource_version": true,
|
||||||
"endpoint": true,
|
"endpoint": true,
|
||||||
"exported_namespace": false,
|
"exported_namespace": false,
|
||||||
|
"gotk_type": true,
|
||||||
"instance": true,
|
"instance": true,
|
||||||
"job": true,
|
"job": true,
|
||||||
"kubernetes_namespace": true,
|
"kubernetes_namespace": true,
|
||||||
@@ -653,16 +760,37 @@
|
|||||||
"namespace": true,
|
"namespace": true,
|
||||||
"pod": true,
|
"pod": true,
|
||||||
"pod_template_hash": true,
|
"pod_template_hash": true,
|
||||||
|
"ready": false,
|
||||||
|
"service": true,
|
||||||
"status": true,
|
"status": true,
|
||||||
"type": true
|
"type": true
|
||||||
},
|
},
|
||||||
"indexByName": {},
|
"indexByName": {
|
||||||
|
"Time": 0,
|
||||||
|
"Value": 15,
|
||||||
|
"__name__": 1,
|
||||||
|
"container": 2,
|
||||||
|
"customresource_group": 5,
|
||||||
|
"customresource_kind": 6,
|
||||||
|
"customresource_version": 7,
|
||||||
|
"endpoint": 8,
|
||||||
|
"exported_namespace": 4,
|
||||||
|
"instance": 9,
|
||||||
|
"job": 10,
|
||||||
|
"name": 11,
|
||||||
|
"namespace": 3,
|
||||||
|
"pod": 12,
|
||||||
|
"ready": 13,
|
||||||
|
"service": 14
|
||||||
|
},
|
||||||
"renameByName": {
|
"renameByName": {
|
||||||
"Value": "Status",
|
"Value": "",
|
||||||
|
"customresource_kind": "Kind",
|
||||||
"exported_namespace": "Namespace",
|
"exported_namespace": "Namespace",
|
||||||
"kind": "Kind",
|
"kind": "Kind",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"namespace": "Operator Namespace"
|
"namespace": "Operator Namespace",
|
||||||
|
"ready": "Status"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -690,10 +818,6 @@
|
|||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
|
||||||
"defaults": {},
|
|
||||||
"overrides": []
|
|
||||||
},
|
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"fillGradient": 0,
|
"fillGradient": 0,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
@@ -724,7 +848,7 @@
|
|||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
},
|
},
|
||||||
"percentage": false,
|
"percentage": false,
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"pointradius": 2,
|
"pointradius": 2,
|
||||||
"points": false,
|
"points": false,
|
||||||
"renderer": "flot",
|
"renderer": "flot",
|
||||||
@@ -743,9 +867,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"thresholds": [],
|
"thresholds": [],
|
||||||
"timeFrom": null,
|
|
||||||
"timeRegions": [],
|
"timeRegions": [],
|
||||||
"timeShift": null,
|
|
||||||
"title": "Cluster reconciliation duration",
|
"title": "Cluster reconciliation duration",
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
"shared": true,
|
"shared": true,
|
||||||
@@ -754,33 +876,24 @@
|
|||||||
},
|
},
|
||||||
"type": "graph",
|
"type": "graph",
|
||||||
"xaxis": {
|
"xaxis": {
|
||||||
"buckets": null,
|
|
||||||
"mode": "time",
|
"mode": "time",
|
||||||
"name": null,
|
|
||||||
"show": true,
|
"show": true,
|
||||||
"values": []
|
"values": []
|
||||||
},
|
},
|
||||||
"yaxes": [
|
"yaxes": [
|
||||||
{
|
{
|
||||||
"format": "s",
|
"format": "s",
|
||||||
"label": null,
|
|
||||||
"logBase": 1,
|
"logBase": 1,
|
||||||
"max": null,
|
|
||||||
"min": null,
|
|
||||||
"show": true
|
"show": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"format": "short",
|
"format": "short",
|
||||||
"label": null,
|
|
||||||
"logBase": 1,
|
"logBase": 1,
|
||||||
"max": null,
|
|
||||||
"min": null,
|
|
||||||
"show": true
|
"show": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"yaxis": {
|
"yaxis": {
|
||||||
"align": false,
|
"align": false
|
||||||
"alignLevel": null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -790,10 +903,6 @@
|
|||||||
"dashes": false,
|
"dashes": false,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "${DS_PROMETHEUS}",
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldConfig": {
|
|
||||||
"defaults": {},
|
|
||||||
"overrides": []
|
|
||||||
},
|
|
||||||
"fill": 1,
|
"fill": 1,
|
||||||
"fillGradient": 0,
|
"fillGradient": 0,
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
@@ -824,7 +933,7 @@
|
|||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
},
|
},
|
||||||
"percentage": false,
|
"percentage": false,
|
||||||
"pluginVersion": "7.5.5",
|
"pluginVersion": "10.0.2",
|
||||||
"pointradius": 2,
|
"pointradius": 2,
|
||||||
"points": false,
|
"points": false,
|
||||||
"renderer": "flot",
|
"renderer": "flot",
|
||||||
@@ -835,7 +944,7 @@
|
|||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"exemplar": true,
|
"exemplar": true,
|
||||||
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)",
|
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket|OCIRepository\"}[5m])) by (kind, name)",
|
||||||
"hide": false,
|
"hide": false,
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"legendFormat": "{{kind}}/{{name}}",
|
"legendFormat": "{{kind}}/{{name}}",
|
||||||
@@ -843,9 +952,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"thresholds": [],
|
"thresholds": [],
|
||||||
"timeFrom": null,
|
|
||||||
"timeRegions": [],
|
"timeRegions": [],
|
||||||
"timeShift": null,
|
|
||||||
"title": "Source acquisition duration",
|
"title": "Source acquisition duration",
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
"shared": true,
|
"shared": true,
|
||||||
@@ -854,38 +961,29 @@
|
|||||||
},
|
},
|
||||||
"type": "graph",
|
"type": "graph",
|
||||||
"xaxis": {
|
"xaxis": {
|
||||||
"buckets": null,
|
|
||||||
"mode": "time",
|
"mode": "time",
|
||||||
"name": null,
|
|
||||||
"show": true,
|
"show": true,
|
||||||
"values": []
|
"values": []
|
||||||
},
|
},
|
||||||
"yaxes": [
|
"yaxes": [
|
||||||
{
|
{
|
||||||
"format": "s",
|
"format": "s",
|
||||||
"label": null,
|
|
||||||
"logBase": 1,
|
"logBase": 1,
|
||||||
"max": null,
|
|
||||||
"min": null,
|
|
||||||
"show": true
|
"show": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"format": "short",
|
"format": "short",
|
||||||
"label": null,
|
|
||||||
"logBase": 1,
|
"logBase": 1,
|
||||||
"max": null,
|
|
||||||
"min": null,
|
|
||||||
"show": true
|
"show": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"yaxis": {
|
"yaxis": {
|
||||||
"align": false,
|
"align": false
|
||||||
"alignLevel": null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"refresh": "30s",
|
"refresh": "30s",
|
||||||
"schemaVersion": 36,
|
"schemaVersion": 38,
|
||||||
"style": "light",
|
"style": "light",
|
||||||
"tags": [
|
"tags": [
|
||||||
"flux"
|
"flux"
|
||||||
@@ -903,13 +1001,13 @@
|
|||||||
"$__all"
|
"$__all"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"datasource": "$DS_PROMETHEUS",
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "$DS_PROMETHEUS"
|
||||||
|
},
|
||||||
"definition": "label_values(gotk_reconcile_condition, namespace)",
|
"definition": "label_values(gotk_reconcile_condition, namespace)",
|
||||||
"description": null,
|
|
||||||
"error": null,
|
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
"includeAll": true,
|
"includeAll": true,
|
||||||
"label": null,
|
|
||||||
"multi": true,
|
"multi": true,
|
||||||
"name": "operator_namespace",
|
"name": "operator_namespace",
|
||||||
"options": [],
|
"options": [],
|
||||||
@@ -928,10 +1026,8 @@
|
|||||||
"useTags": false
|
"useTags": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allValue": null,
|
|
||||||
"current": {
|
"current": {
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"tags": [],
|
|
||||||
"text": [
|
"text": [
|
||||||
"All"
|
"All"
|
||||||
],
|
],
|
||||||
@@ -939,19 +1035,19 @@
|
|||||||
"$__all"
|
"$__all"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"datasource": "$DS_PROMETHEUS",
|
"datasource": {
|
||||||
"definition": "label_values(gotk_reconcile_condition, exported_namespace)",
|
"type": "prometheus",
|
||||||
"description": null,
|
"uid": "$DS_PROMETHEUS"
|
||||||
"error": null,
|
},
|
||||||
|
"definition": "label_values(gotk_resource_info,exported_namespace)",
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
"includeAll": true,
|
"includeAll": true,
|
||||||
"label": null,
|
|
||||||
"multi": true,
|
"multi": true,
|
||||||
"name": "namespace",
|
"name": "namespace",
|
||||||
"options": [],
|
"options": [],
|
||||||
"query": {
|
"query": {
|
||||||
"query": "label_values(gotk_reconcile_condition, exported_namespace)",
|
"query": "label_values(gotk_resource_info,exported_namespace)",
|
||||||
"refId": "StandardVariableQuery"
|
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||||
},
|
},
|
||||||
"refresh": 2,
|
"refresh": 2,
|
||||||
"regex": "",
|
"regex": "",
|
||||||
@@ -1000,7 +1096,9 @@
|
|||||||
"1d"
|
"1d"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"timezone": "",
|
||||||
"title": "Flux Cluster Stats",
|
"title": "Flux Cluster Stats",
|
||||||
"uid": "flux-cluster",
|
"uid": "flux-cluster",
|
||||||
"version": 3
|
"version": 4,
|
||||||
|
"weekStart": ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ require (
|
|||||||
github.com/Azure/azure-event-hubs-go/v3 v3.6.0
|
github.com/Azure/azure-event-hubs-go/v3 v3.6.0
|
||||||
github.com/fluxcd/helm-controller/api v0.35.0
|
github.com/fluxcd/helm-controller/api v0.35.0
|
||||||
github.com/fluxcd/image-automation-controller/api v0.35.0
|
github.com/fluxcd/image-automation-controller/api v0.35.0
|
||||||
github.com/fluxcd/image-reflector-controller/api v0.29.0
|
github.com/fluxcd/image-reflector-controller/api v0.29.1
|
||||||
github.com/fluxcd/kustomize-controller/api v1.0.0
|
github.com/fluxcd/kustomize-controller/api v1.0.1
|
||||||
github.com/fluxcd/notification-controller/api v1.0.0
|
github.com/fluxcd/notification-controller/api v1.0.0
|
||||||
github.com/fluxcd/pkg/apis/event v0.5.1
|
github.com/fluxcd/pkg/apis/event v0.5.1
|
||||||
github.com/fluxcd/pkg/apis/meta v1.1.1
|
github.com/fluxcd/pkg/apis/meta v1.1.1
|
||||||
github.com/fluxcd/pkg/git v0.12.3
|
github.com/fluxcd/pkg/git v0.12.3
|
||||||
github.com/fluxcd/pkg/git/gogit v0.12.1
|
github.com/fluxcd/pkg/git/gogit v0.12.1
|
||||||
github.com/fluxcd/source-controller/api v1.0.0
|
github.com/fluxcd/source-controller/api v1.0.1
|
||||||
github.com/go-git/go-git/v5 v5.7.0
|
github.com/go-git/go-git/v5 v5.7.0
|
||||||
github.com/hashicorp/hc-install v0.5.2
|
github.com/hashicorp/hc-install v0.5.2
|
||||||
github.com/hashicorp/terraform-exec v0.18.1
|
github.com/hashicorp/terraform-exec v0.18.1
|
||||||
|
|||||||
@@ -89,10 +89,10 @@ github.com/fluxcd/helm-controller/api v0.35.0 h1:UyhKXPni5z69DzPW7GtECGGdUwKsB+O
|
|||||||
github.com/fluxcd/helm-controller/api v0.35.0/go.mod h1:CdHMtr5wM0xgDt/PS147H7QQS+zDxAFgDW3ZN8MnUlU=
|
github.com/fluxcd/helm-controller/api v0.35.0/go.mod h1:CdHMtr5wM0xgDt/PS147H7QQS+zDxAFgDW3ZN8MnUlU=
|
||||||
github.com/fluxcd/image-automation-controller/api v0.35.0 h1:B7yJdAbnx0hwI6ffVu0YAyc3d3sqjXrv6ySK++g3t28=
|
github.com/fluxcd/image-automation-controller/api v0.35.0 h1:B7yJdAbnx0hwI6ffVu0YAyc3d3sqjXrv6ySK++g3t28=
|
||||||
github.com/fluxcd/image-automation-controller/api v0.35.0/go.mod h1:67HbnrXDy550zJKZZbzAZ0yfzL0Ge1O18yn/shcgy0Y=
|
github.com/fluxcd/image-automation-controller/api v0.35.0/go.mod h1:67HbnrXDy550zJKZZbzAZ0yfzL0Ge1O18yn/shcgy0Y=
|
||||||
github.com/fluxcd/image-reflector-controller/api v0.29.0 h1:Epzq0b2sYxgSwKPBN0BWEInQwMLsvU7sjqKJuzGtyIg=
|
github.com/fluxcd/image-reflector-controller/api v0.29.1 h1:mnFaO60b8WyCxpc72utmAJ7J1ZtZjGGThH9NdxVeEyo=
|
||||||
github.com/fluxcd/image-reflector-controller/api v0.29.0/go.mod h1:aYwq15SpkAD/urQme2iEsNouTscfR1Qo39KBlJ+0EW8=
|
github.com/fluxcd/image-reflector-controller/api v0.29.1/go.mod h1:aYwq15SpkAD/urQme2iEsNouTscfR1Qo39KBlJ+0EW8=
|
||||||
github.com/fluxcd/kustomize-controller/api v1.0.0 h1:BVz6lEpfGbny0ppQ82LloLSK0OoEGC51YQaw31j4vT8=
|
github.com/fluxcd/kustomize-controller/api v1.0.1 h1:zz9zx4Mc7rw9gqdgdhMWX1uDM2uR1x7WBUujKs4mdx8=
|
||||||
github.com/fluxcd/kustomize-controller/api v1.0.0/go.mod h1:rYUovoofr3bVPgQowWj/CSGw73qoH0tOCopJ3oNh7lM=
|
github.com/fluxcd/kustomize-controller/api v1.0.1/go.mod h1:rYUovoofr3bVPgQowWj/CSGw73qoH0tOCopJ3oNh7lM=
|
||||||
github.com/fluxcd/notification-controller/api v1.0.0 h1:WiXS116pwhFp7Qe/Fc1GmKCfLBRnZu+rYCeIn07cO+4=
|
github.com/fluxcd/notification-controller/api v1.0.0 h1:WiXS116pwhFp7Qe/Fc1GmKCfLBRnZu+rYCeIn07cO+4=
|
||||||
github.com/fluxcd/notification-controller/api v1.0.0/go.mod h1:uamWZwmhSHE7xdJkgRhH4Eo5/SKKILFI4o+CoQjlczc=
|
github.com/fluxcd/notification-controller/api v1.0.0/go.mod h1:uamWZwmhSHE7xdJkgRhH4Eo5/SKKILFI4o+CoQjlczc=
|
||||||
github.com/fluxcd/pkg/apis/acl v0.1.0 h1:EoAl377hDQYL3WqanWCdifauXqXbMyFuK82NnX6pH4Q=
|
github.com/fluxcd/pkg/apis/acl v0.1.0 h1:EoAl377hDQYL3WqanWCdifauXqXbMyFuK82NnX6pH4Q=
|
||||||
@@ -112,8 +112,8 @@ github.com/fluxcd/pkg/ssh v0.8.0 h1:CqHIsWYfAtGxh2D6ZvzGTkFout6MaQnFpytPzJPbDLA=
|
|||||||
github.com/fluxcd/pkg/ssh v0.8.0/go.mod h1:bo6HgWqIIuXU6r5HCxRFa7Uo7b4Nnzsz6MvdtAYn2XY=
|
github.com/fluxcd/pkg/ssh v0.8.0/go.mod h1:bo6HgWqIIuXU6r5HCxRFa7Uo7b4Nnzsz6MvdtAYn2XY=
|
||||||
github.com/fluxcd/pkg/version v0.2.2 h1:ZpVXECeLA5hIQMft11iLp6gN3cKcz6UNuVTQPw/bRdI=
|
github.com/fluxcd/pkg/version v0.2.2 h1:ZpVXECeLA5hIQMft11iLp6gN3cKcz6UNuVTQPw/bRdI=
|
||||||
github.com/fluxcd/pkg/version v0.2.2/go.mod h1:NGnh/no8S6PyfCDxRFrPY3T5BUnqP48MxfxNRU0z8C0=
|
github.com/fluxcd/pkg/version v0.2.2/go.mod h1:NGnh/no8S6PyfCDxRFrPY3T5BUnqP48MxfxNRU0z8C0=
|
||||||
github.com/fluxcd/source-controller/api v1.0.0 h1:lPjmCXmEiI3tY4pReeVQBMuyLgdH8462W5ewUa9kgYM=
|
github.com/fluxcd/source-controller/api v1.0.1 h1:nycylbNBnQd+EO4UHpqXqAQJ1cGAPxgBbrfERCQ1pp8=
|
||||||
github.com/fluxcd/source-controller/api v1.0.0/go.mod h1:rAY5FRFGZUKpIFNyYANHIgPgJPvbALBHWsq/zHw/cXQ=
|
github.com/fluxcd/source-controller/api v1.0.1/go.mod h1:rAY5FRFGZUKpIFNyYANHIgPgJPvbALBHWsq/zHw/cXQ=
|
||||||
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
|
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
|
||||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
|
|||||||
Reference in New Issue
Block a user