Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Use kedge defined containers list for init containers #189

Merged
merged 1 commit into from
Aug 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type ConfigMapMod struct {

type PodSpecMod struct {
Containers []Container `json:"containers,conflicting,omitempty"`
InitContainers []Container `json:"initContainers,conflicting,omitempty"`
api_v1.PodSpec `json:",inline"`
}

Expand Down
6 changes: 6 additions & 0 deletions pkg/transform/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ func CreateK8sObjects(app *spec.App) ([]runtime.Object, []string, error) {
}
log.Debugf("object after population: %#v\n", app)

app.PodSpec.InitContainers, err = populateContainers(app.InitContainers, app.ConfigMaps, app.Secrets)
if err != nil {
return nil, nil, errors.Wrapf(err, "app %q", app.Name)
}
log.Debugf("object after population: %#v\n", app)

// create pvc for each root level persistent volume
var pvcs []runtime.Object
for _, v := range app.VolumeClaims {
Expand Down