Compare commits
10 Commits
6ba8990ba3
...
6c164e3698
Author | SHA1 | Date | |
---|---|---|---|
|
6c164e3698 | ||
40bad6b345 | |||
25f3499403 | |||
288033efd0 | |||
ec26a7ef7a | |||
213039eaae | |||
f5303b85fc | |||
|
503543c9d5 | ||
9306f03a5a | |||
0db0e614d6 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.vscode/*
|
||||||
|
node_modules/*
|
152
.releaserc.json
Normal file
152
.releaserc.json
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
{
|
||||||
|
"branches": [
|
||||||
|
{
|
||||||
|
"name": "main",
|
||||||
|
"channel": "stable",
|
||||||
|
"prerelease": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "devel",
|
||||||
|
"channel": "rc",
|
||||||
|
"prerelease": "rc"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"@semantic-release/commit-analyzer", {
|
||||||
|
"preset": "conventionalcommits",
|
||||||
|
"releaseRules": [
|
||||||
|
{
|
||||||
|
"type": "feat",
|
||||||
|
"release": "minor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "fix",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "docs",
|
||||||
|
"release": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "style",
|
||||||
|
"release": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "refactor",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "perf",
|
||||||
|
"release": "minor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "test",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "build",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ci",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "revert",
|
||||||
|
"release": "patch"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "release",
|
||||||
|
"release": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parserOpts": {
|
||||||
|
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/release-notes-generator", {
|
||||||
|
"preset": "conventionalcommits",
|
||||||
|
"presetConfig": {
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "feat",
|
||||||
|
"section": "Features",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "fix",
|
||||||
|
"section": "Bug Fixes",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "docs",
|
||||||
|
"hidden": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "refactor",
|
||||||
|
"section": "Refactoring",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "perf",
|
||||||
|
"section": "Performance Improvements",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "test",
|
||||||
|
"section": " Tests",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ci",
|
||||||
|
"section": "Continuous Integrations",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "chore",
|
||||||
|
"hidden": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "revert",
|
||||||
|
"section": "Reverts",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "release",
|
||||||
|
"hidden": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "build",
|
||||||
|
"section": "Build system and dependencies",
|
||||||
|
"hidden": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/changelog", {
|
||||||
|
"changelogFile": "CHANGELOG.md"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/npm", {
|
||||||
|
"npmPublish": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
["@saithodev/semantic-release-gitea", {
|
||||||
|
"giteaUrl": "https://git.ext.icikowski.pl"
|
||||||
|
}],
|
||||||
|
[
|
||||||
|
"@semantic-release/git", {
|
||||||
|
"assets": ["CHANGELOG.md","package.json", "package-lock.json"],
|
||||||
|
"message": "release(${nextRelease.channel}): v${nextRelease.version}\n\n${nextRelease.notes}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"preset": "conventionalcommits"
|
||||||
|
}
|
||||||
|
|
38
.renovaterc.json
Normal file
38
.renovaterc.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"local>renovate/renovate"
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"groupName": "all non-major dependencies",
|
||||||
|
"groupSlug": "all-minor-patch",
|
||||||
|
"matchPackagePatterns": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"matchUpdateTypes": [
|
||||||
|
"minor",
|
||||||
|
"patch",
|
||||||
|
"pin",
|
||||||
|
"digest"
|
||||||
|
],
|
||||||
|
"automerge": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupName": "all major dependencies",
|
||||||
|
"groupSlug": "all-major",
|
||||||
|
"matchPackagePatterns": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"matchUpdateTypes": [
|
||||||
|
"major"
|
||||||
|
],
|
||||||
|
"automerge": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ignoreDeps": [],
|
||||||
|
"postUpdateOptions": [
|
||||||
|
"gomodTidy",
|
||||||
|
"gomodUpdateImportPaths"
|
||||||
|
]
|
||||||
|
}
|
13
.woodpecker/.release.yml
Normal file
13
.woodpecker/.release.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
evaluate: '(CI_COMMIT_BRANCH == "devel" && not (CI_COMMIT_MESSAGE startsWith "release")) || (CI_COMMIT_BRANCH == "main" && not (CI_COMMIT_MESSAGE startsWith "release(stable)"))'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
semantic-release:
|
||||||
|
image: node:latest
|
||||||
|
secrets:
|
||||||
|
- gitea_token
|
||||||
|
- git_credentials
|
||||||
|
commands:
|
||||||
|
- npm i
|
||||||
|
- npm run release
|
11
.woodpecker/.test.yml
Normal file
11
.woodpecker/.test.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
when:
|
||||||
|
- event: [push, pull_request]
|
||||||
|
branch: devel
|
||||||
|
evaluate: 'not (CI_COMMIT_MESSAGE startsWith "release")'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
test:
|
||||||
|
group: test
|
||||||
|
image: golang:1.22-alpine
|
||||||
|
commands:
|
||||||
|
- go test -v ./...
|
24
CHANGELOG.md
Normal file
24
CHANGELOG.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
## [1.1.0-rc.1](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.0.1-rc.1...v1.1.0-rc.1) (2024-02-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **handler:** change path resolver logic ([40bad6b](https://git.ext.icikowski.pl/go/kubeprobes/commit/40bad6b3456afaf9a7d04fb0af3911f47ffd601b))
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integrations
|
||||||
|
|
||||||
|
* **renovate:** add Renovate bot configuration ([f5303b8](https://git.ext.icikowski.pl/go/kubeprobes/commit/f5303b85fce436d9d8114b72dee8f4b44f332c55))
|
||||||
|
|
||||||
|
|
||||||
|
### Build system and dependencies
|
||||||
|
|
||||||
|
* **deps:** update all non-major dependencies ([288033e](https://git.ext.icikowski.pl/go/kubeprobes/commit/288033efd050b13e877e26682c1bef8e269b2988))
|
||||||
|
* **deps:** update dependency semantic-release to v23 ([213039e](https://git.ext.icikowski.pl/go/kubeprobes/commit/213039eaae78fce6734455ef379d492e799bc07f))
|
||||||
|
|
||||||
|
## [1.0.1-rc.1](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.0.0...v1.0.1-rc.1) (2023-11-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integrations
|
||||||
|
|
||||||
|
* **init:** add initial CI configuration ([0db0e61](https://git.ext.icikowski.pl/go/kubeprobes/commit/0db0e614d6e6ae31b12b8629e5adaa3230bdbc45))
|
7435
package-lock.json
generated
Normal file
7435
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
18
package.json
Normal file
18
package.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"name": "kubeprobes",
|
||||||
|
"version": "1.1.0-rc.1",
|
||||||
|
"scripts": {
|
||||||
|
"release": "./node_modules/.bin/semantic-release"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@saithodev/semantic-release-gitea": "^2.1.0",
|
||||||
|
"@semantic-release/changelog": "^6.0.3",
|
||||||
|
"@semantic-release/commit-analyzer": "^11.0.0",
|
||||||
|
"@semantic-release/git": "^10.0.1",
|
||||||
|
"@semantic-release/npm": "^11.0.1",
|
||||||
|
"@semantic-release/release-notes-generator": "^12.0.1",
|
||||||
|
"conventional-changelog-conventionalcommits": "^7.0.2",
|
||||||
|
"semantic-release": "^23.0.0"
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package kubeprobes
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type kubeprobes struct {
|
type kubeprobes struct {
|
||||||
@ -11,15 +12,16 @@ type kubeprobes struct {
|
|||||||
|
|
||||||
// ServeHTTP implements http.Handler interface
|
// ServeHTTP implements http.Handler interface
|
||||||
func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
switch r.URL.Path {
|
subs := strings.Split(strings.TrimSuffix(r.URL.Path, "/"), "/")
|
||||||
case "/live":
|
switch subs[len(subs)-1] {
|
||||||
|
case "live":
|
||||||
sq := newStatusQuery(kp.livenessProbes)
|
sq := newStatusQuery(kp.livenessProbes)
|
||||||
if sq.isAllGreen() {
|
if sq.isAllGreen() {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
} else {
|
} else {
|
||||||
w.WriteHeader(http.StatusServiceUnavailable)
|
w.WriteHeader(http.StatusServiceUnavailable)
|
||||||
}
|
}
|
||||||
case "/ready":
|
case "ready":
|
||||||
sq := newStatusQuery(append(kp.livenessProbes, kp.readinessProbes...))
|
sq := newStatusQuery(append(kp.livenessProbes, kp.readinessProbes...))
|
||||||
if sq.isAllGreen() {
|
if sq.isAllGreen() {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
Loading…
Reference in New Issue
Block a user