Skip to content

Commit

Permalink
Merge pull request #22 from slashpai/merge-0.7.0
Browse files Browse the repository at this point in the history
MON-3465: Sync metrics-server with upstream v0.7.0
  • Loading branch information
openshift-merge-bot[bot] committed Jan 30, 2024
2 parents 64c9016 + 5adb585 commit 34ac541
Show file tree
Hide file tree
Showing 4,052 changed files with 408,632 additions and 201,624 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Expand Up @@ -4,7 +4,7 @@ about: Report a bug encountered while operating Metrics Server

---

<!--
<!--
STOP -- PLEASE READ!
If you're looking for help, check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).
Expand All @@ -24,6 +24,7 @@ Not doing so may result in your bug not being addressed in a timely manner. Than
**Anything else we need to know?**:

**Environment**:

- Kubernetes distribution (GKE, EKS, Kubeadm, the hard way, etc.):
- Container Network Setup (flannel, calico, etc.):
- Kubernetes version (use `kubectl version`):
Expand Down Expand Up @@ -56,10 +57,11 @@ Not doing so may result in your bug not being addressed in a timely manner. Than
</details>

- Status of Metrics API:

<details>
<summary>spolier for Status of Metrics API:</summary>

```
```sh
kubectl describe apiservice v1beta1.metrics.k8s.io
```

Expand Down
26 changes: 26 additions & 0 deletions .github/dependabot.yaml
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
groups:
gomod-dependencies:
patterns:
- "*"
- package-ecosystem: gomod
directory: /scripts
schedule:
interval: weekly
groups:
gomod-dependencies:
patterns:
- "*"
41 changes: 41 additions & 0 deletions .github/workflows/gh-workflow-approve.yaml
@@ -0,0 +1,41 @@
name: Approve GH Workflows

on:
pull_request_target:
types:
- labeled
- synchronize
branches:
- master

jobs:
approve:
name: Approve ok-to-test
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Update PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
debug: ${{ secrets.ACTIONS_RUNNER_DEBUG == 'true' }}
script: |
const result = await github.rest.actions.listWorkflowRunsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
event: "pull_request",
status: "action_required",
head_sha: context.payload.pull_request.head.sha,
per_page: 100
});
for (var run of result.data.workflow_runs) {
await github.rest.actions.approveWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: run.id
});
}
9 changes: 5 additions & 4 deletions .github/workflows/lint-test-chart.yaml
Expand Up @@ -3,6 +3,7 @@ name: Lint and Test Chart
on:
pull_request:
paths:
- .github/workflows/lint-test-chart.yaml
- "charts/metrics-server/**"

jobs:
Expand All @@ -15,12 +16,12 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 0

- name: Set-up Python
uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 # v4.4.0
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.x"

Expand All @@ -40,7 +41,7 @@ jobs:
rm -f /tmp/ah.tar.gz
- name: Set-up chart-testing
uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec # v2.3.1
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1

- name: Check for changes
id: changes
Expand All @@ -63,7 +64,7 @@ jobs:

- name: Create Kind cluster
if: fromJSON(steps.changes.outputs.changed)
uses: helm/kind-action@d8ccf8fb623ce1bb360ae2f45f323d9d5c5e9f00 # v1.5.0
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
with:
wait: 120s

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-chart.yaml
Expand Up @@ -17,7 +17,7 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 0

Expand All @@ -28,13 +28,13 @@ jobs:
- name: Get chart version
id: chart_version
uses: mikefarah/yq@87cba2ecbeaecf860efcceb66deab46ae030ce1e # v4.30.6
uses: mikefarah/yq@dd648994340a5d03225d97abf19c9bf1086c3f07 # v4.40.5
with:
cmd: yq eval '.version' './charts/metrics-server/Chart.yaml'

- name: Get chart app version
id: chart_app_version
uses: mikefarah/yq@87cba2ecbeaecf860efcceb66deab46ae030ce1e # v4.30.6
uses: mikefarah/yq@dd648994340a5d03225d97abf19c9bf1086c3f07 # v4.40.5
with:
cmd: yq eval '.appVersion' './charts/metrics-server/Chart.yaml'

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:

- name: Run chart-releaser
if: fromJSON(steps.check_can_release.outputs.continue)
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "metrics-server-helm-chart-{{ .Version }}"
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/release.yaml
Expand Up @@ -7,16 +7,27 @@ on:

jobs:
build:
name: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Build manifests
run: make release-manifests
- name: Release
uses: softprops/action-gh-release@v1
- name: Release manifests
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
_output/components.yaml
_output/high-availability.yaml
_output/high-availability-1.21+.yaml
- name: Build binaries
run: make build-all
- name: Release binaries
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
_output/metrics-server-*
8 changes: 2 additions & 6 deletions .golangci.yml
Expand Up @@ -5,8 +5,6 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
Expand All @@ -23,14 +21,12 @@ linters:
- misspell
- nakedret
- nolintlint
- rowserrcheck
- structcheck
- staticcheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace

linters-settings:
goimports:
local-prefixes: sigs.k8s.io/metrics-server
local-prefixes: sigs.k8s.io/metrics-server
21 changes: 12 additions & 9 deletions CONTRIBUTING.md
Expand Up @@ -22,28 +22,29 @@ If your repo has certain guidelines for contribution, put them here ahead of the

## Chart Changes

When contributing chart changes please follow the same process as when contributing other content but also please **DON'T** modify _Chart.yaml_ in the PR as this would result in a chart release when merged and will mean that your PR will need modifying before it can be accepted. The chart version will be updated as part of the PR to release the chart.
When contributing chart changes please follow the same process as when contributing other content but also please **DON'T** modify _Chart.yaml_ in the PR as this would result in a chart release when merged and will mean that your PR will need modifying before it can be accepted. The chart version will be updated as part of the PR to release the chart.

# Development
## Development

Required tools:
* [Docker](https://www.docker.com/)
* [Kind](https://kind.sigs.k8s.io/)
* [Skaffold](https://skaffold.dev/)

- [Docker](https://www.docker.com/)
- [Kind](https://kind.sigs.k8s.io/)
- [Skaffold](https://skaffold.dev/)

## Adding dependencies

The project follows a standard Go project layout, see more about [dependency-management](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#dependency-management).

## Running static code validation

```
```sh
make lint
```

## Running tests

```
```sh
make test-unit
make test-version
make test-e2e
Expand All @@ -52,12 +53,14 @@ make test-e2e
## Live reload

To start local development just run:
```

```sh
kind create cluster
skaffold dev
```

To execute e2e tests run:
```

```sh
go test test/e2e_test.go -v -count=1
```
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,7 +1,7 @@
# Update the base image in Makefile when updating golang version. This has to
# be pre-pulled in order to work on GCB.
ARG ARCH
FROM golang:1.19.11 as build
FROM golang:1.21.6 as build

WORKDIR /go/src/sigs.k8s.io/metrics-server
COPY go.mod .
Expand Down

0 comments on commit 34ac541

Please sign in to comment.