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

KATA-1374: Create monitor daemonset post runtimeclass creation #183

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion controllers/openshift_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ func (r *KataConfigOpenShiftReconciler) Reconcile(ctx context.Context, req ctrl.
foundDs := &appsv1.DaemonSet{}
err = r.Client.Get(context.TODO(), types.NamespacedName{Name: ds.Name, Namespace: ds.Namespace}, foundDs)
if err != nil {
if k8serrors.IsNotFound(err) {
//The DaemonSet (DS) should be ideally created after the required SeLinux policy is installed on the
//node. One of the ways to ensure this is to check for the existence of "kata" runtimeclass before
//creating the DS
//Alternatively we can create the DS post execution of setRuntimeClass()
if k8serrors.IsNotFound(err) && r.kataConfig.Status.RuntimeClass == "kata" {
r.Log.Info("Creating a new installation monitor daemonset", "ds.Namespace", ds.Namespace, "ds.Name", ds.Name)
err = r.Client.Create(context.TODO(), ds)
if err != nil {
Expand Down