-
Notifications
You must be signed in to change notification settings - Fork 128
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
Update method for checking endpoint protocol #769
Conversation
The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists.
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.
LGTM. Could you add the bug reference to the commit message? 2015103
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.
Unfortunately, it looks like a few unit tests are breaking due to the change; it looks like the tests need some additional mocks as the method-under-test eventually calls out to juju primatives.
e.g.
======================================================================
ERROR: tests.contrib.hahelpers.test_cluster_utils.ClusterUtilsTests.test_https_cert_key_incomplete_identity_relation
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
File "/home/ubuntu/git/github.com/juju/charm-helpers/charmhelpers/core/hookenv.py", line 1180, in inner_translate_exc2
return f(*args, **kwargs)
File "/home/ubuntu/git/github.com/juju/charm-helpers/charmhelpers/core/hookenv.py", line 1374, in network_get_primary_address
response = subprocess.check_output(
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'network-get'
Unfortunately, the github actions are currently broken due to: #774 so you'll need to run them manually (on say focal), until we get this fixed.
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.
Please see inline test comment; I think a boolean assert should be flipped.
'key', # relation_get('ssl_key') | ||
'ca_cert', # relation_get('ca_cert') | ||
] | ||
self.assertTrue(cluster_utils.https()) |
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.
I think this should be assertFalse
as the request for local unit is {}
and that it will return False
from https()
.
I've manually verified that the tox pep8 and py3 targets run on focal and jammy (actually py310 due to nose2 requirement). This is in lieu of the fix to the CI runners. |
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]>
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
Update method for checking endpoint protocol The `https` method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but the `https` method will return True. This patch updates the `https` method to return False if an unfilled certificate request exists. (cherry picked from commit 6064a34) Co-authored-by: Liam Young <[email protected]> (cherry picked from commit ed01437)
The
https
method is used to check if an endpoint is expected to be http or https. One of the checks it performs is to examine the the certificates relation. If the relation is present then it looks for the existance of a CA. However the OpenStack charms do not switch to https until a certificate is provided via the certificates relation. This means there can be a disconnect if the certificate provider has provided a CA but has not yet provided the unit specific certificates. If this happens then the payload will still be using http but thehttps
method will return True.This patch updates the
https
method to return False if an unfilled certificate request exists.https://bugs.launchpad.net/charm-keystone/+bug/2015103