Skip to content

Commit

Permalink
Migrate snapshotDetail and restoreDetail to go api (#987)
Browse files Browse the repository at this point in the history
* Migrate snapshotDetail and restoreDetail to go api

* progress

* more progress

* restore fixes

* remove dead code

* fixes
  • Loading branch information
emosbaugh committed Aug 25, 2020
1 parent a986e44 commit bb2be4d
Show file tree
Hide file tree
Showing 26 changed files with 1,327 additions and 375 deletions.
2 changes: 1 addition & 1 deletion kotsadm/api/kustomize/overlays/dev/deployment.yaml
Expand Up @@ -36,7 +36,7 @@ spec:
- name: S3_BUCKET_ENDPOINT
value: "true"
- name: SHIP_API_ENDPOINT
value: http://kotsadm-api.default.svc.cluster.local:3000
value: http://kotsadm.default.svc.cluster.local:3000
- name: SHIP_API_ADVERTISE_ENDPOINT
value: http://127.0.0.1:30065
- name: GRAPHQL_PREM_ENDPOINT
Expand Down
45 changes: 0 additions & 45 deletions kotsadm/api/src/controllers/kots/RestoreAPI.ts

This file was deleted.

1 change: 0 additions & 1 deletion kotsadm/api/src/schema/query.ts
Expand Up @@ -45,6 +45,5 @@ export const Query = `
getPrometheusAddress: String
snapshotConfig(slug: String!): SnapshotConfig
restoreDetail(appId: String!, restoreName: String!): RestoreDetail
}
`;
73 changes: 0 additions & 73 deletions kotsadm/api/src/snapshots/resolvers/snapshot_queries.ts
Expand Up @@ -39,78 +39,5 @@ export function SnapshotQueries(stores: Stores, params: Params) {
ttl
};
},

