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

Commit

Permalink
removed global cluster parsing. Closes #2489
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jun 5, 2018
1 parent b13bbdd commit 86e28a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
20 changes: 1 addition & 19 deletions cli/packages/prisma-yml/src/Environment.ts
Expand Up @@ -251,9 +251,8 @@ export class Environment {
}

private initClusters(rc: RC): Cluster[] {
const rcClusters = this.getClustersFromRC(rc)
const sharedClusters = this.getSharedClusters(rc)
return [...rcClusters, ...sharedClusters]
return [...sharedClusters]
}

private getSharedClusters(rc: RC): Cluster[] {
Expand All @@ -269,23 +268,6 @@ export class Environment {
})
}

private getClustersFromRC(rc: RC): Cluster[] {
if (!rc.clusters) {
return []
}
return Object.keys(rc.clusters).map(name => {
const cluster = rc.clusters![name]
return new Cluster(
this.out,
name,
cluster.host,
cluster.clusterSecret,
isLocal(cluster.host),
false,
)
})
}

private getLocalClusterConfig() {
return this.clusters
.filter(
Expand Down
17 changes: 0 additions & 17 deletions cli/packages/prisma-yml/src/PrismaDefinition.ts
Expand Up @@ -215,23 +215,6 @@ and execute ${chalk.bold.green(
}

getCluster(throws: boolean = false): Cluster | undefined {
const clusterName = this.getClusterName()
if (clusterName) {
const cluster = this.env.clusterByName(clusterName)
if (!cluster && clusterName !== 'local') {
if (throws) {
throw new Error(
`Cluster ${clusterName}, that is provided in the prisma.yml could not be found.
If it is a private cluster, make sure that you're logged in with ${chalk.bold.green(
'prisma login',
)}`,
)
}
} else if (cluster) {
return cluster
}
}

if (this.definition && this.endpoint) {
const {
clusterBaseUrl,
Expand Down

0 comments on commit 86e28a9

Please sign in to comment.