(ctx context.Context, clusterId string, name string)
| 94 | } |
| 95 | |
| 96 | func (i *imlPluginService) GetConfig(ctx context.Context, clusterId string, name string) (*Config, *PluginDefine, error) { |
| 97 | |
| 98 | define, err := i.defineStore.First(ctx, map[string]interface{}{ |
| 99 | "name": name, |
| 100 | }) |
| 101 | if err != nil { |
| 102 | if errors.Is(err, gorm.ErrRecordNotFound) { |
| 103 | return nil, nil, fmt.Errorf("plugin define not found: %s", name) |
| 104 | } |
| 105 | return nil, nil, err |
| 106 | } |
| 107 | conf, _ := i.pluginPartitionStore.First(ctx, map[string]interface{}{ |
| 108 | "partition": clusterId, |
| 109 | "Plugin": name, |
| 110 | }) |
| 111 | if conf == nil { |
| 112 | return &Config{ |
| 113 | Plugin: name, |
| 114 | Status: define.Status, |
| 115 | Config: define.Config, |
| 116 | Operator: "", |
| 117 | }, FromEntity(define), nil |
| 118 | |
| 119 | } |
| 120 | return ConfigFromStore(conf), FromEntity(define), nil |
| 121 | |
| 122 | } |
| 123 | |
| 124 | func (i *imlPluginService) Defines(ctx context.Context, kind ...plugin_model.Kind) ([]*PluginDefine, error) { |
| 125 | if len(kind) == 0 { |
nothing calls this directly
no test coverage detected