Преглед изворни кода

fix: use updated RegistryStatus object

Jose Diaz-Gonzalez пре 2 година
родитељ
комит
5b69d15aa2
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      api/server/handlers/registry/status.go

+ 4 - 4
api/server/handlers/registry/status.go

@@ -43,11 +43,11 @@ func (c *StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	defer span.End()
 
 	registry, _ := ctx.Value(types.RegistryScope).(*models.Registry)
-	req := connect.NewRequest(&porterv1.ECRStatusRequest{
+	req := connect.NewRequest(&porterv1.RegistryStatusRequest{
 		ProjectId:  int64(registry.ProjectID),
 		RegistryId: int64(registry.ID),
 	})
-	status, err := c.Config().ClusterControlPlaneClient.ECRStatus(ctx, req)
+	status, err := c.Config().ClusterControlPlaneClient.RegistryStatus(ctx, req)
 	if err != nil {
 		err := fmt.Errorf("unable to retrieve status for cluster: %w", err)
 		err = telemetry.Error(ctx, span, err, err.Error())
@@ -65,11 +65,11 @@ func (c *StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	resp := StatusResponse{
 		ProjectID:  int(registry.ProjectID),
 		RegistryID: int(registry.ID),
-		Status:     statusResp.Scanned,
+		Status:     statusResp.IsVulnerabilityScanningEnabled,
 	}
 
 	telemetry.WithAttributes(span,
-		telemetry.AttributeKV{Key: "registry-status", Value: statusResp.Scanned},
+		telemetry.AttributeKV{Key: "registry-status", Value: statusResp.IsVulnerabilityScanningEnabled},
 	)
 
 	c.WriteResult(w, r, resp)