From f7b0a92932d6bc7573d54a9262d19c6394121f3a Mon Sep 17 00:00:00 2001 From: Jeff Lowdermlk Date: Thu, 15 Jan 2015 14:33:45 -0800 Subject: [PATCH] Fail rollingupdate if replacement rc schema has same name as existing --- pkg/kubectl/cmd/rollingupdate.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/kubectl/cmd/rollingupdate.go b/pkg/kubectl/cmd/rollingupdate.go index bba728c0429..b5e25f509ad 100644 --- a/pkg/kubectl/cmd/rollingupdate.go +++ b/pkg/kubectl/cmd/rollingupdate.go @@ -66,6 +66,10 @@ $ cat frontend-v2.json | kubectl rollingupdate frontend-v1 -f - if mapping.Kind != "ReplicationController" { usageError(cmd, "%s does not specify a valid ReplicationController", filename) } + if oldName == newName { + usageError(cmd, "%s cannot have the same name as the existing ReplicationController %s", + filename, oldName) + } err = CompareNamespaceFromFile(cmd, namespace) checkErr(err)