Skip to content

Commit

Permalink
get plugin values from plugin store project
Browse files Browse the repository at this point in the history
  • Loading branch information
vramk23 committed Mar 12, 2024
1 parent c7e81ae commit 9b0b33f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion server/pkg/plugin-store/plugin_store_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,24 @@ func (p *PluginStore) GetPluginData(clusterId string, storeType pluginstorepb.St

func (p *PluginStore) GetPluginValues(clusterId string, storeType pluginstorepb.StoreType,
pluginName, version string) ([]byte, error) {
return nil, nil
config, err := p.GetStoreConfig(clusterId, storeType)
if err != nil {
return nil, err
}

pluginStoreDir, err := p.clonePluginStoreProject(config.GitProjectURL, config.GitProjectId)
if err != nil {
return nil, err
}
defer os.RemoveAll(pluginStoreDir)

pluginValuesPath := pluginStoreDir + "/" + p.cfg.PluginsStorePath + "/" + pluginName + "/" + version + "/" + "values.yaml"
p.log.Infof("Loading %s plugin values from %s", pluginName, pluginValuesPath)
pluginListData, err := os.ReadFile(pluginValuesPath)
if err != nil {
return nil, errors.WithMessage(err, "failed to read plugins values file")
}
return pluginListData, nil
}

func (p *PluginStore) DeployPlugin(clusterId string, storeType pluginstorepb.StoreType,
Expand Down

0 comments on commit 9b0b33f

Please sign in to comment.