Skip to content

Commit

Permalink
ccruntime: Remove cleanup
Browse files Browse the repository at this point in the history
It's not needed anymore for the CC Runtime, as Kata Containers does the
cleanup as part of the uninstall.

See: kata-containers/kata-containers@8d9bec2

Calling the cleanup after calling the uninstall, which has already done
the cleanup, could result on a infinite loop.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
  • Loading branch information
fidencio committed Aug 11, 2024
1 parent 6b249fd commit 2879312
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 0 additions & 4 deletions bundle/manifests/cc-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ metadata:
}
},
"config": {
"cleanupCmd": [
"/opt/kata-artifacts/scripts/kata-deploy.sh",
"reset"
],
"debug": false,
"defaultRuntimeClassName": "kata-qemu",
"environmentVariables": [
Expand Down
1 change: 0 additions & 1 deletion config/samples/ccruntime/base/ccruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
name: host
installCmd: ["/opt/kata-artifacts/scripts/kata-deploy.sh", "install"]
uninstallCmd: ["/opt/kata-artifacts/scripts/kata-deploy.sh", "cleanup"]
cleanupCmd: ["/opt/kata-artifacts/scripts/kata-deploy.sh", "reset"]
# Uncomment and add the required RuntimeClasses to be created
# If this is commented, then the operator creates 3 default runtimeclasses "kata", "kata-clh", "kata-qemu"
runtimeClasses:
Expand Down
12 changes: 7 additions & 5 deletions controllers/ccruntime_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,14 @@ func (r *CcRuntimeReconciler) processDaemonset(operation DaemonOperation) *appsv
preStopHook := &corev1.Lifecycle{}

if operation == InstallOperation {
preStopHook = &corev1.Lifecycle{
PreStop: &corev1.LifecycleHandler{
Exec: &corev1.ExecAction{
Command: r.ccRuntime.Spec.Config.CleanupCmd,
if r.ccRuntime.Spec.Config.CleanupCmd != nil {
preStopHook = &corev1.Lifecycle{
PreStop: &corev1.LifecycleHandler{
Exec: &corev1.ExecAction{
Command: r.ccRuntime.Spec.Config.CleanupCmd,
},
},
},
}
}
containerCommand = r.ccRuntime.Spec.Config.InstallCmd
}
Expand Down
1 change: 0 additions & 1 deletion docs/PAYLOAD_IMAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Following is an example for Kata runtime depicting the key attributes.
name: local-bin
installCmd: ["/opt/kata-artifacts/scripts/kata-deploy.sh", "install"]
uninstallCmd: ["/opt/kata-artifacts/scripts/kata-deploy.sh", "cleanup"]
cleanupCmd: ["/opt/kata-artifacts/scripts/kata-deploy.sh", "reset"]
```

The installer (`/opt/kata-artifacts/scripts/kata-deploy.sh`) copies the required kata artifacts to
Expand Down

0 comments on commit 2879312

Please sign in to comment.