MCPcopy Index your code
hub / github.com/helm/helm / buildLegacyRuntimeConfig

Function buildLegacyRuntimeConfig

internal/plugin/metadata.go:154–187  ·  view source on GitHub ↗
(m MetadataLegacy)

Source from the content-addressed store, hash-verified

152}
153
154func buildLegacyRuntimeConfig(m MetadataLegacy) RuntimeConfig {
155 var protocolCommands []SubprocessProtocolCommand
156 if len(m.Downloaders) > 0 {
157 protocolCommands =
158 make([]SubprocessProtocolCommand, 0, len(m.Downloaders))
159 for _, d := range m.Downloaders {
160 protocolCommands = append(protocolCommands, SubprocessProtocolCommand{
161 Protocols: d.Protocols,
162 PlatformCommand: []PlatformCommand{{Command: d.Command}},
163 })
164 }
165 }
166
167 platformCommand := m.PlatformCommand
168 if len(platformCommand) == 0 && len(m.Command) > 0 {
169 platformCommand = []PlatformCommand{{Command: m.Command}}
170 }
171
172 platformHooks := m.PlatformHooks
173 expandHookArgs := true
174 if len(platformHooks) == 0 && len(m.Hooks) > 0 {
175 platformHooks = make(PlatformHooks, len(m.Hooks))
176 for hookName, hookCommand := range m.Hooks {
177 platformHooks[hookName] = []PlatformCommand{{Command: "sh", Args: []string{"-c", hookCommand}}}
178 expandHookArgs = false
179 }
180 }
181 return &RuntimeConfigSubprocess{
182 PlatformCommand: platformCommand,
183 PlatformHooks: platformHooks,
184 ProtocolCommands: protocolCommands,
185 expandHookArgs: expandHookArgs,
186 }
187}
188
189func fromMetadataV1(mv1 MetadataV1) (*Metadata, error) {
190 config, err := unmarshalConfig(mv1.Type, mv1.Config)

Callers 1

fromMetadataLegacyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…