Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
fix deploying to old clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jun 5, 2018
1 parent 724dcf5 commit 954bc5c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cli/packages/prisma-cli-engine/src/Client/Client.ts
Expand Up @@ -220,6 +220,19 @@ export class Client {
}
}

if (
e.message.includes('HTTP method not allowed') &&
(this.clusterClient as any).url.endsWith('management')
) {
// TODO: make url mutable in graphql client
;(this.clusterClient as any).url = (this
.clusterClient as any).url.replace(/management$/, 'cluster')

const result = await this.clusterClient.request(query, variables)
debug(result)
return result
}

if (
e.message.includes('ECONNREFUSED') &&
(e.message.includes('localhost') || e.message.includes('127.0.0.1'))
Expand Down

0 comments on commit 954bc5c

Please sign in to comment.