Skip to content
Snippets Groups Projects
  1. Sep 11, 2017
    • Alex Clemmer's avatar
      Merge pull request #122 from hausdorff/fix-116 · 70af2cd3
      Alex Clemmer authored
      Add types for prototype parameters
      70af2cd3
    • Alex Clemmer's avatar
      Merge pull request #121 from hausdorff/fix-113 · 394dea5d
      Alex Clemmer authored
      Fix #113
      394dea5d
    • Alex Clemmer's avatar
      Add pretty-printing for `prototype search` results · fd0251bc
      Alex Clemmer authored
      When a user runs `prototype search`, we'd like for the output to include
      the name, description, and available template types, and we'd like that
      output to be padded for readability. For example, if the user runs
      `prototype search io.`, we'd like to output something like this:
      
         io.whatever.pkg.foo    Foo's main template    [jsonnet, yaml]
         io.whatever.pkg.foobar Foobar's main template [jsonnet,   yaml, json]
      
      This commit will introduce this style of padded output to the `prototype
      search` subcommand.
      fd0251bc
    • Alex Clemmer's avatar
      Add types for prototype params and templates · 358e6c25
      Alex Clemmer authored
      This commit will fix #116 by introducing two new constructs to the
      prototype specification schema:
      
      1. Mandatory types for prototype parameters. This lets us accept bare
         words on the command line, and then "do the right thing" when
         emitting JSON or Jsonnet.
      
         For example, say a template produces a `core.v1.Service` that exposes
         a port with a `--targetPort` flag. When the user passes a number
         (e.g., `80`) in, we should _not_ put quote marks around it, since we
         want to expose port `80`. When the user passes a string (e.g.,
         `"nginxPort"`), we _should_ put quote marks around it, to denote that
         we're exposing the port with that name.
      
         In order to do this, we need to know they "type" of the parameter (in
         this case, `NumberOrString`).
      
      2. Mandatory template types. A template can have a JSON, YAML, or
         Jsonent flavor, and we default to using Jsonnet. This is useful
         mostly to make type parameters less error-prone (since one set of
         parameters corresponds to one set of templates), but it also
         significantly de-bloats the output of commands like `search`, since
         one fully-qualified name can correspond to multiple flavors of the
         same template.
      358e6c25
    • Alex Clemmer's avatar
      Emit `k.libsonnet` during `init` subcommand · 98c7428f
      Alex Clemmer authored
      This commit fixes #113, causing us to emit `k.libsonnet` (a collection
      of extensions to the k8s API) by updating the dependency on
      `ksonnet-lib/ksonnet-gen` and exercising the new signature for
      `ksonnet.Emit`, which handles this automatically.
      
      We update the `vendor/` directory and the code that depends on it in the
      same commit so that we don't break bisect.
      98c7428f
  2. Sep 09, 2017
  3. Sep 08, 2017
  4. Sep 07, 2017
    • Alex Clemmer's avatar
      Merge pull request #109 from jessicayuen/jyuen/param-rewriter · 4a554ab3
      Alex Clemmer authored
      Support import param rewrite for jsonnet snippets
      4a554ab3
    • Alex Clemmer's avatar
      Merge pull request #105 from hausdorff/deprecate-update · 40489cbb
      Alex Clemmer authored
      Deprecate `update` subcommand; introduce `apply`
      40489cbb
    • Alex Clemmer's avatar
      Deprecate `update` subcommand; introduce `apply` · 94a18089
      Alex Clemmer authored
      This commit is a follow-up to the discussion in the ksonnet.next design
      doc, in which users consistently expressed their preference that the
      `update` command be called `apply`.
      
      NOTE: We have renamed `pkg/kubecfg/update_test.go` ->
      `pkg/kubecfg/apply_test.go`, but we copy the `update`'s integration test
      file. The reason is that the `update` unit tests actually test things
      like GC (rather than the command itself), so the file name is
      inconsequential. On the other hand, the integration tests test the
      commands themselves, so it is important to have two copies, one for
      `update` and one for `apply`.
      94a18089
    • Jessica Yuen's avatar
      Support import param rewrite for jsonnet snippets · 4f54b184
      Jessica Yuen authored
      This commit will rewrite all parameters in the passed Jsonnet file of
      the form `import param://foo` to `${foo}`. This will be a utility for
      `ksonnet prototype use` to support LSP-spec-compliant snippet JSONs.
      4f54b184
    • Jessica Yuen's avatar
      24d09f66
    • Alex Clemmer's avatar
      Merge pull request #106 from hausdorff/lib-path · 46529843
      Alex Clemmer authored
      Include `lib/` and `vendor/lib` when expanding templates
      46529843
    • Alex Clemmer's avatar
      Include `lib/` and `vendor/lib` when expanding templates · bc77be8e
      Alex Clemmer authored
      Currently, if the user wants to deploy a ksonnet application, and that
      application uses some vendored library, or something in the `lib/`
      directory, they will have to pass the appropriate `-J` flags into the
      command themselves.
      
      This commit will automatically add these whenever we're in an app
      directory and a command is issued. In particular, even if the user
      passes in the `-f` flag (rather than an environment name), we'll still
      add library paths to the command if we're in a ksonnet app directory.
      This is meant to capture the case that a user wants to update one
      resource in particular in a ksonnet application.
      bc77be8e
    • Angus Lees's avatar
      Merge pull request #114 from anguslees/showtest-fix · f5f893c5
      Angus Lees authored
      Disable yaml case until test can be rewritten
      f5f893c5
    • Angus Lees's avatar
      Disable yaml case until test can be rewritten · 18554b9f
      Angus Lees authored
      show_test has been failing intermittently since
      af3f0f6c introduced `-f`.
      
      The test failure is due to the flags not being completely reset
      between `RootCmd.Execute()` invocations, thus the second of json/yaml
      (changes because hash ordering) sees *duplicate* `-f` options, and
      produces duplicate output.  This breaks json test validation, but
      not yaml(!)
      
      Ideally we would revert the offending change and resubmit with fixed
      tests, but there have been numerous changes merged since. To stop
      developing _further_ failure blindness, this change simply disables
      the (less-strict) yaml testcase while a rewrite of show_test is
      undertaken (probably a move to new integration framework).
      
      This is *not* a fix for #99
      18554b9f
  5. Sep 06, 2017
  6. Sep 05, 2017
  7. Sep 03, 2017
  8. Sep 02, 2017
    • Alex Clemmer's avatar
      Implement parser and evaluator for TextMate snippets · 434d1f67
      Alex Clemmer authored
      The Language Server Protocol (LSP) implements TextMate's "snippets"
      feature. Originally imagined as a kind of Mad Libs for code, with users
      given a code template and some number of "placeholder" blanks to fill
      out, which was done by using tab to switch between them, LSP team
      attempted to standardize this feature across language servers, so that
      language authors had a well-specified interface to provide "snippets" to
      any editor implementing the LSP.
      
      Today, the LSP specification of TextMate snippets forms the bedrock of the
      ksonnet prototype specification. Specifically, though users will
      eventually be able to use Jsonnet to generate prototypes, they are
      compiled down to the TextMate snippets specification.
      
      This commit begins this process by introducing an implementation of the
      LSP snippets specification, including both a parser and an evaluator.
      
      For more details, see the extensive comment in `interface.go`.
      434d1f67
    • Alex Clemmer's avatar
      Fix #95 · 0d9dc5cb
      Alex Clemmer authored
      0d9dc5cb
    • Alex Clemmer's avatar
  9. Sep 01, 2017
  10. Aug 31, 2017
  11. Aug 30, 2017
    • Marko Mikulicic's avatar
      Fix README · 25734d2c
      Marko Mikulicic authored
      Now the commands take either an env or a file, so let's at least fix the
      README to make it work with files.
      25734d2c
    • Alex Clemmer's avatar
      Merge pull request #88 from hausdorff/ks-gen · 651c24cd
      Alex Clemmer authored
      Implement `init`; bring synchronization primitives to spec
      651c24cd
    • Alex Clemmer's avatar
      Make delete, diff, show, update, and validate aware of ksonnet apps · af3f0f6c
      Alex Clemmer authored
      The ksonnet.next design doc specifies the core kubecfg verbs (i.e., the
      ones listed above) to all have the form:
      
        kubecfg <verb> [<env-name>|-f <file-or-dir>]
      
      That is to say, each of these should be able to take either an
      environment name, or a `-f` flag with a list of files and directories to
      apply `verb` on. In the case of the environment, we will apply `verb` to
      every component in the `components/` directory.
      
      This commit implements this behavior for all these verbs.
      af3f0f6c
    • Alex Clemmer's avatar
      Implement `metadata.Manager#ComponentPaths` · bea6b795
      Alex Clemmer authored
      This commit will introduce the ability of the `metadata.Manager` to
      report every file in the `components/` directory.
      
      This is primarily useful when we invoke the Jsonnet VM, as it requires a
      list of files to expand. (The `template.Expander` also handles YAML and
      JSON.)
      bea6b795
    • Alex Clemmer's avatar
      Add a template expander abstraction · 86c5ad02
      Alex Clemmer authored
      This commit will introduce the `template.Expander` abstraction, which is
      meant to abstract over an invocation of the Jsonnet VM. Specifically, it
      provides facilities for users to provide (e.g.) Jpaths, ext vars, and so
      on.
      
      The main justification for this change is:
      
      * We need a common way for the `pkg` and `cmd` packages to interact with
        the Jsonnet VM.
      * The `utils` package is already too much of a catch-all.
      * It's easier to think about an invocation of the Jsonnet VM when we
        additionally encapsulate the parameters we pass to it on every
        invocation in kubecfg.
      86c5ad02