Skip to content

Commit

Permalink
Merge pull request #359 from gthiemonge/fix-mycnf-mount
Browse files Browse the repository at this point in the history
Avoid unneeded reconciles
  • Loading branch information
openshift-merge-bot[bot] committed Aug 5, 2024
2 parents 3235000 + 24d5658 commit ff203bf
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 10 deletions.
3 changes: 3 additions & 0 deletions controllers/amphoracontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controllers
import (
"context"
"fmt"
"sort"
"strings"
"time"

Expand Down Expand Up @@ -596,6 +597,8 @@ func (r *OctaviaAmphoraControllerReconciler) generateServiceConfigMaps(
rsyslogIPAddresses = append(rsyslogIPAddresses, fmt.Sprintf("%s:514", val))
}
}
sort.Strings(ipAddresses)
sort.Strings(rsyslogIPAddresses)
ipAddressString := strings.Join(ipAddresses, ",")
templateParameters["ControllerIPList"] = ipAddressString
templateParameters["AdminLogTargetList"] = strings.Join(rsyslogIPAddresses, ",")
Expand Down
6 changes: 0 additions & 6 deletions pkg/octavia/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,5 @@ func GetVolumeMounts(serviceName string) []corev1.VolumeMount {
SubPath: serviceName + "-config.json",
ReadOnly: true,
},
{
Name: "config-data",
MountPath: "/etc/my.cnf",
SubPath: "my.cnf",
ReadOnly: true,
},
}
}
6 changes: 6 additions & 0 deletions templates/octavia/config/db-sync-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"dest": "/etc/octavia/octavia.conf",
"owner": "octavia",
"perm": "0600"
},
{
"source": "/var/lib/config-data/merged/my.cnf",
"dest": "/etc/my.cnf",
"owner": "octavia",
"perm": "0644"
}
],
"permissions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"dest": "/etc/octavia/octavia.conf.d/custom.conf",
"owner": "octavia",
"perm": "0600"
},
{
"source": "/var/lib/config-data/merged/my.cnf",
"dest": "/etc/my.cnf",
"owner": "octavia",
"perm": "0644"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"dest": "/etc/octavia/octavia.conf.d/custom.conf",
"owner": "octavia",
"perm": "0600"
},
{
"source": "/var/lib/config-data/merged/my.cnf",
"dest": "/etc/my.cnf",
"owner": "octavia",
"perm": "0644"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"dest": "/etc/octavia/octavia.conf.d/custom.conf",
"owner": "octavia",
"perm": "0600"
},
{
"source": "/var/lib/config-data/merged/my.cnf",
"dest": "/etc/my.cnf",
"owner": "octavia",
"perm": "0644"
}
]
}
6 changes: 6 additions & 0 deletions templates/octaviaapi/config/octavia-api-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
"owner": "octavia",
"perm": "0600",
"optional": true
},
{
"source": "/var/lib/config-data/merged/my.cnf",
"dest": "/etc/my.cnf",
"owner": "octavia",
"perm": "0644"
}
],
"permissions": [
Expand Down
6 changes: 6 additions & 0 deletions templates/octaviaapi/config/octavia-driver-agent-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
"perm": "0400",
"optional": true,
"merge": true
},
{
"source": "/var/lib/config-data/merged/my.cnf",
"dest": "/etc/my.cnf",
"owner": "octavia",
"perm": "0644"
}
],
"permissions": [
Expand Down
4 changes: 0 additions & 4 deletions tests/kuttl/tests/octavia_tls/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ spec:
name: config-data-merged
readOnly: true
subPath: octavia-api-config.json
- mountPath: /etc/my.cnf
name: config-data
- mountPath: /run/octavia
name: octavia-run
- mountPath: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
Expand Down Expand Up @@ -194,8 +192,6 @@ spec:
name: config-data-merged
readOnly: true
subPath: octavia-driver-agent-config.json
- mountPath: /etc/my.cnf
name: config-data
- mountPath: /run/octavia
name: octavia-run
- mountPath: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
Expand Down

0 comments on commit ff203bf

Please sign in to comment.