-
Notifications
You must be signed in to change notification settings - Fork 62
Use MultiTemplateDir for the support of multi-segment dir in template #1096
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ import ( | |
|
|
||
| novav1 "github.com/openstack-k8s-operators/nova-operator/api/nova/v1beta1" | ||
| "github.com/openstack-k8s-operators/nova-operator/internal/nova" | ||
| "github.com/openstack-k8s-operators/nova-operator/internal/nova/api" | ||
| novaapi "github.com/openstack-k8s-operators/nova-operator/internal/nova/api" | ||
|
gibizer marked this conversation as resolved.
|
||
|
|
||
| memcachedv1 "github.com/openstack-k8s-operators/infra-operator/apis/memcached/v1beta1" | ||
| rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1" | ||
|
|
@@ -1143,17 +1143,19 @@ func (r *NovaReconciler) ensureNovaManageJobSecret( | |
|
|
||
| cms := []util.Template{ | ||
| { | ||
| Name: scriptName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeScripts, | ||
| InstanceType: "nova/nova-manage", | ||
| Labels: cmLabels, | ||
| Name: scriptName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeScripts, | ||
| InstanceType: instance.GetObjectKind().GroupVersionKind().Kind, | ||
| MultiTemplateDir: "nova/nova-manage", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yepp this is the correct use of the new interface.
|
||
| Labels: cmLabels, | ||
| }, | ||
| { | ||
| Name: configName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeConfig, | ||
| InstanceType: "nova/nova-manage", | ||
| InstanceType: instance.GetObjectKind().GroupVersionKind().Kind, | ||
| MultiTemplateDir: "nova/nova-manage", | ||
| ConfigOptions: templateParameters, | ||
| Labels: cmLabels, | ||
| CustomData: extraData, | ||
|
|
@@ -2142,10 +2144,11 @@ func (r *NovaReconciler) ensureCellSecret( | |
| ) | ||
|
|
||
| template := util.Template{ | ||
| Name: secretName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeNone, | ||
| InstanceType: getTemplateInstanceType(instance), | ||
| Name: secretName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeNone, | ||
| // No MultiTemplateDir: TemplateTypeNone does not load templates from a directory. | ||
| InstanceType: instance.GetObjectKind().GroupVersionKind().Kind, | ||
| Labels: labels, | ||
| CustomData: data, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we are not loading any template from file here hence we don't need to pass a templateDir. If I'm correct then a comment would be nice here about it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In lib-common, we do not check Will add a comment in there in code to clarify. |
||
| } | ||
|
|
@@ -2202,10 +2205,11 @@ func (r *NovaReconciler) ensureTopLevelSecret( | |
| ) | ||
|
|
||
| template := util.Template{ | ||
| Name: secretName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeNone, | ||
| InstanceType: getTemplateInstanceType(instance), | ||
| Name: secretName, | ||
| Namespace: instance.Namespace, | ||
| Type: util.TemplateTypeNone, | ||
| // No MultiTemplateDir: TemplateTypeNone does not load templates from a directory. | ||
| InstanceType: instance.GetObjectKind().GroupVersionKind().Kind, | ||
| Labels: labels, | ||
| CustomData: data, | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -815,7 +815,7 @@ func (r *NovaCellReconciler) generateComputeConfigs( | |
|
|
||
| configName := instance.GetName() + "-compute-config" | ||
| err := r.GenerateConfigs( | ||
| ctx, h, instance, configName, &hashes, templateParameters, extraData, cmLabels, map[string]string{}, | ||
| ctx, h, instance, configName, &hashes, templateParameters, extraData, cmLabels, map[string]string{}, "nova/compute", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I see that this resolved the 'novacell' mismatching behavior I thought still takes place |
||
| ) | ||
| if err != nil { | ||
| return err | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a
NovaCellinstance, lib-common will look under a subdir derived from"novacell", not"nova/compute". Is that expected?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks about right, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np!