Skip to content
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

Rebase openshift/kuryr-kubernetes from https://opendev.org/openstack/kuryr-kubernetes #530

Merged
merged 2 commits into from Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion kuryr_kubernetes/controller/drivers/lbaasv2.py
Expand Up @@ -877,7 +877,7 @@ def _wait_for_provisioning(self, loadbalancer, timeout,
{'status': status, 'lb': loadbalancer,
'rem': remaining})

raise k_exc.ResourceNotReady(loadbalancer)
raise k_exc.LoadBalancerNotReady(loadbalancer['id'], status)

def _wait_for_deletion(self, loadbalancer, timeout,
interval=_LB_STS_POLL_FAST_INTERVAL):
Expand Down
2 changes: 1 addition & 1 deletion kuryr_kubernetes/controller/drivers/nested_vlan_vif.py
Expand Up @@ -122,7 +122,7 @@ def request_vifs(self, pod, project_id, subnets, security_groups,
def activate_vif(self, vif, pod=None, retry_info=None):
try:
super().activate_vif(vif)
except k_exc.ResourceNotReady:
except k_exc.PortNotReady:
if retry_info and retry_info.get('elapsed', 0) > ACTIVE_TIMEOUT:
parent_port = self._get_parent_port(pod)
trunk_id = self._get_trunk_id(parent_port)
Expand Down
2 changes: 1 addition & 1 deletion kuryr_kubernetes/controller/drivers/neutron_vif.py
Expand Up @@ -105,7 +105,7 @@ def activate_vif(self, vif, **kwargs):
raise k_exc.ResourceNotReady(vif)

if port['status'] != kl_const.PORT_STATUS_ACTIVE:
raise k_exc.ResourceNotReady(vif)
raise k_exc.PortNotReady(vif.id, port['status'])

vif.active = True

Expand Down
17 changes: 17 additions & 0 deletions kuryr_kubernetes/exceptions.py
Expand Up @@ -38,6 +38,23 @@ def __init__(self, resource):
super(ResourceNotReady, self).__init__("Resource not ready: %r" % msg)


class LoadBalancerNotReady(ResourceNotReady):
def __init__(self, loadbalancer_id, status):
super().__init__(
'Loadbalancer %s is stuck in %s status for several minutes. This '
'is unexpected and indicates problem with OpenStack Octavia. '
'Please contact your OpenStack administrator.' % (
loadbalancer_id, status))


class PortNotReady(ResourceNotReady):
def __init__(self, port_id, status):
super().__init__(
'Port %s is stuck in %s status for several minutes. This '
'is unexpected and indicates problem with OpenStack Neutron. '
'Please contact your OpenStack administrator.' % (port_id, status))


class K8sResourceNotFound(K8sClientException):
def __init__(self, resource):
super(K8sResourceNotFound, self).__init__("Resource not "
Expand Down