Removed unused functions

Fixes #534 by removing functions askForConfirmation in app.go, TransformData and RandStringBytes in utils.go
This commit is contained in:
Suraj Narwade
2017-04-04 11:24:35 +05:30
parent a24084d2a6
commit 3a086b4f2f
2 changed files with 0 additions and 55 deletions
-38
View File
@@ -17,37 +17,21 @@ limitations under the License.
package transformer
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"os"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/ghodss/yaml"
"github.com/kubernetes-incubator/kompose/pkg/kobject"
"path/filepath"
"github.com/pkg/errors"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
)
const letterBytes = "abcdefghijklmnopqrstuvwxyz0123456789"
const Selector = "io.kompose.service"
// RandStringBytes generates randomly n-character string
func RandStringBytes(n int) string {
b := make([]byte, n)
for i := range b {
b[i] = letterBytes[rand.Intn(len(letterBytes))]
}
return string(b)
}
// CreateOutFile creates the file to write to if --out is specified
func CreateOutFile(out string) (*os.File, error) {
var f *os.File
@@ -130,28 +114,6 @@ func ConfigAnnotations(service kobject.ServiceConfig) map[string]string {
return annotations
}
// TransformData transforms data to json/yaml
func TransformData(obj runtime.Object, GenerateJSON bool) ([]byte, error) {
// Convert to versioned object
objectVersion := obj.GetObjectKind().GroupVersionKind()
version := unversioned.GroupVersion{Group: objectVersion.Group, Version: objectVersion.Version}
versionedObj, err := api.Scheme.ConvertToVersion(obj, version)
if err != nil {
return nil, err
}
// convert data to json / yaml
data, err := yaml.Marshal(versionedObj)
if GenerateJSON == true {
data, err = json.MarshalIndent(versionedObj, "", " ")
}
if err != nil {
return nil, err
}
log.Debugf("%s\n", data)
return data, nil
}
// Print either prints to stdout or to file/s
func Print(name, path string, trailing string, data []byte, toStdout, generateJSON bool, f *os.File) (string, error) {
file := ""