Browse Source

Dependecy fixups

layerset v0.0.2
Till Wegmüller 4 years ago
parent
commit
3d7d47f27a
  1. 15
      cmd/imageadm/build.go
  2. 5
      cmd/imageadm/root.go
  3. 6
      gnutar/cmd.go
  4. 47
      go.mod
  5. 32
      go.sum
  6. 31
      host/aci_image.go
  7. 5
      host/keystore.go
  8. 7
      image/build/aci.go
  9. 3
      zfs/common.go

15
cmd/imageadm/build.go

@ -10,7 +10,6 @@ import (
"git.wegmueller.it/opencloud/opencloud/common"
"git.wegmueller.it/opencloud/opencloud/image"
"git.wegmueller.it/opencloud/opencloud/ips"
"git.wegmueller.it/toasterson/glog"
"github.com/appc/spec/schema"
"github.com/appc/spec/schema/types"
"github.com/spf13/cobra"
@ -66,7 +65,7 @@ func runBuild(_ *cobra.Command, args []string) {
}
manifest.Labels = append(manifest.Labels, authorLabel)
}
glog.Infof("Building Image %s", manifest.Name.String())
//glog.Infof("Building Image %s", manifest.Name.String())
if outBuff, err = json.Marshal(manifest); err != nil {
common.ExitWithErr("could not marshal manifest: %s", err)
}
@ -81,7 +80,7 @@ func runBuild(_ *cobra.Command, args []string) {
} else {
rootfsExists = true
}
glog.Infof("Performing IPS Tasks:")
//glog.Infof("Performing IPS Tasks:")
if len(config.Packages) >= 1 {
for _, img := range config.IPSImages {
var ipsImg *ips.Image
@ -90,15 +89,15 @@ func runBuild(_ *cobra.Command, args []string) {
pubs = append(pubs, pubConf.Name+"="+pubConf.URL)
}
if !rootfsExists {
glog.Infof("Image does not exist creating under: %s", filepath.Join(path, "rootfs", img.RelativeRoot))
//glog.Infof("Image does not exist creating under: %s", filepath.Join(path, "rootfs", img.RelativeRoot))
if ipsImg, err = ips.CreateImage(filepath.Join(path, "rootfs", img.RelativeRoot), pubs); err != nil {
common.ExitWithErr("could not create IPS image %s", err)
}
} else {
glog.Infof("Image exists Loading...")
//glog.Infof("Image exists Loading...")
ipsImg = ips.LoadImage(filepath.Join(path, "rootfs", img.RelativeRoot))
}
glog.Infof("Installing %s packages into image: %v", len(config.Packages), config.Packages)
//glog.Infof("Installing %s packages into image: %v", len(config.Packages), config.Packages)
if err = ipsImg.Install(config.Packages...); err != nil {
//It can be that we get an error if there is nothing to do thus ignore for now
//TODO Ignore only when there is nothing to do
@ -109,12 +108,12 @@ func runBuild(_ *cobra.Command, args []string) {
//TODO Build in Zone variant
filesToCopy := config.GetAllFilesToCopy()
if len(filesToCopy) >= 1 {
glog.Infof("Copying %n files from root\n %v", len(filesToCopy), filesToCopy)
//glog.Infof("Copying %n files from root\n %v", len(filesToCopy), filesToCopy)
}
if err = image.PopulateImageFromRoot(config, filepath.Join(path, "rootfs")); err != nil {
common.ExitWithErr("could not populate from image%s", err)
}
glog.Infof("Creating ACI Image as %s.aci", manifest.Name.String())
//glog.Infof("Creating ACI Image as %s.aci", manifest.Name.String())
//At this point we assume that the script has installed everything it needs into so we package everything into an aci image
if err = image.BuildACI(path, filepath.Join(path, manifest.Name.String()+".aci"), *manifest); err != nil {
common.ExitWithErr("could not pack rootfs: %s", err)

5
cmd/imageadm/root.go

@ -5,7 +5,6 @@ import (
"os"
"git.wegmueller.it/opencloud/opencloud/common"
"git.wegmueller.it/toasterson/glog"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
@ -37,10 +36,10 @@ func preRun(cmd *cobra.Command, args []string) {
debug := viper.GetBool("debug")
config := viper.GetString("config")
if loglevel != "" {
glog.SetLevelFromString(loglevel)
//glog.SetLevelFromString(loglevel)
}
if debug {
glog.SetLevel(glog.LOG_DEBUG)
//glog.SetLevel(glog.LOG_DEBUG)
}
if config != "" {
viper.SetConfigFile(config)

6
gnutar/cmd.go

@ -4,8 +4,6 @@ import (
"io"
"os/exec"
"runtime"
"git.wegmueller.it/toasterson/glog"
)
var gnutarBin = "tar"
@ -21,8 +19,8 @@ func execTar(args []string, out io.Writer, input io.Reader) (err error) {
if tarBin, err = exec.LookPath(gnutarBin); err != nil {
return err
}
glog.Tracef("Found Tar Binary %s", tarBin)
glog.Tracef("Executing %v", args)
//glog.Tracef("Found Tar Binary %s", tarBin)
//glog.Tracef("Executing %v", args)
cmd := exec.Command(tarBin, args...)
if out != nil {
cmd.Stdout = out

47
go.mod

@ -3,53 +3,44 @@ module git.wegmueller.it/opencloud/opencloud
go 1.12
require (
git.wegmueller.it/illumos/go-zone v0.0.0-20190415132030-91574cfb7f06
git.wegmueller.it/illumos/go-zone v0.0.1
git.wegmueller.it/toasterson/glog v0.0.0-20180725211246-3619df391249
git.wegmueller.it/toasterson/uxfiletool v0.0.0-20170928184011-ba45dba7b5d7
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/appc/spec v0.8.11
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae
github.com/coreos/go-semver v0.2.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c // indirect
github.com/gorilla/mux v1.7.1 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/h2non/filetype v1.0.5
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/heroku/docker-registry-client v0.0.0-20181004091502-47ecf50fd8d4
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/labstack/gommon v0.2.8
github.com/magiconair/properties v1.8.0 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.7 // indirect
github.com/mholt/caddy v0.11.0
github.com/mitchellh/mapstructure v0.0.0-20180511142126-bb74f1db0675 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runtime-spec v1.0.1
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pelletier/go-toml v1.3.0 // indirect
github.com/ryanuber/columnize v2.1.0+incompatible
github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.4.1 // indirect
github.com/spf13/afero v1.1.1 // indirect
github.com/spf13/cast v1.2.0 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/cobra v0.0.3
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec // indirect
github.com/spf13/pflag v1.0.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/spf13/viper v1.0.2
github.com/stretchr/testify v1.3.0
github.com/toasterson/mozaik v0.0.0-20170720104311-bccb4b6eab9e
github.com/toasterson/opencloud v0.0.0-20170906180432-08e4d063edaa // indirect
github.com/valyala/fasttemplate v1.0.1 // indirect
github.com/vbauerster/mpb v3.4.0+incompatible
github.com/ztrue/tracerr v0.3.0
go4.org v0.0.0-20180417224846-9599cf28b011 // indirect
golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc // indirect
golang.org/x/text v0.3.0 // indirect
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.1 // indirect
go4.org v0.0.0-20190313082347-94abd6928b1d // indirect
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20190420063019-afa5a82059c6 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)

32
go.sum

@ -1,6 +1,9 @@
git.wegmueller.it/illumos/go-zone v0.0.0-20190415132030-91574cfb7f06 h1:eY5uBWSuHVh1g66HQhFm22/VtYTwhvxLn6jRbTOY/9E=
git.wegmueller.it/illumos/go-zone v0.0.0-20190415132030-91574cfb7f06/go.mod h1:kS7jJY8r2IzzMD/cy0Yo1jpnhXkKe+hCMUqJ/+Q/B64=
git.wegmueller.it/illumos/go-zone v0.0.1 h1:dzTaMlyC9PgTEUxyARWPDMmO6XXlKAshN7zO3rh3r4U=
git.wegmueller.it/illumos/go-zone v0.0.1/go.mod h1:EJq5YRdJwwkNgx3AYg3CKg5ZXGMFzUAFcy1QIiwWEDw=
git.wegmueller.it/opencloud/opencloud v0.0.0-20180831083912-e176ab4ec7c9/go.mod h1:HUaRmUt+M9r2yiVrlBrtyL+QUFq6cK4VwMgnUB29dWE=
git.wegmueller.it/opencloud/opencloud v0.0.1/go.mod h1:xsjwodqsG+/dGz6oJidTT12LewWeeplCrNiuqGzgnh0=
git.wegmueller.it/toasterson/glog v0.0.0-20180725211246-3619df391249 h1:wOGVu7exVeQXi49bBkcKBFV/hr4Nz3AIc2XYbYPO0wE=
git.wegmueller.it/toasterson/glog v0.0.0-20180725211246-3619df391249/go.mod h1:y11hBpN5HjKJd9MkVTLqohOaXxHB3SS0uejuF0IBhsY=
git.wegmueller.it/toasterson/uxfiletool v0.0.0-20170928184011-ba45dba7b5d7 h1:S2kMq8WD5+fUWN7kcKSe+aAEYYyOXc9z4mTeSnlTaQM=
@ -15,6 +18,8 @@ github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae h1:2Zmk+8cNvAGuY8A
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M=
github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -28,16 +33,22 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c h1:jWtZjFEUE/Bz0IeIhqCnyZ3HG6KRXSntXe4SjtuTH7c=
github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU=
github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/h2non/filetype v1.0.5 h1:Esu2EFM5vrzNynnGQpj0nxhCkzVQh2HRY7AXUh/dyJM=
github.com/h2non/filetype v1.0.5/go.mod h1:isekKqOuhMj+s/7r3rIeTErIRy4Rub5uBWHfvMusLMU=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce h1:prjrVgOk2Yg6w+PflHoszQNLTUh4kaByUcEWM/9uin4=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874 h1:em+tTnzgU7N22woTBMcSJAOW7tRHAkK597W+MD/CpK8=
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/heroku/docker-registry-client v0.0.0-20181004091502-47ecf50fd8d4 h1:44WMsEqwiYnpHA3E4Rg1K379MH5iZllp2sO5nzXARI0=
github.com/heroku/docker-registry-client v0.0.0-20181004091502-47ecf50fd8d4/go.mod h1:ceV82AfTGFCOL/b0cdpP54uKVSL1Gef0TBSTGFDuqyY=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
@ -64,6 +75,8 @@ github.com/mholt/caddy v0.11.0 h1:cuhEyR7So/SBBRiAaiRBe9BoccDu6uveIPuM9FMMavg=
github.com/mholt/caddy v0.11.0/go.mod h1:Wb1PlT4DAYSqOEd03MsqkdkXnTxA8v9pKjdpxbqM1kY=
github.com/mitchellh/mapstructure v0.0.0-20180511142126-bb74f1db0675 h1:/rdJjIiKG5rRdwG5yxHmSE/7ZREjpyC0kL7GxGT/qJw=
github.com/mitchellh/mapstructure v0.0.0-20180511142126-bb74f1db0675/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
@ -72,6 +85,8 @@ github.com/opencontainers/runtime-spec v1.0.1 h1:wY4pOY8fBdSIvs9+IDHC55thBuEulhz
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.3.0 h1:e5+lF2E4Y2WCIxBefVowBuB0iHrUH4HZ8q+6mGF7fJc=
github.com/pelletier/go-toml v1.3.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@ -84,14 +99,22 @@ github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/spf13/afero v1.1.1 h1:Lt3ihYMlE+lreX1GS4Qw4ZsNpYQLxIXKBTEOXm3nt6I=
github.com/spf13/afero v1.1.1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg=
github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso=
github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@ -113,11 +136,18 @@ github.com/ztrue/tracerr v0.3.0 h1:lDi6EgEYhPYPnKcjsYzmWw4EkFEoA/gfe+I9Y5f+h6Y=
github.com/ztrue/tracerr v0.3.0/go.mod h1:qEalzze4VN9O8tnhBXScfCrmoJo10o8TN5ciKjm6Mww=
go4.org v0.0.0-20180417224846-9599cf28b011 h1:i0QTVNl3j6yciHiQIHxz+mnsSQqo/xi78EGN7yNpMVw=
go4.org v0.0.0-20180417224846-9599cf28b011/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
go4.org v0.0.0-20190313082347-94abd6928b1d h1:JkRdGP3zvTtTbabWSAC6n67ka30y7gOzWAah4XYJSfw=
go4.org v0.0.0-20190313082347-94abd6928b1d/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8 h1:h7zdf0RiEvWbYBKIx4b+q41xoUVnMmvsGZnIVE5syG8=
golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190420063019-afa5a82059c6 h1:HdqqaWmYAUI7/dmByKKEw+yxDksGSo+9GjkUc9Zp34E=
golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5 h1:UMbOtg4ZL2GyTAolLE9QfNvzskWvFkI935Z98i9moXA=
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -133,3 +163,5 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

31
host/aci_image.go

@ -18,7 +18,6 @@ import (
"git.wegmueller.it/opencloud/opencloud/image"
"git.wegmueller.it/opencloud/opencloud/pod"
"git.wegmueller.it/opencloud/opencloud/zfs"
"git.wegmueller.it/toasterson/glog"
"github.com/appc/spec/discovery"
"github.com/appc/spec/schema"
"github.com/appc/spec/schema/types"
@ -190,7 +189,7 @@ func (h *Host) ACIImages() ([]*pod.Image, error) {
if img != nil {
id = img.UUID.String()
}
glog.Warnf("WARNING: images/%v: %v", id, err)
//glog.Warnf("WARNING: images/%v: %v", id, err)
} else {
rv = append(rv, img)
}
@ -201,17 +200,17 @@ func (h *Host) ACIImages() ([]*pod.Image, error) {
func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *pod.Image, erv error) {
newId := uuid.NewV4()
if name.Empty() {
glog.Infoln("Starting import")
//glog.Infoln("Starting import")
} else {
glog.Infof("Starting import of %v", name)
//glog.Infof("Starting import of %v", name)
}
if asc != nil {
glog.Debugln("Checking signature")
//glog.Debugln("Checking signature")
didKeyDiscovery := false
ks := h.Keystore()
checkSig:
if _, err := ks.CheckSignature(name.String(), aci, asc); err == openpgpErr.ErrUnknownIssuer && !didKeyDiscovery {
glog.Infoln("Image signed by an unknown issuer, attempting to discover public key...")
//glog.Infoln("Image signed by an unknown issuer, attempting to discover public key...")
if err := h.TrustKey(name.String(), "", ""); err != nil {
return nil, err
}
@ -222,13 +221,13 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
} else if err != nil {
return nil, err
} else {
glog.Infoln("Valid signature for", name)
//glog.Infoln("Valid signature for", name)
aci.Seek(0, io.SeekStart)
asc.Seek(0, io.SeekStart)
}
} else {
glog.Debugln("No signature to check")
//glog.Debugln("No signature to check")
}
img := pod.NewImage(h.Dataset, newId)
@ -245,7 +244,7 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
// Save copy of the signature
if asc != nil {
glog.Debugln("Saving signature copy")
//glog.Debugln("Saving signature copy")
if ascCopy, err := os.OpenFile(img.Path("aci.asc"), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0400); err != nil {
return nil, err
} else {
@ -258,7 +257,7 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
}
// Load manifest
glog.Debugln("Loading manifest")
//glog.Debugln("Loading manifest")
var manifestBytes []byte
buff := bytes.NewBuffer(manifestBytes)
err := gnutar.ExtractOne("manifest", aci, buff, true)
@ -276,13 +275,13 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
}
if len(img.Manifest.Dependencies) == 0 {
glog.Debugln("No dependencies to fetch")
//glog.Debugln("No dependencies to fetch")
if _, err := h.Dataset.CreateChildDataset(path.Join("images", img.Name()), zfs.Properties{"mountpoint": h.Dataset.VFSPath("images", img.Name(), "rootfs")}); err != nil {
return nil, err
}
} else {
for i, dep := range img.Manifest.Dependencies {
glog.Infof("Looking for dependency:", dep.ImageName, dep.Labels, dep.ImageID)
//glog.Infof("Looking for dependency:", dep.ImageName, dep.Labels, dep.ImageID)
if dimg, err := h.getACIImageDependency(dep); err != nil {
return nil, err
} else {
@ -291,7 +290,7 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
// save the hash to the real manifest.
img.Manifest.Dependencies[i].ImageID = dimg.Hash
if i == 0 {
glog.Infof("Cloning parent %v as base rootfs\n", dimg)
//glog.Infof("Cloning parent %v as base rootfs\n", dimg)
if ds, err := dimg.Clone(path.Join("images", img.Name()), h.Dataset.VFSPath("images", img.Name(), "rootfs")); err != nil {
return nil, err
} else {
@ -308,7 +307,7 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
return nil, err
}
glog.Infoln("Unpacking rootfs")
//glog.Infoln("Unpacking rootfs")
aciRd, err := common.DecompressingReader(aci)
if err != nil {
@ -319,7 +318,7 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
err = gnutar.ExtractOneInto("rootfs", img.Path(), aciRd)
if err != nil {
glog.Tracef("returned %s", err)
//glog.Tracef("returned %s", err)
return nil, err
}
@ -327,7 +326,7 @@ func (h *Host) ImportACIImage(name types.ACIdentifier, aci, asc *os.File) (_ *po
// CAN'T HAPPEN
return nil, err
} else {
glog.Infoln("Successfully imported", hash)
//glog.Infoln("Successfully imported", hash)
img.Hash = hash
}

5
host/keystore.go

@ -4,7 +4,6 @@ import (
"git.wegmueller.it/opencloud/opencloud/common"
"git.wegmueller.it/opencloud/opencloud/image/discovery"
"git.wegmueller.it/opencloud/opencloud/keystore"
"git.wegmueller.it/toasterson/glog"
)
func (h *Host) Keystore() *keystore.Keystore {
@ -44,9 +43,9 @@ func (h *Host) TrustKey(prefix string, location, fingerprint string) error {
}
if keypath == "" {
glog.Infoln("Key NOT accepted")
//glog.Infoln("Key NOT accepted")
} else {
glog.Infof("Key accepted and saved as %v\n", keypath)
//glog.Infof("Key accepted and saved as %v\n", keypath)
}
return nil

7
image/build/aci.go

@ -11,7 +11,6 @@ import (
"fmt"
"git.wegmueller.it/toasterson/glog"
"git.wegmueller.it/toasterson/uxfiletool"
"github.com/appc/spec/aci"
"github.com/appc/spec/schema"
@ -19,14 +18,14 @@ import (
func PopulateImageFromRoot(conf *Config, target string) error {
for _, file := range conf.GetAllFilesToCopy() {
glog.Debugf("Copying: %s", file.Path)
//glog.Debugf("Copying: %s", file.Path)
if err := uxfiletool.ExactCopy(file.Path, target); err != nil {
glog.Tracef("Error Encountered: %s", err)
//glog.Tracef("Error Encountered: %s", err)
if !os.IsNotExist(err) {
if strings.Contains(err.Error(), "operation not applicable") {
continue
}
glog.Errf("Error: %s", err)
//glog.Errf("Error: %s", err)
return err
}
}

3
zfs/common.go

@ -8,7 +8,6 @@ import (
"strconv"
"strings"
"git.wegmueller.it/toasterson/glog"
"github.com/c2h5oh/datasize"
)
@ -384,7 +383,7 @@ func zfsExec(args []string) (retVal []string, err error) {
var out, serr bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &serr
glog.Traceln(cmd.Path, cmd.Args)
//glog.Traceln(cmd.Path, cmd.Args)
if err = cmd.Run(); err != nil {
return []string{}, errors.New(strings.TrimSpace(serr.String()))
}

Loading…
Cancel
Save