Git Product home page Git Product logo

docker-tag-yoinker's People

Contributors

issmirnov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-tag-yoinker's Issues

Crash when config file does not exist

When we run the binary specifying a config file that doesn't exist, we get a crash.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x49b555]

goroutine 1 [running]:
bytes.(*Buffer).WriteTo(0xc0000972f0, 0x0, 0x0, 0x0, 0x0, 0xc0000c4940)
	/home/travis/.gimme/versions/go1.14.6.linux.amd64/src/bytes/buffer.go:239 +0x85
github.com/rs/zerolog.ConsoleWriter.Write(0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000c4940, 0x4, 0x4, 0x0, 0x0, ...)
	/home/travis/gopath/src/github.com/rs/zerolog/console.go:116 +0x349
github.com/rs/zerolog.levelWriterAdapter.WriteLevel(...)
	/home/travis/gopath/src/github.com/rs/zerolog/writer.go:20
github.com/rs/zerolog.(*Event).write(0xc0000b2720, 0x3f, 0x1f4)
	/home/travis/gopath/src/github.com/rs/zerolog/event.go:76 +0x122
github.com/rs/zerolog.(*Event).msg(0xc0000b2720, 0xc00009a2d0, 0x4b)
	/home/travis/gopath/src/github.com/rs/zerolog/event.go:140 +0x210
github.com/rs/zerolog.(*Event).Msgf(0xc0000b2720, 0x756944, 0x1e, 0xc00010fde8, 0x1, 0x1)
	/home/travis/gopath/src/github.com/rs/zerolog/event.go:127 +0x83
github.com/issmirnov/docker-tag-yoinker/config.LoadConfig(0x7ffd377a0994, 0xf, 0x9d1ac0, 0x2, 0x0)
	/home/travis/gopath/src/github.com/issmirnov/docker-tag-yoinker/config/config.go:15 +0x20c
main.main()
	/home/travis/gopath/src/github.com/issmirnov/docker-tag-yoinker/main.go:52 +0x1d4

I need to check the LoadConfig method and ensure the file exists.

Set proper exit codes if version not found

Since we want to use this in scripts, we should return a non zero exit code + empty string if no valid version is found. Log messages should go to stderr, while only the version goes to stdout.

Notify user if no config file found

Currently, the error case shown when no config file is found is "Sorry, but no tags match the rules set in your config file.".

We should really check for the existence of the config file in the init loader phase.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.