Skip to content

Commit

Permalink
✨ inject setting resources. (#138)
Browse files Browse the repository at this point in the history
Support injecting _general_ settings (Resources) into extension
configuration.
Example:
```
  metadata:
    provider:
      address: localhost:$(PORT)
      initConfig:
      - providerSpecificConfig:
          mavenInsecure: $(maven.insecure)
          mavenSettingsFile: $(maven.settings.path)
      name: java
    resources:
    - fields:
      - key: maven.settings.path
        name: settings
        path: /shared/creds/maven/settings.xml
      selector: identity:kind=maven
    - fields:
      - key: maven.insecure
        name: value
      selector: setting:key=mvn.insecure.enabled

```

Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel authored Dec 18, 2024
1 parent 04cda03 commit b3937d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ func (r *ResourceInjector) build(md *Metadata) (err error) {
return
}
}
case "setting":
setting := &api.Setting{}
err = addon.Setting.Get(parsed.value, &setting.Value)
if err != nil {
return
}
err = r.add(&resource, setting)
if err != nil {
return
}
default:
err = &SelectorNotSupported{Selector: resource.Selector}
return
Expand Down

0 comments on commit b3937d3

Please sign in to comment.