removed the returned value from the callRemoteExecution method, all the resp handling is done inside it

This commit is contained in:
pb 2025-07-10 17:31:38 +02:00
parent a46708842b
commit 722a42e36d

View File

@ -265,29 +265,6 @@ func (b *ArgoBuilder) addS3annotations(art *Artifact, template *Template, rw gra
}
}
func (b *ArgoBuilder) SetupS3Credentials(storage *resources.StorageResource, namespace string, tool tools2.Tool) (string, error) {
s := tool.GetS3Secret(storage.UUID, namespace)
// var s *v1.Secret
if s == nil {
id, err := tool.CreateAccessSecret(
"hF9wRGog75JuMdshWeEZ",
"OwXXJkVQyb5l1aVPdOegKOtDJGoP1dJYeo8O7mDW",
storage.UUID,
namespace,
)
if err != nil {
l := oclib.GetLogger()
l.Fatal().Msg("Error when creating the secret holding credentials for S3 access in " + namespace + " : " + err.Error())
}
return id, nil
}
// s.Name = "toto"
return s.Name, nil
}
func (b *ArgoBuilder) addAuthInformation(storage *resources.StorageResource, namespace string, art *Artifact) {
@ -322,7 +299,35 @@ func (b *ArgoBuilder) addAuthInformation(storage *resources.StorageResource, nam
}
}
func (b *ArgoBuilder) SetupS3Credentials(storage *resources.StorageResource, namespace string, tool tools2.Tool) (string, error) {
s := tool.GetS3Secret(storage.UUID, namespace)
// var s *v1.Secret
accessKey, secretKey := retrieveMinioCredential("peer",namespace)
if s == nil {
id, err := tool.CreateAccessSecret(
accessKey,
secretKey,
storage.UUID,
namespace,
)
if err != nil {
l := oclib.GetLogger()
l.Fatal().Msg("Error when creating the secret holding credentials for S3 access in " + namespace + " : " + err.Error())
}
return id, nil
}
// s.Name = "toto"
return s.Name, nil
}
// This method needs to evolve to an API call to the peer passed as a parameter
func retrieveMinioCredential(peer string, namespace string) (string,string) {
return "hF9wRGog75JuMdshWeEZ", "OwXXJkVQyb5l1aVPdOegKOtDJGoP1dJYeo8O7mDW"
}
func (b *ArgoBuilder) addTaskToArgo(dag *Dag, graphItemID string, processing *resources.ProcessingResource,
firstItems []string, lastItems []string) (*Dag, []string, []string) {
@ -485,21 +490,21 @@ func (b *ArgoBuilder) retrieveProcessingCompute(graphID string) *resources.Compu
// Execute the last actions once the YAML file for the Argo Workflow is created
func (b *ArgoBuilder) CompleteBuild(executionsId string) (string, error) {
logger.Info().Msg(fmt.Sprint("DEV :: Completing build"))
setter := AdmiraltySetter{Id: executionsId}
// Setup admiralty for each node
for _, peer := range b.RemotePeers {
logger.Info().Msg(fmt.Sprint("DEV :: Launching Admiralty Setup for ", peer))
setter.InitializeAdmiralty(conf.GetConfig().PeerID,peer)
}
// setter := AdmiraltySetter{Id: executionsId}
// // Setup admiralty for each node
// for _, peer := range b.RemotePeers {
// logger.Info().Msg(fmt.Sprint("DEV :: Launching Admiralty Setup for ", peer))
// setter.InitializeAdmiralty(conf.GetConfig().PeerID,peer)
// }
// Update the name of the admiralty node to use
for _, template := range b.Workflow.Spec.Templates {
if len(template.Metadata.Annotations) > 0 {
if peerId, ok := template.Metadata.Annotations["multicluster.admiralty.io/clustername"]; ok {
template.Metadata.Annotations["multicluster.admiralty.io/clustername"] = "target-" + peerId + "-" + conf.GetConfig().ExecutionID
}
}
}
// // Update the name of the admiralty node to use
// for _, template := range b.Workflow.Spec.Templates {
// if len(template.Metadata.Annotations) > 0 {
// if peerId, ok := template.Metadata.Annotations["multicluster.admiralty.io/clustername"]; ok {
// template.Metadata.Annotations["multicluster.admiralty.io/clustername"] = "target-" + peerId + "-" + conf.GetConfig().ExecutionID
// }
// }
// }
// Generate the YAML file
random_name := fakelish.GenerateFakeWord(5, 8) + "-" + fakelish.GenerateFakeWord(5, 8)