Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Correctly detect env from ctx (#346)
Browse files Browse the repository at this point in the history
#345
  • Loading branch information
tamalsaha committed Dec 19, 2017
1 parent 830e7e3 commit bd1aa83
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 13 deletions.
3 changes: 1 addition & 2 deletions cloud/providers/azure/cloud.go
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/adal"
"github.com/Azure/go-autorest/autorest/azure"
_env "github.com/appscode/go/env"
"github.com/appscode/go/errors"
. "github.com/appscode/go/types"
api "github.com/pharmer/pharmer/apis/v1alpha1"
Expand Down Expand Up @@ -573,7 +572,7 @@ func (conn *cloudConnector) createVirtualMachine(nic network.Interface, as compu
AdminUsername: StringP(conn.namer.AdminUsername()),
CustomData: StringP(base64.StdEncoding.EncodeToString([]byte(data))),
LinuxConfiguration: &compute.LinuxConfiguration{
DisablePasswordAuthentication: BoolP(!_env.FromHost().DebugEnabled()),
DisablePasswordAuthentication: BoolP(!Env(conn.ctx).DebugEnabled()),
SSH: &compute.SSHConfiguration{
PublicKeys: &[]compute.SSHPublicKey{
{
Expand Down
3 changes: 1 addition & 2 deletions cloud/providers/vultr/cloud.go
Expand Up @@ -7,7 +7,6 @@ import (
"strings"

gv "github.com/JamesClonk/vultr/lib"
_env "github.com/appscode/go/env"
"github.com/appscode/go/errors"
api "github.com/pharmer/pharmer/apis/v1alpha1"
. "github.com/pharmer/pharmer/cloud"
Expand Down Expand Up @@ -272,7 +271,7 @@ func (conn *cloudConnector) CreateInstance(name, token string, ng *api.NodeGroup
Hostname: name,
Tag: conn.cluster.Name,
}
if _env.FromHost().IsPublic() {
if Env(conn.ctx).IsPublic() {
opts.SSHKey = sshKeyID
}
resp, err := conn.client.CreateServer(name, regionID, planID, osID, opts)
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/aws/README.md
Expand Up @@ -22,7 +22,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 2 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/azure/README.md
Expand Up @@ -23,7 +23,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 1 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/digitalocean/README.md
Expand Up @@ -21,7 +21,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 2 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/lightsail/README.md
Expand Up @@ -22,7 +22,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 1 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/linode/README.md
Expand Up @@ -22,7 +22,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 2 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/packet/README.md
Expand Up @@ -22,7 +22,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 1 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/scaleway/README.md
Expand Up @@ -22,7 +22,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 2 work

As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.
```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/vultr/README.md
Expand Up @@ -23,7 +23,7 @@ Following example will use `pharmer ` to create a Kubernetes cluster with 2 work
As a prerequisite, you need to have `pharmer` installed. To install `pharmer` run the following command.

```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
```

### Pharmer storage
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/README.md
Expand Up @@ -33,7 +33,7 @@ development environment, please follow [these instructions](https://golang.org/d
#### Download Source

```console
$ go get github.com/pharmer/pharmer
$ go get -u github.com/pharmer/pharmer
$ cd $(go env GOPATH)/src/github.com/pharmer/pharmer
```

Expand Down

0 comments on commit bd1aa83

Please sign in to comment.