diff --git a/openstack_operator/templates/keystone/ingress.yml.j2 b/openstack_operator/templates/keystone/ingress.yml.j2 index 9caab96d..d4dfa4e1 100644 --- a/openstack_operator/templates/keystone/ingress.yml.j2 +++ b/openstack_operator/templates/keystone/ingress.yml.j2 @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +{% if spec.ingress is defined %} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -52,4 +52,5 @@ spec: - {{ v.host }} {% endfor %} secretName: keystone-tls +{% endif %} {% endif %} \ No newline at end of file diff --git a/openstack_operator/tests/unit/base.py b/openstack_operator/tests/unit/base.py index eee523f9..afc0d596 100644 --- a/openstack_operator/tests/unit/base.py +++ b/openstack_operator/tests/unit/base.py @@ -63,16 +63,15 @@ class KubernetesObjectTestCase(testtools.TestCase): cls.object = utils.render_template(cls.TEMPLATE_FILE, name=name, spec=spec) - def auto_generation_test_metadata_has_openstack_namespace(self): + def test_metadata_has_correct_namespace(self): """Ensure that the metadata for auto-generated releases has openstack namespace.""" + if self.object is None: + return if self.AUTO_GENERATED: self.assertIn("namespace", self.object["metadata"]) self.assertEqual("openstack", self.object["metadata"]["namespace"]) - - def cr_test_metadata_has_no_specific_namespace(self): - """Ensure that the CR metadata has no specific namespace.""" - if not self.AUTO_GENERATED: + else: self.assertNotIn("namespace", self.object["metadata"]) diff --git a/openstack_operator/tests/unit/test_keystone.py b/openstack_operator/tests/unit/test_keystone.py index 3bf1ae00..7add750f 100644 --- a/openstack_operator/tests/unit/test_keystone.py +++ b/openstack_operator/tests/unit/test_keystone.py @@ -34,13 +34,6 @@ class KeystoneIngressTestCase(base.IngressTestCase): TEMPLATE_FILE = 'keystone/ingress.yml.j2' -class KeystoneSecretTestCase(base.SecretTestCase): - """Basic tests for the Secret.""" - - RELEASE_TYPE = 'keystone' - TEMPLATE_FILE = 'keystone/secret-fernet.yml.j2' - - class KeystoneServiceTestCase(base.ServiceTestCase): """Basic tests for the Service.""" diff --git a/openstack_operator/tests/unit/test_rabbitmq.py b/openstack_operator/tests/unit/test_rabbitmq.py index e17fc8a0..bc68dc27 100644 --- a/openstack_operator/tests/unit/test_rabbitmq.py +++ b/openstack_operator/tests/unit/test_rabbitmq.py @@ -32,5 +32,5 @@ class RabbitmqServiceTestCase(base.ServiceTestCase): """Basic tests for the Service.""" SAMPLE_FILE = 'infrastructure_v1alpha1_rabbitmq.yaml' - TEMPLATE_FILE = 'Rabbitmq/service.yml.j2' + TEMPLATE_FILE = 'rabbitmq/service.yml.j2' AUTO_GENERATED = False