mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-25 06:20:21 +08:00
fix: Issue where getting workflow manifest was showing all of the fields.
This commit is contained in:
@@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/onepanelio/core/pkg/util"
|
"github.com/onepanelio/core/pkg/util"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"log"
|
|
||||||
"math"
|
"math"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -45,12 +45,20 @@ func apiWorkflowExecution(wf *v1.WorkflowExecution) (workflow *api.WorkflowExecu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if wf.WorkflowTemplate != nil {
|
if wf.WorkflowTemplate != nil {
|
||||||
|
wftManifest, err := v1.RemoveAllButSpec(wf.WorkflowTemplate.GetManifestBytes())
|
||||||
|
if err != nil {
|
||||||
|
log.WithFields(log.Fields{
|
||||||
|
"Method": "apiWorkflowExecution",
|
||||||
|
"Step": "RemoveAllButSpec",
|
||||||
|
"Error": err.Error(),
|
||||||
|
}).Error("Invalid status.")
|
||||||
|
}
|
||||||
workflow.WorkflowTemplate = &api.WorkflowTemplate{
|
workflow.WorkflowTemplate = &api.WorkflowTemplate{
|
||||||
Uid: wf.WorkflowTemplate.UID,
|
Uid: wf.WorkflowTemplate.UID,
|
||||||
CreatedAt: wf.WorkflowTemplate.CreatedAt.UTC().Format(time.RFC3339),
|
CreatedAt: wf.WorkflowTemplate.CreatedAt.UTC().Format(time.RFC3339),
|
||||||
Name: wf.WorkflowTemplate.Name,
|
Name: wf.WorkflowTemplate.Name,
|
||||||
Version: wf.WorkflowTemplate.Version,
|
Version: wf.WorkflowTemplate.Version,
|
||||||
Manifest: wf.WorkflowTemplate.Manifest,
|
Manifest: string(wftManifest),
|
||||||
IsLatest: wf.WorkflowTemplate.IsLatest,
|
IsLatest: wf.WorkflowTemplate.IsLatest,
|
||||||
IsArchived: wf.WorkflowTemplate.IsArchived,
|
IsArchived: wf.WorkflowTemplate.IsArchived,
|
||||||
}
|
}
|
||||||
@@ -62,7 +70,11 @@ func apiWorkflowExecution(wf *v1.WorkflowExecution) (workflow *api.WorkflowExecu
|
|||||||
func apiWorkflowTemplate(wft *v1.WorkflowTemplate) *api.WorkflowTemplate {
|
func apiWorkflowTemplate(wft *v1.WorkflowTemplate) *api.WorkflowTemplate {
|
||||||
manifest, err := v1.RemoveAllButSpec(wft.GetManifestBytes())
|
manifest, err := v1.RemoveAllButSpec(wft.GetManifestBytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error - TODO @todo")
|
log.WithFields(log.Fields{
|
||||||
|
"Method": "apiWorkflowTemplate",
|
||||||
|
"Step": "RemoveAllButSpec",
|
||||||
|
"Error": err.Error(),
|
||||||
|
}).Error("Get Workflow Template failed.")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &api.WorkflowTemplate{
|
return &api.WorkflowTemplate{
|
||||||
|
|||||||
Reference in New Issue
Block a user