harness-drone/operator/runner/machine/client.go
2019-03-13 14:47:47 -07:00

47 lines
1.2 KiB
Go

// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
// +build !oss
package machine
// import (
// "io/ioutil"
// "net/http"
// "path/filepath"
// "docker.io/go-docker"
// "docker.io/go-docker/api"
// "github.com/docker/go-connections/tlsconfig"
// )
// // Client returns a new Docker client from the
// // machine directory.
// func Client(path string) (docker.APIClient, error) {
// // read the docker-machine configuration file from
// // the local machine directory.
// configPath, err := := filepath.Join(path, "config.json")
// if err != nil {
// return nil, err
// }
// config :=
// options := tlsconfig.Options{
// CAFile: filepath.Join(path, "ca.pem"),
// CertFile: filepath.Join(path, "cert.pem"),
// KeyFile: filepath.Join(path, "key.pem"),
// InsecureSkipVerify: false,
// }
// tlsc, err := tlsconfig.Client(options)
// if err != nil {
// return nil, err
// }
// client = &http.Client{
// Transport: &http.Transport{
// TLSClientConfig: tlsc,
// },
// CheckRedirect: docker.CheckRedirect,
// }
// return docker.NewClient(host, api.DefaultVersion, client, nil)
// }