Compare commits
10 Commits
v1.3.1-rc.
...
devel
Author | SHA1 | Date | |
---|---|---|---|
|
a9bb22f16c | ||
65f30a6b09 | |||
|
c269e64231 | ||
0ad514865c | |||
|
8f8d6eb47f | ||
48aa72b375 | |||
|
7f5d2fd5e2 | ||
|
e830e25560 | ||
ec44d7f643 | |||
df80db0e29 |
@ -5,6 +5,6 @@ when:
|
||||
|
||||
steps:
|
||||
test:
|
||||
image: golang:1.22-alpine
|
||||
image: golang:1.23-alpine
|
||||
commands:
|
||||
- go test -v ./...
|
||||
|
52
CHANGELOG.md
52
CHANGELOG.md
@ -1,3 +1,55 @@
|
||||
## [1.3.2-rc.3](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.3.2-rc.2...v1.3.2-rc.3) (2024-08-20)
|
||||
|
||||
### Build system and dependencies
|
||||
|
||||
* **deps:** update all non-major dependencies ([65f30a6](https://git.ext.icikowski.pl/go/kubeprobes/commit/65f30a6b09628b6e58f40318279e2034f92790ba))
|
||||
|
||||
## [1.3.2-rc.2](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.3.2-rc.1...v1.3.2-rc.2) (2024-08-20)
|
||||
|
||||
### Build system and dependencies
|
||||
|
||||
* **deps:** update golang docker tag to v1.23 ([0ad5148](https://git.ext.icikowski.pl/go/kubeprobes/commit/0ad514865ca927f9f87747b2710f6be9f8b43590))
|
||||
|
||||
## [1.3.2-rc.1](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.3.1...v1.3.2-rc.1) (2024-08-20)
|
||||
|
||||
### Build system and dependencies
|
||||
|
||||
* **deps:** update all major dependencies ([48aa72b](https://git.ext.icikowski.pl/go/kubeprobes/commit/48aa72b3757830fb05ed136765cb7389ba1d7285))
|
||||
|
||||
## [1.3.1](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.3.0...v1.3.1) (2024-05-27)
|
||||
|
||||
|
||||
### Refactoring
|
||||
|
||||
* **formatting:** change line terminators from CRLF to LF ([ec44d7f](https://git.ext.icikowski.pl/go/kubeprobes/commit/ec44d7f643e78cfb1e9724b36416458782a6c775))
|
||||
* **probes:** rename `ProbeFunction` to `Probe` ([8dc7f27](https://git.ext.icikowski.pl/go/kubeprobes/commit/8dc7f27400075fabca9525f42eb20404736fb1cb))
|
||||
|
||||
|
||||
### Continuous Integrations
|
||||
|
||||
* **deps:** pin `conventional-changelog-conventionalcommits` to version 7.x ([b15846a](https://git.ext.icikowski.pl/go/kubeprobes/commit/b15846aa58864f5809e2226cad9c52770f84aae9))
|
||||
* **test:** remove `group` directive ([a1bab99](https://git.ext.icikowski.pl/go/kubeprobes/commit/a1bab99cbdbf903256be3172036fc9b8c44f9992))
|
||||
|
||||
|
||||
### Build system and dependencies
|
||||
|
||||
* **deps:** update all non-major dependencies ([a68663c](https://git.ext.icikowski.pl/go/kubeprobes/commit/a68663cff022fa135d48fae6f00e39ea684983f1))
|
||||
* **deps:** update dependency @semantic-release/commit-analyzer to v12 ([2a79a68](https://git.ext.icikowski.pl/go/kubeprobes/commit/2a79a6878f647049ca2f01711d74561f6c4974c6))
|
||||
* **deps:** update dependency @semantic-release/npm to v12 ([fdee33a](https://git.ext.icikowski.pl/go/kubeprobes/commit/fdee33a1e7c05bd19f0f5d675df434ad4d844911))
|
||||
* **deps:** update dependency @semantic-release/release-notes-generator to v13 ([0cba4d2](https://git.ext.icikowski.pl/go/kubeprobes/commit/0cba4d2a50319cc0250dc3cb14e32dee813b4fc0))
|
||||
* **deps:** update dependency conventional-changelog-conventionalcommits to v8 ([8918072](https://git.ext.icikowski.pl/go/kubeprobes/commit/8918072d5c818bad10542957b93440730d50baf1))
|
||||
* **deps:** update dependency semantic-release to v23.0.3 ([cea539f](https://git.ext.icikowski.pl/go/kubeprobes/commit/cea539fd6d68608635ec19ae8840da749695bfac))
|
||||
* **deps:** update dependency semantic-release to v23.0.4 ([2d5b101](https://git.ext.icikowski.pl/go/kubeprobes/commit/2d5b101b8d38d7af7c6b4ba570f1045fe9e9dc7b))
|
||||
* **deps:** update dependency semantic-release to v23.0.5 ([061100e](https://git.ext.icikowski.pl/go/kubeprobes/commit/061100e432a61ed6bcb310de297880db369e2f24))
|
||||
* **deps:** update dependency semantic-release to v23.0.8 ([b98f6ef](https://git.ext.icikowski.pl/go/kubeprobes/commit/b98f6ef609c278bfbd25c25316ad166fba75f255))
|
||||
|
||||
## [1.3.1-rc.11](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.3.1-rc.10...v1.3.1-rc.11) (2024-05-27)
|
||||
|
||||
|
||||
### Refactoring
|
||||
|
||||
* **formatting:** change line terminators from CRLF to LF ([ec44d7f](https://git.ext.icikowski.pl/go/kubeprobes/commit/ec44d7f643e78cfb1e9724b36416458782a6c775))
|
||||
|
||||
## [1.3.1-rc.10](https://git.ext.icikowski.pl/go/kubeprobes/compare/v1.3.1-rc.9...v1.3.1-rc.10) (2024-05-27)
|
||||
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
# kubeprobes
|
||||
|
||||
[![Go Report Card](https://goreportcard.com/badge/pkg.icikowski.pl/kubeprobes)](https://goreportcard.com/report/pkg.icikowski.pl/kubeprobes)
|
||||
|
||||
Simple and effective package for implementing [Kubernetes liveness and readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/)' handler.
|
||||
|
||||
## Installation
|
||||
|
294
kubeprobes.go
294
kubeprobes.go
@ -1,147 +1,147 @@
|
||||
package kubeprobes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Kubeprobes represents liveness & readiness probes handler.
|
||||
type Kubeprobes interface {
|
||||
http.Handler
|
||||
|
||||
// LivenessHandler returns [http.Handler] for liveness probes.
|
||||
LivenessHandler() http.Handler
|
||||
// ReadinessHandler returns [http.Handler] for readiness probes.
|
||||
ReadinessHandler() http.Handler
|
||||
}
|
||||
|
||||
type kubeprobes struct {
|
||||
livenessProbes []Probe
|
||||
readinessProbes []Probe
|
||||
|
||||
verbose bool
|
||||
|
||||
pathLive string
|
||||
pathReady string
|
||||
}
|
||||
|
||||
// New returns a new instance of a Kubernetes probes with given options.
|
||||
func New(options ...Option) (Kubeprobes, error) {
|
||||
kp := &kubeprobes{
|
||||
livenessProbes: []Probe{},
|
||||
readinessProbes: []Probe{},
|
||||
pathLive: defaultLivenessPath,
|
||||
pathReady: defaultReadinessPath,
|
||||
}
|
||||
|
||||
for _, option := range options {
|
||||
option.apply(kp)
|
||||
}
|
||||
|
||||
if err := kp.validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return kp, nil
|
||||
}
|
||||
|
||||
func (kp *kubeprobes) validate() error {
|
||||
var err error
|
||||
|
||||
if kp.pathLive == "" {
|
||||
err = errors.Join(err, fmt.Errorf("liveness probe path must not be empty"))
|
||||
}
|
||||
|
||||
if kp.pathReady == "" {
|
||||
err = errors.Join(err, fmt.Errorf("readiness probe path must not be empty"))
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(kp.pathLive, "/") {
|
||||
err = errors.Join(err, fmt.Errorf("liveness probe path must start with slash (current: %q)", kp.pathLive))
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(kp.pathReady, "/") {
|
||||
err = errors.Join(err, fmt.Errorf("readiness probe path must start with slash (current: %q)", kp.pathReady))
|
||||
}
|
||||
|
||||
if kp.pathLive == kp.pathReady {
|
||||
err = errors.Join(err, fmt.Errorf("liveness and readiness probes have the same values (both %q)", kp.pathLive))
|
||||
}
|
||||
|
||||
if len(kp.livenessProbes) == 0 {
|
||||
err = errors.Join(err, fmt.Errorf("no liveness probes defined"))
|
||||
}
|
||||
|
||||
if len(kp.readinessProbes) == 0 {
|
||||
err = errors.Join(err, fmt.Errorf("no readiness probes defined"))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type probesResponse struct {
|
||||
Passed []statusEntry `json:"passed,omitempty"`
|
||||
Failed []statusEntry `json:"failed,omitempty"`
|
||||
}
|
||||
|
||||
func (kp *kubeprobes) handleLiveness(w http.ResponseWriter, r *http.Request) {
|
||||
sq := newStatusQuery(kp.livenessProbes)
|
||||
output := probesResponse{}
|
||||
|
||||
sq.wait()
|
||||
output.Failed = sq.failed
|
||||
if r.URL.Query().Has(verboseOutputFlag) || kp.verbose {
|
||||
output.Passed = sq.passed
|
||||
}
|
||||
|
||||
w.Header().Add(headerContentType, contentTypeJSON)
|
||||
if sq.ok {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
}
|
||||
_ = json.NewEncoder(w).Encode(output)
|
||||
}
|
||||
|
||||
func (kp *kubeprobes) handleReadiness(w http.ResponseWriter, r *http.Request) {
|
||||
sq := newStatusQuery(append(kp.livenessProbes, kp.readinessProbes...))
|
||||
output := probesResponse{}
|
||||
|
||||
sq.wait()
|
||||
output.Failed = sq.failed
|
||||
if r.URL.Query().Has(verboseOutputFlag) || kp.verbose {
|
||||
output.Passed = sq.passed
|
||||
}
|
||||
|
||||
w.Header().Add(headerContentType, contentTypeJSON)
|
||||
if sq.ok {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
}
|
||||
_ = json.NewEncoder(w).Encode(output)
|
||||
}
|
||||
|
||||
// LivenessHandler implements Kubeprobes.
|
||||
func (kp *kubeprobes) LivenessHandler() http.Handler {
|
||||
return http.HandlerFunc(kp.handleLiveness)
|
||||
}
|
||||
|
||||
// ReadinessHandler implements Kubeprobes.
|
||||
func (kp *kubeprobes) ReadinessHandler() http.Handler {
|
||||
return http.HandlerFunc(kp.handleReadiness)
|
||||
}
|
||||
|
||||
// ServeHTTP implements Kubeprobes.
|
||||
func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case kp.pathLive:
|
||||
kp.handleLiveness(w, r)
|
||||
case kp.pathReady:
|
||||
kp.handleReadiness(w, r)
|
||||
default:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
}
|
||||
}
|
||||
package kubeprobes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Kubeprobes represents liveness & readiness probes handler.
|
||||
type Kubeprobes interface {
|
||||
http.Handler
|
||||
|
||||
// LivenessHandler returns [http.Handler] for liveness probes.
|
||||
LivenessHandler() http.Handler
|
||||
// ReadinessHandler returns [http.Handler] for readiness probes.
|
||||
ReadinessHandler() http.Handler
|
||||
}
|
||||
|
||||
type kubeprobes struct {
|
||||
livenessProbes []Probe
|
||||
readinessProbes []Probe
|
||||
|
||||
verbose bool
|
||||
|
||||
pathLive string
|
||||
pathReady string
|
||||
}
|
||||
|
||||
// New returns a new instance of a Kubernetes probes with given options.
|
||||
func New(options ...Option) (Kubeprobes, error) {
|
||||
kp := &kubeprobes{
|
||||
livenessProbes: []Probe{},
|
||||
readinessProbes: []Probe{},
|
||||
pathLive: defaultLivenessPath,
|
||||
pathReady: defaultReadinessPath,
|
||||
}
|
||||
|
||||
for _, option := range options {
|
||||
option.apply(kp)
|
||||
}
|
||||
|
||||
if err := kp.validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return kp, nil
|
||||
}
|
||||
|
||||
func (kp *kubeprobes) validate() error {
|
||||
var err error
|
||||
|
||||
if kp.pathLive == "" {
|
||||
err = errors.Join(err, fmt.Errorf("liveness probe path must not be empty"))
|
||||
}
|
||||
|
||||
if kp.pathReady == "" {
|
||||
err = errors.Join(err, fmt.Errorf("readiness probe path must not be empty"))
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(kp.pathLive, "/") {
|
||||
err = errors.Join(err, fmt.Errorf("liveness probe path must start with slash (current: %q)", kp.pathLive))
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(kp.pathReady, "/") {
|
||||
err = errors.Join(err, fmt.Errorf("readiness probe path must start with slash (current: %q)", kp.pathReady))
|
||||
}
|
||||
|
||||
if kp.pathLive == kp.pathReady {
|
||||
err = errors.Join(err, fmt.Errorf("liveness and readiness probes have the same values (both %q)", kp.pathLive))
|
||||
}
|
||||
|
||||
if len(kp.livenessProbes) == 0 {
|
||||
err = errors.Join(err, fmt.Errorf("no liveness probes defined"))
|
||||
}
|
||||
|
||||
if len(kp.readinessProbes) == 0 {
|
||||
err = errors.Join(err, fmt.Errorf("no readiness probes defined"))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type probesResponse struct {
|
||||
Passed []statusEntry `json:"passed,omitempty"`
|
||||
Failed []statusEntry `json:"failed,omitempty"`
|
||||
}
|
||||
|
||||
func (kp *kubeprobes) handleLiveness(w http.ResponseWriter, r *http.Request) {
|
||||
sq := newStatusQuery(kp.livenessProbes)
|
||||
output := probesResponse{}
|
||||
|
||||
sq.wait()
|
||||
output.Failed = sq.failed
|
||||
if r.URL.Query().Has(verboseOutputFlag) || kp.verbose {
|
||||
output.Passed = sq.passed
|
||||
}
|
||||
|
||||
w.Header().Add(headerContentType, contentTypeJSON)
|
||||
if sq.ok {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
}
|
||||
_ = json.NewEncoder(w).Encode(output)
|
||||
}
|
||||
|
||||
func (kp *kubeprobes) handleReadiness(w http.ResponseWriter, r *http.Request) {
|
||||
sq := newStatusQuery(append(kp.livenessProbes, kp.readinessProbes...))
|
||||
output := probesResponse{}
|
||||
|
||||
sq.wait()
|
||||
output.Failed = sq.failed
|
||||
if r.URL.Query().Has(verboseOutputFlag) || kp.verbose {
|
||||
output.Passed = sq.passed
|
||||
}
|
||||
|
||||
w.Header().Add(headerContentType, contentTypeJSON)
|
||||
if sq.ok {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
}
|
||||
_ = json.NewEncoder(w).Encode(output)
|
||||
}
|
||||
|
||||
// LivenessHandler implements Kubeprobes.
|
||||
func (kp *kubeprobes) LivenessHandler() http.Handler {
|
||||
return http.HandlerFunc(kp.handleLiveness)
|
||||
}
|
||||
|
||||
// ReadinessHandler implements Kubeprobes.
|
||||
func (kp *kubeprobes) ReadinessHandler() http.Handler {
|
||||
return http.HandlerFunc(kp.handleReadiness)
|
||||
}
|
||||
|
||||
// ServeHTTP implements Kubeprobes.
|
||||
func (kp *kubeprobes) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case kp.pathLive:
|
||||
kp.handleLiveness(w, r)
|
||||
case kp.pathReady:
|
||||
kp.handleReadiness(w, r)
|
||||
default:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
}
|
||||
}
|
||||
|
@ -1,182 +1,182 @@
|
||||
package kubeprobes
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func getStatusFromEndpoint(t *testing.T, client *http.Client, endpoint string) int {
|
||||
t.Helper()
|
||||
resp, err := client.Get(endpoint)
|
||||
if err != nil {
|
||||
t.Errorf("error getting status from endpoint: %s", err)
|
||||
}
|
||||
return resp.StatusCode
|
||||
}
|
||||
|
||||
func TestValidation(t *testing.T) {
|
||||
var (
|
||||
live, _ = NewManualProbe("live")
|
||||
ready, _ = NewManualProbe("ready")
|
||||
)
|
||||
|
||||
tests := map[string]struct {
|
||||
opts []Option
|
||||
expectedError bool
|
||||
}{
|
||||
"no modifications and no error": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
},
|
||||
},
|
||||
"modifications and no error": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath("/livez"),
|
||||
WithReadinessPath("/readyz"),
|
||||
},
|
||||
},
|
||||
"missing liveness probes": {
|
||||
opts: []Option{
|
||||
WithReadinessProbes(ready),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"missing readiness probes": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"liveness probe path empty": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath(""),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"readiness probe path empty": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithReadinessPath(""),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"liveness probe path does not start with slash": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath("livez"),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"readiness probe path does not start with slash": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithReadinessPath("readyz"),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"liveness and readiness probe paths are equal": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath("/check"),
|
||||
WithReadinessPath("/check"),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range tests {
|
||||
name, tc := name, tc
|
||||
t.Run(name, func(t *testing.T) {
|
||||
_, err := New(tc.opts...)
|
||||
switch {
|
||||
case err == nil && tc.expectedError:
|
||||
t.Error("expected error, but no error was returned")
|
||||
case err != nil && !tc.expectedError:
|
||||
t.Errorf("expected no error but got %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandler(t *testing.T) {
|
||||
var (
|
||||
live, _ = NewManualProbe("live")
|
||||
ready, _ = NewManualProbe("ready")
|
||||
)
|
||||
|
||||
tests := map[string]struct {
|
||||
livenessProbeTransformation func(*testing.T, ManualProbe)
|
||||
readinessProbeTransformation func(*testing.T, ManualProbe)
|
||||
expectedLiveStatus int
|
||||
expectedReadyStatus int
|
||||
}{
|
||||
"not live": {
|
||||
livenessProbeTransformation: markAsDown,
|
||||
readinessProbeTransformation: markAsDown,
|
||||
expectedLiveStatus: http.StatusServiceUnavailable,
|
||||
expectedReadyStatus: http.StatusServiceUnavailable,
|
||||
},
|
||||
"live but not ready": {
|
||||
livenessProbeTransformation: markAsUp,
|
||||
readinessProbeTransformation: markAsDown,
|
||||
expectedLiveStatus: http.StatusOK,
|
||||
expectedReadyStatus: http.StatusServiceUnavailable,
|
||||
},
|
||||
"live and ready": {
|
||||
livenessProbeTransformation: markAsUp,
|
||||
readinessProbeTransformation: markAsUp,
|
||||
expectedLiveStatus: http.StatusOK,
|
||||
expectedReadyStatus: http.StatusOK,
|
||||
},
|
||||
"ready but not live - should never happen": {
|
||||
livenessProbeTransformation: markAsDown,
|
||||
readinessProbeTransformation: markAsUp,
|
||||
expectedLiveStatus: http.StatusServiceUnavailable,
|
||||
expectedReadyStatus: http.StatusServiceUnavailable,
|
||||
},
|
||||
}
|
||||
|
||||
kp, err := New(
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v", err)
|
||||
}
|
||||
|
||||
srv := httptest.NewServer(kp)
|
||||
defer srv.Close()
|
||||
client := srv.Client()
|
||||
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
test.livenessProbeTransformation(t, live)
|
||||
test.readinessProbeTransformation(t, ready)
|
||||
|
||||
liveStatus := getStatusFromEndpoint(t, client, srv.URL+defaultLivenessPath)
|
||||
readyStatus := getStatusFromEndpoint(t, client, srv.URL+defaultReadinessPath)
|
||||
otherStatus := getStatusFromEndpoint(t, client, srv.URL+"/something")
|
||||
|
||||
if liveStatus != test.expectedLiveStatus {
|
||||
t.Errorf("expected live status %d, got %d", test.expectedLiveStatus, liveStatus)
|
||||
}
|
||||
if readyStatus != test.expectedReadyStatus {
|
||||
t.Errorf("expected ready status %d, got %d", test.expectedReadyStatus, readyStatus)
|
||||
}
|
||||
if otherStatus != http.StatusNotFound {
|
||||
t.Errorf("expected 404 status, got %d", otherStatus)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
package kubeprobes
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func getStatusFromEndpoint(t *testing.T, client *http.Client, endpoint string) int {
|
||||
t.Helper()
|
||||
resp, err := client.Get(endpoint)
|
||||
if err != nil {
|
||||
t.Errorf("error getting status from endpoint: %s", err)
|
||||
}
|
||||
return resp.StatusCode
|
||||
}
|
||||
|
||||
func TestValidation(t *testing.T) {
|
||||
var (
|
||||
live, _ = NewManualProbe("live")
|
||||
ready, _ = NewManualProbe("ready")
|
||||
)
|
||||
|
||||
tests := map[string]struct {
|
||||
opts []Option
|
||||
expectedError bool
|
||||
}{
|
||||
"no modifications and no error": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
},
|
||||
},
|
||||
"modifications and no error": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath("/livez"),
|
||||
WithReadinessPath("/readyz"),
|
||||
},
|
||||
},
|
||||
"missing liveness probes": {
|
||||
opts: []Option{
|
||||
WithReadinessProbes(ready),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"missing readiness probes": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"liveness probe path empty": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath(""),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"readiness probe path empty": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithReadinessPath(""),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"liveness probe path does not start with slash": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath("livez"),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"readiness probe path does not start with slash": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithReadinessPath("readyz"),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
"liveness and readiness probe paths are equal": {
|
||||
opts: []Option{
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
WithLivenessPath("/check"),
|
||||
WithReadinessPath("/check"),
|
||||
},
|
||||
expectedError: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range tests {
|
||||
name, tc := name, tc
|
||||
t.Run(name, func(t *testing.T) {
|
||||
_, err := New(tc.opts...)
|
||||
switch {
|
||||
case err == nil && tc.expectedError:
|
||||
t.Error("expected error, but no error was returned")
|
||||
case err != nil && !tc.expectedError:
|
||||
t.Errorf("expected no error but got %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandler(t *testing.T) {
|
||||
var (
|
||||
live, _ = NewManualProbe("live")
|
||||
ready, _ = NewManualProbe("ready")
|
||||
)
|
||||
|
||||
tests := map[string]struct {
|
||||
livenessProbeTransformation func(*testing.T, ManualProbe)
|
||||
readinessProbeTransformation func(*testing.T, ManualProbe)
|
||||
expectedLiveStatus int
|
||||
expectedReadyStatus int
|
||||
}{
|
||||
"not live": {
|
||||
livenessProbeTransformation: markAsDown,
|
||||
readinessProbeTransformation: markAsDown,
|
||||
expectedLiveStatus: http.StatusServiceUnavailable,
|
||||
expectedReadyStatus: http.StatusServiceUnavailable,
|
||||
},
|
||||
"live but not ready": {
|
||||
livenessProbeTransformation: markAsUp,
|
||||
readinessProbeTransformation: markAsDown,
|
||||
expectedLiveStatus: http.StatusOK,
|
||||
expectedReadyStatus: http.StatusServiceUnavailable,
|
||||
},
|
||||
"live and ready": {
|
||||
livenessProbeTransformation: markAsUp,
|
||||
readinessProbeTransformation: markAsUp,
|
||||
expectedLiveStatus: http.StatusOK,
|
||||
expectedReadyStatus: http.StatusOK,
|
||||
},
|
||||
"ready but not live - should never happen": {
|
||||
livenessProbeTransformation: markAsDown,
|
||||
readinessProbeTransformation: markAsUp,
|
||||
expectedLiveStatus: http.StatusServiceUnavailable,
|
||||
expectedReadyStatus: http.StatusServiceUnavailable,
|
||||
},
|
||||
}
|
||||
|
||||
kp, err := New(
|
||||
WithLivenessProbes(live),
|
||||
WithReadinessProbes(ready),
|
||||
)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error, got %v", err)
|
||||
}
|
||||
|
||||
srv := httptest.NewServer(kp)
|
||||
defer srv.Close()
|
||||
client := srv.Client()
|
||||
|
||||
for name, test := range tests {
|
||||
name, test := name, test
|
||||
t.Run(name, func(t *testing.T) {
|
||||
test.livenessProbeTransformation(t, live)
|
||||
test.readinessProbeTransformation(t, ready)
|
||||
|
||||
liveStatus := getStatusFromEndpoint(t, client, srv.URL+defaultLivenessPath)
|
||||
readyStatus := getStatusFromEndpoint(t, client, srv.URL+defaultReadinessPath)
|
||||
otherStatus := getStatusFromEndpoint(t, client, srv.URL+"/something")
|
||||
|
||||
if liveStatus != test.expectedLiveStatus {
|
||||
t.Errorf("expected live status %d, got %d", test.expectedLiveStatus, liveStatus)
|
||||
}
|
||||
if readyStatus != test.expectedReadyStatus {
|
||||
t.Errorf("expected ready status %d, got %d", test.expectedReadyStatus, readyStatus)
|
||||
}
|
||||
if otherStatus != http.StatusNotFound {
|
||||
t.Errorf("expected 404 status, got %d", otherStatus)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
265
package-lock.json
generated
265
package-lock.json
generated
@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "kubeprobes",
|
||||
"version": "1.3.1-rc.10",
|
||||
"version": "1.3.2-rc.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "kubeprobes",
|
||||
"version": "1.3.1-rc.10",
|
||||
"version": "1.3.2-rc.3",
|
||||
"devDependencies": {
|
||||
"@saithodev/semantic-release-gitea": "^2.1.0",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/commit-analyzer": "^12.0.0",
|
||||
"@semantic-release/commit-analyzer": "^13.0.0",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/npm": "^12.0.0",
|
||||
"@semantic-release/release-notes-generator": "^13.0.0",
|
||||
"conventional-changelog-conventionalcommits": "^7.0.2",
|
||||
"semantic-release": "^23.0.0"
|
||||
"@semantic-release/release-notes-generator": "^14.0.0",
|
||||
"conventional-changelog-conventionalcommits": "^8.0.0",
|
||||
"semantic-release": "^24.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@ -376,14 +376,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/commit-analyzer": {
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-12.0.0.tgz",
|
||||
"integrity": "sha512-qG+md5gdes+xa8zP7lIo1fWE17zRdO8yMCaxh9lyL65TQleoSv8WHHOqRURfghTytUh+NpkSyBprQ5hrkxOKVQ==",
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-13.0.0.tgz",
|
||||
"integrity": "sha512-KtXWczvTAB1ZFZ6B4O+w8HkfYm/OgQb1dUGNFZtDgQ0csggrmkq8sTxhd+lwGF8kMb59/RnG9o4Tn7M/I8dQ9Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"conventional-changelog-angular": "^7.0.0",
|
||||
"conventional-commits-filter": "^4.0.0",
|
||||
"conventional-commits-parser": "^5.0.0",
|
||||
"conventional-changelog-angular": "^8.0.0",
|
||||
"conventional-changelog-writer": "^8.0.0",
|
||||
"conventional-commits-filter": "^5.0.0",
|
||||
"conventional-commits-parser": "^6.0.0",
|
||||
"debug": "^4.0.0",
|
||||
"import-from-esm": "^1.0.3",
|
||||
"lodash-es": "^4.17.21",
|
||||
@ -833,21 +835,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@semantic-release/release-notes-generator": {
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-13.0.0.tgz",
|
||||
"integrity": "sha512-LEeZWb340keMYuREMyxrODPXJJ0JOL8D/mCl74B4LdzbxhtXV2LrPN2QBEcGJrlQhoqLO0RhxQb6masHytKw+A==",
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-14.0.1.tgz",
|
||||
"integrity": "sha512-K0w+5220TM4HZTthE5dDpIuFrnkN1NfTGPidJFm04ULT1DEZ9WG89VNXN7F0c+6nMEpWgqmPvb7vY7JkB2jyyA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"conventional-changelog-angular": "^7.0.0",
|
||||
"conventional-changelog-writer": "^7.0.0",
|
||||
"conventional-commits-filter": "^4.0.0",
|
||||
"conventional-commits-parser": "^5.0.0",
|
||||
"conventional-changelog-angular": "^8.0.0",
|
||||
"conventional-changelog-writer": "^8.0.0",
|
||||
"conventional-commits-filter": "^5.0.0",
|
||||
"conventional-commits-parser": "^6.0.0",
|
||||
"debug": "^4.0.0",
|
||||
"get-stream": "^7.0.0",
|
||||
"import-from-esm": "^1.0.3",
|
||||
"into-stream": "^7.0.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"read-pkg-up": "^11.0.0"
|
||||
"read-package-up": "^11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.8.1"
|
||||
@ -959,6 +962,13 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/semver": {
|
||||
"version": "7.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz",
|
||||
"integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz",
|
||||
@ -1500,74 +1510,75 @@
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-changelog-angular": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz",
|
||||
"integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz",
|
||||
"integrity": "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"compare-func": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-changelog-conventionalcommits": {
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz",
|
||||
"integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-8.0.0.tgz",
|
||||
"integrity": "sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"compare-func": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-changelog-writer": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.1.tgz",
|
||||
"integrity": "sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-8.0.0.tgz",
|
||||
"integrity": "sha512-TQcoYGRatlAnT2qEWDON/XSfnVG38JzA7E0wcGScu7RElQBkg9WWgZd1peCWFcWDh1xfb2CfsrcvOn1bbSzztA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"conventional-commits-filter": "^4.0.0",
|
||||
"@types/semver": "^7.5.5",
|
||||
"conventional-commits-filter": "^5.0.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"json-stringify-safe": "^5.0.1",
|
||||
"meow": "^12.0.1",
|
||||
"semver": "^7.5.2",
|
||||
"split2": "^4.0.0"
|
||||
"meow": "^13.0.0",
|
||||
"semver": "^7.5.2"
|
||||
},
|
||||
"bin": {
|
||||
"conventional-changelog-writer": "cli.mjs"
|
||||
"conventional-changelog-writer": "dist/cli/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-commits-filter": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-4.0.0.tgz",
|
||||
"integrity": "sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-5.0.0.tgz",
|
||||
"integrity": "sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/conventional-commits-parser": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz",
|
||||
"integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.0.0.tgz",
|
||||
"integrity": "sha512-TbsINLp48XeMXR8EvGjTnKGsZqBemisPoyWESlpRyR8lif0lcwzqz+NMtYSj1ooF/WYjSuu7wX0CtdeeMEQAmA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-text-path": "^2.0.0",
|
||||
"JSONStream": "^1.3.5",
|
||||
"meow": "^12.0.1",
|
||||
"split2": "^4.0.0"
|
||||
"meow": "^13.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"conventional-commits-parser": "cli.mjs"
|
||||
"conventional-commits-parser": "dist/cli/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/convert-hrtime": {
|
||||
@ -3188,18 +3199,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-text-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz",
|
||||
"integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"text-extensions": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-typed-array": {
|
||||
"version": "1.1.13",
|
||||
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz",
|
||||
@ -3312,12 +3311,6 @@
|
||||
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
|
||||
"integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
@ -3327,31 +3320,6 @@
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/jsonparse": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
|
||||
"integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==",
|
||||
"dev": true,
|
||||
"engines": [
|
||||
"node >= 0.2.0"
|
||||
]
|
||||
},
|
||||
"node_modules/JSONStream": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
|
||||
"integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"jsonparse": "^1.2.0",
|
||||
"through": ">=2.2.7 <3"
|
||||
},
|
||||
"bin": {
|
||||
"JSONStream": "bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/keyv": {
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
||||
@ -3513,12 +3481,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/meow": {
|
||||
"version": "12.1.1",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz",
|
||||
"integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==",
|
||||
"version": "13.2.0",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz",
|
||||
"integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16.10"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@ -6825,36 +6794,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/read-pkg-up": {
|
||||
"version": "11.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-11.0.0.tgz",
|
||||
"integrity": "sha512-LOVbvF1Q0SZdjClSefZ0Nz5z8u+tIE7mV5NibzmE9VYmDe9CaBbAVtz1veOSZbofrdsilxuDAYnFenukZVp8/Q==",
|
||||
"deprecated": "Renamed to read-package-up",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"find-up-simple": "^1.0.0",
|
||||
"read-pkg": "^9.0.0",
|
||||
"type-fest": "^4.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/read-pkg-up/node_modules/type-fest": {
|
||||
"version": "4.18.2",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz",
|
||||
"integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/read-pkg/node_modules/type-fest": {
|
||||
"version": "4.18.2",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz",
|
||||
@ -7023,16 +6962,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semantic-release": {
|
||||
"version": "23.1.1",
|
||||
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-23.1.1.tgz",
|
||||
"integrity": "sha512-qqJDBhbtHsjUEMsojWKGuL5lQFCJuPtiXKEIlFKyTzDDGTAE/oyvznaP8GeOr5PvcqBJ6LQz4JCENWPLeehSpA==",
|
||||
"version": "24.1.0",
|
||||
"resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.1.0.tgz",
|
||||
"integrity": "sha512-FwaE2hKDHQn9G6GA7xmqsc9WnsjaFD/ppLM5PUg56Do9oKSCf+vH6cPeb3hEBV/m06n8Sh9vbVqPjHu/1onzQw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@semantic-release/commit-analyzer": "^12.0.0",
|
||||
"@semantic-release/commit-analyzer": "^13.0.0-beta.1",
|
||||
"@semantic-release/error": "^4.0.0",
|
||||
"@semantic-release/github": "^10.0.0",
|
||||
"@semantic-release/npm": "^12.0.0",
|
||||
"@semantic-release/release-notes-generator": "^13.0.0",
|
||||
"@semantic-release/release-notes-generator": "^14.0.0-beta.1",
|
||||
"aggregate-error": "^5.0.0",
|
||||
"cosmiconfig": "^9.0.0",
|
||||
"debug": "^4.0.0",
|
||||
@ -7070,6 +7010,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz",
|
||||
"integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
@ -7079,6 +7020,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
|
||||
"integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@ -7091,6 +7033,7 @@
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz",
|
||||
"integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"clean-stack": "^5.2.0",
|
||||
"indent-string": "^5.0.0"
|
||||
@ -7107,6 +7050,7 @@
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.2.0.tgz",
|
||||
"integrity": "sha512-TyUIUJgdFnCISzG5zu3291TAsE77ddchd0bepon1VVQrKLGKFED4iXFEDQ24mIPdPBbyE16PK3F8MYE1CmcBEQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"escape-string-regexp": "5.0.0"
|
||||
},
|
||||
@ -7122,6 +7066,7 @@
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
|
||||
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@ -7130,16 +7075,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semantic-release/node_modules/execa": {
|
||||
"version": "9.1.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-9.1.0.tgz",
|
||||
"integrity": "sha512-lSgHc4Elo2m6bUDhc3Hl/VxvUDJdQWI40RZ4KMY9bKRc+hgMOT7II/JjbNDhI8VnMtrCb7U/fhpJIkLORZozWw==",
|
||||
"version": "9.3.1",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-9.3.1.tgz",
|
||||
"integrity": "sha512-gdhefCCNy/8tpH/2+ajP9IQc14vXchNdd0weyzSJEFURhRMGncQ+zKFxwjAufIewPEJm9BPOaJnvg2UtlH2gPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sindresorhus/merge-streams": "^4.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"figures": "^6.1.0",
|
||||
"get-stream": "^9.0.0",
|
||||
"human-signals": "^7.0.0",
|
||||
"human-signals": "^8.0.0",
|
||||
"is-plain-obj": "^4.1.0",
|
||||
"is-stream": "^4.0.1",
|
||||
"npm-run-path": "^5.2.0",
|
||||
@ -7149,7 +7095,7 @@
|
||||
"yoctocolors": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": "^18.19.0 || >=20.5.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
||||
@ -7160,6 +7106,7 @@
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
|
||||
"integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@sec-ant/readable-stream": "^0.4.1",
|
||||
"is-stream": "^4.0.1"
|
||||
@ -7176,6 +7123,7 @@
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
|
||||
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
@ -7184,10 +7132,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semantic-release/node_modules/human-signals": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-7.0.0.tgz",
|
||||
"integrity": "sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz",
|
||||
"integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=18.18.0"
|
||||
}
|
||||
@ -7197,6 +7146,7 @@
|
||||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",
|
||||
"integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@ -7209,6 +7159,7 @@
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
|
||||
"integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@ -7221,6 +7172,7 @@
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz",
|
||||
"integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^4.0.0"
|
||||
},
|
||||
@ -7236,6 +7188,7 @@
|
||||
"resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz",
|
||||
"integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@ -7248,6 +7201,7 @@
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
|
||||
"integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@ -7260,6 +7214,7 @@
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
||||
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
@ -7272,6 +7227,7 @@
|
||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
|
||||
"integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@ -7489,15 +7445,6 @@
|
||||
"integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/split2": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/stream-combiner2": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz",
|
||||
@ -7732,18 +7679,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/text-extensions": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz",
|
||||
"integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/thenify": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
|
||||
@ -7765,12 +7700,6 @@
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/through2": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
|
||||
|
10
package.json
10
package.json
@ -1,18 +1,18 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "kubeprobes",
|
||||
"version": "1.3.1-rc.10",
|
||||
"version": "1.3.2-rc.3",
|
||||
"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": "^12.0.0",
|
||||
"@semantic-release/commit-analyzer": "^13.0.0",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/npm": "^12.0.0",
|
||||
"@semantic-release/release-notes-generator": "^13.0.0",
|
||||
"conventional-changelog-conventionalcommits": "^7.0.2",
|
||||
"semantic-release": "^23.0.0"
|
||||
"@semantic-release/release-notes-generator": "^14.0.0",
|
||||
"conventional-changelog-conventionalcommits": "^8.0.0",
|
||||
"semantic-release": "^24.0.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user