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

Automated backport of #2822: Create xtables.lock as a file if it doesn't already exist #2844

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
2 changes: 1 addition & 1 deletion controllers/submariner/globalnet_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func newGlobalnetDaemonSet(cr *v1alpha1.Submariner, name string) *appsv1.DaemonS
Spec: corev1.PodSpec{
Volumes: []corev1.Volume{
{Name: "host-run-xtables-lock", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{
Path: "/run/xtables.lock",
Path: "/run/xtables.lock", Type: &hostPathFileOrCreate,
}}},
},
Containers: []corev1.Container{
Expand Down
4 changes: 3 additions & 1 deletion controllers/submariner/route_agent_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
"k8s.io/utils/pointer"
)

var hostPathFileOrCreate = corev1.HostPathFileOrCreate

//nolint:wrapcheck // No need to wrap errors here.
func (r *Reconciler) reconcileRouteagentDaemonSet(ctx context.Context, instance *v1alpha1.Submariner, reqLogger logr.Logger,
) (*appsv1.DaemonSet, error) {
Expand Down Expand Up @@ -74,7 +76,7 @@ func newRouteAgentDaemonSet(cr *v1alpha1.Submariner, name string) *appsv1.Daemon
Volumes: []corev1.Volume{
// We need to share /run/xtables.lock with the host for iptables
{Name: "host-run-xtables-lock", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{
Path: "/run/xtables.lock",
Path: "/run/xtables.lock", Type: &hostPathFileOrCreate,
}}},
// We need to share /run/openvswitch/db.sock with the host for OVS
{Name: "host-run-openvswitch-db-sock", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{
Expand Down
Loading