Skip to content

Commit 70aa31a

Browse files
Merge pull request #337 from shiftstack/openstack-cluster-name
OCPBUGS-13680: Pass --cluster-name to OpenStack CCM
2 parents f8e0afd + 7b95787 commit 70aa31a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

pkg/cloud/openstack/assets/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ spec:
5454
env:
5555
- name: CLOUD_CONFIG
5656
value: /etc/openstack/config/cloud.conf
57+
- name: OCP_INFRASTRUCTURE_NAME
58+
value: {{ .infrastructureName }}
5759
command:
5860
- /bin/bash
5961
- -c
@@ -67,6 +69,7 @@ spec:
6769
--v=1 \
6870
--cloud-config=$(CLOUD_CONFIG) \
6971
--cloud-provider=openstack \
72+
--cluster-name=$(OCP_INFRASTRUCTURE_NAME) \
7073
--use-service-account-credentials=true \
7174
--configure-cloud-routes=false \
7275
--bind-address=127.0.0.1 \

pkg/cloud/openstack/openstack.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ type imagesReference struct {
3232
}
3333

3434
var templateValuesValidationMap = map[string]interface{}{
35-
"images": "required",
36-
"cloudproviderName": "required,type(string)",
37-
"featureGates": "type(string)",
35+
"images": "required",
36+
"cloudproviderName": "required,type(string)",
37+
"featureGates": "type(string)",
38+
"infrastructureName": "required,type(string)",
3839
}
3940

4041
type openstackAssets struct {
@@ -48,9 +49,10 @@ func (o *openstackAssets) GetRenderedResources() []client.Object {
4849

4950
func getTemplateValues(images *imagesReference, operatorConfig config.OperatorConfig) (common.TemplateValues, error) {
5051
values := common.TemplateValues{
51-
"images": images,
52-
"cloudproviderName": operatorConfig.GetPlatformNameString(),
53-
"featureGates": operatorConfig.FeatureGates,
52+
"images": images,
53+
"cloudproviderName": operatorConfig.GetPlatformNameString(),
54+
"featureGates": operatorConfig.FeatureGates,
55+
"infrastructureName": operatorConfig.InfrastructureName,
5456
}
5557
_, err := govalidator.ValidateMap(values, templateValuesValidationMap)
5658
if err != nil {

pkg/cloud/openstack/openstack_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func TestResourcesRenderingSmoke(t *testing.T) {
3131
}, {
3232
name: "Minimal allowed config",
3333
config: config.OperatorConfig{
34+
InfrastructureName: "infra-name",
3435
ImagesReference: config.ImagesReference{
3536
CloudControllerManagerOpenStack: "CloudControllerManagerOpenstack",
3637
},

0 commit comments

Comments
 (0)