// tslint:disable-next-line cyclomatic-complexity
async restoreDetail(root: any, args: any, context: Context): Promise<RestoreDetail> {
context.requireSingleTenantSession();

const { appId, restoreName: name } = args;
const { restoreInProgressName, restoreUndeployStatus } = await stores.kotsAppStore.getApp(appId);

const active = !!restoreInProgressName && restoreInProgressName === name;
const velero = new VeleroClient("velero"); // TODO namespace
const restore = await velero.readRestore(name);
if (!restore) {
if (restoreUndeployStatus === "failed") {
// HACK: once the user has see the error, clear it out.
// Otherwise there is no way to get back to snapshot list.
await stores.kotsAppStore.updateAppRestoreReset(appId);
return {
name,
active,
phase: Phase.Failed,
volumes: [],
errors: [{
title: "Restore has failed",
message: "Please check logs for errors.",
}],
warnings: [],
};
}

return {
name,
active,
phase: Phase.New,
volumes: [],
errors: [],
warnings: [],
};
}

const volumes = await velero.listRestoreVolumes(name);
const detail: RestoreDetail = {
name,
active,
phase: restore.status ? restore.status.phase : Phase.New,
volumes,
errors: [],
warnings: [],
};

if (detail.phase === Phase.Completed || detail.phase === Phase.PartiallyFailed || detail.phase === Phase.Failed) {
const results = await velero.getRestoreResults(name);

_.each(results.warnings.namespaces, (warnings, namespace) => {
_.each(warnings, (warning) => {
detail.warnings.push({
message: warning,
namespace,
});
});
});

_.each(results.errors.namespaces, (errors, namespace) => {
_.each(errors, (error) => {
detail.errors.push({
message: error,
namespace,
});
});
});
}

return detail;
},
};
}
3 changes: 3 additions & 0 deletions kotsadm/go.mod
Expand Up @@ -14,6 +14,7 @@ require (
github.com/deislabs/oras v0.8.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/docker/go-units v0.4.0
github.com/go-logfmt/logfmt v0.4.0
github.com/gorilla/mux v1.7.4
github.com/gorilla/websocket v1.4.0
github.com/gosimple/slug v1.9.0
Expand Down Expand Up @@ -48,6 +49,8 @@ require (
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451
sigs.k8s.io/application v0.8.2
sigs.k8s.io/controller-runtime v0.6.0
xojoc.pw/logparse v0.0.0-20200116210938-e2e713e9bde6
xojoc.pw/useragent v0.0.0-20200116211053-1ec61d55e8fe // indirect
)

replace (
Expand Down
13 changes: 13 additions & 0 deletions kotsadm/go.sum
Expand Up @@ -41,7 +41,9 @@ github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
Expand Down Expand Up @@ -287,6 +289,7 @@ github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xb
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
Expand Down Expand Up @@ -381,6 +384,7 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
Expand Down Expand Up @@ -617,10 +621,12 @@ github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6K
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-getter v1.3.1-0.20190627223108-da0323b9545e h1:6krcdHPiS+aIP9XKzJzSahfjD7jG7Z+4+opm0z39V1M=
github.com/hashicorp/go-getter v1.3.1-0.20190627223108-da0323b9545e/go.mod h1:/O1k/AizTN0QmfEKknCYGvICeyKUDqCYA8vvWtGWDeQ=
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd h1:rNuUHR+CvK1IS89MMtcF0EpcVMZtjKfPRp4MEmt/aTs=
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-plugin v0.0.0-20190610192547-a1bc61569a26 h1:sADP8l/FAtMyWJ9GIcQT/04Ae80ZZ75ogOrtW0DIZhc=
github.com/hashicorp/go-plugin v0.0.0-20190610192547-a1bc61569a26/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY=
github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
Expand All @@ -635,6 +641,7 @@ github.com/hashicorp/hcl v0.0.0-20160711231752-d8c773c4cba1/go.mod h1:oZtUIOe8dh
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/heketi/heketi v0.0.0-20181109135656-558b29266ce0/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o=
github.com/heketi/heketi v9.0.1-0.20190917153846-c2e2a4ab7ab9+incompatible/go.mod h1:bB9ly3RchcQqsQ9CpyaQwvva7RS5ytVoSoholZQON6o=
Expand Down Expand Up @@ -721,6 +728,7 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kubernetes-csi/csi-lib-utils v0.7.0/go.mod h1:bze+2G9+cmoHxN6+WyG1qT4MDxgZJMLGwc7V4acPNm0=
github.com/kubernetes-csi/csi-test v2.0.0+incompatible/go.mod h1:YxJ4UiuPWIhMBkxUKY5c267DyA0uDZ/MtAimhx/2TA0=
github.com/kubernetes-csi/external-snapshotter/v2 v2.1.1-0.20200617021606-4800ca72d403 h1:4p5gNpe6xvhsCD1DY2f/eOa2xHUL3InSb7OkVD00/Do=
github.com/kubernetes-csi/external-snapshotter/v2 v2.1.1-0.20200617021606-4800ca72d403/go.mod h1:ArR2bKKq4dEfoRwRH69kt/xYOliLUlaqCZ+LM1teU8Q=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw=
Expand Down Expand Up @@ -862,6 +870,7 @@ github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyh
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs=
github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
Expand Down Expand Up @@ -1673,3 +1682,7 @@ sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI=
xojoc.pw/logparse v0.0.0-20200116210938-e2e713e9bde6 h1:r0AKMMDJdj5rM/2aJwwnPE4w5ft+1hD4/c/qxee3Mcc=
xojoc.pw/logparse v0.0.0-20200116210938-e2e713e9bde6/go.mod h1:XFQ9Mj3JxkWPp9BN+7zT7+lgJSwlyD3V9Lo2jVIdUio=
xojoc.pw/useragent v0.0.0-20200116211053-1ec61d55e8fe h1:KHyqPlOEFFT7OPh4WR7qFzNNndwj1VuwV+rZ+Tb3bio=
xojoc.pw/useragent v0.0.0-20200116211053-1ec61d55e8fe/go.mod h1:71om/Qz9HbIEjbUrkrzmJiF26FSh6tcwqSFdBBkLtJQ=
2 changes: 1 addition & 1 deletion kotsadm/kustomize/base/service.yaml
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: kotsadm-api
name: kotsadm
labels:
app: kotsadm
spec:
Expand Down
2 changes: 1 addition & 1 deletion kotsadm/kustomize/overlays/dev/deployment.yaml
Expand Up @@ -52,7 +52,7 @@ spec:
- name: REPLICATED_API_ENDPOINT
value: http://replicated-app:3000
- name: API_ENDPOINT
value: http://kotsadm-api.default.svc.cluster.local:3000
value: http://kotsadm.default.svc.cluster.local:3000
- name: API_ADVERTISE_ENDPOINT
value: http://127.0.0.1:30065
# - name: DISABLE_OUTBOUND_CONNECTIONS
Expand Down
2 changes: 1 addition & 1 deletion kotsadm/operator/kustomize/overlays/dev/deployment.yaml
Expand Up @@ -10,7 +10,7 @@ spec:
imagePullPolicy: IfNotPresent
env:
- name: KOTSADM_API_ENDPOINT
value: http://kotsadm-api.default.svc.cluster.local:3000
value: http://kotsadm.default.svc.cluster.local:3000
- name: KOTSADM_TARGET_NAMESPACE
value: "test"
valueFrom: ~
3 changes: 2 additions & 1 deletion kotsadm/pkg/apiserver/server.go
Expand Up @@ -61,9 +61,9 @@ func Start() {
// Functions that the operator calls
r.Path("/api/v1/appstatus").Methods("PUT", "OPTIONS").HandlerFunc(handlers.SetAppStatus)
r.Path("/api/v1/deploy/result").Methods("PUT").HandlerFunc(handlers.UpdateDeployResult)
r.Path("/api/v1/undeploy/result").Methods("PUT").HandlerFunc(handlers.UpdateUndeployResult)

// Functions that are not called by the browser
r.Path("/api/v1/undeploy/result").Methods("PUT").HandlerFunc(handlers.NodeProxy(upstream))
r.Path("/api/v1/preflight/app/{appSlug}/sequence/{sequence}").Methods("GET").HandlerFunc(handlers.GetPreflightStatus)
r.Path("/api/v1/preflight/app/{appSlug}/sequence/{sequence}").Methods("POST").HandlerFunc(handlers.PostPreflightStatus)
r.Path("/api/v1/kots/ports").Methods("GET").HandlerFunc(handlers.GetApplicationPorts)
Expand Down Expand Up @@ -151,6 +151,7 @@ func Start() {
// App snapshot routes
r.Path("/api/v1/app/{appSlug}/snapshot/backup").Methods("OPTIONS", "POST").HandlerFunc(handlers.CreateBackup)
r.Path("/api/v1/app/{appSlug}/snapshot/restore/status").Methods("OPTIONS", "GET").HandlerFunc(handlers.GetRestoreStatus)
r.Path("/api/v1/app/{appSlug}/snapshot/restore/{restoreName}").Methods("OPTIONS", "GET").HandlerFunc(handlers.GetKotsadmRestore)
r.Path("/api/v1/app/{appSlug}/snapshots").Methods("OPTIONS", "GET").HandlerFunc(handlers.ListBackups)
r.Path("/api/v1/app/{appSlug}/snapshot/config").Methods("OPTIONS", "GET").HandlerFunc(handlers.GetSnapshotConfig)

Expand Down
3 changes: 2 additions & 1 deletion kotsadm/pkg/handlers/backup.go
@@ -1,6 +1,7 @@
package handlers

import (
"context"
"net/http"

"github.com/gorilla/mux"
Expand Down Expand Up @@ -207,7 +208,7 @@ func GetKotsadmBackup(w http.ResponseWriter, r *http.Request) {
return
}

backup, err := snapshot.GetKotsadmBackupDetail(mux.Vars(r)["snapshotName"])
backup, err := snapshot.GetKotsadmBackupDetail(context.TODO(), mux.Vars(r)["snapshotName"])
if err != nil {
logger.Error(err)
getBackupResponse.Error = "failed to get backup detail"
Expand Down
81 changes: 70 additions & 11 deletions kotsadm/pkg/handlers/deploy.go
Expand Up @@ -2,16 +2,20 @@ package handlers

import (
"encoding/json"
"io/ioutil"
"net/http"
"strconv"
"time"

"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/replicatedhq/kots/kotsadm/pkg/app"
apptypes "github.com/replicatedhq/kots/kotsadm/pkg/app/types"
"github.com/replicatedhq/kots/kotsadm/pkg/downstream"
"github.com/replicatedhq/kots/kotsadm/pkg/downstream/types"
downstreamtypes "github.com/replicatedhq/kots/kotsadm/pkg/downstream/types"
"github.com/replicatedhq/kots/kotsadm/pkg/logger"
"github.com/replicatedhq/kots/kotsadm/pkg/store"
"github.com/replicatedhq/kots/kotsadm/pkg/version"
"go.uber.org/zap"
)

func DeployAppVersion(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -71,15 +75,8 @@ func UpdateDeployResult(w http.ResponseWriter, r *http.Request) {
return
}

body, err := ioutil.ReadAll(r.Body)
if err != nil {
logger.Error(err)
w.WriteHeader(http.StatusInternalServerError)
return
}

output := types.DownstreamOutput{}
err = json.Unmarshal(body, &output)
output := downstreamtypes.DownstreamOutput{}
err = json.NewDecoder(r.Body).Decode(&output)
if err != nil {
logger.Error(err)
w.WriteHeader(http.StatusInternalServerError)
Expand Down Expand Up @@ -116,3 +113,65 @@ func UpdateDeployResult(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
return
}

func UpdateUndeployResult(w http.ResponseWriter, r *http.Request) {
if handleOptionsRequest(w, r) {
return
}

auth, err := parseClusterAuthorization(r.Header.Get("Authorization"))
if err != nil {
logger.Error(err)
w.WriteHeader(http.StatusForbidden)
return
}

_, err = downstream.GetClusterIDFromDeployToken(auth.Password)
if err != nil {
logger.Error(err)
w.WriteHeader(http.StatusForbidden)
return
}

output := downstreamtypes.DownstreamOutput{}
err = json.NewDecoder(r.Body).Decode(&output)
if err != nil {
logger.Error(err)
w.WriteHeader(http.StatusInternalServerError)
return
}

var status apptypes.UndeployStatus
if output.IsError {
status = apptypes.UndeployFailed
} else {
status = apptypes.UndeployCompleted
}

logger.Info("restore API set undeploy status",
zap.String("status", string(status)),
zap.String("appID", output.AppID))

foundApp, err := store.GetStore().GetApp(output.AppID)
if err != nil {
err = errors.Wrap(err, "failed to get app")
logger.Error(err)
w.WriteHeader(http.StatusInternalServerError)
return
}

if foundApp.RestoreInProgressName != "" {
go func() {
<-time.After(20 * time.Second)
err = app.SetRestoreUndeployStatus(output.AppID, status)
if err != nil {
err = errors.Wrap(err, "failed to set app undeploy status")
logger.Error(err)
return
}
}()
}

w.WriteHeader(http.StatusOK)
return
}

0 comments on commit bb2be4d

Please sign in to comment.