Skip to content

Commit 4a4b27d

Browse files
committed
Switch DNS to use *Core* spec
These fields should have been dropped when the DNS *Core* spec was implemented. Images get overwritten during reconcile to what exists in the openstackversion resource so there should be no user facing issues in dropping these fields. Signed-off-by: Martin Schuppert <[email protected]>
1 parent a932ec4 commit 4a4b27d

File tree

6 files changed

+5
-9
lines changed

6 files changed

+5
-9
lines changed

apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,8 +2390,6 @@ spec:
23902390
type: boolean
23912391
template:
23922392
properties:
2393-
containerImage:
2394-
type: string
23952393
dnsDataLabelSelectorValue:
23962394
default: dnsdata
23972395
type: string

apis/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ type DNSMasqSection struct {
345345
// +kubebuilder:validation:Optional
346346
// +operator-sdk:csv:customresourcedefinitions:type=spec
347347
// Template - Overrides to use when creating the DNSMasq service
348-
Template *networkv1.DNSMasqSpec `json:"template,omitempty"`
348+
Template *networkv1.DNSMasqSpecCore `json:"template,omitempty"`
349349
}
350350

351351
// KeystoneSection defines the desired state of Keystone service

apis/core/v1beta1/openstackcontrolplane_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ func (r *OpenStackControlPlane) DefaultServices() {
843843
// DNS
844844
if r.Spec.DNS.Enabled || r.Spec.DNS.Template != nil {
845845
if r.Spec.DNS.Template == nil {
846-
r.Spec.DNS.Template = &networkv1.DNSMasqSpec{}
846+
r.Spec.DNS.Template = &networkv1.DNSMasqSpecCore{}
847847
}
848848

849849
r.Spec.DNS.Template.Default()

apis/core/v1beta1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,8 +2390,6 @@ spec:
23902390
type: boolean
23912391
template:
23922392
properties:
2393-
containerImage:
2394-
type: string
23952393
dnsDataLabelSelectorValue:
23962394
default: dnsdata
23972395
type: string

pkg/openstack/dnsmasq.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func ReconcileDNSMasqs(ctx context.Context, instance *corev1beta1.OpenStackContr
3737
Log := GetLogger(ctx)
3838

3939
if instance.Spec.DNS.Template == nil {
40-
instance.Spec.DNS.Template = &networkv1.DNSMasqSpec{}
40+
instance.Spec.DNS.Template = &networkv1.DNSMasqSpecCore{}
4141
}
4242

4343
if instance.Spec.DNS.Template.NodeSelector == nil {
@@ -46,7 +46,7 @@ func ReconcileDNSMasqs(ctx context.Context, instance *corev1beta1.OpenStackContr
4646

4747
Log.Info("Reconciling DNSMasq", "DNSMasq.Namespace", instance.Namespace, "DNSMasq.Name", "dnsmasq")
4848
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), dnsmasq, func() error {
49-
instance.Spec.DNS.Template.DeepCopyInto(&dnsmasq.Spec)
49+
instance.Spec.DNS.Template.DeepCopyInto(&dnsmasq.Spec.DNSMasqSpecCore)
5050
dnsmasq.Spec.ContainerImage = *version.Status.ContainerImages.InfraDnsmasqImage
5151
err := controllerutil.SetControllerReference(helper.GetBeforeObject(), dnsmasq, helper.GetScheme())
5252
if err != nil {

0 commit comments

Comments
 (0)