Skip to content

Commit

Permalink
Merge pull request #337 from shiftstack/openstack-cluster-name
Browse files Browse the repository at this point in the history
OCPBUGS-13680: Pass --cluster-name to OpenStack CCM
  • Loading branch information
openshift-merge-bot[bot] committed Apr 12, 2024
2 parents f8e0afd + 7b95787 commit 70aa31a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions pkg/cloud/openstack/assets/deployment.yaml
Expand Up @@ -54,6 +54,8 @@ spec:
env:
- name: CLOUD_CONFIG
value: /etc/openstack/config/cloud.conf
- name: OCP_INFRASTRUCTURE_NAME
value: {{ .infrastructureName }}
command:
- /bin/bash
- -c
Expand All @@ -67,6 +69,7 @@ spec:
--v=1 \
--cloud-config=$(CLOUD_CONFIG) \
--cloud-provider=openstack \
--cluster-name=$(OCP_INFRASTRUCTURE_NAME) \
--use-service-account-credentials=true \
--configure-cloud-routes=false \
--bind-address=127.0.0.1 \
Expand Down
14 changes: 8 additions & 6 deletions pkg/cloud/openstack/openstack.go
Expand Up @@ -32,9 +32,10 @@ type imagesReference struct {
}

var templateValuesValidationMap = map[string]interface{}{
"images": "required",
"cloudproviderName": "required,type(string)",
"featureGates": "type(string)",
"images": "required",
"cloudproviderName": "required,type(string)",
"featureGates": "type(string)",
"infrastructureName": "required,type(string)",
}

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

func getTemplateValues(images *imagesReference, operatorConfig config.OperatorConfig) (common.TemplateValues, error) {
values := common.TemplateValues{
"images": images,
"cloudproviderName": operatorConfig.GetPlatformNameString(),
"featureGates": operatorConfig.FeatureGates,
"images": images,
"cloudproviderName": operatorConfig.GetPlatformNameString(),
"featureGates": operatorConfig.FeatureGates,
"infrastructureName": operatorConfig.InfrastructureName,
}
_, err := govalidator.ValidateMap(values, templateValuesValidationMap)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/cloud/openstack/openstack_test.go
Expand Up @@ -31,6 +31,7 @@ func TestResourcesRenderingSmoke(t *testing.T) {
}, {
name: "Minimal allowed config",
config: config.OperatorConfig{
InfrastructureName: "infra-name",
ImagesReference: config.ImagesReference{
CloudControllerManagerOpenStack: "CloudControllerManagerOpenstack",
},
Expand Down

0 comments on commit 70aa31a

Please sign in to comment.