From bf5e51f2a099db5f15b15cdb2cc12a5e3ae08e2b Mon Sep 17 00:00:00 2001 From: Marcus Maxwell Date: Mon, 29 May 2017 16:09:38 +0100 Subject: [PATCH 1/2] Add 'Host' header to fix the watcher 400 Bad Request: missing required Host header .gem/ruby/2.4.1/gems/kubeclient-2.4.0/lib/kubeclient/watch_stream.rb:27:in `each': Bad Request (Kubeclient::HttpError) --- lib/kubeclient/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kubeclient/common.rb b/lib/kubeclient/common.rb index d83bd0c8..e8e9ce5f 100644 --- a/lib/kubeclient/common.rb +++ b/lib/kubeclient/common.rb @@ -66,7 +66,7 @@ def initialize_client( @entities = {} @discovered = false @api_version = version - @headers = {} + @headers = { 'Host': URI(uri).host } @ssl_options = ssl_options @auth_options = auth_options @socket_options = socket_options From 07e24d4cde34c29fc052cda9d74f2dd9eadb2517 Mon Sep 17 00:00:00 2001 From: Marcus Maxwell Date: Mon, 29 May 2017 17:47:54 +0100 Subject: [PATCH 2/2] Fix tests --- lib/kubeclient/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kubeclient/common.rb b/lib/kubeclient/common.rb index e8e9ce5f..2f16091b 100644 --- a/lib/kubeclient/common.rb +++ b/lib/kubeclient/common.rb @@ -66,7 +66,7 @@ def initialize_client( @entities = {} @discovered = false @api_version = version - @headers = { 'Host': URI(uri).host } + @headers = { 'Host' => URI(uri).host } @ssl_options = ssl_options @auth_options = auth_options @socket_options = socket_options