mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-09 20:46:51 +00:00
Compare commits
1 Commits
6.11.1
...
feat/notat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ecb5d1e7f |
6
.github/actions/release-notes/Dockerfile
vendored
Normal file
6
.github/actions/release-notes/Dockerfile
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM stefanprodan/alpine-base:latest
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
9
.github/actions/release-notes/action.yml
vendored
Normal file
9
.github/actions/release-notes/action.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: 'github-release-notes'
|
||||||
|
description: 'A GitHub Action to run github-release-notes commands'
|
||||||
|
author: 'Stefan Prodan'
|
||||||
|
branding:
|
||||||
|
icon: 'command'
|
||||||
|
color: 'blue'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
25
.github/actions/release-notes/entrypoint.sh
vendored
Normal file
25
.github/actions/release-notes/entrypoint.sh
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
VERSION=0.2.0
|
||||||
|
BIN_DIR="$GITHUB_WORKSPACE/bin"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
mkdir -p ${BIN_DIR}
|
||||||
|
tmpDir=$(mktemp -d)
|
||||||
|
|
||||||
|
pushd $tmpDir >& /dev/null
|
||||||
|
|
||||||
|
curl -sSL https://github.com/buchanae/github-release-notes/releases/download/${VERSION}/github-release-notes-linux-amd64-${VERSION}.tar.gz | tar xz
|
||||||
|
cp github-release-notes ${BIN_DIR}/github-release-notes
|
||||||
|
|
||||||
|
popd >& /dev/null
|
||||||
|
rm -rf $tmpDir
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
|
||||||
|
echo "$BIN_DIR" >> $GITHUB_PATH
|
||||||
|
echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH
|
||||||
24
.github/actions/runner-cleanup/action.yml
vendored
24
.github/actions/runner-cleanup/action.yml
vendored
@@ -1,24 +0,0 @@
|
|||||||
name: Runner Cleanup
|
|
||||||
description: A GitHub Action for removing bloat from Ubuntu GitHub Actions runner.
|
|
||||||
author: Stefan Prodan
|
|
||||||
branding:
|
|
||||||
color: blue
|
|
||||||
icon: command
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: "Disk Usage Before Cleanup"
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
df -h
|
|
||||||
- name: "Remove .NET, Android and Haskell"
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo rm -rf /usr/share/dotnet || true
|
|
||||||
sudo rm -rf /usr/local/lib/android || true
|
|
||||||
sudo rm -rf /opt/ghc || true
|
|
||||||
sudo rm -rf /usr/local/.ghcup || true
|
|
||||||
- name: "Disk Usage After Cleanup"
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
df -h
|
|
||||||
11
.github/dependabot.yaml
vendored
11
.github/dependabot.yaml
vendored
@@ -1,11 +0,0 @@
|
|||||||
version: 2
|
|
||||||
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
groups:
|
|
||||||
actions:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
28
.github/workflows/cve-scan.yml
vendored
28
.github/workflows/cve-scan.yml
vendored
@@ -1,25 +1,31 @@
|
|||||||
name: cve-scan
|
name: cve-scan
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
- "master"
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- "master"
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
govulncheck:
|
trivy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout
|
||||||
- uses: ./.github/actions/runner-cleanup
|
uses: actions/checkout@v3
|
||||||
- name: Vulnerability scan
|
- name: Build image
|
||||||
id: govulncheck
|
id: build
|
||||||
uses: golang/govulncheck-action@v1
|
run: |
|
||||||
|
IMAGE=test/podinfo:${GITHUB_SHA}
|
||||||
|
docker build -t ${IMAGE} .
|
||||||
|
echo "image=$IMAGE" >> $GITHUB_OUTPUT
|
||||||
|
- name: Run Trivy vulnerability scanner
|
||||||
|
uses: aquasecurity/trivy-action@master
|
||||||
with:
|
with:
|
||||||
repo-checkout: false
|
image-ref: ${{ steps.build.outputs.image }}
|
||||||
|
format: table
|
||||||
|
exit-code: "1"
|
||||||
|
ignore-unfixed: true
|
||||||
|
vuln-type: os,library
|
||||||
|
severity: CRITICAL,HIGH
|
||||||
|
|||||||
18
.github/workflows/e2e.yml
vendored
18
.github/workflows/e2e.yml
vendored
@@ -14,21 +14,20 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
- name: Disk Cleanup
|
|
||||||
uses: ./.github/actions/runner-cleanup
|
|
||||||
- name: Setup Kubernetes
|
- name: Setup Kubernetes
|
||||||
uses: helm/kind-action@v1.14.0
|
uses: helm/kind-action@v1.8.0
|
||||||
with:
|
with:
|
||||||
|
version: v0.20.0
|
||||||
cluster_name: kind
|
cluster_name: kind
|
||||||
- name: Build container image
|
- name: Build container image
|
||||||
run: |
|
run: |
|
||||||
./test/build.sh
|
./test/build.sh
|
||||||
kind load docker-image test/podinfo:latest
|
kind load docker-image test/podinfo:latest
|
||||||
- name: Setup Helm
|
- name: Setup Helm
|
||||||
uses: azure/setup-helm@v4
|
uses: azure/setup-helm@v3
|
||||||
with:
|
with:
|
||||||
version: v4.1.0
|
version: v3.12.3
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: ./test/deploy.sh
|
run: ./test/deploy.sh
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
@@ -49,13 +48,14 @@ jobs:
|
|||||||
PODINFO_MODULE_URL: "oci://localhost:5000/podinfo"
|
PODINFO_MODULE_URL: "oci://localhost:5000/podinfo"
|
||||||
PODINFO_VERSION: "0.0.0-devel"
|
PODINFO_VERSION: "0.0.0-devel"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout
|
||||||
- uses: ./.github/actions/runner-cleanup
|
uses: actions/checkout@v4
|
||||||
- name: Setup Timoni
|
- name: Setup Timoni
|
||||||
uses: stefanprodan/timoni/actions/setup@main
|
uses: stefanprodan/timoni/actions/setup@main
|
||||||
- name: Setup Kubernetes
|
- name: Setup Kubernetes
|
||||||
uses: helm/kind-action@v1.14.0
|
uses: helm/kind-action@v1.8.0
|
||||||
with:
|
with:
|
||||||
|
version: v0.20.0
|
||||||
cluster_name: kind
|
cluster_name: kind
|
||||||
- name: Build container
|
- name: Build container
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
57
.github/workflows/release.yml
vendored
57
.github/workflows/release.yml
vendored
@@ -16,15 +16,14 @@ jobs:
|
|||||||
id-token: write # needed for keyless signing
|
id-token: write # needed for keyless signing
|
||||||
packages: write # needed for ghcr access
|
packages: write # needed for ghcr access
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/runner-cleanup
|
- uses: sigstore/cosign-installer@v3
|
||||||
- uses: sigstore/cosign-installer@v4.0.0
|
- uses: fluxcd/flux2/action@main
|
||||||
- uses: fluxcd/flux2/action@v2.8.1
|
- uses: stefanprodan/timoni/actions/setup@main
|
||||||
- uses: stefanprodan/timoni/actions/setup@v0.26.0
|
|
||||||
- name: Setup Notation CLI
|
- name: Setup Notation CLI
|
||||||
uses: notaryproject/notation-action/setup@v1
|
uses: notaryproject/notation-action/setup@v1
|
||||||
with:
|
with:
|
||||||
version: "1.1.0"
|
version: "1.0.0"
|
||||||
- name: Setup Notation signing keys
|
- name: Setup Notation signing keys
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.config/notation/localkeys/
|
mkdir -p ~/.config/notation/localkeys/
|
||||||
@@ -34,28 +33,28 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NOTATION_KEY: ${{ secrets.NOTATION_SIGNING_KEY }}
|
NOTATION_KEY: ${{ secrets.NOTATION_SIGNING_KEY }}
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 1.26.x
|
go-version: 1.21.x
|
||||||
- name: Setup Helm
|
- name: Setup Helm
|
||||||
uses: azure/setup-helm@v4
|
uses: azure/setup-helm@v3
|
||||||
with:
|
with:
|
||||||
version: v4.1.1
|
version: v3.12.3
|
||||||
- name: Setup QEMU
|
- name: Setup QEMU
|
||||||
uses: docker/setup-qemu-action@v4
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
platforms: all
|
platforms: all
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
@@ -71,7 +70,7 @@ jobs:
|
|||||||
echo "REVISION=${GITHUB_SHA}" >> $GITHUB_OUTPUT
|
echo "REVISION=${GITHUB_SHA}" >> $GITHUB_OUTPUT
|
||||||
- name: Generate images meta
|
- name: Generate images meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v6
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/stefanprodan/podinfo
|
docker.io/stefanprodan/podinfo
|
||||||
@@ -80,7 +79,7 @@ jobs:
|
|||||||
type=raw,value=${{ steps.prep.outputs.VERSION }}
|
type=raw,value=${{ steps.prep.outputs.VERSION }}
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
- name: Publish multi-arch image
|
- name: Publish multi-arch image
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
sbom: true
|
sbom: true
|
||||||
provenance: true
|
provenance: true
|
||||||
@@ -114,7 +113,7 @@ jobs:
|
|||||||
--source="${{ github.event.repository.html_url }}" \
|
--source="${{ github.event.repository.html_url }}" \
|
||||||
--revision="${GITHUB_REF_NAME}/${GITHUB_SHA}"
|
--revision="${GITHUB_REF_NAME}/${GITHUB_SHA}"
|
||||||
flux tag artifact oci://ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} --tag latest
|
flux tag artifact oci://ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} --tag latest
|
||||||
- name: Sign artifacts with Cosign
|
- name: Sign OCI artifacts
|
||||||
env:
|
env:
|
||||||
COSIGN_EXPERIMENTAL: 1
|
COSIGN_EXPERIMENTAL: 1
|
||||||
run: |
|
run: |
|
||||||
@@ -122,8 +121,12 @@ jobs:
|
|||||||
cosign sign ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
cosign sign ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
||||||
cosign sign ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
cosign sign ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
||||||
cosign sign ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
cosign sign ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }} --yes
|
||||||
|
notation sign --signature-format cose docker.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
|
||||||
|
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
|
||||||
|
notation sign --signature-format cose ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }}
|
||||||
|
notation sign --signature-format cose ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }}
|
||||||
- name: Publish base image
|
- name: Publish base image
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
@@ -142,25 +145,25 @@ jobs:
|
|||||||
--source="${{ github.event.repository.html_url }}" \
|
--source="${{ github.event.repository.html_url }}" \
|
||||||
--revision="${GITHUB_REF_NAME}/${GITHUB_SHA}"
|
--revision="${GITHUB_REF_NAME}/${GITHUB_SHA}"
|
||||||
flux tag artifact oci://ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} --tag latest
|
flux tag artifact oci://ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} --tag latest
|
||||||
- name: Sign config artifact with cso
|
- name: Sign config artifact
|
||||||
run: |
|
run: |
|
||||||
echo "$COSIGN_KEY" > /tmp/cosign.key
|
echo "$COSIGN_KEY" > /tmp/cosign.key
|
||||||
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} --yes
|
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} --yes
|
||||||
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:latest --yes
|
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:latest --yes
|
||||||
|
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }}
|
||||||
|
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo-deploy:latest
|
||||||
env:
|
env:
|
||||||
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
|
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
|
||||||
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
|
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
|
||||||
- name: Sign artifacts with Notation
|
- uses: ./.github/actions/release-notes
|
||||||
|
- name: Generate release notes
|
||||||
run: |
|
run: |
|
||||||
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
|
echo 'CHANGELOG' > /tmp/release.txt
|
||||||
notation sign --signature-format cose ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }}
|
github-release-notes -org stefanprodan -repo podinfo -since-latest-release >> /tmp/release.txt
|
||||||
notation sign --signature-format cose ghcr.io/stefanprodan/manifests/podinfo:${{ steps.prep.outputs.VERSION }}
|
|
||||||
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }}
|
|
||||||
notation sign --signature-format cose ghcr.io/stefanprodan/podinfo-deploy:latest
|
|
||||||
- name: Publish release
|
- name: Publish release
|
||||||
uses: goreleaser/goreleaser-action@v7
|
uses: goreleaser/goreleaser-action@v5
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --skip=validate
|
args: release --release-notes=/tmp/release.txt --skip-validate
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
23
.github/workflows/test.yml
vendored
23
.github/workflows/test.yml
vendored
@@ -10,36 +10,35 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
KUBERNETES_VERSION: 1.35.0
|
KUBERNETES_VERSION: 1.26.0
|
||||||
HELM_VERSION: 4.1.1
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout
|
||||||
- uses: ./.github/actions/runner-cleanup
|
uses: actions/checkout@v4
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 1.26.x
|
go-version: 1.21.x
|
||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
**/go.sum
|
**/go.sum
|
||||||
**/go.mod
|
**/go.mod
|
||||||
- name: Setup kubectl
|
- name: Setup kubectl
|
||||||
uses: azure/setup-kubectl@v4
|
uses: azure/setup-kubectl@v3
|
||||||
with:
|
with:
|
||||||
version: v${{ env.KUBERNETES_VERSION }}
|
version: v${{ env.KUBERNETES_VERSION }}
|
||||||
- name: Setup kubeconform
|
- name: Setup kubeconform
|
||||||
uses: ./.github/actions/kubeconform
|
uses: ./.github/actions/kubeconform
|
||||||
- name: Setup Helm
|
- name: Setup Helm
|
||||||
uses: azure/setup-helm@v4
|
uses: azure/setup-helm@v3
|
||||||
with:
|
with:
|
||||||
version: v${{ env.HELM_VERSION }}
|
version: v3.10.3
|
||||||
- name: Setup CUE
|
- name: Setup CUE
|
||||||
uses: cue-lang/setup-cue@v1.0.1
|
uses: cue-lang/setup-cue@v1.0.0
|
||||||
- name: Setup Timoni
|
- name: Setup Timoni
|
||||||
uses: stefanprodan/timoni/actions/setup@v0.26.0
|
uses: stefanprodan/timoni/actions/setup@main
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: make test
|
run: make test
|
||||||
- name: Validate Helm chart
|
- name: Validate Helm chart
|
||||||
@@ -52,7 +51,7 @@ jobs:
|
|||||||
- name: Verify CUE formatting
|
- name: Verify CUE formatting
|
||||||
working-directory: ./timoni/podinfo
|
working-directory: ./timoni/podinfo
|
||||||
run: |
|
run: |
|
||||||
cue fmt ./...
|
cue fmt ./..
|
||||||
status=$(git status . --porcelain)
|
status=$(git status . --porcelain)
|
||||||
[[ -z "$status" ]] || {
|
[[ -z "$status" ]] || {
|
||||||
echo "CUE files are not correctly formatted"
|
echo "CUE files are not correctly formatted"
|
||||||
|
|||||||
@@ -1,18 +1,3 @@
|
|||||||
version: 2
|
|
||||||
|
|
||||||
# xref: https://goreleaser.com/customization/project/
|
|
||||||
project_name: podinfo
|
|
||||||
|
|
||||||
# xref: https://goreleaser.com/customization/hooks/
|
|
||||||
before:
|
|
||||||
hooks:
|
|
||||||
- go mod download
|
|
||||||
|
|
||||||
# xref: https://goreleaser.com/customization/env/
|
|
||||||
env:
|
|
||||||
- CGO_ENABLED=0
|
|
||||||
|
|
||||||
# xref: https://goreleaser.com/customization/build/
|
|
||||||
builds:
|
builds:
|
||||||
- main: ./cmd/podcli
|
- main: ./cmd/podcli
|
||||||
binary: podcli
|
binary: podcli
|
||||||
@@ -23,13 +8,9 @@ builds:
|
|||||||
- linux
|
- linux
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
|
env:
|
||||||
# xref: https://goreleaser.com/customization/archive/
|
- CGO_ENABLED=0
|
||||||
archives:
|
archives:
|
||||||
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||||
files:
|
files:
|
||||||
- LICENSE
|
- none*
|
||||||
|
|
||||||
# xref: https://goreleaser.com/customization/changelog/
|
|
||||||
changelog:
|
|
||||||
use: github-native
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.26-alpine AS builder
|
FROM golang:1.21-alpine as builder
|
||||||
|
|
||||||
ARG REVISION
|
ARG REVISION
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ RUN CGO_ENABLED=0 go build -ldflags "-s -w \
|
|||||||
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
|
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
|
||||||
-a -o bin/podcli cmd/podcli/*
|
-a -o bin/podcli cmd/podcli/*
|
||||||
|
|
||||||
FROM alpine:3.23
|
FROM alpine:3.19
|
||||||
|
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.26
|
FROM golang:1.21
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
ARG GO_VERSION=1.26
|
ARG GO_VERSION=1.21
|
||||||
ARG XX_VERSION=1.9.0
|
ARG XX_VERSION=1.3.0
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ RUN xx-go build -ldflags "-s -w \
|
|||||||
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
|
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
|
||||||
-a -o bin/podcli cmd/podcli/*
|
-a -o bin/podcli cmd/podcli/*
|
||||||
|
|
||||||
FROM alpine:3.23
|
FROM alpine:3.19
|
||||||
|
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -16,7 +16,7 @@ run:
|
|||||||
--ui-logo=https://raw.githubusercontent.com/stefanprodan/podinfo/gh-pages/cuddle_clap.gif $(EXTRA_RUN_ARGS)
|
--ui-logo=https://raw.githubusercontent.com/stefanprodan/podinfo/gh-pages/cuddle_clap.gif $(EXTRA_RUN_ARGS)
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: tidy fmt vet
|
test:
|
||||||
go test ./... -coverprofile cover.out
|
go test ./... -coverprofile cover.out
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -24,13 +24,14 @@ build:
|
|||||||
GIT_COMMIT=$$(git rev-list -1 HEAD) && CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/stefanprodan/podinfo/pkg/version.REVISION=$(GIT_COMMIT)" -a -o ./bin/podcli ./cmd/podcli/*
|
GIT_COMMIT=$$(git rev-list -1 HEAD) && CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/stefanprodan/podinfo/pkg/version.REVISION=$(GIT_COMMIT)" -a -o ./bin/podcli ./cmd/podcli/*
|
||||||
|
|
||||||
tidy:
|
tidy:
|
||||||
rm -f go.sum; go mod tidy -compat=1.26
|
rm -f go.sum; go mod tidy -compat=1.21
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
go vet ./...
|
go vet ./...
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
go fmt ./...
|
gofmt -l -s -w ./
|
||||||
|
goimports -l -w ./
|
||||||
|
|
||||||
build-charts:
|
build-charts:
|
||||||
helm lint charts/*
|
helm lint charts/*
|
||||||
@@ -81,11 +82,6 @@ version-set:
|
|||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/webapp/backend/deployment.yaml && \
|
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/webapp/backend/deployment.yaml && \
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/frontend/deployment.yaml && \
|
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/frontend/deployment.yaml && \
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/backend/deployment.yaml && \
|
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/backend/deployment.yaml && \
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/statefulset-primary.yaml && \
|
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/deployment-replica.yaml && \
|
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/cronjob-rollup-daily.yaml && \
|
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/cronjob-rollup-weekly.yaml && \
|
|
||||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/cronjob-backup-daily.yaml && \
|
|
||||||
/usr/bin/sed -i '' "s/$$current/$$next/g" timoni/podinfo/values.cue && \
|
/usr/bin/sed -i '' "s/$$current/$$next/g" timoni/podinfo/values.cue && \
|
||||||
echo "Version $$next set in code, deployment, module, chart and kustomize"
|
echo "Version $$next set in code, deployment, module, chart and kustomize"
|
||||||
|
|
||||||
@@ -97,7 +93,7 @@ swagger:
|
|||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
go get github.com/swaggo/swag/gen@latest
|
go get github.com/swaggo/swag/gen@latest
|
||||||
go get github.com/swaggo/swag/cmd/swag@latest
|
go get github.com/swaggo/swag/cmd/swag@latest
|
||||||
cd pkg/api/http && $$(go env GOPATH)/bin/swag init -g server.go
|
cd pkg/api && $$(go env GOPATH)/bin/swag init -g server.go
|
||||||
|
|
||||||
.PHONY: timoni-build
|
.PHONY: timoni-build
|
||||||
timoni-build:
|
timoni-build:
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -22,10 +22,10 @@ Specifications:
|
|||||||
* Swagger docs
|
* Swagger docs
|
||||||
* Timoni, Helm and Kustomize installers
|
* Timoni, Helm and Kustomize installers
|
||||||
* End-to-End testing with Kubernetes Kind and Helm
|
* End-to-End testing with Kubernetes Kind and Helm
|
||||||
* Multi-arch container image with Docker buildx and GitHub Actions
|
* Multi-arch container image with Docker buildx and Github Actions
|
||||||
* Container image signing with Sigstore cosign
|
* Container image signing with Sigstore cosign
|
||||||
* SBOMs and SLSA Provenance embedded in the container image
|
* SBOMs and SLSA Provenance embedded in the container image
|
||||||
* CVE scanning with govulncheck
|
* CVE scanning with Trivy
|
||||||
|
|
||||||
Web API:
|
Web API:
|
||||||
|
|
||||||
@@ -57,16 +57,6 @@ Web API:
|
|||||||
gRPC API:
|
gRPC API:
|
||||||
|
|
||||||
* `/grpc.health.v1.Health/Check` health checking
|
* `/grpc.health.v1.Health/Check` health checking
|
||||||
* `/grpc.EchoService/Echo` echos the received content
|
|
||||||
* `/grpc.VersionService/Version` returns podinfo version and Git commit hash
|
|
||||||
* `/grpc.DelayService/Delay` returns a successful response after the given seconds in the body of gRPC request
|
|
||||||
* `/grpc.EnvService/Env` returns environment variables as a JSON array
|
|
||||||
* `/grpc.HeaderService/Header` returns the headers present in the gRPC request. Any custom header can also be given as a part of request and that can be returned using this API
|
|
||||||
* `/grpc.InfoService/Info` returns the runtime information
|
|
||||||
* `/grpc.PanicService/Panic` crashes the process with gRPC status code as '1 CANCELLED'
|
|
||||||
* `/grpc.StatusService/Status` returns the gRPC Status code given in the request body
|
|
||||||
* `/grpc.TokenService/TokenGenerate` issues a JWT token valid for one minute
|
|
||||||
* `/grpc.TokenService/TokenValidate` validates the JWT token
|
|
||||||
|
|
||||||
Web UI:
|
Web UI:
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
version: 6.11.1
|
version: 6.5.4
|
||||||
appVersion: 6.11.1
|
appVersion: 6.5.4
|
||||||
name: podinfo
|
name: podinfo
|
||||||
engine: gotpl
|
engine: gotpl
|
||||||
description: Podinfo Helm chart for Kubernetes
|
description: Podinfo Helm chart for Kubernetes
|
||||||
|
|||||||
@@ -13,26 +13,24 @@ The Podinfo charts are published to
|
|||||||
[GitHub Container Registry](https://github.com/stefanprodan/podinfo/pkgs/container/charts%2Fpodinfo)
|
[GitHub Container Registry](https://github.com/stefanprodan/podinfo/pkgs/container/charts%2Fpodinfo)
|
||||||
and signed with [Cosign](https://github.com/sigstore/cosign) & GitHub Actions OIDC.
|
and signed with [Cosign](https://github.com/sigstore/cosign) & GitHub Actions OIDC.
|
||||||
|
|
||||||
To install the chart with the release name `podinfo` from GHCR:
|
To install the chart with the release name `my-release` from GHCR:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ helm upgrade -i podinfo oci://ghcr.io/stefanprodan/charts/podinfo
|
$ helm upgrade -i my-release oci://ghcr.io/stefanprodan/charts/podinfo
|
||||||
```
|
```
|
||||||
|
|
||||||
To verify a chart version with Cosign:
|
To verify a chart with Cosign:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ cosign verify ghcr.io/stefanprodan/charts/podinfo:<VERSION> \
|
$ cosign verify ghcr.io/stefanprodan/charts/podinfo:<VERSION>
|
||||||
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
|
|
||||||
--certificate-identity-regexp=^https://github\\.com/stefanprodan/podinfo/.*$
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, you can install the chart from GitHub pages:
|
Alternatively, you can install the chart from GitHub pages:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ helm repo add stefanprodan https://stefanprodan.github.io/podinfo
|
$ helm repo add podinfo https://stefanprodan.github.io/podinfo
|
||||||
|
|
||||||
$ helm upgrade -i podinfo stefanprodan/podinfo
|
$ helm upgrade -i my-release podinfo/podinfo
|
||||||
```
|
```
|
||||||
|
|
||||||
The command deploys podinfo on the Kubernetes cluster in the default namespace.
|
The command deploys podinfo on the Kubernetes cluster in the default namespace.
|
||||||
@@ -40,10 +38,10 @@ The [configuration](#configuration) section lists the parameters that can be con
|
|||||||
|
|
||||||
## Uninstalling the Chart
|
## Uninstalling the Chart
|
||||||
|
|
||||||
To uninstall the `podinfo` release:
|
To uninstall/delete the `my-release` deployment:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ helm uninstall podinfo
|
$ helm delete my-release
|
||||||
```
|
```
|
||||||
|
|
||||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||||
@@ -52,101 +50,81 @@ The command removes all the Kubernetes components associated with the chart and
|
|||||||
|
|
||||||
The following tables lists the configurable parameters of the podinfo chart and their default values.
|
The following tables lists the configurable parameters of the podinfo chart and their default values.
|
||||||
|
|
||||||
| Parameter | Default | Description |
|
| Parameter | Default | Description |
|
||||||
|--------------------------------------------------|--------------------------------|---------------------------------------------------------------------------------------------------|
|
| --------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `replicaCount` | `1` | Desired number of pods |
|
| `replicaCount` | `1` | Desired number of pods |
|
||||||
| `logLevel` | `info` | Log level: `debug`, `info`, `warn`, `error` |
|
| `logLevel` | `info` | Log level: `debug`, `info`, `warn`, `error` |
|
||||||
| `backend` | `None` | Echo backend URL |
|
| `backend` | `None` | Echo backend URL |
|
||||||
| `backends` | `[]` | Array of echo backend URLs |
|
| `backends` | `[]` | Array of echo backend URLs |
|
||||||
| `cache` | `None` | Redis address in the format `tcp://<host>:<port>` |
|
| `cache` | `None` | Redis address in the format `tcp://<host>:<port>` |
|
||||||
| `redis.enabled` | `false` | Create Redis deployment for caching purposes |
|
| `redis.enabled` | `false` | Create Redis deployment for caching purposes |
|
||||||
| `redis.repository` | `docker.io/redis` | Redis image repository |
|
| `ui.color` | `#34577c` | UI color |
|
||||||
| `redis.tag` | `<VERSION>` | Redis image tag |
|
| `ui.message` | `None` | UI greetings message |
|
||||||
| `redis.imagePullSecrets` | `[]` | Redis image pull secrets |
|
| `ui.logo` | `None` | UI logo |
|
||||||
| `ui.color` | `#34577c` | UI color |
|
| `faults.delay` | `false` | Random HTTP response delays between 0 and 5 seconds |
|
||||||
| `ui.message` | `None` | UI greetings message |
|
| `faults.error` | `false` | 1/3 chances of a random HTTP response error |
|
||||||
| `ui.logo` | `None` | UI logo |
|
| `faults.unhealthy` | `false` | When set, the healthy state is never reached |
|
||||||
| `faults.delay` | `false` | Random HTTP response delays between 0 and 5 seconds |
|
| `faults.unready` | `false` | When set, the ready state is never reached |
|
||||||
| `faults.error` | `false` | 1/3 chances of a random HTTP response error |
|
| `faults.testFail` | `false` | When set, a helm test is included which always fails |
|
||||||
| `faults.unhealthy` | `false` | When set, the healthy state is never reached |
|
| `faults.testTimeout` | `false` | When set, a helm test is included which always times out |
|
||||||
| `faults.unready` | `false` | When set, the ready state is never reached |
|
| `image.repository` | `stefanprodan/podinfo` | Image repository |
|
||||||
| `faults.testFail` | `false` | When set, a helm test is included which always fails |
|
| `image.tag` | `<VERSION>` | Image tag |
|
||||||
| `faults.testTimeout` | `false` | When set, a helm test is included which always times out |
|
| `image.pullPolicy` | `IfNotPresent` | Image pull policy |
|
||||||
| `image.repository` | `ghcr.io/stefanprodan/podinfo` | Image repository |
|
| `service.enabled` | `true` | Create a Kubernetes Service, should be disabled when using [Flagger](https://flagger.app) |
|
||||||
| `image.tag` | `<VERSION>` | Image tag |
|
| `service.type` | `ClusterIP` | Type of the Kubernetes Service |
|
||||||
| `image.pullPolicy` | `IfNotPresent` | Image pull policy |
|
| `service.metricsPort` | `9797` | Prometheus metrics endpoint port |
|
||||||
| `image.pullSecrets` | `[]` | Image pull secrets |
|
| `service.httpPort` | `9898` | Container HTTP port |
|
||||||
| `service.enabled` | `true` | Create a Kubernetes Service, should be disabled when using [Flagger](https://flagger.app) |
|
| `service.externalPort` | `9898` | ClusterIP HTTP port |
|
||||||
| `service.type` | `ClusterIP` | Type of the Kubernetes Service |
|
| `service.grpcPort` | `9999` | ClusterIP gPRC port |
|
||||||
| `service.metricsPort` | `9797` | Prometheus metrics endpoint port |
|
| `service.grpcService` | `podinfo` | gPRC service name |
|
||||||
| `service.httpPort` | `9898` | Container HTTP port |
|
| `service.nodePort` | `31198` | NodePort for the HTTP endpoint |
|
||||||
| `service.externalPort` | `9898` | ClusterIP HTTP port |
|
| `h2c.enabled` | `false` | Allow upgrading to h2c (non-TLS version of HTTP/2) |
|
||||||
| `service.grpcPort` | `9999` | ClusterIP gPRC port |
|
| `hpa.enabled` | `false` | Enables the Kubernetes HPA |
|
||||||
| `service.grpcService` | `podinfo` | gPRC service name |
|
| `hpa.maxReplicas` | `10` | Maximum amount of pods |
|
||||||
| `service.nodePort` | `31198` | NodePort for the HTTP endpoint |
|
| `hpa.cpu` | `None` | Target CPU usage per pod |
|
||||||
| `service.trafficDistribution` | `""` | Traffic distribution strategy |
|
| `hpa.memory` | `None` | Target memory usage per pod |
|
||||||
| `service.additionalLabels` | `{}` | Additional labels to add to the service |
|
| `hpa.requests` | `None` | Target HTTP requests per second per pod |
|
||||||
| `service.externalTrafficPolicy` | `None` | External traffic policy for LoadBalance service |
|
| `serviceAccount.enabled` | `false` | Whether a service account should be created |
|
||||||
| `h2c.enabled` | `false` | Allow upgrading to h2c (non-TLS version of HTTP/2) |
|
| `serviceAccount.name` | `None` | The name of the service account to use, if not set and create is true, a name is generated using the fullname template |
|
||||||
| `extraArgs` | `[]` | Additional command line arguments to pass to podinfo container |
|
| `serviceAccount.imagePullSecrets` | `[]` | List of image pull secrets if pulling from private registries. |
|
||||||
| `extraEnvs` | `[]` | Extra environment variables for the podinfo container |
|
| `securityContext` | `{}` | The security context to be set on the podinfo container |
|
||||||
| `config.path` | `""` | config file path |
|
| `linkerd.profile.enabled` | `false` | Create Linkerd service profile |
|
||||||
| `config.name` | `""` | config file name |
|
| `serviceMonitor.enabled` | `false` | Whether a Prometheus Operator service monitor should be created |
|
||||||
| `hpa.enabled` | `false` | Enables the Kubernetes HPA |
|
| `serviceMonitor.interval` | `15s` | Prometheus scraping interval |
|
||||||
| `hpa.maxReplicas` | `10` | Maximum amount of pods |
|
| `serviceMonitor.additionalLabels` | `{}` | Add additional labels to the service monitor |
|
||||||
| `hpa.cpu` | `None` | Target CPU usage per pod |
|
| `ingress.enabled` | `false` | Enables Ingress |
|
||||||
| `hpa.memory` | `None` | Target memory usage per pod |
|
| `ingress.className ` | `""` | Use ingressClassName |
|
||||||
| `hpa.requests` | `None` | Target HTTP requests per second per pod |
|
| `ingress.additionalLabels` | `{}` | Add additional labels to the ingress |
|
||||||
| `serviceAccount.enabled` | `false` | Whether a service account should be created |
|
| `ingress.annotations` | `{}` | Ingress annotations |
|
||||||
| `serviceAccount.name` | `None` | The name of the service account to use, if not set a name is generated using the fullname template|
|
| `ingress.hosts` | `[]` | Ingress accepted hosts |
|
||||||
| `serviceAccount.imagePullSecrets` | `[]` | List of image pull secrets if pulling from private registries |
|
| `ingress.tls` | `[]` | Ingress TLS configuration |
|
||||||
| `securityContext` | `{}` | The security context to be set on the podinfo container |
|
| `resources.requests.cpu` | `1m` | Pod CPU request |
|
||||||
| `podSecurityContext` | `{}` | The security context to be set on the pod |
|
| `resources.requests.memory` | `16Mi` | Pod memory request |
|
||||||
| `podAnnotations` | `{}` | Pod annotations |
|
| `resources.limits.cpu` | `None` | Pod CPU limit |
|
||||||
| `serviceMonitor.enabled` | `false` | Whether a Prometheus Operator service monitor should be created |
|
| `resources.limits.memory` | `None` | Pod memory limit |
|
||||||
| `serviceMonitor.interval` | `15s` | Prometheus scraping interval |
|
| `nodeSelector` | `{}` | Node labels for pod assignment |
|
||||||
| `serviceMonitor.additionalLabels` | `{}` | Add additional labels to the service monitor |
|
| `tolerations` | `[]` | List of node taints to tolerate |
|
||||||
| `ingress.enabled` | `false` | Enables Ingress |
|
| `affinity` | `None` | Node/pod affinities |
|
||||||
| `ingress.className` | `""` | Use ingressClassName |
|
| `podAnnotations` | `{}` | Pod annotations |
|
||||||
| `ingress.additionalLabels` | `{}` | Add additional labels to the ingress |
|
|
||||||
| `ingress.annotations` | `{}` | Ingress annotations |
|
|
||||||
| `ingress.hosts` | `[]` | Ingress accepted hosts |
|
|
||||||
| `ingress.tls` | `[]` | Ingress TLS configuration |
|
|
||||||
| `httpRoute.enabled` | `false` | Enables Gateway API HTTPRoute |
|
|
||||||
| `httpRoute.additionalLabels` | `{}` | Add additional labels to the HTTPRoute |
|
|
||||||
| `httpRoute.annotations` | `{}` | HTTPRoute annotations |
|
|
||||||
| `httpRoute.parentRefs` | `[]` | Gateways that this route is attached to |
|
|
||||||
| `httpRoute.hostnames` | `["podinfo.local"]` | Hostnames matching HTTP header |
|
|
||||||
| `httpRoute.rules` | `[]` | List of rules and filters applied |
|
|
||||||
| `hooks.<hookType>.job.enabled` | `false` | Create a Helm hook job for testing (hookType: see values.yaml for available hooks) |
|
|
||||||
| `hooks.<hookType>.job.hookDeletePolicy` | `hook-succeeded,hook-failed` | Helm hook delete policy |
|
|
||||||
| `hooks.<hookType>.job.ttlSecondsAfterFinished` | `None` | Job TTL after finished |
|
|
||||||
| `hooks.<hookType>.job.sleepSeconds` | `None` | Sleep duration before job exits |
|
|
||||||
| `hooks.<hookType>.job.exitCode` | `0` | Job exit code |
|
|
||||||
| `resources.requests.cpu` | `1m` | Pod CPU request |
|
|
||||||
| `resources.requests.memory` | `16Mi` | Pod memory request |
|
|
||||||
| `resources.limits.cpu` | `None` | Pod CPU limit |
|
|
||||||
| `resources.limits.memory` | `None` | Pod memory limit |
|
|
||||||
| `nodeSelector` | `{}` | Node labels for pod assignment |
|
|
||||||
| `tolerations` | `[]` | List of node taints to tolerate |
|
|
||||||
| `affinity` | `None` | Node/pod affinities |
|
|
||||||
|
|
||||||
Specify each parameter using the `--set key=value[,key=value]` argument:
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ helm upgrade -i podinfo oci://ghcr.io/stefanprodan/charts/podinfo \
|
$ helm install my-release podinfo/podinfo \
|
||||||
--set=serviceMonitor.enabled=true,serviceMonitor.interval=5s
|
--set=serviceMonitor.enabled=true,serviceMonitor.interval=5s
|
||||||
```
|
```
|
||||||
|
|
||||||
To add custom annotations you need to escape the annotation key string:
|
To add custom annotations you need to escape the annotation key string:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ helm upgrade -i podinfo oci://ghcr.io/stefanprodan/charts/podinfo \
|
$ helm upgrade -i my-release podinfo/podinfo \
|
||||||
--set podAnnotations."toolkit\.fluxcd\.io\/tenant"=dev-team
|
--set podAnnotations."appmesh\.k8s\.aws\/preview"=enabled
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart:
|
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ helm upgrade -i my-release oci://ghcr.io/stefanprodan/charts/podinfo -f values.yaml
|
$ helm install my-release podinfo/podinfo -f values.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||||
|
|||||||
@@ -6,15 +6,15 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if contains "NodePort" .Values.service.type }}
|
{{- else if contains "NodePort" .Values.service.type }}
|
||||||
export NODE_PORT=$(kubectl get --namespace {{ include "podinfo.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "podinfo.fullname" . }})
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "podinfo.fullname" . }})
|
||||||
export NODE_IP=$(kubectl get nodes --namespace {{ include "podinfo.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||||
echo http://$NODE_IP:$NODE_PORT
|
echo http://$NODE_IP:$NODE_PORT
|
||||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||||
You can watch the status of by running 'kubectl get svc -w {{ template "podinfo.fullname" . }}'
|
You can watch the status of by running 'kubectl get svc -w {{ template "podinfo.fullname" . }}'
|
||||||
export SERVICE_IP=$(kubectl get svc --namespace {{ include "podinfo.namespace" . }} {{ template "podinfo.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "podinfo.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||||
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
|
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
|
||||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||||
kubectl -n {{ include "podinfo.namespace" . }} port-forward deploy/{{ template "podinfo.fullname" . }} 8080:{{ .Values.service.externalPort }}
|
kubectl -n {{ .Release.Namespace }} port-forward deploy/{{ template "podinfo.fullname" . }} 8080:{{ .Values.service.externalPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -23,13 +23,6 @@ If release name contains chart name it will be used as a full name.
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{/*
|
|
||||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
|
|
||||||
*/}}
|
|
||||||
{{- define "podinfo.namespace" -}}
|
|
||||||
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create chart name and version as used by the chart label.
|
Create chart name and version as used by the chart label.
|
||||||
*/}}
|
*/}}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ apiVersion: cert-manager.io/v1
|
|||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}
|
name: {{ template "podinfo.fullname" . }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}
|
name: {{ template "podinfo.fullname" . }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
@@ -31,9 +30,6 @@ spec:
|
|||||||
{{- if .Values.serviceAccount.enabled }}
|
{{- if .Values.serviceAccount.enabled }}
|
||||||
serviceAccountName: {{ template "podinfo.serviceAccountName" . }}
|
serviceAccountName: {{ template "podinfo.serviceAccountName" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.image.pullSecrets }}
|
|
||||||
imagePullSecrets: {{ toYaml .Values.image.pullSecrets | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
@@ -91,15 +87,6 @@ spec:
|
|||||||
{{- if .Values.h2c.enabled }}
|
{{- if .Values.h2c.enabled }}
|
||||||
- --h2c
|
- --h2c
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.config.path }}
|
|
||||||
- --config-path={{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.config.name }}
|
|
||||||
- --config={{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.extraArgs }}
|
|
||||||
{{- toYaml . | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
env:
|
env:
|
||||||
{{- if .Values.ui.message }}
|
{{- if .Values.ui.message }}
|
||||||
- name: PODINFO_UI_MESSAGE
|
- name: PODINFO_UI_MESSAGE
|
||||||
@@ -117,9 +104,6 @@ spec:
|
|||||||
- name: PODINFO_BACKEND_URL
|
- name: PODINFO_BACKEND_URL
|
||||||
value: {{ .Values.backend }}
|
value: {{ .Values.backend }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.extraEnvs }}
|
|
||||||
{{ toYaml .Values.extraEnvs | indent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.service.httpPort | default 9898 }}
|
containerPort: {{ .Values.service.httpPort | default 9898 }}
|
||||||
@@ -199,10 +183,6 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
{{ toYaml .Values.resources | indent 12 }}
|
{{ toYaml .Values.resources | indent 12 }}
|
||||||
{{- with .Values.podSecurityContext }}
|
|
||||||
securityContext:
|
|
||||||
{{ toYaml . | indent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ toYaml . | indent 8 }}
|
{{ toYaml . | indent 8 }}
|
||||||
@@ -223,7 +203,3 @@ spec:
|
|||||||
secret:
|
secret:
|
||||||
secretName: {{ template "podinfo.tlsSecretName" . }}
|
secretName: {{ template "podinfo.tlsSecretName" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Values.topologySpreadConstraints }}
|
|
||||||
topologySpreadConstraints:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
{{- if .Values.grpcRoute.enabled -}}
|
|
||||||
{{- $fullName := include "podinfo.fullname" . -}}
|
|
||||||
{{- $grpcPort := .Values.service.grpcPort -}}
|
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
|
||||||
kind: GRPCRoute
|
|
||||||
metadata:
|
|
||||||
name: {{ $fullName }}
|
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.grpcRoute.additionalLabels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.grpcRoute.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
parentRefs:
|
|
||||||
{{- with .Values.grpcRoute.parentRefs }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.grpcRoute.hostnames }}
|
|
||||||
hostnames:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
rules:
|
|
||||||
{{- range .Values.grpcRoute.rules }}
|
|
||||||
- backendRefs:
|
|
||||||
- name: {{ $fullName }}
|
|
||||||
port: {{ $grpcPort }}
|
|
||||||
weight: 1
|
|
||||||
{{- with .matches }}
|
|
||||||
matches:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .filters }}
|
|
||||||
filters:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
{{- $hooks := dict "preInstall" "pre-install" "postInstall" "post-install" "preDelete" "pre-delete" "postDelete" "post-delete" "preUpgrade" "pre-upgrade" "postUpgrade" "post-upgrade" "preRollback" "pre-rollback" "postRollback" "post-rollback" }}
|
|
||||||
{{- range $hookName, $hookType := $hooks }}
|
|
||||||
{{- $hookConfig := index $.Values.hooks $hookName }}
|
|
||||||
{{- if and $hookConfig $hookConfig.job $hookConfig.job.enabled }}
|
|
||||||
---
|
|
||||||
apiVersion: batch/v1
|
|
||||||
kind: Job
|
|
||||||
metadata:
|
|
||||||
name: {{ template "podinfo.fullname" $ }}-{{ $hookType }}
|
|
||||||
namespace: {{ include "podinfo.namespace" $ }}
|
|
||||||
labels:
|
|
||||||
{{- include "podinfo.labels" $ | nindent 4 }}
|
|
||||||
annotations:
|
|
||||||
"helm.sh/hook": {{ $hookType }}
|
|
||||||
"helm.sh/hook-delete-policy": {{ $hookConfig.job.hookDeletePolicy }}
|
|
||||||
spec:
|
|
||||||
{{- if kindIs "float64" $hookConfig.job.ttlSecondsAfterFinished }}
|
|
||||||
ttlSecondsAfterFinished: {{ $hookConfig.job.ttlSecondsAfterFinished | int }}
|
|
||||||
{{- end }}
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: job
|
|
||||||
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
|
|
||||||
imagePullPolicy: {{ $.Values.image.pullPolicy }}
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
{{- if kindIs "float64" $hookConfig.job.sleepSeconds }}
|
|
||||||
sleep {{ $hookConfig.job.sleepSeconds | int }}
|
|
||||||
{{- end }}
|
|
||||||
exit {{ $hookConfig.job.exitCode | default 0 }}
|
|
||||||
restartPolicy: Never
|
|
||||||
backoffLimit: 1
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -3,7 +3,6 @@ apiVersion: autoscaling/v2
|
|||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}
|
name: {{ template "podinfo.fullname" . }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
{{- if .Values.httpRoute.enabled -}}
|
|
||||||
{{- $fullName := include "podinfo.fullname" . -}}
|
|
||||||
{{- $svcPort := .Values.service.externalPort -}}
|
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
|
||||||
kind: HTTPRoute
|
|
||||||
metadata:
|
|
||||||
name: {{ $fullName }}
|
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.httpRoute.additionalLabels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.httpRoute.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
parentRefs:
|
|
||||||
{{- with .Values.httpRoute.parentRefs }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.httpRoute.hostnames }}
|
|
||||||
hostnames:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
rules:
|
|
||||||
{{- range .Values.httpRoute.rules }}
|
|
||||||
{{- with .matches }}
|
|
||||||
- matches:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .filters }}
|
|
||||||
filters:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
backendRefs:
|
|
||||||
- name: {{ $fullName }}
|
|
||||||
port: {{ $svcPort }}
|
|
||||||
weight: 1
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -5,7 +5,6 @@ apiVersion: networking.k8s.io/v1
|
|||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
{{- with .Values.ingress.additionalLabels }}
|
{{- with .Values.ingress.additionalLabels }}
|
||||||
|
|||||||
98
charts/podinfo/templates/linkerd.yaml
Normal file
98
charts/podinfo/templates/linkerd.yaml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{{- if .Values.linkerd.profile.enabled -}}
|
||||||
|
apiVersion: linkerd.io/v1alpha2
|
||||||
|
kind: ServiceProfile
|
||||||
|
metadata:
|
||||||
|
name: {{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||||
|
labels:
|
||||||
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
routes:
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /
|
||||||
|
name: GET /
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /api/echo
|
||||||
|
name: POST /api/echo
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /api/info
|
||||||
|
name: GET /api/info
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /chunked/[^/]*
|
||||||
|
name: GET /chunked/{seconds}
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /delay/[^/]*
|
||||||
|
name: GET /delay/{seconds}
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /env
|
||||||
|
name: GET /env
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /headers
|
||||||
|
name: GET /headers
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /healthz
|
||||||
|
name: GET /healthz
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /metrics
|
||||||
|
name: GET /metrics
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /panic
|
||||||
|
name: GET /panic
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /readyz
|
||||||
|
name: GET /readyz
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /readyz/disable
|
||||||
|
name: POST /readyz/disable
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /readyz/enable
|
||||||
|
name: POST /readyz/enable
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /status/[^/]*
|
||||||
|
name: GET /status/{code}
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /cache
|
||||||
|
name: POST /cache
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /cache/[^/]*
|
||||||
|
name: GET /cache/{hash}
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /store
|
||||||
|
name: POST /store
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /store/[^/]*
|
||||||
|
name: GET /store/{hash}
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /token
|
||||||
|
name: POST /token
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /token/validate
|
||||||
|
name: POST /token/validate
|
||||||
|
- condition:
|
||||||
|
method: GET
|
||||||
|
pathRegex: /version
|
||||||
|
name: GET /version
|
||||||
|
- condition:
|
||||||
|
method: POST
|
||||||
|
pathRegex: /ws/echo
|
||||||
|
name: POST /ws/echo
|
||||||
|
{{- end }}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{{- if and .Values.podDisruptionBudget (gt (int .Values.replicaCount) 1) }}
|
|
||||||
apiVersion: policy/v1
|
|
||||||
kind: PodDisruptionBudget
|
|
||||||
metadata:
|
|
||||||
name: {{ include "podinfo.fullname" . }}
|
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
{{- include "podinfo.selectorLabels" . | nindent 6 }}
|
|
||||||
{{- toYaml .Values.podDisruptionBudget | nindent 2 }}
|
|
||||||
{{- end }}
|
|
||||||
@@ -21,9 +21,6 @@ spec:
|
|||||||
{{- if .Values.serviceAccount.enabled }}
|
{{- if .Values.serviceAccount.enabled }}
|
||||||
serviceAccountName: {{ template "podinfo.serviceAccountName" . }}
|
serviceAccountName: {{ template "podinfo.serviceAccountName" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.redis.imagePullSecrets }}
|
|
||||||
imagePullSecrets: {{ toYaml .Values.redis.imagePullSecrets | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: "{{ .Values.redis.repository }}:{{ .Values.redis.tag }}"
|
image: "{{ .Values.redis.repository }}:{{ .Values.redis.tag }}"
|
||||||
|
|||||||
@@ -14,5 +14,4 @@ spec:
|
|||||||
port: 6379
|
port: 6379
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: redis
|
targetPort: redis
|
||||||
appProtocol: redis
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -3,12 +3,8 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}
|
name: {{ template "podinfo.fullname" . }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
{{- with .Values.service.additionalLabels }}
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.service.annotations }}
|
{{- with .Values.service.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{ toYaml . | indent 4 }}
|
{{ toYaml . | indent 4 }}
|
||||||
@@ -37,10 +33,4 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
{{- include "podinfo.selectorLabels" . | nindent 4 }}
|
{{- include "podinfo.selectorLabels" . | nindent 4 }}
|
||||||
{{- if .Values.service.trafficDistribution }}
|
|
||||||
trafficDistribution: {{ .Values.service.trafficDistribution }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if ( and (.Values.service.externalTrafficPolicy) (eq .Values.service.type "LoadBalancer") ) }}
|
|
||||||
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ apiVersion: monitoring.coreos.com/v1
|
|||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}
|
name: {{ template "podinfo.fullname" . }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
{{- with .Values.serviceMonitor.additionalLabels }}
|
{{- with .Values.serviceMonitor.additionalLabels }}
|
||||||
@@ -16,7 +15,7 @@ spec:
|
|||||||
interval: {{ .Values.serviceMonitor.interval }}
|
interval: {{ .Values.serviceMonitor.interval }}
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
- {{ include "podinfo.namespace" . }}
|
- {{ .Release.Namespace }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "podinfo.selectorLabels" . | nindent 6 }}
|
{{- include "podinfo.selectorLabels" . | nindent 6 }}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-cache-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-cache-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
@@ -25,6 +24,6 @@ spec:
|
|||||||
curl -s -XDELETE ${PODINFO_SVC}/cache/test
|
curl -s -XDELETE ${PODINFO_SVC}/cache/test
|
||||||
env:
|
env:
|
||||||
- name: PODINFO_SVC
|
- name: PODINFO_SVC
|
||||||
value: "{{ template "podinfo.fullname" . }}.{{ include "podinfo.namespace" . }}:{{ .Values.service.externalPort }}"
|
value: "{{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }}"
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-fault-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-fault-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-grpc-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-grpc-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
@@ -16,5 +15,5 @@ spec:
|
|||||||
- name: grpc-health-probe
|
- name: grpc-health-probe
|
||||||
image: stefanprodan/grpc_health_probe:v0.3.0
|
image: stefanprodan/grpc_health_probe:v0.3.0
|
||||||
command: ['grpc_health_probe']
|
command: ['grpc_health_probe']
|
||||||
args: ['-addr={{ template "podinfo.fullname" . }}.{{ include "podinfo.namespace" . }}:{{ .Values.service.grpcPort }}']
|
args: ['-addr={{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.grpcPort }}']
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-jwt-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-jwt-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
@@ -23,5 +22,5 @@ spec:
|
|||||||
curl -sH "Authorization: Bearer ${TOKEN}" ${PODINFO_SVC}/token/validate | grep test
|
curl -sH "Authorization: Bearer ${TOKEN}" ${PODINFO_SVC}/token/validate | grep test
|
||||||
env:
|
env:
|
||||||
- name: PODINFO_SVC
|
- name: PODINFO_SVC
|
||||||
value: "{{ template "podinfo.fullname" . }}.{{ include "podinfo.namespace" . }}:{{ .Values.service.externalPort }}"
|
value: "{{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }}"
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-service-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-service-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
@@ -22,5 +21,5 @@ spec:
|
|||||||
curl -s ${PODINFO_SVC}/api/info | grep version
|
curl -s ${PODINFO_SVC}/api/info | grep version
|
||||||
env:
|
env:
|
||||||
- name: PODINFO_SVC
|
- name: PODINFO_SVC
|
||||||
value: "{{ template "podinfo.fullname" . }}.{{ include "podinfo.namespace" . }}:{{ .Values.service.externalPort }}"
|
value: "{{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }}"
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-fault-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-fault-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ apiVersion: v1
|
|||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "podinfo.fullname" . }}-tls-test-{{ randAlphaNum 5 | lower }}
|
name: {{ template "podinfo.fullname" . }}-tls-test-{{ randAlphaNum 5 | lower }}
|
||||||
namespace: {{ include "podinfo.namespace" . }}
|
|
||||||
labels:
|
labels:
|
||||||
{{- include "podinfo.labels" . | nindent 4 }}
|
{{- include "podinfo.labels" . | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
@@ -23,6 +22,6 @@ spec:
|
|||||||
curl -sk ${PODINFO_SVC}/api/info | grep version
|
curl -sk ${PODINFO_SVC}/api/info | grep version
|
||||||
env:
|
env:
|
||||||
- name: PODINFO_SVC
|
- name: PODINFO_SVC
|
||||||
value: "https://{{ template "podinfo.fullname" . }}.{{ include "podinfo.namespace" . }}:{{ .Values.tls.port }}"
|
value: "https://{{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.tls.port }}"
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -8,7 +8,7 @@ backends: []
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: ghcr.io/stefanprodan/podinfo
|
repository: ghcr.io/stefanprodan/podinfo
|
||||||
tag: 6.11.1
|
tag: 6.5.4
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
ui:
|
ui:
|
||||||
@@ -29,7 +29,6 @@ faults:
|
|||||||
service:
|
service:
|
||||||
enabled: true
|
enabled: true
|
||||||
annotations: {}
|
annotations: {}
|
||||||
additionalLabels: { }
|
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
metricsPort: 9797
|
metricsPort: 9797
|
||||||
httpPort: 9898
|
httpPort: 9898
|
||||||
@@ -37,23 +36,11 @@ service:
|
|||||||
grpcPort: 9999
|
grpcPort: 9999
|
||||||
grpcService: podinfo
|
grpcService: podinfo
|
||||||
nodePort: 31198
|
nodePort: 31198
|
||||||
trafficDistribution: ""
|
|
||||||
externalTrafficPolicy: ""
|
|
||||||
|
|
||||||
# enable h2c protocol (non-TLS version of HTTP/2)
|
# enable h2c protocol (non-TLS version of HTTP/2)
|
||||||
h2c:
|
h2c:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
# config file settings
|
|
||||||
config:
|
|
||||||
# config file path
|
|
||||||
path: ""
|
|
||||||
# config file name
|
|
||||||
name: ""
|
|
||||||
|
|
||||||
# Additional command line arguments to pass to podinfo container
|
|
||||||
extraArgs: []
|
|
||||||
|
|
||||||
# enable tls on the podinfo service
|
# enable tls on the podinfo service
|
||||||
tls:
|
tls:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -96,7 +83,7 @@ cache: ""
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
repository: redis
|
repository: redis
|
||||||
tag: 8.6.1
|
tag: 7.0.7
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
# Specifies whether a service account should be created
|
# Specifies whether a service account should be created
|
||||||
@@ -110,19 +97,13 @@ serviceAccount:
|
|||||||
# set container security context
|
# set container security context
|
||||||
securityContext: {}
|
securityContext: {}
|
||||||
|
|
||||||
# set pod security context
|
|
||||||
podSecurityContext: {}
|
|
||||||
|
|
||||||
# -- Expose the service via Kubernetes Ingress
|
|
||||||
# Requires an Ingress controller
|
|
||||||
# Docs https://kubernetes.io/docs/concepts/services-networking/ingress/
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: ""
|
className: ""
|
||||||
additionalLabels: {}
|
additionalLabels: {}
|
||||||
annotations: {}
|
annotations: {}
|
||||||
# kubernetes.io/ingress.class: nginx
|
# kubernetes.io/ingress.class: nginx
|
||||||
# kubernetes.io/tls-acme: "true"
|
# kubernetes.io/tls-acme: "true"
|
||||||
hosts:
|
hosts:
|
||||||
- host: podinfo.local
|
- host: podinfo.local
|
||||||
paths:
|
paths:
|
||||||
@@ -133,30 +114,9 @@ ingress:
|
|||||||
# hosts:
|
# hosts:
|
||||||
# - chart-example.local
|
# - chart-example.local
|
||||||
|
|
||||||
# -- Expose the service via Gateway HTTPRoute
|
linkerd:
|
||||||
# Requires a Gateway controller
|
profile:
|
||||||
# Docs https://gateway-api.sigs.k8s.io/guides/
|
enabled: false
|
||||||
httpRoute:
|
|
||||||
# HTTPRoute enabled.
|
|
||||||
enabled: false
|
|
||||||
# Add additional labels to the HTTPRoute.
|
|
||||||
additionalLabels: {}
|
|
||||||
# HTTPRoute annotations.
|
|
||||||
annotations: {}
|
|
||||||
# Which Gateways this Route is attached to.
|
|
||||||
parentRefs:
|
|
||||||
- name: gateway
|
|
||||||
sectionName: http
|
|
||||||
# namespace: default
|
|
||||||
# Hostnames matching HTTP header.
|
|
||||||
hostnames:
|
|
||||||
- podinfo.local
|
|
||||||
# List of rules and filters applied.
|
|
||||||
rules:
|
|
||||||
- matches:
|
|
||||||
- path:
|
|
||||||
type: PathPrefix
|
|
||||||
value: /
|
|
||||||
|
|
||||||
# create Prometheus Operator monitor
|
# create Prometheus Operator monitor
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
@@ -171,14 +131,6 @@ resources:
|
|||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 64Mi
|
memory: 64Mi
|
||||||
|
|
||||||
# Extra environment variables for the podinfo container
|
|
||||||
extraEnvs: []
|
|
||||||
# Example on how to configure extraEnvs
|
|
||||||
# - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
||||||
# value: "http://otel:4317"
|
|
||||||
# - name: MULTIPLE_VALUES
|
|
||||||
# value: TEST
|
|
||||||
|
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
tolerations: []
|
tolerations: []
|
||||||
@@ -186,25 +138,3 @@ tolerations: []
|
|||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
|
|
||||||
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
|
|
||||||
probes:
|
|
||||||
readiness:
|
|
||||||
initialDelaySeconds: 1
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
successThreshold: 1
|
|
||||||
periodSeconds: 10
|
|
||||||
liveness:
|
|
||||||
initialDelaySeconds: 1
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
successThreshold: 1
|
|
||||||
periodSeconds: 10
|
|
||||||
startup:
|
|
||||||
enable: false
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 20
|
|
||||||
successThreshold: 1
|
|
||||||
periodSeconds: 10
|
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ backends: []
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: ghcr.io/stefanprodan/podinfo
|
repository: ghcr.io/stefanprodan/podinfo
|
||||||
tag: 6.11.1
|
tag: 6.5.4
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
pullSecrets: []
|
|
||||||
|
|
||||||
ui:
|
ui:
|
||||||
color: "#34577c"
|
color: "#34577c"
|
||||||
@@ -30,7 +29,6 @@ faults:
|
|||||||
service:
|
service:
|
||||||
enabled: true
|
enabled: true
|
||||||
annotations: {}
|
annotations: {}
|
||||||
additionalLabels: { }
|
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
metricsPort: 9797
|
metricsPort: 9797
|
||||||
httpPort: 9898
|
httpPort: 9898
|
||||||
@@ -42,32 +40,11 @@ service:
|
|||||||
# NOTE: requires privileged container with NET_BIND_SERVICE capability -- this is useful for testing
|
# NOTE: requires privileged container with NET_BIND_SERVICE capability -- this is useful for testing
|
||||||
# in local clusters such as kind without port forwarding
|
# in local clusters such as kind without port forwarding
|
||||||
hostPort:
|
hostPort:
|
||||||
# Stable from Kubernetes v1.33+ with a value of PreferClose. Additional values are PreferSameZone and PreferSameNode from v1.34+. Empty string means it's disabled.
|
|
||||||
trafficDistribution: ""
|
|
||||||
externalTrafficPolicy: ""
|
|
||||||
|
|
||||||
# enable h2c protocol (non-TLS version of HTTP/2)
|
# enable h2c protocol (non-TLS version of HTTP/2)
|
||||||
h2c:
|
h2c:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
# config file settings
|
|
||||||
config:
|
|
||||||
# config file path
|
|
||||||
path: ""
|
|
||||||
# config file name
|
|
||||||
name: ""
|
|
||||||
|
|
||||||
# Additional command line arguments to pass to podinfo container
|
|
||||||
extraArgs: []
|
|
||||||
|
|
||||||
# Extra environment variables for the podinfo container
|
|
||||||
extraEnvs: []
|
|
||||||
# Example on how to configure extraEnvs
|
|
||||||
# - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
||||||
# value: "http://otel:4317"
|
|
||||||
# - name: MULTIPLE_VALUES
|
|
||||||
# value: TEST
|
|
||||||
|
|
||||||
# enable tls on the podinfo service
|
# enable tls on the podinfo service
|
||||||
tls:
|
tls:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -93,65 +70,6 @@ certificate:
|
|||||||
dnsNames:
|
dnsNames:
|
||||||
- podinfo
|
- podinfo
|
||||||
|
|
||||||
# Helm hooks (for testing purposes)
|
|
||||||
hooks:
|
|
||||||
preInstall:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
postInstall:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
preDelete:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
postDelete:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
preUpgrade:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
postUpgrade:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
preRollback:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
postRollback:
|
|
||||||
job:
|
|
||||||
enabled: false
|
|
||||||
hookDeletePolicy: hook-succeeded,hook-failed
|
|
||||||
ttlSecondsAfterFinished:
|
|
||||||
sleepSeconds:
|
|
||||||
exitCode: 0
|
|
||||||
|
|
||||||
# metrics-server add-on required
|
# metrics-server add-on required
|
||||||
hpa:
|
hpa:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -168,9 +86,8 @@ cache: ""
|
|||||||
# Redis deployment
|
# Redis deployment
|
||||||
redis:
|
redis:
|
||||||
enabled: false
|
enabled: false
|
||||||
repository: docker.io/redis
|
repository: redis
|
||||||
tag: 8.6.1
|
tag: 7.0.7
|
||||||
imagePullSecrets: []
|
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
# Specifies whether a service account should be created
|
# Specifies whether a service account should be created
|
||||||
@@ -184,12 +101,6 @@ serviceAccount:
|
|||||||
# set container security context
|
# set container security context
|
||||||
securityContext: {}
|
securityContext: {}
|
||||||
|
|
||||||
# set pod security context
|
|
||||||
podSecurityContext: {}
|
|
||||||
|
|
||||||
# -- Expose the service via Kubernetes Ingress
|
|
||||||
# Requires an Ingress controller
|
|
||||||
# Docs https://kubernetes.io/docs/concepts/services-networking/ingress/
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
className: ""
|
className: ""
|
||||||
@@ -207,52 +118,9 @@ ingress:
|
|||||||
# hosts:
|
# hosts:
|
||||||
# - chart-example.local
|
# - chart-example.local
|
||||||
|
|
||||||
# -- Expose the service via Gateway HTTPRoute
|
linkerd:
|
||||||
# Requires a Gateway controller
|
profile:
|
||||||
# Docs https://gateway-api.sigs.k8s.io/guides/
|
enabled: false
|
||||||
httpRoute:
|
|
||||||
# HTTPRoute enabled.
|
|
||||||
enabled: false
|
|
||||||
# Add additional labels to the HTTPRoute.
|
|
||||||
additionalLabels: {}
|
|
||||||
# HTTPRoute annotations.
|
|
||||||
annotations: {}
|
|
||||||
# Which Gateways this Route is attached to.
|
|
||||||
parentRefs:
|
|
||||||
- name: gateway
|
|
||||||
sectionName: http
|
|
||||||
# namespace: default
|
|
||||||
# Hostnames matching HTTP header.
|
|
||||||
hostnames:
|
|
||||||
- podinfo.local
|
|
||||||
# List of rules and filters applied.
|
|
||||||
rules:
|
|
||||||
- matches:
|
|
||||||
- path:
|
|
||||||
type: PathPrefix
|
|
||||||
value: /
|
|
||||||
|
|
||||||
# -- Expose the gRPC service via Gateway GRPCRoute
|
|
||||||
# Requires a Gateway controller with GRPCRoute support
|
|
||||||
# Docs https://gateway-api.sigs.k8s.io/guides/grpc-routing/
|
|
||||||
grpcRoute:
|
|
||||||
# GRPCRoute enabled.
|
|
||||||
enabled: false
|
|
||||||
# Add additional labels to the GRPCRoute.
|
|
||||||
additionalLabels: {}
|
|
||||||
# GRPCRoute annotations.
|
|
||||||
annotations: {}
|
|
||||||
# Which Gateways this Route is attached to.
|
|
||||||
parentRefs:
|
|
||||||
- name: gateway
|
|
||||||
sectionName: http
|
|
||||||
# namespace: default
|
|
||||||
# Hostnames matching HTTP header.
|
|
||||||
hostnames:
|
|
||||||
- podinfo.local
|
|
||||||
# List of rules applied.
|
|
||||||
rules:
|
|
||||||
- {}
|
|
||||||
|
|
||||||
# create Prometheus Operator monitor
|
# create Prometheus Operator monitor
|
||||||
serviceMonitor:
|
serviceMonitor:
|
||||||
@@ -274,13 +142,6 @@ affinity: {}
|
|||||||
|
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
|
|
||||||
# https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
|
|
||||||
topologySpreadConstraints: []
|
|
||||||
|
|
||||||
# Disruption budget will be configured only when the replicaCount is greater than 1
|
|
||||||
podDisruptionBudget: {}
|
|
||||||
# maxUnavailable: 1
|
|
||||||
|
|
||||||
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
|
# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
|
||||||
probes:
|
probes:
|
||||||
readiness:
|
readiness:
|
||||||
|
|||||||
4
cloudbuild.yaml
Normal file
4
cloudbuild.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
steps:
|
||||||
|
- name: 'gcr.io/cloud-builders/docker'
|
||||||
|
args: ['build','-f' , 'Dockerfile', '-t', 'gcr.io/$PROJECT_ID/podinfo:$BRANCH_NAME-$SHORT_SHA', '.']
|
||||||
|
images: ['gcr.io/$PROJECT_ID/podinfo:$BRANCH_NAME-$SHORT_SHA']
|
||||||
@@ -12,13 +12,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/credentials"
|
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
|
||||||
"google.golang.org/grpc/health/grpc_health_v1"
|
"google.golang.org/grpc/health/grpc_health_v1"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
@@ -30,7 +27,6 @@ var (
|
|||||||
body string
|
body string
|
||||||
timeout time.Duration
|
timeout time.Duration
|
||||||
grpcServiceName string
|
grpcServiceName string
|
||||||
grpcTLS bool
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var checkCmd = &cobra.Command{
|
var checkCmd = &cobra.Command{
|
||||||
@@ -67,13 +63,6 @@ var checkgRPCCmd = &cobra.Command{
|
|||||||
RunE: runCheckgPRC,
|
RunE: runCheckgPRC,
|
||||||
}
|
}
|
||||||
|
|
||||||
var checkWsCmd = &cobra.Command{
|
|
||||||
Use: `ws [address]`,
|
|
||||||
Short: "WebSocket round-trip health check",
|
|
||||||
Example: ` check ws ws://localhost:9898/ws/echo --retry=1 --delay=2s --timeout=5s`,
|
|
||||||
RunE: runCheckWs,
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
checkUrlCmd.Flags().StringVar(&method, "method", "GET", "HTTP method")
|
checkUrlCmd.Flags().StringVar(&method, "method", "GET", "HTTP method")
|
||||||
checkUrlCmd.Flags().StringVar(&body, "body", "", "HTTP POST/PUT content")
|
checkUrlCmd.Flags().StringVar(&body, "body", "", "HTTP POST/PUT content")
|
||||||
@@ -91,16 +80,10 @@ func init() {
|
|||||||
checkgRPCCmd.Flags().DurationVar(&retryDelay, "delay", 1*time.Second, "wait duration between retries")
|
checkgRPCCmd.Flags().DurationVar(&retryDelay, "delay", 1*time.Second, "wait duration between retries")
|
||||||
checkgRPCCmd.Flags().DurationVar(&timeout, "timeout", 5*time.Second, "timeout")
|
checkgRPCCmd.Flags().DurationVar(&timeout, "timeout", 5*time.Second, "timeout")
|
||||||
checkgRPCCmd.Flags().StringVar(&grpcServiceName, "service", "", "gRPC service name")
|
checkgRPCCmd.Flags().StringVar(&grpcServiceName, "service", "", "gRPC service name")
|
||||||
checkgRPCCmd.Flags().BoolVar(&grpcTLS, "tls", false, "use TLS for gRPC connection")
|
|
||||||
checkCmd.AddCommand(checkgRPCCmd)
|
checkCmd.AddCommand(checkgRPCCmd)
|
||||||
|
|
||||||
checkCmd.AddCommand(checkCertCmd)
|
checkCmd.AddCommand(checkCertCmd)
|
||||||
|
|
||||||
checkWsCmd.Flags().IntVar(&retryCount, "retry", 0, "times to retry the WebSocket check")
|
|
||||||
checkWsCmd.Flags().DurationVar(&retryDelay, "delay", 1*time.Second, "wait duration between retries")
|
|
||||||
checkWsCmd.Flags().DurationVar(&timeout, "timeout", 5*time.Second, "timeout")
|
|
||||||
checkCmd.AddCommand(checkWsCmd)
|
|
||||||
|
|
||||||
rootCmd.AddCommand(checkCmd)
|
rootCmd.AddCommand(checkCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,72 +262,6 @@ func fmtContentLength(b int64) string {
|
|||||||
return fmt.Sprintf("%.1f %cB", float64(b)/float64(div), "kMGTPE"[exp])
|
return fmt.Sprintf("%.1f %cB", float64(b)/float64(div), "kMGTPE"[exp])
|
||||||
}
|
}
|
||||||
|
|
||||||
func runCheckWs(cmd *cobra.Command, args []string) error {
|
|
||||||
if retryCount < 0 {
|
|
||||||
return fmt.Errorf("--retry is required")
|
|
||||||
}
|
|
||||||
if len(args) < 1 {
|
|
||||||
return fmt.Errorf("address is required! example: check ws wss://localhost:9898/ws/echo")
|
|
||||||
}
|
|
||||||
|
|
||||||
address := args[0]
|
|
||||||
if !strings.HasPrefix(address, "ws://") && !strings.HasPrefix(address, "wss://") {
|
|
||||||
return fmt.Errorf("address must start with ws:// or wss://")
|
|
||||||
}
|
|
||||||
|
|
||||||
for n := 0; n <= retryCount; n++ {
|
|
||||||
if n != 0 {
|
|
||||||
time.Sleep(retryDelay)
|
|
||||||
}
|
|
||||||
|
|
||||||
dialer := websocket.Dialer{
|
|
||||||
HandshakeTimeout: timeout,
|
|
||||||
}
|
|
||||||
|
|
||||||
conn, _, err := dialer.Dial(address, nil)
|
|
||||||
if err != nil {
|
|
||||||
logger.Info("check failed",
|
|
||||||
zap.String("address", address),
|
|
||||||
zap.Error(err))
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
msg := "podinfo-check"
|
|
||||||
start := time.Now()
|
|
||||||
|
|
||||||
conn.SetWriteDeadline(start.Add(timeout))
|
|
||||||
if err := conn.WriteMessage(websocket.TextMessage, []byte(msg)); err != nil {
|
|
||||||
conn.Close()
|
|
||||||
logger.Info("check failed",
|
|
||||||
zap.String("address", address),
|
|
||||||
zap.Error(err))
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
conn.SetReadDeadline(time.Now().Add(timeout))
|
|
||||||
_, resp, err := conn.ReadMessage()
|
|
||||||
if err != nil {
|
|
||||||
conn.Close()
|
|
||||||
logger.Info("check failed",
|
|
||||||
zap.String("address", address),
|
|
||||||
zap.Error(err))
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
rtt := time.Since(start)
|
|
||||||
conn.Close()
|
|
||||||
|
|
||||||
logger.Info("check succeed",
|
|
||||||
zap.String("address", address),
|
|
||||||
zap.Duration("round-trip", rtt),
|
|
||||||
zap.Int("response size", len(resp)))
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Exit(1)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func runCheckgPRC(cmd *cobra.Command, args []string) error {
|
func runCheckgPRC(cmd *cobra.Command, args []string) error {
|
||||||
if retryCount < 0 {
|
if retryCount < 0 {
|
||||||
return fmt.Errorf("--retry is required")
|
return fmt.Errorf("--retry is required")
|
||||||
@@ -354,19 +271,12 @@ func runCheckgPRC(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
address := args[0]
|
address := args[0]
|
||||||
|
|
||||||
var creds grpc.DialOption
|
|
||||||
if grpcTLS {
|
|
||||||
creds = grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))
|
|
||||||
} else {
|
|
||||||
creds = grpc.WithTransportCredentials(insecure.NewCredentials())
|
|
||||||
}
|
|
||||||
|
|
||||||
for n := 0; n <= retryCount; n++ {
|
for n := 0; n <= retryCount; n++ {
|
||||||
if n != 0 {
|
if n != 1 {
|
||||||
time.Sleep(retryDelay)
|
time.Sleep(retryDelay)
|
||||||
}
|
}
|
||||||
|
|
||||||
conn, err := grpc.NewClient(address, creds)
|
conn, err := grpc.Dial(address, grpc.WithInsecure())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Info("check failed",
|
logger.Info("check failed",
|
||||||
zap.String("address", address),
|
zap.String("address", address),
|
||||||
@@ -381,14 +291,13 @@ func runCheckgPRC(cmd *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if stat, ok := status.FromError(err); ok && stat.Code() == codes.Unimplemented {
|
if stat, ok := status.FromError(err); ok && stat.Code() == codes.Unimplemented {
|
||||||
logger.Info("gRPC health protocol not implemented")
|
logger.Info("gPRC health protocol not implemented")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
} else {
|
} else {
|
||||||
logger.Info("check failed",
|
logger.Info("check failed",
|
||||||
zap.String("address", address),
|
zap.String("address", address),
|
||||||
zap.Error(err))
|
zap.Error(err))
|
||||||
}
|
}
|
||||||
conn.Close()
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,6 +305,7 @@ func runCheckgPRC(cmd *cobra.Command, args []string) error {
|
|||||||
logger.Info("check succeed",
|
logger.Info("check succeed",
|
||||||
zap.String("status", resp.GetStatus().String()))
|
zap.String("status", resp.GetStatus().String()))
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
|
|
||||||
"github.com/stefanprodan/podinfo/pkg/api/grpc"
|
"github.com/stefanprodan/podinfo/pkg/api"
|
||||||
"github.com/stefanprodan/podinfo/pkg/api/http"
|
"github.com/stefanprodan/podinfo/pkg/grpc"
|
||||||
"github.com/stefanprodan/podinfo/pkg/signals"
|
"github.com/stefanprodan/podinfo/pkg/signals"
|
||||||
"github.com/stefanprodan/podinfo/pkg/version"
|
"github.com/stefanprodan/podinfo/pkg/version"
|
||||||
go_grpc "google.golang.org/grpc"
|
go_grpc "google.golang.org/grpc"
|
||||||
@@ -138,13 +138,11 @@ func main() {
|
|||||||
var grpcServer *go_grpc.Server
|
var grpcServer *go_grpc.Server
|
||||||
if grpcCfg.Port > 0 {
|
if grpcCfg.Port > 0 {
|
||||||
grpcSrv, _ := grpc.NewServer(&grpcCfg, logger)
|
grpcSrv, _ := grpc.NewServer(&grpcCfg, logger)
|
||||||
//grpcinfoSrv, _ := grpc.NewInfoServer(&grpcCfg)
|
|
||||||
|
|
||||||
grpcServer = grpcSrv.ListenAndServe()
|
grpcServer = grpcSrv.ListenAndServe()
|
||||||
}
|
}
|
||||||
|
|
||||||
// load HTTP server config
|
// load HTTP server config
|
||||||
var srvCfg http.Config
|
var srvCfg api.Config
|
||||||
if err := viper.Unmarshal(&srvCfg); err != nil {
|
if err := viper.Unmarshal(&srvCfg); err != nil {
|
||||||
logger.Panic("config unmarshal failed", zap.Error(err))
|
logger.Panic("config unmarshal failed", zap.Error(err))
|
||||||
}
|
}
|
||||||
@@ -157,7 +155,7 @@ func main() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// start HTTP server
|
// start HTTP server
|
||||||
srv, _ := http.NewServer(&srvCfg, logger)
|
srv, _ := api.NewServer(&srvCfg, logger)
|
||||||
httpServer, httpsServer, healthy, ready := srv.ListenAndServe()
|
httpServer, httpsServer, healthy, ready := srv.ListenAndServe()
|
||||||
|
|
||||||
// graceful shutdown
|
// graceful shutdown
|
||||||
|
|||||||
@@ -12,18 +12,18 @@ spec:
|
|||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/name: backend
|
app: backend
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
prometheus.io/scrape: "true"
|
prometheus.io/scrape: "true"
|
||||||
prometheus.io/port: "9797"
|
prometheus.io/port: "9797"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: backend
|
app: backend
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: backend
|
- name: backend
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
image: ghcr.io/stefanprodan/podinfo:6.5.4
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -42,7 +42,7 @@ spec:
|
|||||||
- --grpc-port=9999
|
- --grpc-port=9999
|
||||||
- --grpc-service-name=backend
|
- --grpc-service-name=backend
|
||||||
- --level=info
|
- --level=info
|
||||||
- --cache-server=tcp://cache:6379
|
- --cache-server=cache:6379
|
||||||
env:
|
env:
|
||||||
- name: PODINFO_UI_COLOR
|
- name: PODINFO_UI_COLOR
|
||||||
value: "#34577c"
|
value: "#34577c"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: backend
|
app: backend
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 9898
|
port: 9898
|
||||||
|
|||||||
6
deploy/bases/cache/deployment.yaml
vendored
6
deploy/bases/cache/deployment.yaml
vendored
@@ -5,15 +5,15 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/name: cache
|
app: cache
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: cache
|
app: cache
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: docker.io/redis:8.6.1
|
image: redis:7.0.7
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- redis-server
|
- redis-server
|
||||||
|
|||||||
2
deploy/bases/cache/service.yaml
vendored
2
deploy/bases/cache/service.yaml
vendored
@@ -5,7 +5,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: cache
|
app: cache
|
||||||
ports:
|
ports:
|
||||||
- name: redis
|
- name: redis
|
||||||
port: 6379
|
port: 6379
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
# Database Setup
|
|
||||||
|
|
||||||
This directory contains the Kubernetes manifests to simulate a database setup
|
|
||||||
with a primary database, read replicas, and scheduled maintenance tasks using CronJobs.
|
|
||||||
|
|
||||||
## Components
|
|
||||||
|
|
||||||
### Core Resources
|
|
||||||
|
|
||||||
| Resource | File | Description |
|
|
||||||
|----------|------|-------------|
|
|
||||||
| ServiceAccount | `serviceaccount.yaml` | Shared service account for all database workloads |
|
|
||||||
| PVC | `pvc-primary.yaml` | 1Gi persistent storage for primary database |
|
|
||||||
| StatefulSet | `statefulset-primary.yaml` | Primary database with persistent storage at `/data` |
|
|
||||||
| Deployment | `deployment-replica.yaml` | Read replica deployment |
|
|
||||||
| Service (Headless) | `service-primary.yaml` | Headless service for StatefulSet |
|
|
||||||
| Service | `service-replica.yaml` | ClusterIP service for replicas |
|
|
||||||
| HPA | `hpa-replica.yaml` | Autoscaler for replicas (2-3 pods, 99% CPU) |
|
|
||||||
|
|
||||||
### CronJobs
|
|
||||||
|
|
||||||
| CronJob | Schedule | Duration | TTL Cleanup | Description |
|
|
||||||
|---------|----------|----------|-------------|-------------|
|
|
||||||
| `rollup-daily` | Every 10 min | ~1 min | 1 hour | Daily rollup simulation (6 iterations) |
|
|
||||||
| `rollup-weekly` | Every 30 min | ~2 min | 1 day | Weekly rollup simulation (12 iterations) |
|
|
||||||
| `backup-daily` | Daily at midnight | ~1 min | 1 day | Backup simulation (configured to fail) |
|
|
||||||
|
|
||||||
### Scripts
|
|
||||||
|
|
||||||
Located in `scripts/` directory:
|
|
||||||
|
|
||||||
- `rollup.sh` - Rollup simulation script with configurable steps via `ROLLUP_STEPS` env var
|
|
||||||
- `backup.sh` - Backup simulation script with configurable exit code via `BACKUP_EXIT` env var
|
|
||||||
|
|
||||||
## Labels
|
|
||||||
|
|
||||||
All resources use Kubernetes recommended labels:
|
|
||||||
|
|
||||||
- `app.kubernetes.io/name` - Component name
|
|
||||||
- `app.kubernetes.io/part-of: database` - Part of database application
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
### Primary Database
|
|
||||||
- **Port**: 3306 (MySQL standard)
|
|
||||||
- **Storage**: 1Gi PersistentVolumeClaim mounted at `/data`
|
|
||||||
- **Service**: Headless (`clusterIP: None`) for StatefulSet
|
|
||||||
|
|
||||||
### Replica Database
|
|
||||||
- **Port**: 3306
|
|
||||||
- **Scaling**: HPA with 2-3 replicas at 99% CPU utilization
|
|
||||||
- **Service**: ClusterIP
|
|
||||||
|
|
||||||
### CronJob Scripts
|
|
||||||
|
|
||||||
The scripts check database-replica health before running:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
podcli check http database-replica:3306/readyz
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Deploy with Kustomize:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
kubectl apply -k deploy/bases/database
|
|
||||||
```
|
|
||||||
|
|
||||||
Or include in an overlay:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# kustomization.yaml
|
|
||||||
resources:
|
|
||||||
- ../../bases/database
|
|
||||||
```
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
apiVersion: batch/v1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: backup-daily
|
|
||||||
spec:
|
|
||||||
# Runs every day at midnight for 1 minute
|
|
||||||
schedule: "0 0 * * *"
|
|
||||||
concurrencyPolicy: Forbid
|
|
||||||
successfulJobsHistoryLimit: 1
|
|
||||||
failedJobsHistoryLimit: 1
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
# Cleanup after 1 day
|
|
||||||
ttlSecondsAfterFinished: 86400
|
|
||||||
backoffLimit: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: backup-daily
|
|
||||||
app.kubernetes.io/part-of: database
|
|
||||||
spec:
|
|
||||||
serviceAccountName: database
|
|
||||||
restartPolicy: Never
|
|
||||||
containers:
|
|
||||||
- name: backup
|
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- /scripts/backup.sh
|
|
||||||
env:
|
|
||||||
- name: BACKUP_EXIT
|
|
||||||
value: "1"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 32Mi
|
|
||||||
requests:
|
|
||||||
cpu: 10m
|
|
||||||
memory: 16Mi
|
|
||||||
volumeMounts:
|
|
||||||
- name: scripts
|
|
||||||
mountPath: /scripts
|
|
||||||
volumes:
|
|
||||||
- name: scripts
|
|
||||||
configMap:
|
|
||||||
name: backup-script
|
|
||||||
defaultMode: 0755
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
apiVersion: batch/v1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: rollup-daily
|
|
||||||
spec:
|
|
||||||
# Runs every 10 minutes for 1 minute
|
|
||||||
schedule: "*/10 * * * *"
|
|
||||||
concurrencyPolicy: Forbid
|
|
||||||
successfulJobsHistoryLimit: 1
|
|
||||||
failedJobsHistoryLimit: 1
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
# Cleanup after 1 hour
|
|
||||||
ttlSecondsAfterFinished: 3600
|
|
||||||
backoffLimit: 3
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: rollup-daily
|
|
||||||
app.kubernetes.io/part-of: database
|
|
||||||
spec:
|
|
||||||
serviceAccountName: database
|
|
||||||
restartPolicy: OnFailure
|
|
||||||
containers:
|
|
||||||
- name: healthcheck
|
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- /scripts/rollup.sh
|
|
||||||
env:
|
|
||||||
- name: ROLLUP_STEPS
|
|
||||||
value: "6"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 32Mi
|
|
||||||
requests:
|
|
||||||
cpu: 10m
|
|
||||||
memory: 16Mi
|
|
||||||
volumeMounts:
|
|
||||||
- name: scripts
|
|
||||||
mountPath: /scripts
|
|
||||||
volumes:
|
|
||||||
- name: scripts
|
|
||||||
configMap:
|
|
||||||
name: rollup-script
|
|
||||||
defaultMode: 0755
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
apiVersion: batch/v1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: rollup-weekly
|
|
||||||
spec:
|
|
||||||
# Runs every 30 minutes for 2 minutes
|
|
||||||
schedule: "*/30 * * * *"
|
|
||||||
concurrencyPolicy: Forbid
|
|
||||||
successfulJobsHistoryLimit: 1
|
|
||||||
failedJobsHistoryLimit: 1
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
# Cleanup after 1 day
|
|
||||||
ttlSecondsAfterFinished: 86400
|
|
||||||
backoffLimit: 3
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: rollup-weekly
|
|
||||||
app.kubernetes.io/part-of: database
|
|
||||||
spec:
|
|
||||||
serviceAccountName: database
|
|
||||||
restartPolicy: OnFailure
|
|
||||||
containers:
|
|
||||||
- name: healthcheck
|
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- /scripts/rollup.sh
|
|
||||||
env:
|
|
||||||
- name: ROLLUP_STEPS
|
|
||||||
value: "12"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 32Mi
|
|
||||||
requests:
|
|
||||||
cpu: 10m
|
|
||||||
memory: 16Mi
|
|
||||||
volumeMounts:
|
|
||||||
- name: scripts
|
|
||||||
mountPath: /scripts
|
|
||||||
volumes:
|
|
||||||
- name: scripts
|
|
||||||
configMap:
|
|
||||||
name: rollup-script
|
|
||||||
defaultMode: 0755
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: database-replica
|
|
||||||
spec:
|
|
||||||
minReadySeconds: 3
|
|
||||||
revisionHistoryLimit: 5
|
|
||||||
progressDeadlineSeconds: 60
|
|
||||||
strategy:
|
|
||||||
rollingUpdate:
|
|
||||||
maxUnavailable: 0
|
|
||||||
type: RollingUpdate
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: database-replica
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
prometheus.io/scrape: "true"
|
|
||||||
prometheus.io/port: "9797"
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: database-replica
|
|
||||||
app.kubernetes.io/part-of: database
|
|
||||||
spec:
|
|
||||||
serviceAccountName: database
|
|
||||||
containers:
|
|
||||||
- name: database
|
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: db
|
|
||||||
containerPort: 3306
|
|
||||||
protocol: TCP
|
|
||||||
- name: http-metrics
|
|
||||||
containerPort: 9797
|
|
||||||
protocol: TCP
|
|
||||||
command:
|
|
||||||
- ./podinfo
|
|
||||||
- --port=3306
|
|
||||||
- --port-metrics=9797
|
|
||||||
- --level=info
|
|
||||||
livenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- podcli
|
|
||||||
- check
|
|
||||||
- http
|
|
||||||
- localhost:3306/healthz
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
timeoutSeconds: 5
|
|
||||||
readinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- podcli
|
|
||||||
- check
|
|
||||||
- http
|
|
||||||
- localhost:3306/readyz
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
timeoutSeconds: 5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 2000m
|
|
||||||
memory: 512Mi
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 32Mi
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
apiVersion: autoscaling/v2
|
|
||||||
kind: HorizontalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: database-replica
|
|
||||||
spec:
|
|
||||||
scaleTargetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: database-replica
|
|
||||||
minReplicas: 2
|
|
||||||
maxReplicas: 3
|
|
||||||
metrics:
|
|
||||||
- type: Resource
|
|
||||||
resource:
|
|
||||||
name: cpu
|
|
||||||
target:
|
|
||||||
type: Utilization
|
|
||||||
averageUtilization: 99
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
resources:
|
|
||||||
- serviceaccount.yaml
|
|
||||||
- pvc-primary.yaml
|
|
||||||
- statefulset-primary.yaml
|
|
||||||
- deployment-replica.yaml
|
|
||||||
- service-primary.yaml
|
|
||||||
- service-replica.yaml
|
|
||||||
- hpa-replica.yaml
|
|
||||||
- cronjob-rollup-daily.yaml
|
|
||||||
- cronjob-rollup-weekly.yaml
|
|
||||||
- cronjob-backup-daily.yaml
|
|
||||||
configMapGenerator:
|
|
||||||
- name: rollup-script
|
|
||||||
files:
|
|
||||||
- scripts/rollup.sh
|
|
||||||
options:
|
|
||||||
disableNameSuffixHash: true
|
|
||||||
- name: backup-script
|
|
||||||
files:
|
|
||||||
- scripts/backup.sh
|
|
||||||
options:
|
|
||||||
disableNameSuffixHash: true
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: database-primary
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 1Gi
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# This is a simulation of a backup process.
|
|
||||||
|
|
||||||
EXIT_CODE=${BACKUP_EXIT:-0}
|
|
||||||
|
|
||||||
echo "Starting backup (estimated run time: 60s)"
|
|
||||||
podcli check http database-replica:3306/readyz
|
|
||||||
sleep 60
|
|
||||||
echo "Backup finished"
|
|
||||||
exit $EXIT_CODE
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# This is a simulation of a rollup process.
|
|
||||||
|
|
||||||
STEPS=${ROLLUP_STEPS:-6}
|
|
||||||
echo "Starting rollup with $STEPS steps (estimated run time: $((STEPS * 10))s)"
|
|
||||||
podcli check http database-replica:3306/readyz
|
|
||||||
i=1
|
|
||||||
while [ $i -le $STEPS ]; do
|
|
||||||
echo "Running rollup iteration $i of $STEPS"
|
|
||||||
sleep 10
|
|
||||||
i=$((i + 1))
|
|
||||||
done
|
|
||||||
echo "Rollup finished"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: database-primary
|
|
||||||
spec:
|
|
||||||
type: ClusterIP
|
|
||||||
clusterIP: None
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/name: database-primary
|
|
||||||
ports:
|
|
||||||
- name: db
|
|
||||||
port: 3306
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: db
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: database-replica
|
|
||||||
spec:
|
|
||||||
type: ClusterIP
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/name: database-replica
|
|
||||||
ports:
|
|
||||||
- name: db
|
|
||||||
port: 3306
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: db
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: database
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: database-primary
|
|
||||||
spec:
|
|
||||||
serviceName: database-primary
|
|
||||||
replicas: 1
|
|
||||||
minReadySeconds: 3
|
|
||||||
revisionHistoryLimit: 5
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: database-primary
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
prometheus.io/scrape: "true"
|
|
||||||
prometheus.io/port: "9797"
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: database-primary
|
|
||||||
app.kubernetes.io/part-of: database
|
|
||||||
spec:
|
|
||||||
serviceAccountName: database
|
|
||||||
containers:
|
|
||||||
- name: database
|
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- name: db
|
|
||||||
containerPort: 3306
|
|
||||||
protocol: TCP
|
|
||||||
- name: http-metrics
|
|
||||||
containerPort: 9797
|
|
||||||
protocol: TCP
|
|
||||||
command:
|
|
||||||
- ./podinfo
|
|
||||||
- --port=3306
|
|
||||||
- --port-metrics=9797
|
|
||||||
- --level=info
|
|
||||||
livenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- podcli
|
|
||||||
- check
|
|
||||||
- http
|
|
||||||
- localhost:3306/healthz
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
timeoutSeconds: 5
|
|
||||||
readinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- podcli
|
|
||||||
- check
|
|
||||||
- http
|
|
||||||
- localhost:3306/readyz
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
timeoutSeconds: 5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 2000m
|
|
||||||
memory: 512Mi
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 32Mi
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /data
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: database-primary
|
|
||||||
@@ -12,18 +12,18 @@ spec:
|
|||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/name: frontend
|
app: frontend
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
prometheus.io/scrape: "true"
|
prometheus.io/scrape: "true"
|
||||||
prometheus.io/port: "9797"
|
prometheus.io/port: "9797"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: frontend
|
app: frontend
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: frontend
|
- name: frontend
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
image: ghcr.io/stefanprodan/podinfo:6.5.4
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -41,7 +41,7 @@ spec:
|
|||||||
- --port-metrics=9797
|
- --port-metrics=9797
|
||||||
- --level=info
|
- --level=info
|
||||||
- --backend-url=http://backend:9898/echo
|
- --backend-url=http://backend:9898/echo
|
||||||
- --cache-server=tcp://cache:6379
|
- --cache-server=cache:6379
|
||||||
env:
|
env:
|
||||||
- name: PODINFO_UI_COLOR
|
- name: PODINFO_UI_COLOR
|
||||||
value: "#34577c"
|
value: "#34577c"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: frontend
|
app: frontend
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: 80
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ resources:
|
|||||||
- ../../bases/backend
|
- ../../bases/backend
|
||||||
- ../../bases/frontend
|
- ../../bases/frontend
|
||||||
- ../../bases/cache
|
- ../../bases/cache
|
||||||
- ../../bases/database
|
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- labels.yaml
|
- labels.yaml
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ kind: LabelTransformer
|
|||||||
metadata:
|
metadata:
|
||||||
name: labels
|
name: labels
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/environment: dev
|
env: dev
|
||||||
app.kubernetes.io/instance: webapp
|
instance: webapp
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- path: metadata/labels
|
- path: metadata/labels
|
||||||
create: true
|
create: true
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ resources:
|
|||||||
- ../../bases/backend
|
- ../../bases/backend
|
||||||
- ../../bases/frontend
|
- ../../bases/frontend
|
||||||
- ../../bases/cache
|
- ../../bases/cache
|
||||||
- ../../bases/database
|
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- labels.yaml
|
- labels.yaml
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ kind: LabelTransformer
|
|||||||
metadata:
|
metadata:
|
||||||
name: labels
|
name: labels
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/environment: production
|
env: production
|
||||||
app.kubernetes.io/instance: webapp
|
instance: webapp
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- path: metadata/labels
|
- path: metadata/labels
|
||||||
create: true
|
create: true
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ resources:
|
|||||||
- ../../bases/backend
|
- ../../bases/backend
|
||||||
- ../../bases/frontend
|
- ../../bases/frontend
|
||||||
- ../../bases/cache
|
- ../../bases/cache
|
||||||
- ../../bases/database
|
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- labels.yaml
|
- labels.yaml
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ kind: LabelTransformer
|
|||||||
metadata:
|
metadata:
|
||||||
name: labels
|
name: labels
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/environment: staging
|
env: staging
|
||||||
app.kubernetes.io/instance: webapp
|
instance: webapp
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- path: metadata/labels
|
- path: metadata/labels
|
||||||
create: true
|
create: true
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
serviceAccountName: webapp
|
serviceAccountName: webapp
|
||||||
containers:
|
containers:
|
||||||
- name: backend
|
- name: backend
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
image: ghcr.io/stefanprodan/podinfo:6.5.4
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
serviceAccountName: webapp
|
serviceAccountName: webapp
|
||||||
containers:
|
containers:
|
||||||
- name: frontend
|
- name: frontend
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
image: ghcr.io/stefanprodan/podinfo:6.5.4
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
129
go.mod
129
go.mod
@@ -1,82 +1,89 @@
|
|||||||
module github.com/stefanprodan/podinfo
|
module github.com/stefanprodan/podinfo
|
||||||
|
|
||||||
go 1.26.0
|
go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/chzyer/readline v1.5.1
|
github.com/chzyer/readline v1.5.1
|
||||||
github.com/fatih/color v1.18.0
|
github.com/fatih/color v1.16.0
|
||||||
github.com/fsnotify/fsnotify v1.9.0
|
github.com/fsnotify/fsnotify v1.7.0
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.2
|
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||||
github.com/gomodule/redigo v1.9.3
|
github.com/gomodule/redigo v1.8.9
|
||||||
github.com/gorilla/mux v1.8.1
|
github.com/gorilla/mux v1.8.1
|
||||||
github.com/gorilla/websocket v1.5.3
|
github.com/gorilla/websocket v1.5.1
|
||||||
github.com/prometheus/client_golang v1.23.2
|
github.com/prometheus/client_golang v1.17.0
|
||||||
github.com/spf13/cobra v1.10.2
|
github.com/spf13/cobra v1.8.0
|
||||||
github.com/spf13/pflag v1.0.10
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/spf13/viper v1.21.0
|
github.com/spf13/viper v1.18.1
|
||||||
github.com/swaggo/http-swagger v1.3.4
|
github.com/swaggo/http-swagger v1.3.4
|
||||||
github.com/swaggo/swag v1.16.6
|
github.com/swaggo/swag v1.16.2
|
||||||
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.65.0
|
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.46.1
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.65.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.1
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
|
||||||
go.opentelemetry.io/contrib/propagators/aws v1.40.0
|
go.opentelemetry.io/contrib/propagators/aws v1.21.1
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.40.0
|
go.opentelemetry.io/contrib/propagators/b3 v1.21.1
|
||||||
go.opentelemetry.io/contrib/propagators/jaeger v1.40.0
|
go.opentelemetry.io/contrib/propagators/jaeger v1.21.1
|
||||||
go.opentelemetry.io/contrib/propagators/ot v1.40.0
|
go.opentelemetry.io/contrib/propagators/ot v1.21.1
|
||||||
go.opentelemetry.io/otel v1.40.0
|
go.opentelemetry.io/otel v1.21.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
|
||||||
go.opentelemetry.io/otel/sdk v1.40.0
|
go.opentelemetry.io/otel/sdk v1.21.0
|
||||||
go.opentelemetry.io/otel/trace v1.40.0
|
go.opentelemetry.io/otel/trace v1.21.0
|
||||||
go.uber.org/zap v1.27.1
|
go.uber.org/zap v1.26.0
|
||||||
golang.org/x/net v0.51.0
|
golang.org/x/net v0.19.0
|
||||||
google.golang.org/grpc v1.79.1
|
google.golang.org/grpc v1.60.0
|
||||||
google.golang.org/protobuf v1.36.11
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Fix CVE-2022-32149
|
||||||
|
replace golang.org/x/text => golang.org/x/text v0.14.0
|
||||||
|
|
||||||
|
// Fix CVE-2022-28948
|
||||||
|
replace gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/go-logr/logr v1.4.3 // indirect
|
github.com/go-logr/logr v1.3.0 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.21.1 // indirect
|
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
github.com/go-openapi/jsonreference v0.20.0 // indirect
|
||||||
github.com/go-openapi/spec v0.21.0 // indirect
|
github.com/go-openapi/spec v0.20.6 // indirect
|
||||||
github.com/go-openapi/swag v0.23.1 // indirect
|
github.com/go-openapi/swag v0.19.15 // indirect
|
||||||
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.9.0 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
github.com/mailru/easyjson v0.7.6 // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/prometheus/client_model v0.6.2 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
github.com/prometheus/common v0.66.1 // indirect
|
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
|
||||||
github.com/prometheus/procfs v0.16.1 // indirect
|
github.com/prometheus/common v0.44.0 // indirect
|
||||||
github.com/sagikazarmark/locafero v0.11.0 // indirect
|
github.com/prometheus/procfs v0.11.1 // indirect
|
||||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||||
github.com/spf13/afero v1.15.0 // indirect
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/spf13/cast v1.10.0 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
|
github.com/spf13/afero v1.11.0 // indirect
|
||||||
|
github.com/spf13/cast v1.6.0 // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/swaggo/files v1.0.1 // indirect
|
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe // indirect
|
||||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
go.opentelemetry.io/otel/metric v1.21.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.40.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
|
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
golang.org/x/mod v0.33.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
golang.org/x/sync v0.19.0 // indirect
|
golang.org/x/tools v0.13.0 // indirect
|
||||||
golang.org/x/sys v0.41.0 // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
|
||||||
golang.org/x/text v0.34.0 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
|
||||||
golang.org/x/tools v0.42.0 // indirect
|
google.golang.org/protobuf v1.31.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
323
go.sum
323
go.sum
@@ -2,215 +2,242 @@ github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc
|
|||||||
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
|
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
|
||||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM=
|
github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM=
|
||||||
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
|
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
|
||||||
github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI=
|
github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI=
|
||||||
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
|
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
|
||||||
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
|
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
|
||||||
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
|
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
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/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||||
|
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||||
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||||
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
|
||||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||||
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
|
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||||
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
|
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
|
||||||
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
|
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||||
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
|
github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
|
||||||
github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
|
github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
|
||||||
github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
|
github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jIQ=
|
||||||
github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
|
github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
|
||||||
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
|
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||||
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
|
github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=
|
||||||
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
|
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
|
||||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
|
||||||
github.com/gomodule/redigo v1.9.3 h1:dNPSXeXv6HCq2jdyWfjgmhBdqnR6PRO3m/G05nvpPC8=
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/gomodule/redigo v1.9.3/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/gomodule/redigo v1.8.9 h1:Sl3u+2BI/kk+VEatbj0scLdrFhjPmbxOc1myhDP41ws=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/gomodule/redigo v1.8.9/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE=
|
||||||
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 h1:X+2YciYSxvMQK0UZ7sg45ZVabVZBeBuvMkmuI2V3Fak=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7/go.mod h1:lW34nIZuQ8UDPdkon5fmfp2l3+ZkQ2me/+oecHYLOII=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
|
||||||
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||||
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
|
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
|
||||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
|
||||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
|
||||||
github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
|
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
|
||||||
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
|
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
|
||||||
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
|
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
|
||||||
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
|
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
|
||||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
|
||||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
|
||||||
|
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||||
|
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=
|
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
|
||||||
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
|
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
|
||||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
|
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
||||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=
|
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||||
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
|
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||||
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
|
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||||
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
|
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||||
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
|
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
||||||
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
|
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
||||||
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
|
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||||
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||||
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
|
github.com/spf13/viper v1.18.1 h1:rmuU42rScKWlhhJDyXZRKJQHXFX02chSVW1IvkPGiVM=
|
||||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
github.com/spf13/viper v1.18.1/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
|
||||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||||
github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE=
|
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc=
|
||||||
github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg=
|
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
|
||||||
github.com/swaggo/http-swagger v1.3.4 h1:q7t/XLx0n15H1Q9/tk3Y9L4n210XzJF5WtnDX64a5ww=
|
github.com/swaggo/http-swagger v1.3.4 h1:q7t/XLx0n15H1Q9/tk3Y9L4n210XzJF5WtnDX64a5ww=
|
||||||
github.com/swaggo/http-swagger v1.3.4/go.mod h1:9dAh0unqMBAlbp1uE2Uc2mQTxNMU/ha4UbucIg1MFkQ=
|
github.com/swaggo/http-swagger v1.3.4/go.mod h1:9dAh0unqMBAlbp1uE2Uc2mQTxNMU/ha4UbucIg1MFkQ=
|
||||||
github.com/swaggo/swag v1.16.6 h1:qBNcx53ZaX+M5dxVyTrgQ0PJ/ACK+NzhwcbieTt+9yI=
|
github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04=
|
||||||
github.com/swaggo/swag v1.16.6/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg=
|
github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E=
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.46.1 h1:Ifzy1lucGMQJh6wPRxusde8bWaDhYjSNOqDyn6Hb4TM=
|
||||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.46.1/go.mod h1:YfFNem80G9UZ/mL5zd5GGXZSy95eXK+RhzIWBkLjLSc=
|
||||||
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.65.0 h1:LIMn2KWRS0jRDDHYyIEYgKWsMwufA9GXusJiwik0u64=
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.1 h1:gbhw/u49SS3gkPWiYweQNJGm/uJN5GkI/FrosxSHT7A=
|
||||||
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.65.0/go.mod h1:JwJa4o3Wq+4Yz2BjlYFGWyx2h0Fw1lnoj5kpsaTI97o=
|
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.1/go.mod h1:GnOaBaFQ2we3b9AGWJpsBa7v1S5RlQzlC3O7dRMxZhM=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.65.0 h1:ab5U7DpTjjN8pNgwqlA/s0Csb+N2Raqo9eTSDhfg4Z8=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.65.0/go.mod h1:nwFJC46Dxhqz5R9k7IV8To/Z46JPvW+GNKhTxQQlUzg=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8=
|
go.opentelemetry.io/contrib/propagators/aws v1.21.1 h1:uQIQIDWb0gzyvon2ICnghpLAf9w7ADOCUiIiwCQgR2o=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0=
|
go.opentelemetry.io/contrib/propagators/aws v1.21.1/go.mod h1:kCcto3ACQxm+VrkQX/NK/TkDmAd99MQhvffzyTKhzL4=
|
||||||
go.opentelemetry.io/contrib/propagators/aws v1.40.0 h1:4VIrh75jW4RTimUNx1DSk+6H9/nDr1FvmKoOVDh3K04=
|
go.opentelemetry.io/contrib/propagators/b3 v1.21.1 h1:WPYiUgmw3+b7b3sQ1bFBFAf0q+Di9dvNc3AtYfnT4RQ=
|
||||||
go.opentelemetry.io/contrib/propagators/aws v1.40.0/go.mod h1:B0dCov9KNQGlut3T8wZZjDnLXEXdBroM7bFsHh/gRos=
|
go.opentelemetry.io/contrib/propagators/b3 v1.21.1/go.mod h1:EmzokPoSqsYMBVK4nRnhsfm5mbn8J1eDuz/U1UaQaWg=
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.40.0 h1:xariChe8OOVF3rNlfzGFgQc61npQmXhzZj/i82mxMfg=
|
go.opentelemetry.io/contrib/propagators/jaeger v1.21.1 h1:f4beMGDKiVzg9IcX7/VuWVy+oGdjx3dNJ72YehmtY5k=
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.40.0/go.mod h1:72WvbdxbOfXaELEQfonFfOL6osvcVjI7uJEE8C2nkrs=
|
go.opentelemetry.io/contrib/propagators/jaeger v1.21.1/go.mod h1:U9jhkEl8d1LL+QXY7q3kneJWJugiN3kZJV2OWz3hkBY=
|
||||||
go.opentelemetry.io/contrib/propagators/jaeger v1.40.0 h1:aXl9uobjJs5vquMLt9ZkI/3zIuz8XQ3TqOKSWx0/xdU=
|
go.opentelemetry.io/contrib/propagators/ot v1.21.1 h1:3TN5vkXjKYWp0YdMcnUEC/A+pBPvqz9V3nCS2xmcurk=
|
||||||
go.opentelemetry.io/contrib/propagators/jaeger v1.40.0/go.mod h1:ioMePqe6k6c/ovXSkmkMr1mbN5qRBGJxNTVop7/2XO0=
|
go.opentelemetry.io/contrib/propagators/ot v1.21.1/go.mod h1:oy0MYCbS/b3cqUDW37wBWtlwBIsutngS++Lklpgh+fc=
|
||||||
go.opentelemetry.io/contrib/propagators/ot v1.40.0 h1:Lon8J5SPmWaL1Ko2TIlCNHJ42/J1b5XbJlgJaE/9m7I=
|
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
|
||||||
go.opentelemetry.io/contrib/propagators/ot v1.40.0/go.mod h1:dKWtJTlp1Yj+8Cneye5idO46eRPIbi23qVuJYKjNnvY=
|
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
|
||||||
go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
|
||||||
go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 h1:QKdN8ly8zEMrByybbQgv8cWBcdAarwmIPZ6FThrWXJs=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0/go.mod h1:bTdK1nhqF76qiPoCCdyFIV+N/sRHYXYCTQc+3VCi3MI=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 h1:DvJDOPmSWQHWywQS6lKL+pb8s3gBLOZUtw4N+mavW1I=
|
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0/go.mod h1:EtekO9DEJb4/jRyN4v4Qjc2yA7AtfCBuz2FynRUWTXs=
|
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.40.0 h1:MzfofMZN8ulNqobCmCAVbqVL5syHw+eB2qPRkCMA/fQ=
|
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.40.0/go.mod h1:E73G9UFtKRXrxhBsHtG00TB5WxX57lpsQzogDkqBTz8=
|
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
|
||||||
go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g=
|
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
|
||||||
go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc=
|
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
|
||||||
go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8=
|
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
|
||||||
go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE=
|
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw=
|
|
||||||
go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg=
|
|
||||||
go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw=
|
|
||||||
go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA=
|
|
||||||
go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A=
|
|
||||||
go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4=
|
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||||
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
|
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
|
||||||
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
|
||||||
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
|
|
||||||
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
|
|
||||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
|
||||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
||||||
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
|
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
|
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
|
||||||
|
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
|
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
|
||||||
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
|
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
|
||||||
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/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.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||||
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|
||||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
|
||||||
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
|
|
||||||
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
|
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||||
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
|
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
|
||||||
|
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M=
|
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I=
|
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ=
|
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I=
|
||||||
google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
|
||||||
google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
|
google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k=
|
||||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
|
||||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
|
||||||
|
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
|
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||||
|
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: podinfod
|
- name: podinfod
|
||||||
image: ghcr.io/stefanprodan/podinfo:6.11.1
|
image: ghcr.io/stefanprodan/podinfo:6.5.4
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -72,9 +72,3 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 64Mi
|
memory: 64Mi
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /data
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
emptyDir: {}
|
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ resources:
|
|||||||
- hpa.yaml
|
- hpa.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param seconds path int true "seconds to wait for"
|
// @Param seconds path int true "seconds to wait for"
|
||||||
// @Router /chunked/{seconds} [get]
|
// @Router /chunked/{seconds} [get]
|
||||||
// @Success 200 {object} http.MapResponse
|
// @Success 200 {object} api.MapResponse
|
||||||
func (s *Server) chunkedHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) chunkedHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
_, span := s.tracer.Start(r.Context(), "chunkedHandler")
|
_, span := s.tracer.Start(r.Context(), "chunkedHandler")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import "net/http"
|
import "net/http"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
@@ -51,7 +51,7 @@ func (m *RandomDelayMiddleware) Handler(next http.Handler) http.Handler {
|
|||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param seconds path int true "seconds to wait for"
|
// @Param seconds path int true "seconds to wait for"
|
||||||
// @Router /delay/{seconds} [get]
|
// @Router /delay/{seconds} [get]
|
||||||
// @Success 200 {object} http.MapResponse
|
// @Success 200 {object} api.MapResponse
|
||||||
func (s *Server) delayHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) delayHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
_, span := s.tracer.Start(r.Context(), "delayHandler")
|
_, span := s.tracer.Start(r.Context(), "delayHandler")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -19,6 +19,7 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"version": "{{.Version}}"
|
"version": "{{.Version}}"
|
||||||
},
|
},
|
||||||
|
"host": "{{.Host}}",
|
||||||
"basePath": "{{.BasePath}}",
|
"basePath": "{{.BasePath}}",
|
||||||
"paths": {
|
"paths": {
|
||||||
"/": {
|
"/": {
|
||||||
@@ -58,7 +59,7 @@ const docTemplate = `{
|
|||||||
"202": {
|
"202": {
|
||||||
"description": "Accepted",
|
"description": "Accepted",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,7 +82,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.RuntimeResponse"
|
"$ref": "#/definitions/api.RuntimeResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,7 +200,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,7 +232,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -437,7 +438,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -460,7 +461,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -515,7 +516,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.TokenResponse"
|
"$ref": "#/definitions/api.TokenResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -538,7 +539,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.TokenValidationResponse"
|
"$ref": "#/definitions/api.TokenValidationResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"401": {
|
"401": {
|
||||||
@@ -564,7 +565,7 @@ const docTemplate = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -587,7 +588,7 @@ const docTemplate = `{
|
|||||||
"202": {
|
"202": {
|
||||||
"description": "Accepted",
|
"description": "Accepted",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -595,13 +596,13 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"http.MapResponse": {
|
"api.MapResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http.RuntimeResponse": {
|
"api.RuntimeResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"color": {
|
"color": {
|
||||||
@@ -639,7 +640,7 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http.TokenResponse": {
|
"api.TokenResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"expires_at": {
|
"expires_at": {
|
||||||
@@ -650,7 +651,7 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http.TokenValidationResponse": {
|
"api.TokenValidationResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"expires_at": {
|
"expires_at": {
|
||||||
@@ -667,7 +668,7 @@ const docTemplate = `{
|
|||||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||||
var SwaggerInfo = &swag.Spec{
|
var SwaggerInfo = &swag.Spec{
|
||||||
Version: "2.0",
|
Version: "2.0",
|
||||||
Host: "",
|
Host: "localhost:9898",
|
||||||
BasePath: "/",
|
BasePath: "/",
|
||||||
Schemes: []string{"http", "https"},
|
Schemes: []string{"http", "https"},
|
||||||
Title: "Podinfo API",
|
Title: "Podinfo API",
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
},
|
},
|
||||||
"version": "2.0"
|
"version": "2.0"
|
||||||
},
|
},
|
||||||
|
"host": "localhost:9898",
|
||||||
"basePath": "/",
|
"basePath": "/",
|
||||||
"paths": {
|
"paths": {
|
||||||
"/": {
|
"/": {
|
||||||
@@ -56,7 +57,7 @@
|
|||||||
"202": {
|
"202": {
|
||||||
"description": "Accepted",
|
"description": "Accepted",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +80,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.RuntimeResponse"
|
"$ref": "#/definitions/api.RuntimeResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,7 +198,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,7 +230,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,7 +436,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -458,7 +459,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -513,7 +514,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.TokenResponse"
|
"$ref": "#/definitions/api.TokenResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -536,7 +537,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.TokenValidationResponse"
|
"$ref": "#/definitions/api.TokenValidationResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"401": {
|
"401": {
|
||||||
@@ -562,7 +563,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -585,7 +586,7 @@
|
|||||||
"202": {
|
"202": {
|
||||||
"description": "Accepted",
|
"description": "Accepted",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/http.MapResponse"
|
"$ref": "#/definitions/api.MapResponse"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -593,13 +594,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"http.MapResponse": {
|
"api.MapResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http.RuntimeResponse": {
|
"api.RuntimeResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"color": {
|
"color": {
|
||||||
@@ -637,7 +638,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http.TokenResponse": {
|
"api.TokenResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"expires_at": {
|
"expires_at": {
|
||||||
@@ -648,7 +649,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"http.TokenValidationResponse": {
|
"api.TokenValidationResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"expires_at": {
|
"expires_at": {
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
basePath: /
|
basePath: /
|
||||||
definitions:
|
definitions:
|
||||||
http.MapResponse:
|
api.MapResponse:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
http.RuntimeResponse:
|
api.RuntimeResponse:
|
||||||
properties:
|
properties:
|
||||||
color:
|
color:
|
||||||
type: string
|
type: string
|
||||||
@@ -29,20 +29,21 @@ definitions:
|
|||||||
version:
|
version:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
http.TokenResponse:
|
api.TokenResponse:
|
||||||
properties:
|
properties:
|
||||||
expires_at:
|
expires_at:
|
||||||
type: string
|
type: string
|
||||||
token:
|
token:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
http.TokenValidationResponse:
|
api.TokenValidationResponse:
|
||||||
properties:
|
properties:
|
||||||
expires_at:
|
expires_at:
|
||||||
type: string
|
type: string
|
||||||
token_name:
|
token_name:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
host: localhost:9898
|
||||||
info:
|
info:
|
||||||
contact:
|
contact:
|
||||||
name: Source Code
|
name: Source Code
|
||||||
@@ -78,7 +79,7 @@ paths:
|
|||||||
"202":
|
"202":
|
||||||
description: Accepted
|
description: Accepted
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Echo
|
summary: Echo
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -93,7 +94,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.RuntimeResponse'
|
$ref: '#/definitions/api.RuntimeResponse'
|
||||||
summary: Runtime information
|
summary: Runtime information
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -172,7 +173,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Chunked transfer encoding
|
summary: Chunked transfer encoding
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -193,7 +194,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Delay
|
summary: Delay
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -329,7 +330,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Status code
|
summary: Status code
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -345,7 +346,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Upload file
|
summary: Upload file
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -381,7 +382,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.TokenResponse'
|
$ref: '#/definitions/api.TokenResponse'
|
||||||
summary: Generate JWT token
|
summary: Generate JWT token
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -396,7 +397,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.TokenValidationResponse'
|
$ref: '#/definitions/api.TokenValidationResponse'
|
||||||
"401":
|
"401":
|
||||||
description: Unauthorized
|
description: Unauthorized
|
||||||
schema:
|
schema:
|
||||||
@@ -413,7 +414,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Version
|
summary: Version
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -428,7 +429,7 @@ paths:
|
|||||||
"202":
|
"202":
|
||||||
description: Accepted
|
description: Accepted
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/http.MapResponse'
|
$ref: '#/definitions/api.MapResponse'
|
||||||
summary: Echo over websockets
|
summary: Echo over websockets
|
||||||
tags:
|
tags:
|
||||||
- HTTP API
|
- HTTP API
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Router /api/echo [post]
|
// @Router /api/echo [post]
|
||||||
// @Success 202 {object} http.MapResponse
|
// @Success 202 {object} api.MapResponse
|
||||||
func (s *Server) echoHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) echoHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx, span := s.tracer.Start(r.Context(), "echoHandler")
|
ctx, span := s.tracer.Start(r.Context(), "echoHandler")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
@@ -19,7 +18,7 @@ var wsCon = websocket.Upgrader{}
|
|||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Router /ws/echo [post]
|
// @Router /ws/echo [post]
|
||||||
// @Success 202 {object} http.MapResponse
|
// @Success 202 {object} api.MapResponse
|
||||||
// Test: go run ./cmd/podcli/* ws localhost:9898/ws/echo
|
// Test: go run ./cmd/podcli/* ws localhost:9898/ws/echo
|
||||||
func (s *Server) echoWsHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) echoWsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
c, err := wsCon.Upgrade(w, r, nil)
|
c, err := wsCon.Upgrade(w, r, nil)
|
||||||
@@ -29,19 +28,13 @@ func (s *Server) echoWsHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var wg sync.WaitGroup
|
|
||||||
wg.Add(1)
|
|
||||||
|
|
||||||
defer c.Close()
|
defer c.Close()
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
defer close(done)
|
defer close(done)
|
||||||
in := make(chan interface{})
|
in := make(chan interface{})
|
||||||
|
defer close(in)
|
||||||
go s.writeWs(c, in)
|
go s.writeWs(c, in)
|
||||||
go s.sendHostWs(c, in, done, &wg)
|
go s.sendHostWs(c, in, done)
|
||||||
go func() {
|
|
||||||
defer close(in)
|
|
||||||
wg.Wait()
|
|
||||||
}()
|
|
||||||
for {
|
for {
|
||||||
_, message, err := c.ReadMessage()
|
_, message, err := c.ReadMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -61,7 +54,7 @@ func (s *Server) echoWsHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) sendHostWs(ws *websocket.Conn, in chan interface{}, done chan struct{}, wg *sync.WaitGroup) {
|
func (s *Server) sendHostWs(ws *websocket.Conn, in chan interface{}, done chan struct{}) {
|
||||||
ticker := time.NewTicker(5 * time.Second)
|
ticker := time.NewTicker(5 * time.Second)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
for {
|
for {
|
||||||
@@ -77,7 +70,6 @@ func (s *Server) sendHostWs(ws *websocket.Conn, in chan interface{}, done chan s
|
|||||||
in <- status
|
in <- status
|
||||||
case <-done:
|
case <-done:
|
||||||
s.logger.Debug("websocket exit")
|
s.logger.Debug("websocket exit")
|
||||||
wg.Done()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Router /env [get]
|
// @Router /env [get]
|
||||||
// @Success 200 {object} http.ArrayResponse
|
// @Success 200 {object} api.ArrayResponse
|
||||||
func (s *Server) envHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) envHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
_, span := s.tracer.Start(r.Context(), "envHandler")
|
_, span := s.tracer.Start(r.Context(), "envHandler")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package http
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package grpc
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
pb "github.com/stefanprodan/podinfo/pkg/api/grpc/delay"
|
|
||||||
"go.uber.org/zap"
|
|
||||||
)
|
|
||||||
|
|
||||||
type DelayServer struct {
|
|
||||||
pb.UnimplementedDelayServiceServer
|
|
||||||
config *Config
|
|
||||||
logger *zap.Logger
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *DelayServer) Delay(ctx context.Context, delayInput *pb.DelayRequest) (*pb.DelayResponse, error) {
|
|
||||||
|
|
||||||
time.Sleep(time.Duration(delayInput.Seconds) * time.Second)
|
|
||||||
return &pb.DelayResponse{Message: delayInput.Seconds}, nil
|
|
||||||
}
|
|
||||||
@@ -1,211 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.28.1
|
|
||||||
// protoc v4.25.0
|
|
||||||
// source: delay/delay.proto
|
|
||||||
|
|
||||||
package delay
|
|
||||||
|
|
||||||
import (
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
type DelayRequest struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DelayRequest) Reset() {
|
|
||||||
*x = DelayRequest{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_delay_delay_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DelayRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*DelayRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *DelayRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_delay_delay_proto_msgTypes[0]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use DelayRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*DelayRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_delay_delay_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DelayRequest) GetSeconds() int64 {
|
|
||||||
if x != nil {
|
|
||||||
return x.Seconds
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
type DelayResponse struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Message int64 `protobuf:"varint,1,opt,name=message,proto3" json:"message,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DelayResponse) Reset() {
|
|
||||||
*x = DelayResponse{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_delay_delay_proto_msgTypes[1]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DelayResponse) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*DelayResponse) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *DelayResponse) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_delay_delay_proto_msgTypes[1]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use DelayResponse.ProtoReflect.Descriptor instead.
|
|
||||||
func (*DelayResponse) Descriptor() ([]byte, []int) {
|
|
||||||
return file_delay_delay_proto_rawDescGZIP(), []int{1}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DelayResponse) GetMessage() int64 {
|
|
||||||
if x != nil {
|
|
||||||
return x.Message
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_delay_delay_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_delay_delay_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x11, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x2f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x12, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x22, 0x28, 0x0a, 0x0c, 0x44, 0x65,
|
|
||||||
0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65,
|
|
||||||
0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x65, 0x63,
|
|
||||||
0x6f, 0x6e, 0x64, 0x73, 0x22, 0x29, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73,
|
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32,
|
|
||||||
0x44, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
|
||||||
0x34, 0x0a, 0x05, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x13, 0x2e, 0x64, 0x65, 0x6c, 0x61, 0x79,
|
|
||||||
0x2e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
|
||||||
0x64, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x2f, 0x64, 0x65, 0x6c, 0x61, 0x79,
|
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_delay_delay_proto_rawDescOnce sync.Once
|
|
||||||
file_delay_delay_proto_rawDescData = file_delay_delay_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_delay_delay_proto_rawDescGZIP() []byte {
|
|
||||||
file_delay_delay_proto_rawDescOnce.Do(func() {
|
|
||||||
file_delay_delay_proto_rawDescData = protoimpl.X.CompressGZIP(file_delay_delay_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_delay_delay_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_delay_delay_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|
||||||
var file_delay_delay_proto_goTypes = []interface{}{
|
|
||||||
(*DelayRequest)(nil), // 0: delay.DelayRequest
|
|
||||||
(*DelayResponse)(nil), // 1: delay.DelayResponse
|
|
||||||
}
|
|
||||||
var file_delay_delay_proto_depIdxs = []int32{
|
|
||||||
0, // 0: delay.DelayService.Delay:input_type -> delay.DelayRequest
|
|
||||||
1, // 1: delay.DelayService.Delay:output_type -> delay.DelayResponse
|
|
||||||
1, // [1:2] is the sub-list for method output_type
|
|
||||||
0, // [0:1] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_delay_delay_proto_init() }
|
|
||||||
func file_delay_delay_proto_init() {
|
|
||||||
if File_delay_delay_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_delay_delay_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*DelayRequest); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_delay_delay_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*DelayResponse); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_delay_delay_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 2,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 1,
|
|
||||||
},
|
|
||||||
GoTypes: file_delay_delay_proto_goTypes,
|
|
||||||
DependencyIndexes: file_delay_delay_proto_depIdxs,
|
|
||||||
MessageInfos: file_delay_delay_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_delay_delay_proto = out.File
|
|
||||||
file_delay_delay_proto_rawDesc = nil
|
|
||||||
file_delay_delay_proto_goTypes = nil
|
|
||||||
file_delay_delay_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "./delay";
|
|
||||||
|
|
||||||
package delay;
|
|
||||||
|
|
||||||
message DelayRequest {
|
|
||||||
int64 seconds = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DelayResponse {
|
|
||||||
int64 message = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
service DelayService {
|
|
||||||
rpc Delay (DelayRequest) returns (DelayResponse) {}
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.2.0
|
|
||||||
// - protoc v4.25.0
|
|
||||||
// source: delay/delay.proto
|
|
||||||
|
|
||||||
package delay
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
|
||||||
|
|
||||||
// DelayServiceClient is the client API for DelayService service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type DelayServiceClient interface {
|
|
||||||
Delay(ctx context.Context, in *DelayRequest, opts ...grpc.CallOption) (*DelayResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type delayServiceClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDelayServiceClient(cc grpc.ClientConnInterface) DelayServiceClient {
|
|
||||||
return &delayServiceClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *delayServiceClient) Delay(ctx context.Context, in *DelayRequest, opts ...grpc.CallOption) (*DelayResponse, error) {
|
|
||||||
out := new(DelayResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/delay.DelayService/Delay", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DelayServiceServer is the server API for DelayService service.
|
|
||||||
// All implementations must embed UnimplementedDelayServiceServer
|
|
||||||
// for forward compatibility
|
|
||||||
type DelayServiceServer interface {
|
|
||||||
Delay(context.Context, *DelayRequest) (*DelayResponse, error)
|
|
||||||
mustEmbedUnimplementedDelayServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedDelayServiceServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedDelayServiceServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedDelayServiceServer) Delay(context.Context, *DelayRequest) (*DelayResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Delay not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedDelayServiceServer) mustEmbedUnimplementedDelayServiceServer() {}
|
|
||||||
|
|
||||||
// UnsafeDelayServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to DelayServiceServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeDelayServiceServer interface {
|
|
||||||
mustEmbedUnimplementedDelayServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterDelayServiceServer(s grpc.ServiceRegistrar, srv DelayServiceServer) {
|
|
||||||
s.RegisterService(&DelayService_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _DelayService_Delay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(DelayRequest)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(DelayServiceServer).Delay(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/delay.DelayService/Delay",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(DelayServiceServer).Delay(ctx, req.(*DelayRequest))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// DelayService_ServiceDesc is the grpc.ServiceDesc for DelayService service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var DelayService_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "delay.DelayService",
|
|
||||||
HandlerType: (*DelayServiceServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Delay",
|
|
||||||
Handler: _DelayService_Delay_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "delay/delay.proto",
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
package grpc
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"net"
|
|
||||||
"regexp"
|
|
||||||
"strconv"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stefanprodan/podinfo/pkg/api/grpc/delay"
|
|
||||||
"google.golang.org/grpc"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
"google.golang.org/grpc/test/bufconn"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGrpcDelay(t *testing.T) {
|
|
||||||
|
|
||||||
// Server initialization
|
|
||||||
// bufconn => uses in-memory connection instead of system network I/O
|
|
||||||
lis := bufconn.Listen(1024 * 1024)
|
|
||||||
t.Cleanup(func() {
|
|
||||||
lis.Close()
|
|
||||||
})
|
|
||||||
|
|
||||||
srv := grpc.NewServer()
|
|
||||||
t.Cleanup(func() {
|
|
||||||
srv.Stop()
|
|
||||||
})
|
|
||||||
|
|
||||||
delay.RegisterDelayServiceServer(srv, &DelayServer{})
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
if err := srv.Serve(lis); err != nil {
|
|
||||||
log.Fatalf("srv.Serve %v", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
// - Test
|
|
||||||
dialer := func(context.Context, string) (net.Conn, error) {
|
|
||||||
return lis.Dial()
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
|
|
||||||
conn, err := grpc.DialContext(ctx, "", grpc.WithContextDialer(dialer), grpc.WithInsecure())
|
|
||||||
t.Cleanup(func() {
|
|
||||||
conn.Close()
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("grpc.DialContext %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
client := delay.NewDelayServiceClient(conn)
|
|
||||||
res, err := client.Delay(context.Background(), &delay.DelayRequest{Seconds: 3})
|
|
||||||
|
|
||||||
// Check the status code is what we expect.
|
|
||||||
if _, ok := status.FromError(err); !ok {
|
|
||||||
t.Errorf("Delay returned type %T, want %T", err, status.Error)
|
|
||||||
}
|
|
||||||
|
|
||||||
if res != nil {
|
|
||||||
fmt.Printf("res %v\n", res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the response body is what we expect. Here we expect the response to be "3" as the delay is set to 3 seconds.
|
|
||||||
expected := "3"
|
|
||||||
r := regexp.MustCompile(expected)
|
|
||||||
if !r.MatchString(strconv.FormatInt(res.Message, 10)) {
|
|
||||||
t.Fatalf("Returned unexpected body:\ngot \n%v \nwant \n%s",
|
|
||||||
res.Message, expected)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package grpc
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/stefanprodan/podinfo/pkg/api/grpc/echo"
|
|
||||||
"go.uber.org/zap"
|
|
||||||
)
|
|
||||||
|
|
||||||
type echoServer struct {
|
|
||||||
echo.UnimplementedEchoServiceServer
|
|
||||||
config *Config
|
|
||||||
logger *zap.Logger
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *echoServer) Echo(ctx context.Context, message *echo.Message) (*echo.Message, error) {
|
|
||||||
|
|
||||||
s.logger.Info("Received message body from client:", zap.String("input body", message.Body))
|
|
||||||
return &echo.Message{Body: message.Body}, nil
|
|
||||||
}
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.26.0
|
|
||||||
// protoc v4.24.3
|
|
||||||
// source: echo/echo.proto
|
|
||||||
|
|
||||||
package echo
|
|
||||||
|
|
||||||
import (
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
type Message struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Message) Reset() {
|
|
||||||
*x = Message{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_echo_echo_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Message) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*Message) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *Message) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_echo_echo_proto_msgTypes[0]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use Message.ProtoReflect.Descriptor instead.
|
|
||||||
func (*Message) Descriptor() ([]byte, []int) {
|
|
||||||
return file_echo_echo_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Message) GetBody() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Body
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_echo_echo_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_echo_echo_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x0f, 0x65, 0x63, 0x68, 0x6f, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
|
||||||
0x6f, 0x12, 0x04, 0x65, 0x63, 0x68, 0x6f, 0x22, 0x1d, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
|
||||||
0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
|
||||||
0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x32, 0x35, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65,
|
|
||||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x0d, 0x2e,
|
|
||||||
0x65, 0x63, 0x68, 0x6f, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x2e, 0x65,
|
|
||||||
0x63, 0x68, 0x6f, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x42, 0x08, 0x5a,
|
|
||||||
0x06, 0x2e, 0x2f, 0x65, 0x63, 0x68, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_echo_echo_proto_rawDescOnce sync.Once
|
|
||||||
file_echo_echo_proto_rawDescData = file_echo_echo_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_echo_echo_proto_rawDescGZIP() []byte {
|
|
||||||
file_echo_echo_proto_rawDescOnce.Do(func() {
|
|
||||||
file_echo_echo_proto_rawDescData = protoimpl.X.CompressGZIP(file_echo_echo_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_echo_echo_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_echo_echo_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
|
||||||
var file_echo_echo_proto_goTypes = []interface{}{
|
|
||||||
(*Message)(nil), // 0: echo.Message
|
|
||||||
}
|
|
||||||
var file_echo_echo_proto_depIdxs = []int32{
|
|
||||||
0, // 0: echo.EchoService.Echo:input_type -> echo.Message
|
|
||||||
0, // 1: echo.EchoService.Echo:output_type -> echo.Message
|
|
||||||
1, // [1:2] is the sub-list for method output_type
|
|
||||||
0, // [0:1] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_echo_echo_proto_init() }
|
|
||||||
func file_echo_echo_proto_init() {
|
|
||||||
if File_echo_echo_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_echo_echo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*Message); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_echo_echo_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 1,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 1,
|
|
||||||
},
|
|
||||||
GoTypes: file_echo_echo_proto_goTypes,
|
|
||||||
DependencyIndexes: file_echo_echo_proto_depIdxs,
|
|
||||||
MessageInfos: file_echo_echo_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_echo_echo_proto = out.File
|
|
||||||
file_echo_echo_proto_rawDesc = nil
|
|
||||||
file_echo_echo_proto_goTypes = nil
|
|
||||||
file_echo_echo_proto_depIdxs = nil
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "./echo";
|
|
||||||
|
|
||||||
package echo;
|
|
||||||
|
|
||||||
message Message {
|
|
||||||
string body = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
service EchoService {
|
|
||||||
rpc Echo(Message) returns (Message) {}
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
|
||||||
// - protoc v4.24.3
|
|
||||||
// source: echo/echo.proto
|
|
||||||
|
|
||||||
package echo
|
|
||||||
|
|
||||||
import (
|
|
||||||
context "context"
|
|
||||||
grpc "google.golang.org/grpc"
|
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
|
||||||
|
|
||||||
const (
|
|
||||||
EchoService_Echo_FullMethodName = "/echo.EchoService/Echo"
|
|
||||||
)
|
|
||||||
|
|
||||||
// EchoServiceClient is the client API for EchoService service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
||||||
type EchoServiceClient interface {
|
|
||||||
Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type echoServiceClient struct {
|
|
||||||
cc grpc.ClientConnInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient {
|
|
||||||
return &echoServiceClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *echoServiceClient) Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
|
|
||||||
out := new(Message)
|
|
||||||
err := c.cc.Invoke(ctx, EchoService_Echo_FullMethodName, in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return out, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// EchoServiceServer is the server API for EchoService service.
|
|
||||||
// All implementations must embed UnimplementedEchoServiceServer
|
|
||||||
// for forward compatibility
|
|
||||||
type EchoServiceServer interface {
|
|
||||||
Echo(context.Context, *Message) (*Message, error)
|
|
||||||
mustEmbedUnimplementedEchoServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedEchoServiceServer struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedEchoServiceServer) Echo(context.Context, *Message) (*Message, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedEchoServiceServer) mustEmbedUnimplementedEchoServiceServer() {}
|
|
||||||
|
|
||||||
// UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to EchoServiceServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeEchoServiceServer interface {
|
|
||||||
mustEmbedUnimplementedEchoServiceServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer) {
|
|
||||||
s.RegisterService(&EchoService_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _EchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(Message)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(EchoServiceServer).Echo(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: EchoService_Echo_FullMethodName,
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(EchoServiceServer).Echo(ctx, req.(*Message))
|
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
// EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service.
|
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var EchoService_ServiceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "echo.EchoService",
|
|
||||||
HandlerType: (*EchoServiceServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Echo",
|
|
||||||
Handler: _EchoService_Echo_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "echo/echo.proto",
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package grpc
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"log"
|
|
||||||
"net"
|
|
||||||
"regexp"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stefanprodan/podinfo/pkg/api/grpc/echo"
|
|
||||||
"google.golang.org/grpc"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
"google.golang.org/grpc/test/bufconn"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGrpcEcho(t *testing.T) {
|
|
||||||
|
|
||||||
lis := bufconn.Listen(1024 * 1024)
|
|
||||||
t.Cleanup(func() {
|
|
||||||
lis.Close()
|
|
||||||
})
|
|
||||||
|
|
||||||
s := NewMockGrpcServer()
|
|
||||||
srv := grpc.NewServer()
|
|
||||||
t.Cleanup(func() {
|
|
||||||
srv.Stop()
|
|
||||||
})
|
|
||||||
|
|
||||||
echo.RegisterEchoServiceServer(srv, &echoServer{config: s.config, logger: s.logger})
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
if err := srv.Serve(lis); err != nil {
|
|
||||||
log.Fatalf("srv.Serve %v", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
dialer := func(context.Context, string) (net.Conn, error) {
|
|
||||||
return lis.Dial()
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
|
|
||||||
conn, err := grpc.DialContext(ctx, "", grpc.WithContextDialer(dialer), grpc.WithInsecure())
|
|
||||||
t.Cleanup(func() {
|
|
||||||
conn.Close()
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("grpc.DialContext %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
client := echo.NewEchoServiceClient(conn)
|
|
||||||
res, err := client.Echo(context.Background(), &echo.Message{Body: "test123-test"})
|
|
||||||
|
|
||||||
if _, ok := status.FromError(err); !ok {
|
|
||||||
t.Errorf("Echo returned type %T, want %T", err, status.Error)
|
|
||||||
}
|
|
||||||
|
|
||||||
expected := ".*body.*test123-test.*"
|
|
||||||
r := regexp.MustCompile(expected)
|
|
||||||
if !r.MatchString(res.String()) {
|
|
||||||
t.Fatalf("Returned unexpected body:\ngot \n%v \nwant \n%s",
|
|
||||||
res, expected)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user