From 3718307c600ddd26531b008c935aa997c1fcf6e5 Mon Sep 17 00:00:00 2001 From: Randsw Date: Thu, 30 Nov 2023 15:54:55 +0300 Subject: [PATCH] fix(api): Add failure field to swagger docs --- handlers/handlers.go | 14 ++++++++++++++ helm-chart/kubeinfo-backend/values.yaml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/handlers/handlers.go b/handlers/handlers.go index 1ba555d..d339eea 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -95,6 +95,8 @@ func Metrics(w http.ResponseWriter, r *http.Request) { // @Summary Get info about nodes in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.NodeRespose +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router /nodes [get] func GetNodes(w http.ResponseWriter, r *http.Request) { //Connect to k8s api server @@ -112,6 +114,8 @@ func GetNodes(w http.ResponseWriter, r *http.Request) { // @Summary Get info about namespaces in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.NamespaceResponse +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router /namespaces [get] func GetNamespaces(w http.ResponseWriter, r *http.Request) { //Connect to k8s api server @@ -129,6 +133,8 @@ func GetNamespaces(w http.ResponseWriter, r *http.Request) { // @Summary Get info about pods in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.NamespaceResponse +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router /pods [get] func GetPods(w http.ResponseWriter, r *http.Request) { //Connect to k8s api server @@ -146,6 +152,8 @@ func GetPods(w http.ResponseWriter, r *http.Request) { // @Summary Get info about ingresses in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.IngressResponse +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router /ingresses [get] func GetIngresses(w http.ResponseWriter, r *http.Request) { //Connect to k8s api server @@ -163,6 +171,8 @@ func GetIngresses(w http.ResponseWriter, r *http.Request) { // @Summary Get info about FluxCD Kustomizations in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.FluxKustomizationsResponse +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router /fluxkustomizations [get] func GetFluxKustomizations(w http.ResponseWriter, r *http.Request) { //Connect to k8s api server @@ -181,6 +191,8 @@ func GetFluxKustomizations(w http.ResponseWriter, r *http.Request) { // @Summary Get info about FluxCD Kustomizations in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.FluxHelmreleasesResponse +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router /fluxhelmreleases [get] func GetFluxHelmreleases(w http.ResponseWriter, r *http.Request) { //Connect to k8s api server @@ -199,6 +211,8 @@ func GetFluxHelmreleases(w http.ResponseWriter, r *http.Request) { // @Summary Get info about resources in cluster // @Produce json // @Success 200 {object} kubeApiResponseStruct.ResourceResponce +// @Failure 500 {object} string +// @Failure 503 {object} string // @Router / [get] func GetKubeInfo(w http.ResponseWriter, r *http.Request) { // Variable declaration diff --git a/helm-chart/kubeinfo-backend/values.yaml b/helm-chart/kubeinfo-backend/values.yaml index ec6175f..930d7be 100644 --- a/helm-chart/kubeinfo-backend/values.yaml +++ b/helm-chart/kubeinfo-backend/values.yaml @@ -8,7 +8,7 @@ image: repository: ghcr.io/randsw/kubeinfo pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "1.1.8" + tag: "latest" imagePullSecrets: [] nameOverride: ""