def test_get_tiller_pod_throws_exception(self, mock_grpc, mock_k8s, mock_ip): mock_k8s.get_namespace_pod.return_value.items = [] tiller_obj = tiller.Tiller() mock_grpc.insecure_channel.side_effect = ex.ChannelException() self.assertRaises(ex.TillerPodNotRunningException, tiller_obj._get_tiller_pod)
def get_channel(self): ''' Return a tiller channel ''' tiller_ip = self._get_tiller_ip() tiller_port = self._get_tiller_port() try: return grpc.insecure_channel( '%s:%s' % (tiller_ip, tiller_port), options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), ('grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)]) except Exception: raise ex.ChannelException()
def get_channel(self): ''' Return a Tiller channel ''' tiller_ip = self._get_tiller_ip() tiller_port = self._get_tiller_port() try: LOG.debug( 'Tiller getting gRPC insecure channel at %s:%s ' 'with options: [grpc.max_send_message_length=%s, ' 'grpc.max_receive_message_length=%s]', tiller_ip, tiller_port, MAX_MESSAGE_LENGTH, MAX_MESSAGE_LENGTH) return grpc.insecure_channel( '%s:%s' % (tiller_ip, tiller_port), options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), ('grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)]) except Exception: raise ex.ChannelException()