(ctx devspacecontext.Context, configLoader loader.ConfigLoader, configOptions *loader.ConfigOptions, imageSelector string)
| 146 | } |
| 147 | |
| 148 | func getImageSelector(ctx devspacecontext.Context, configLoader loader.ConfigLoader, configOptions *loader.ConfigOptions, imageSelector string) ([]string, error) { |
| 149 | var imageSelectors []string |
| 150 | if imageSelector != "" { |
| 151 | var ( |
| 152 | err error |
| 153 | config config2.Config |
| 154 | dependencies []types.Dependency |
| 155 | ) |
| 156 | if !configLoader.Exists() { |
| 157 | config = config2.Ensure(nil) |
| 158 | } else { |
| 159 | config, err = configLoader.Load(ctx.Context(), ctx.KubeClient(), configOptions, ctx.Log()) |
| 160 | if err != nil { |
| 161 | return nil, err |
| 162 | } |
| 163 | |
| 164 | ctx = ctx.WithConfig(config) |
| 165 | dependencies, err = dependency.NewManager(ctx, configOptions).ResolveAll(ctx, dependency.ResolveOptions{}) |
| 166 | if err != nil { |
| 167 | ctx.Log().Warnf("Error resolving dependencies: %v", err) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | resolved, err := runtimevar.NewRuntimeResolver(".", true).FillRuntimeVariablesAsImageSelector(ctx.Context(), imageSelector, config, dependencies) |
| 172 | if err != nil { |
| 173 | return nil, err |
| 174 | } |
| 175 | |
| 176 | imageSelectors = append(imageSelectors, resolved.Image) |
| 177 | } |
| 178 | |
| 179 | return imageSelectors, nil |
| 180 | } |
no test coverage detected