-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"okteto stack deploy" and "okteto up" building okteto registry images…
… if they don't exist (#1154) * Okteto up building dev image if it does not exists Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com> * Okteto stack deploy building dev image if it doesn't exist Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com> * Address review comments Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
- Loading branch information
Showing
14 changed files
with
444 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2020 The Okteto Authors | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// 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 registry | ||
|
||
import ( | ||
"net/http" | ||
"strings" | ||
|
||
"github.com/heroku/docker-registry-client/registry" | ||
"github.com/okteto/okteto/pkg/log" | ||
) | ||
|
||
// NewRegistryClient creates a new Registry with the given URL and credentials, then Ping()s it | ||
// before returning it to verify that the registry is available. | ||
func NewRegistryClient(registryURL, username, password string) (*registry.Registry, error) { | ||
transport := http.DefaultTransport | ||
return newFromTransport(registryURL, username, password, transport) | ||
} | ||
|
||
func newFromTransport(registryURL, username, password string, transport http.RoundTripper) (*registry.Registry, error) { | ||
url := strings.TrimSuffix(registryURL, "/") | ||
transport = registry.WrapTransport(transport, url, username, password) | ||
registry := ®istry.Registry{ | ||
URL: url, | ||
Client: &http.Client{ | ||
Transport: transport, | ||
}, | ||
Logf: log.Infof, | ||
} | ||
|
||
return registry, nil | ||
} |
Oops, something went wrong.