Compare commits

..

10 Commits

Author SHA1 Message Date
semantic-release-bot
6c164e3698 release(rc): v1.1.0-rc.1
All checks were successful
ci/woodpecker/push/release Pipeline was successful
## [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](40bad6b345))

### Continuous Integrations

* **renovate:** add Renovate bot configuration ([f5303b8](f5303b85fc))

### Build system and dependencies

* **deps:** update all non-major dependencies ([288033e](288033efd0))
* **deps:** update dependency semantic-release to v23 ([213039e](213039eaae))
2024-02-29 00:24:19 +00:00
40bad6b345
feat(handler): change path resolver logic
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
2024-02-29 01:19:31 +01:00
25f3499403 Merge pull request 'build(deps): update all non-major dependencies' (#2) from renovate-all-minor-patch into devel
Reviewed-on: #2
2024-02-29 00:54:20 +01:00
288033efd0 build(deps): update all non-major dependencies 2024-02-28 23:53:55 +00:00
ec26a7ef7a Merge pull request 'build(deps): update dependency semantic-release to v23' (#3) from renovate-major-all-major into devel
Reviewed-on: #3
2024-02-29 00:52:05 +01:00
213039eaae build(deps): update dependency semantic-release to v23 2024-02-28 23:46:31 +00:00
f5303b85fc
ci(renovate): add Renovate bot configuration 2024-02-29 00:20:31 +01:00
semantic-release-bot
503543c9d5 release(rc): v1.0.1-rc.1
## [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](0db0e614d6))
2023-11-04 20:18:49 +00:00
9306f03a5a Merge pull request 'Add Woodpecker CI support' (#1) from ci into devel
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
Reviewed-on: #1
2023-11-04 21:17:42 +01:00
0db0e614d6
ci(init): add initial CI configuration
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
2023-11-04 20:36:45 +01:00
9 changed files with 7698 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode/*
node_modules/*

152
.releaserc.json Normal file
View 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
View 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
View 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
View 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
View 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

File diff suppressed because it is too large Load Diff

18
package.json Normal file
View 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"
}
}

View File

@ -2,6 +2,7 @@ package kubeprobes
import (
"net/http"
"strings"
)
type kubeprobes struct {
@ -11,15 +12,16 @@ type kubeprobes struct {
// ServeHTTP implements http.Handler interface
func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/live":
subs := strings.Split(strings.TrimSuffix(r.URL.Path, "/"), "/")
switch subs[len(subs)-1] {
case "live":
sq := newStatusQuery(kp.livenessProbes)
if sq.isAllGreen() {
w.WriteHeader(http.StatusOK)
} else {
w.WriteHeader(http.StatusServiceUnavailable)
}
case "/ready":
case "ready":
sq := newStatusQuery(append(kp.livenessProbes, kp.readinessProbes...))
if sq.isAllGreen() {
w.WriteHeader(http.StatusOK)