Code Monkey home page Code Monkey logo

ankh's People

Contributors

esmet avatar jhsu avatar johnmurray avatar jonahgeorge avatar jondlm avatar mmoresco avatar rcousineau-xandr avatar shortland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ankh's Issues

`--filter` does weird things when more than one document matches the filter

It looks like exactly one newline at the end of any matched document is removed, causing yaml badness when more than one document is matched and they are concatenated.

This is probably fallout from the highly hand-written yaml filter code that attempts to preserve comments and whitespace. More care is needed.

version command: missing ~/.ankh/config

after a fresh install, running ankh version prints this error:

$ ankh version
# WARNING /Users/ogupte/.ankh/config: Unable to read ankh config '/Users/ogupte/.ankh/config': open /Users/ogupte/.ankh/config: no such file or directory
# ERROR   Context '' not found in `contexts`
# INFO    The following contexts are available:

Validation of slack config when --slack is provided

repro step
remove slack from your ankh config and try to execute ankh apply --slack, it will throw an error saying that authentication failed

expected:
apply validation if --slack is provided so that
if (sendSlackMessage && (!config.slack || !config.slack.token || !config.slack.format .... )) throw error

Ankh panics on some inputs

Steps to reproduce

Make a minimal-chart directory with the following Chart.yaml:

name: my-app
version: 1.0.0

And the following minimal-chart/templates/config-map.yaml:

apiVersion: v1
kind: ConfigMap
metadata:
  name: "my-app-{{ .Release.Name }}"
  labels:
	app: "my-app"
    release: {{ .Release.Name }}
data:
  SOME_CONFIG: "any-value"

Then run ankh lint chart-path=./minimal-chart, choose some environment, and leave the namespace blank.

Observed

Ankh panics with:

panic: attempted to parse unknown event: none [recovered]
	panic: attempted to parse unknown event: none [recovered]
	panic: attempted to parse unknown event: none

goroutine 1 [running]:
github.com/jawher/mow%2ecli.(*step).run(0xc000368600, 0x14e13a0, 0xc0002280f0)
	/Users/dbemiller/go/pkg/mod/github.com/jawher/[email protected]/flow.go:28 +0xd6
github.com/jawher/mow%2ecli.(*step).run(0xc000368660, 0x14e13a0, 0xc0002280f0)
	/Users/dbemiller/go/pkg/mod/github.com/jawher/[email protected]/flow.go:20 +0xbe
github.com/jawher/mow%2ecli.(*step).run(0xc0003691d0, 0x14e13a0, 0xc0002280f0)
	/Users/dbemiller/go/pkg/mod/github.com/jawher/[email protected]/flow.go:20 +0xbe
github.com/jawher/mow%2ecli.(*step).callDo.func1(0xc000369200, 0x0, 0x0)
	/Users/dbemiller/go/pkg/mod/github.com/jawher/[email protected]/flow.go:41 +0x4a
panic(0x14e13a0, 0xc0002280f0)
	/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/panic.go:969 +0x166
gopkg.in/yaml%2ev2.handleErr(0xc00073c798)
	/Users/dbemiller/go/pkg/mod/gopkg.in/[email protected]/yaml.go:249 +0x9a
panic(0x14e13a0, 0xc0002280f0)
	/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/panic.go:969 +0x166
gopkg.in/yaml%2ev2.(*parser).parse(0xc000356000, 0xc00007e100)
	/Users/dbemiller/go/pkg/mod/gopkg.in/[email protected]/decode.go:158 +0x251
gopkg.in/yaml%2ev2.(*Decoder).Decode(0xc00073c848, 0x14c7bc0, 0xc0001081e0, 0x0, 0x0)
	/Users/dbemiller/go/pkg/mod/gopkg.in/[email protected]/yaml.go:122 +0xdf
github.com/appnexus/ankh/helm.helmLint(0xc000362480, 0xc0000fe000, 0xbb, 0x0, 0x0, 0xc000600400)
	/Users/dbemiller/code/ankh/helm/lintstage.go:106 +0x232
...

Expected

An error message that describes what's broken or missing.

ankh should pass templated output through temp files

@esmet:

ankh passing templated output through temp files (instead of stdout/stdin pipes) would probably solve:

  • ankh erroring immediately if the underlying kubectl wrapper prompts stdin for a password
  • kubectl apply error messages to reference an input file line number instead of vaguely saying "from stdin"

Helm 3 Support

Helm 3 removes the --name flag in favor of the following format:

Usage:
  helm template [NAME] [CHART] [flags]

This causes failures in ankh templating:

# INFO    Templating chart "flotilla" from path "helm/flotilla"
# FATAL   error running the helm command: exit status 1 -- the helm process had the following output on stderr:
Error: unknown flag: --name

Deprecate `current-context`

Using current-context is dangerous so let's remove it and instead allow people to use explicit --environment and --context flags.

`ankh chart diff` command

  • perform ankh template
  • perform ankh chart fetch (#87)
  • print a diff of those two results

is it possible to use something like git diff --no-index for a nice +/- view (versus diff with </>)?

current-context cannot reference a context from `includes`

It's not currently possible to switch to a context that comes from an include:

$ ankh config use-context kube00nym2-staging
# ERROR   Context 'kube00nym2-staging' not found in `contexts`
# INFO    The following contexts are available:
# INFO    - minikube

We've decided that the whole concept of current-context should go away in the next major release since it's too dangerous to rely on that bit of state. In light of that, let's add a deprecation warning that says

WARNING current-context will be removed in the next major version of ankh. It currently does not support values that come from include. Use the --context flag instead.

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.