Skip to content

Commit c373c65

Browse files
committed
Fix lint errors and kuttl tests
1 parent 65c4f54 commit c373c65

File tree

18 files changed

+71
-79
lines changed

18 files changed

+71
-79
lines changed

config/samples/designate_redis_tls.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ metadata:
55
spec:
66
replicas: 1
77
tls:
8-
secretName: redis-tls
9-
caBundleSecretName: redis-tls
8+
secretName: cert-designate-redis-svc
9+
caBundleSecretName: combined-ca-bundle

controllers/designatecentral_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,11 +785,11 @@ func (r *DesignateCentralReconciler) generateServiceConfigMaps(
785785
),
786786
}
787787
if len(instance.Spec.RedisHostIPs) > 0 {
788-
backendUrl := fmt.Sprintf("redis://%s:6379/", instance.Spec.RedisHostIPs[0])
788+
backendURL := fmt.Sprintf("redis://%s:6379/", instance.Spec.RedisHostIPs[0])
789789
if tlsCfg != nil {
790-
backendUrl = fmt.Sprintf("%s?ssl=true", backendUrl)
790+
backendURL = fmt.Sprintf("%s?ssl=true", backendURL)
791791
}
792-
templateParameters["CoordinationBackendUrl"] = backendUrl
792+
templateParameters["CoordinationBackendURL"] = backendURL
793793
}
794794

795795
transportURLSecret, _, err := secret.GetSecret(ctx, h, instance.Spec.TransportURLSecret, instance.Namespace)

controllers/designateproducer_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,11 +785,11 @@ func (r *DesignateProducerReconciler) generateServiceConfigMaps(
785785
}
786786

787787
if len(instance.Spec.RedisHostIPs) > 0 {
788-
backendUrl := fmt.Sprintf("redis://%s:6379/", instance.Spec.RedisHostIPs[0])
788+
backendURL := fmt.Sprintf("redis://%s:6379/", instance.Spec.RedisHostIPs[0])
789789
if tlsCfg != nil {
790-
backendUrl = fmt.Sprintf("%s?ssl=true", backendUrl)
790+
backendURL = fmt.Sprintf("%s?ssl=true", backendURL)
791791
}
792-
templateParameters["CoordinationBackendUrl"] = backendUrl
792+
templateParameters["CoordinationBackendURL"] = backendURL
793793
}
794794

795795
transportURLSecret, _, err := secret.GetSecret(ctx, h, instance.Spec.TransportURLSecret, instance.Namespace)

templates/designate/bin/init.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ cp -a ${SVC_CFG} ${SVC_CFG_MERGED}
3535
for dir in /var/lib/config-data/default; do
3636
merge_config_dir ${dir}
3737
done
38-

templates/designatecentral/config/designate.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ connection={{ .DatabaseConnection }}
1818
{{/* Some services don't need this section, so either we create independent files
1919
or do not error on this missing for the ones that need it.
2020
TODO: look into creating separate conf templates. */}}
21-
{{ if .CoordinationBackendUrl }}
21+
{{ if .CoordinationBackendURL }}
2222
[coordination]
23-
backend_url={{ .CoordinationBackendUrl }}
23+
backend_url={{ .CoordinationBackendURL }}
2424
{{ end }}
2525

2626
[service:api]

templates/designateproducer/bin/init.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ cp -a ${SVC_CFG} ${SVC_CFG_MERGED}
3434
for dir in /var/lib/config-data/default; do
3535
merge_config_dir ${dir}
3636
done
37-

templates/designateproducer/config/designate.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ connection={{ .DatabaseConnection }}
1818
{{/* Some services don't need this section, so either we create independent files
1919
or do not error on this missing for the ones that need it.
2020
TODO: look into creating separate conf templates. */}}
21-
{{ if .CoordinationBackendUrl }}
21+
{{ if .CoordinationBackendURL }}
2222
[coordination]
23-
backend_url={{ .CoordinationBackendUrl }}
23+
backend_url={{ .CoordinationBackendURL }}
2424
{{ end }}
2525

2626
[service:api]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestAssert
3+
commands:
4+
- script: |
5+
if ! oc get -n $NAMESPACE secret -o json designate-central-config-data | jq '.data["designate.conf"] | @base64d' | sed -e 's/\\n/\n/g' | grep ^backend_url.*redis.*/$;
6+
then
7+
echo "Configuration of backend_url failed"
8+
exit 1
9+
fi
10+
exit 0
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
delete:
4+
- apiVersion: designate.openstack.org/v1beta1
5+
kind: Designate
6+
name: designate
7+
- apiVersion: redis.openstack.org/v1beta1
8+
kind: Redis
9+
name: designate-redis
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
apiVersion: v1
2-
kind: Secret
1+
apiVersion: k8s.cni.cncf.io/v1
2+
kind: NetworkAttachmentDefinition
33
metadata:
4-
name: cert-designate-internal-svc
5-
---
6-
apiVersion: v1
7-
kind: Secret
8-
metadata:
9-
name: cert-designate-public-svc
10-
---
11-
apiVersion: v1
12-
kind: Secret
13-
metadata:
14-
name: combined-ca-bundle
4+
name: designate

0 commit comments

Comments
 (0)