Skip to content

Commit

Permalink
Linting and spelling issues (#958)
Browse files Browse the repository at this point in the history
* linting and spelling issues

Signed-off-by: Ramiro Berrelleza <rberrelleza@gmail.com>
  • Loading branch information
rberrelleza committed Jun 25, 2020
1 parent c15cdd0 commit 12c02b5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func Login() *cobra.Command {
Run
$ okteto login
and this command will open your browser to ask your authentication details and retreive your API token. You can script it by using the --token parameter.
and this command will open your browser to ask your authentication details and retrieve your API token. You can script it by using the --token parameter.
By default, this will log into cloud.okteto.com. If you want to log into your Okteto Enterprise instance, specify a URL. For example, run
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/down/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package down

import (
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/login/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ type Handler struct {
errChan chan error
}

func (a *Handler) handle() http.Handler {
func (h *Handler) handle() http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
code := r.URL.Query().Get("code")
s := r.URL.Query().Get("state")

if a.state != s {
a.errChan <- fmt.Errorf("invalid request state")
if h.state != s {
h.errChan <- fmt.Errorf("invalid request state")
w.WriteHeader(http.StatusBadRequest)
return
}

if _, err := w.Write(loginHTML); err != nil {
a.errChan <- fmt.Errorf("failed to write to the response: %s", err)
h.errChan <- fmt.Errorf("failed to write to the response: %s", err)
w.WriteHeader(http.StatusInternalServerError)
}

a.response <- code
h.response <- code
}

return http.HandlerFunc(fn)
Expand Down
16 changes: 8 additions & 8 deletions pkg/k8s/forward/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestStop(t *testing.T) {
}

pf.activeServices = map[string]*active{
"svc": &active{
"svc": {
readyChan: make(chan struct{}, 1),
stopChan: make(chan struct{}, 1),
},
Expand Down Expand Up @@ -186,19 +186,19 @@ func Test_getServicePorts(t *testing.T) {
{
name: "services-with-port",
forwards: map[int]model.Forward{
80: model.Forward{Local: 80, Remote: 8090},
8080: model.Forward{Local: 8080, Remote: 8090, ServiceName: "svc", Service: true},
22: model.Forward{Local: 22000, Remote: 22},
80: {Local: 80, Remote: 8090},
8080: {Local: 8080, Remote: 8090, ServiceName: "svc", Service: true},
22: {Local: 22000, Remote: 22},
},
expected: []string{"8080:8090"},
},
{
name: "services-with-multiple-ports",
forwards: map[int]model.Forward{
80: model.Forward{Local: 80, Remote: 8090},
8080: model.Forward{Local: 8080, Remote: 8090, ServiceName: "svc", Service: true},
22: model.Forward{Local: 22000, Remote: 22},
8089: model.Forward{Local: 8089, Remote: 80890, ServiceName: "svc", Service: true},
80: {Local: 80, Remote: 8090},
8080: {Local: 8080, Remote: 8090, ServiceName: "svc", Service: true},
22: {Local: 22000, Remote: 22},
8089: {Local: 8089, Remote: 80890, ServiceName: "svc", Service: true},
},
expected: []string{"8080:8090", "8089:80890"},
},
Expand Down
3 changes: 2 additions & 1 deletion pkg/model/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ var (
// ValidKubeNameRegex is the regex to validate a kubernetes resource name
ValidKubeNameRegex = regexp.MustCompile(`[^a-z0-9\-]+`)

rootUser int64 = 0
rootUser int64

// DevReplicas is the number of dev replicas
DevReplicas int32 = 1

Expand Down
2 changes: 1 addition & 1 deletion pkg/model/dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ forward:
}

if d.PersistentVolumeEnabled() {
t.Errorf("peristent volume was enabled by default")
t.Errorf("persistent volume was enabled by default")
}
})
}
Expand Down

0 comments on commit 12c02b5

Please sign in to comment.