Skip to content

Commit

Permalink
Merge branch 'main' into xav/troubleshoot-bump
Browse files Browse the repository at this point in the history
  • Loading branch information
xavpaice authored Oct 23, 2023
2 parents 2fbb4bf + 9c9bc7e commit 8774e26
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 170 deletions.
24 changes: 12 additions & 12 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,45 +62,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23"

# Install Kubectl 1.24
ENV KUBECTL_1_24_VERSION=v1.24.16
ENV KUBECTL_1_24_VERSION=v1.24.17
ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71
ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5
RUN curl -fsSLO "${KUBECTL_1_24_URL}" \
&& echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24"

# Install Kubectl 1.25
ENV KUBECTL_1_25_VERSION=v1.25.12
ENV KUBECTL_1_25_VERSION=v1.25.15
ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f
ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575
RUN curl -fsSLO "${KUBECTL_1_25_URL}" \
&& echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25"

# Install Kubectl 1.26
ENV KUBECTL_1_26_VERSION=v1.26.7
ENV KUBECTL_1_26_VERSION=v1.26.10
ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971
ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86
RUN curl -fsSLO "${KUBECTL_1_26_URL}" \
&& echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26"

# Install Kubectl 1.27
ENV KUBECTL_1_27_VERSION=v1.27.4
ENV KUBECTL_1_27_VERSION=v1.27.7
ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f
ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79
RUN curl -fsSLO "${KUBECTL_1_27_URL}" \
&& echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27"

# Install Kubectl 1.28
ENV KUBECTL_1_28_VERSION=v1.28.1
ENV KUBECTL_1_28_VERSION=v1.28.3
ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1
ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1
RUN curl -fsSLO "${KUBECTL_1_28_URL}" \
&& echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
Expand Down Expand Up @@ -136,9 +136,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \
ENV KOTS_HELM_BIN_DIR=/usr/local/bin

# Install helm v3
ENV HELM3_VERSION=3.13.0
ENV HELM3_VERSION=3.13.1
ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz
ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f
ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0
RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \
&& echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \
&& tar -xzvf helm.tar.gz \
Expand Down
24 changes: 12 additions & 12 deletions deploy/okteto/okteto-v2.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,45 +63,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23"

# Install Kubectl 1.24
ENV KUBECTL_1_24_VERSION=v1.24.16
ENV KUBECTL_1_24_VERSION=v1.24.17
ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71
ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5
RUN curl -fsSLO "${KUBECTL_1_24_URL}" \
&& echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24"

# Install Kubectl 1.25
ENV KUBECTL_1_25_VERSION=v1.25.12
ENV KUBECTL_1_25_VERSION=v1.25.15
ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f
ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575
RUN curl -fsSLO "${KUBECTL_1_25_URL}" \
&& echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25"

# Install Kubectl 1.26
ENV KUBECTL_1_26_VERSION=v1.26.7
ENV KUBECTL_1_26_VERSION=v1.26.10
ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971
ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86
RUN curl -fsSLO "${KUBECTL_1_26_URL}" \
&& echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26"

# Install Kubectl 1.27
ENV KUBECTL_1_27_VERSION=v1.27.4
ENV KUBECTL_1_27_VERSION=v1.27.7
ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f
ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79
RUN curl -fsSLO "${KUBECTL_1_27_URL}" \
&& echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27"

# Install Kubectl 1.28
ENV KUBECTL_1_28_VERSION=v1.28.1
ENV KUBECTL_1_28_VERSION=v1.28.3
ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1
ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1
RUN curl -fsSLO "${KUBECTL_1_28_URL}" \
&& echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
Expand Down Expand Up @@ -136,9 +136,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \
ENV KOTS_HELM_BIN_DIR=/usr/local/bin

# Install helm v3
ENV HELM3_VERSION=3.13.0
ENV HELM3_VERSION=3.13.1
ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz
ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f
ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0
RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \
&& echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \
&& tar -xzvf helm.tar.gz \
Expand Down
24 changes: 12 additions & 12 deletions deploy/okteto/okteto.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,45 +64,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23"

# Install Kubectl 1.24
ENV KUBECTL_1_24_VERSION=v1.24.16
ENV KUBECTL_1_24_VERSION=v1.24.17
ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71
ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5
RUN curl -fsSLO "${KUBECTL_1_24_URL}" \
&& echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24"

# Install Kubectl 1.25
ENV KUBECTL_1_25_VERSION=v1.25.12
ENV KUBECTL_1_25_VERSION=v1.25.15
ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f
ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575
RUN curl -fsSLO "${KUBECTL_1_25_URL}" \
&& echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25"

