Skip to content

Commit

Permalink
use source_uri from model metadata
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Aug 20, 2024
1 parent d648931 commit 9652253
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions models/meshmodel/core/v1beta1/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ type ArtifactHub struct{}
const MesheryAnnotationPrefix = "design.meshery.io"

func (ah ArtifactHub) HandleDependents(comp component.ComponentDefinition, kc *kubernetes.Client, isDeploy, performUpgrade bool) (summary string, err error) {
sourceURI, err := utils.Cast[string](comp.Metadata.AdditionalProperties["source_uri"]) // should be part of registrant data(?)
if err != nil {
sourceURI, ok := comp.Model.Metadata.AdditionalProperties["source_uri"] // should be part of registrant data(?)
if !ok {
return summary, err
}

Expand All @@ -72,9 +72,14 @@ func (ah ArtifactHub) HandleDependents(comp component.ComponentDefinition, kc *k
act = kubernetes.INSTALL
}

_sourceURI, err := utils.Cast[string](sourceURI)
if err != nil {
return summary, err
}

if sourceURI != "" {
err = kc.ApplyHelmChart(kubernetes.ApplyHelmChartConfig{
URL: sourceURI,
URL: _sourceURI,
Namespace: comp.Configuration["namespace"].(string),
CreateNamespace: true,
Action: act,
Expand Down

0 comments on commit 9652253

Please sign in to comment.