Skip to content

Commit

Permalink
Merge branch 'dev' into cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kbudde authored Jan 1, 2024
2 parents b341639 + 0556856 commit 43285a7
Show file tree
Hide file tree
Showing 7 changed files with 543 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/job-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
only: ytt, vendir
vendir: latest
only: ytt
ytt: latest
- name: Build myks
run: go install .
- name: Test
run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./...
- name: Upload coverage reports to Codecov
Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/mykso/myks/cmd/vendir"
"github.com/mykso/myks/internal/myks"
)

Expand All @@ -36,6 +37,7 @@ func NewMyksCmd(version, commit, date string) *cobra.Command {
cmd.AddCommand(newInitCmd())
cmd.AddCommand(newPrintConfigCmd())
cmd.AddCommand(newSyncCmd())
cmd.AddCommand(vendir.VendirCmd)
initConfig()
addPlugins(cmd)
return cmd
Expand Down
60 changes: 60 additions & 0 deletions cmd/vendir/vendir.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package vendir

import (
"fmt"
"io"
"log"
"math/rand"
"os"
"time"

carvelCmd "carvel.dev/vendir/pkg/vendir/cmd"
uierrs "github.com/cppforlife/go-cli-ui/errors"
"github.com/cppforlife/go-cli-ui/ui"
"github.com/spf13/cobra"
)

func RunEmbeddedVendir() bool {
if len(os.Args) < 2 {
return false
}
if os.Args[1] != "vendir" {
return false
}
os.Args = os.Args[1:] // remove "vendir" from args

vendirMain()
return true
}

// copied from https://github.com/mykso/vendir/blob/unique-tmp-dir/cmd/vendir/vendir.go
func vendirMain() {
rand.New(rand.NewSource(time.Now().UTC().UnixNano()))

log.SetOutput(io.Discard)

// TODO logs
// TODO log flags used

confUI := ui.NewConfUI(ui.NewNoopLogger())
defer confUI.Flush()

command := carvelCmd.NewDefaultVendirCmd(confUI)

err := command.Execute()
if err != nil {
confUI.ErrorLinef("vendir: Error: %v", uierrs.NewMultiLineError(err))
os.Exit(1)
}

confUI.PrintLinef("Succeeded")
}

var VendirCmd = &cobra.Command{
Use: "vendir",
Short: "Run embedded vendir",
Long: "Vendir is embedded in myks to manage vendir.yaml files.",
RunE: func(cmd *cobra.Command, args []string) error {
return fmt.Errorf("build error 'vendir'. Please create an issue at https://github.com/mykso/myks/issues/new")
},
}
72 changes: 72 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module github.com/mykso/myks
go 1.21

require (
carvel.dev/vendir v0.38.0
github.com/alecthomas/chroma/v2 v2.12.0
github.com/cppforlife/go-cli-ui v0.0.0-20220425131040-94f26b16bc14
github.com/creasty/defaults v1.7.0
github.com/logrusorgru/aurora/v4 v4.0.0
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
Expand All @@ -17,24 +19,94 @@ require (
)

require (
carvel.dev/imgpkg v0.39.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Azure/azure-sdk-for-go v55.0.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.2 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.1 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.7.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.5.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.3.1 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.3.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.1.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.4.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.4.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.3.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.6.0 // indirect
github.com/aws/smithy-go v1.6.0 // indirect
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04 // indirect
github.com/bmatcuk/doublestar v1.2.1 // indirect
github.com/carvel-dev/semver/v4 v4.0.1-0.20230221220520-8090ce423695 // indirect
github.com/cheggaaa/pb/v3 v3.1.4 // indirect
github.com/chrismellard/docker-credential-acr-env v0.0.0-20220327082430-c57b701bfc08 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/cppforlife/cobrautil v0.0.0-20221021151949-d60711905d65 // indirect
github.com/cppforlife/color v1.9.1-0.20200716202919-6706ac40b835 // indirect
github.com/dimchansky/utfbom v1.1.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/docker/cli v24.0.0+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-containerregistry v0.16.1 // indirect
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/otiai10/copy v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.9.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/vito/go-interact v1.0.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.24.3 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace carvel.dev/vendir => github.com/mykso/vendir v0.0.0-20231226140829-0b5478366ac6 // unique-tmp-dir
Loading

0 comments on commit 43285a7

Please sign in to comment.