Skip to content

Commit c1a3dc1

Browse files
authored
add custom-pod-autoscaler-operator (#57965)
<!--- Provide a short summary in the Title above. Examples of good PR titles: * "ruby-3.1: new package" * "haproxy: fix CVE-2014-123456" --> <!-- Please include references to any related issues or delete this section otherwise. --> Fixes: Related: ### Pre-review Checklist <!-- This checklist is mostly useful as a reminder of small things that can easily be forgotten – it is meant as a helpful tool rather than hoops to jump through. At the moment of this PR you have the most information on what all the change will affect, so please take the time to jot it down. Put an `x` in all the items that apply, make notes next to any that haven't been addressed, and remove any items that are not relevant to this PR. --> #### For new package PRs only <!-- remove if unrelated --> - [ ] This PR is marked as fixing a pre-existing package request bug - [ ] Alternatively, the PR is marked as related to a pre-existing package request bug, such as a dependency - [X] REQUIRED - The package is available under an OSI-approved or FSF-approved license - [X] REQUIRED - The version of the package is still receiving security updates - [ ] This PR links to the upstream project's support policy (e.g. `endoflife.date`) #### For new version streams <!-- remove if unrelated --> - [ ] The upstream project actually supports multiple concurrent versions. - [ ] Any subpackages include the version string in their package name (e.g. `name: ${{package.name}}-compat`) - [ ] The package (and subpackages) `provides:` logical unversioned forms of the package (e.g. `nodejs`, `nodejs-lts`) - [ ] If non-streamed package names no longer built, open PR to withdraw them (see [WITHDRAWING PACKAGES](https://github.com/wolfi-dev/os/blob/main/WITHDRAWING_PACKAGES.md)) #### For package updates (renames) in the base images <!-- remove if unrelated --> When updating packages part of base images (i.e. cgr.dev/chainguard/wolfi-base or ghcr.io/wolfi-dev/sdk) - [ ] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk images successfully build - [ ] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk contain no obsolete (no longer built) packages - [ ] Upon launch, does `apk upgrade --latest` successfully upgrades packages or performs no actions #### For security-related PRs <!-- remove if unrelated --> - [ ] The security fix is recorded in the [advisories](https://github.com/wolfi-dev/advisories) repo #### For version bump PRs <!-- remove if unrelated --> - [ ] The `epoch` field is reset to 0 #### For PRs that add patches <!-- remove if unrelated --> - [ ] Patch source is documented --------- Signed-off-by: Dentrax <[email protected]>
1 parent db381d7 commit c1a3dc1

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

custom-pod-autoscaler-operator.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package:
2+
name: custom-pod-autoscaler-operator
3+
version: "1.4.2"
4+
epoch: 0
5+
description: Operator for managing Kubernetes Custom Pod Autoscalers (CPA).
6+
copyright:
7+
- license: Apache-2.0
8+
9+
pipeline:
10+
- uses: git-checkout
11+
with:
12+
expected-commit: 657d0a3a829e596404e4f5c09e71071237721d35
13+
repository: https://github.com/jthomperoo/custom-pod-autoscaler-operator
14+
tag: v${{package.version}}
15+
16+
- uses: go/bump
17+
with:
18+
deps: |-
19+
golang.org/x/[email protected]
20+
golang.org/x/[email protected]
21+
google.golang.org/[email protected]
22+
23+
- uses: go/build
24+
with:
25+
packages: .
26+
output: custom-pod-autoscaler-operator
27+
vendor: true
28+
29+
subpackages:
30+
- name: ${{package.name}}-compat
31+
pipeline:
32+
- runs: |
33+
mkdir -p "${{targets.contextdir}}/app"
34+
ln -s /usr/bin/custom-pod-autoscaler-operator "${{targets.contextdir}}/operator"
35+
test:
36+
pipeline:
37+
- runs: test "$(readlink /operator)" = "/usr/bin/custom-pod-autoscaler-operator"
38+
39+
update:
40+
enabled: true
41+
github:
42+
identifier: jthomperoo/custom-pod-autoscaler-operator
43+
strip-prefix: v
44+
45+
test:
46+
environment:
47+
contents:
48+
packages:
49+
- ${{package.name}}-compat
50+
- curl
51+
- wait-for-it
52+
- helm
53+
environment:
54+
KUBERNETES_SERVICE_HOST: "127.0.0.1"
55+
KUBERNETES_SERVICE_PORT: 32764
56+
pipeline:
57+
- uses: test/tw/ldd-check
58+
- uses: test/kwok/cluster
59+
- name: Fix SA token
60+
runs: |
61+
#!/usr/bin/env bash
62+
set -euo pipefail
63+
# Workaround fix for: "Fail to create in-cluster Kubernetes config: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory"
64+
# InClusterConfig() parses the file and insists it contain a real PEM-encoded CA certificate.
65+
DIR=/var/run/secrets/kubernetes.io/serviceaccount
66+
mkdir -p "$DIR"
67+
kwokctl --name kwok kubectl create serviceaccount cpa
68+
kwokctl --name kwok kubectl -n default create token cpa --duration=8760h > "$DIR/token"
69+
CA=$(kubectl config view --raw -o jsonpath='{.clusters[0].cluster.certificate-authority}')
70+
cp $CA /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
71+
echo default > "$DIR/namespace"
72+
- name: "start daemon on localhost"
73+
uses: test/daemon-check-output
74+
with:
75+
setup: |
76+
helm install custom-pod-autoscaler-operator https://github.com/jthomperoo/custom-pod-autoscaler-operator/releases/download/v${{package.version}}/custom-pod-autoscaler-operator-v${{package.version}}.tgz
77+
start: "/operator"
78+
timeout: 10
79+
expected_output: |
80+
starting manager
81+
Serving metrics server
82+
Starting Controller
83+
post: |
84+
wait-for-it -t 5 --strict localhost:8000 -- echo "Server is up"
85+
kubectl apply -f https://raw.githubusercontent.com/jthomperoo/custom-pod-autoscaler/refs/heads/master/example/python-custom-autoscaler/cpa.yaml

0 commit comments

Comments
 (0)