Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller properly set snapshotter per runtime handler #308

Closed
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
19 changes: 10 additions & 9 deletions controllers/ccruntime_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,15 +629,16 @@ func (r *CcRuntimeReconciler) processDaemonset(operation DaemonOperation) *appsv
}

var runtimeClassNames []string
var snapshotter = ""
var snapshotter_handler_mapping = ""
for _, runtimeClass := range r.ccRuntime.Spec.Config.RuntimeClasses {
runtimeClassNames = append(runtimeClassNames, runtimeClass.Name)
// FIXME: This will need to be changed by the moment the kata-containers
// payload script supports setting one snapshotter per runtime handler.
// For now, for the v0.8.0 release, we're fine assuming that all the
// set snapshotters are going to be the same.
if snapshotter == "" && runtimeClass.Snapshotter != "" {
snapshotter = runtimeClass.Snapshotter

if runtimeClass.Snapshotter == "" {
if snapshotter_handler_mapping != "" {
snapshotter_handler_mapping += runtimeClass.Name + ":" + runtimeClass.Snapshotter
} else {
snapshotter_handler_mapping += "," + runtimeClass.Name + ":" + runtimeClass.Snapshotter
}
}
}
var runtimeClasses = strings.Join(runtimeClassNames, " ")
Expand Down Expand Up @@ -673,8 +674,8 @@ func (r *CcRuntimeReconciler) processDaemonset(operation DaemonOperation) *appsv
Value: shims,
},
{
Name: "SNAPSHOTTER",
Value: snapshotter,
Name: "SNAPSHOTTER_HANDLER_MAPPING",
Value: snapshotter_handler_mapping,
},
}
envVars = append(envVars, r.ccRuntime.Spec.Config.EnvironmentVariables...)
Expand Down
Loading