# Install Kubectl 1.26
ENV KUBECTL_1_26_VERSION=v1.26.7
ENV KUBECTL_1_26_VERSION=v1.26.10
ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971
ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86
RUN curl -fsSLO "${KUBECTL_1_26_URL}" \
&& echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26"

# Install Kubectl 1.27
ENV KUBECTL_1_27_VERSION=v1.27.4
ENV KUBECTL_1_27_VERSION=v1.27.7
ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f
ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79
RUN curl -fsSLO "${KUBECTL_1_27_URL}" \
&& echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27"

# Install Kubectl 1.28
ENV KUBECTL_1_28_VERSION=v1.28.1
ENV KUBECTL_1_28_VERSION=v1.28.3
ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1
ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1
RUN curl -fsSLO "${KUBECTL_1_28_URL}" \
&& echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
Expand Down Expand Up @@ -137,9 +137,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \
ENV KOTS_HELM_BIN_DIR=/usr/local/bin

# Install helm v3
ENV HELM3_VERSION=3.13.0
ENV HELM3_VERSION=3.13.1
ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz
ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f
ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0
RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \
&& echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \
&& tar -xzvf helm.tar.gz \
Expand Down
24 changes: 12 additions & 12 deletions hack/dev/skaffold.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,45 +81,45 @@ RUN curl -fsSLO "${KUBECTL_1_23_URL}" \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.23"

# Install Kubectl 1.24
ENV KUBECTL_1_24_VERSION=v1.24.16
ENV KUBECTL_1_24_VERSION=v1.24.17
ENV KUBECTL_1_24_URL=https://dl.k8s.io/release/${KUBECTL_1_24_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_24_SHA256SUM=33f8179cd124ab97268ec0cf4c91a05514c8e82d7a341d337e92881401844d71
ENV KUBECTL_1_24_SHA256SUM=3e9588e3326c7110a163103fc3ea101bb0e85f4d6fd228cf928fa9a2a20594d5
RUN curl -fsSLO "${KUBECTL_1_24_URL}" \
&& echo "${KUBECTL_1_24_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.24"

# Install Kubectl 1.25
ENV KUBECTL_1_25_VERSION=v1.25.12
ENV KUBECTL_1_25_VERSION=v1.25.15
ENV KUBECTL_1_25_URL=https://dl.k8s.io/release/${KUBECTL_1_25_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_25_SHA256SUM=75842752ea07cb8ee2210df40faa7c61e1317e76d5c7968e380cae83447d4a0f
ENV KUBECTL_1_25_SHA256SUM=6428297af0b06d1bb87601258fb61c13d82bf3187b2329b5f38b6f0fec5be575
RUN curl -fsSLO "${KUBECTL_1_25_URL}" \
&& echo "${KUBECTL_1_25_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.25"

# Install Kubectl 1.26
ENV KUBECTL_1_26_VERSION=v1.26.7
ENV KUBECTL_1_26_VERSION=v1.26.10
ENV KUBECTL_1_26_URL=https://dl.k8s.io/release/${KUBECTL_1_26_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_26_SHA256SUM=d9dc7741e5f279c28ef32fbbe1daa8ebc36622391c33470efed5eb8426959971
ENV KUBECTL_1_26_SHA256SUM=93ad44b4072669237247bfbc171be816f08e7e9e4260418d2cfdd0da1704ae86
RUN curl -fsSLO "${KUBECTL_1_26_URL}" \
&& echo "${KUBECTL_1_26_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.26"

# Install Kubectl 1.27
ENV KUBECTL_1_27_VERSION=v1.27.4
ENV KUBECTL_1_27_VERSION=v1.27.7
ENV KUBECTL_1_27_URL=https://dl.k8s.io/release/${KUBECTL_1_27_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_27_SHA256SUM=4685bfcf732260f72fce58379e812e091557ef1dfc1bc8084226c7891dd6028f
ENV KUBECTL_1_27_SHA256SUM=e5fe510ba6f421958358d3d43b3f0b04c2957d4bc3bb24cf541719af61a06d79
RUN curl -fsSLO "${KUBECTL_1_27_URL}" \
&& echo "${KUBECTL_1_27_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
&& mv kubectl "${KOTS_KUBECTL_BIN_DIR}/kubectl-v1.27"

