diff --git a/pkg/config.go b/pkg/config.go index 69e442e..e189be5 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -2,11 +2,11 @@ package v1 import ( "encoding/base64" - "github.com/ghodss/yaml" "github.com/onepanelio/core/pkg/util" log "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" ) func (c *Client) getConfigMap(namespace, name string) (configMap *ConfigMap, err error) { @@ -55,7 +55,7 @@ func (c *Client) GetNamespaceConfig(namespace string) (config *NamespaceConfig, ArtifactRepository: ArtifactRepositoryConfig{}, } - err = yaml.Unmarshal([]byte(configMap.Data["config"]), &config) + err = yaml.Unmarshal([]byte(configMap.Data["artifactRepository"]), &config.ArtifactRepository) if err != nil || config.ArtifactRepository.S3 == nil { return nil, util.NewUserError(codes.NotFound, "Artifact repository config not found.") } diff --git a/pkg/workflow_execution.go b/pkg/workflow_execution.go index e100194..3d44653 100644 --- a/pkg/workflow_execution.go +++ b/pkg/workflow_execution.go @@ -119,6 +119,12 @@ func (c *Client) injectAutomatedFields(namespace string, wf *wfv1.Workflow, opts } } + // Get artifact repository config from current namespace + wf.Spec.ArtifactRepositoryRef = &wfv1.ArtifactRepositoryRef{ + ConfigMap: "onepanel", + Key: "artifactRepository", + } + // Create dev/shm volume wf.Spec.Volumes = append(wf.Spec.Volumes, corev1.Volume{ Name: "sys-dshm",