# Install Kubectl 1.28
ENV KUBECTL_1_28_VERSION=v1.28.1
ENV KUBECTL_1_28_VERSION=v1.28.3
ENV KUBECTL_1_28_URL=https://dl.k8s.io/release/${KUBECTL_1_28_VERSION}/bin/linux/amd64/kubectl
ENV KUBECTL_1_28_SHA256SUM=e7a7d6f9d06fab38b4128785aa80f65c54f6675a0d2abef655259ddd852274e1
ENV KUBECTL_1_28_SHA256SUM=0c680c90892c43e5ce708e918821f92445d1d244f9b3d7513023bcae9a6246d1
RUN curl -fsSLO "${KUBECTL_1_28_URL}" \
&& echo "${KUBECTL_1_28_SHA256SUM} kubectl" | sha256sum -c - \
&& chmod +x kubectl \
Expand Down Expand Up @@ -153,9 +153,9 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \
ENV KOTS_HELM_BIN_DIR=/usr/local/bin

# Install helm v3
ENV HELM3_VERSION=3.13.0
ENV HELM3_VERSION=3.13.1
ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz
ENV HELM3_SHA256SUM=138676351483e61d12dfade70da6c03d471bbdcac84eaadeb5e1d06fa114a24f
ENV HELM3_SHA256SUM=98c363564d00afd0cc3088e8f830f2a0eeb5f28755b3d8c48df89866374a1ed0
RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \
&& echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \
&& tar -xzvf helm.tar.gz \
Expand Down
6 changes: 0 additions & 6 deletions pkg/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ func Start(params *APIServerParams) {

handlers.RegisterTokenAuthRoutes(handler, debugRouter, loggingRouter)

/**********************************************************************
* License ID auth routes
**********************************************************************/

handlers.RegisterLicenseIDAuthRoutes(r.PathPrefix("").Subrouter(), kotsStore, handler)

/**********************************************************************
* Session auth routes
**********************************************************************/
Expand Down
6 changes: 0 additions & 6 deletions pkg/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@ func RegisterUnauthenticatedRoutes(handler *Handler, kotsStore store.Store, debu
loggingRouter.Path("/api/v1/app/custom-metrics").Methods("POST").HandlerFunc(handler.GetSendCustomAppMetricsHandler(kotsStore))
}

func RegisterLicenseIDAuthRoutes(r *mux.Router, kotsStore store.Store, handler KOTSHandler) {
r.Use(LoggingMiddleware, RequireValidLicenseMiddleware(kotsStore))

r.Name("GetAppMetrics").Path("/api/v1/app/metrics").Methods("GET").HandlerFunc(handler.GetAppMetrics)
}

func StreamJSON(c *websocket.Conn, payload interface{}) {
response, err := json.Marshal(payload)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions pkg/handlers/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,4 @@ type KOTSHandler interface {
// Helm
IsHelmManaged(w http.ResponseWriter, r *http.Request)
GetAppValuesFile(w http.ResponseWriter, r *http.Request)

// APIs available to applications (except legacy /license/v1/license)
GetAppMetrics(w http.ResponseWriter, r *http.Request)
}
10 changes: 0 additions & 10 deletions pkg/handlers/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,9 @@ import (
"github.com/replicatedhq/kots/pkg/kotsutil"
"github.com/replicatedhq/kots/pkg/logger"
"github.com/replicatedhq/kots/pkg/replicatedapp"
"github.com/replicatedhq/kots/pkg/reporting"
"github.com/replicatedhq/kots/pkg/session"
"github.com/replicatedhq/kots/pkg/store"
)

func (h *Handler) GetAppMetrics(w http.ResponseWriter, r *http.Request) {
app := session.ContextGetApp(r)
reportingInfo := reporting.GetReportingInfo(app.ID)
headers := reporting.GetReportingInfoHeaders(reportingInfo)

JSON(w, http.StatusOK, headers)
}

type SendCustomAppMetricsRequest struct {
Data CustomAppMetricsData `json:"data"`
}
Expand Down
18 changes: 0 additions & 18 deletions pkg/handlers/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,3 @@ func RequireValidSessionQuietMiddleware(kotsStore store.Store) mux.MiddlewareFun
})
}
}

func RequireValidLicenseMiddleware(kotsStore store.Store) mux.MiddlewareFunc {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
license, app, err := requireValidLicense(kotsStore, w, r)
if err != nil {
if !kotsStore.IsNotFound(err) {
logger.Error(errors.Wrapf(err, "request %q", r.RequestURI))
}
return
}

r = session.ContextSetLicense(r, license)
r = session.ContextSetApp(r, app)
next.ServeHTTP(w, r)
})
}
}
12 changes: 0 additions & 12 deletions pkg/handlers/mock/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8774e26

Please sign in to comment.