1. 07 Sep, 2017 3 commits
    • 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.
    • Angus Lees's avatar
      Merge pull request #114 from anguslees/showtest-fix · f5f893c5
      Angus Lees authored
      Disable yaml case until test can be rewritten
    • 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
  2. 06 Sep, 2017 4 commits
  3. 05 Sep, 2017 1 commit
  4. 03 Sep, 2017 3 commits
    • Alex Clemmer's avatar
      Merge pull request #100 from hausdorff/proto · 7551f5de
      Alex Clemmer authored
      Introduce initial version of the `prototype` command
    • Alex Clemmer's avatar
      Implement `prototype` command · ae7af0ee
      Alex Clemmer authored
      This commit implements `prototype` and its subcommands (i.e., `use`,
      `search`, and `describe`) as specified in the ksonnet.next design doc.
    • Alex Clemmer's avatar
      Introduce `prototype` package · e8851be8
      Alex Clemmer authored
      This commit will introduce a simple skeleton of the `prototype` package,
      which will (eventually) form the basis of the prototype command
      (including the `search`, `describe`, and `use` subcommands as dictated
      by the specification).
  5. 02 Sep, 2017 3 commits
    • 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`.
    • Alex Clemmer's avatar
      Fix #95 · 0d9dc5cb
      Alex Clemmer authored
    • Alex Clemmer's avatar
  6. 01 Sep, 2017 4 commits
  7. 31 Aug, 2017 2 commits
  8. 30 Aug, 2017 13 commits
    • 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.
    • Alex Clemmer's avatar
      Merge pull request #88 from hausdorff/ks-gen · 651c24cd
      Alex Clemmer authored
      Implement `init`; bring synchronization primitives to spec
    • 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.
    • 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
    • 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
      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.
    • Alex Clemmer's avatar
      Implement `init` subcommand · 83799252
      Alex Clemmer authored
      This commit will implement the first version of the `init` subcommand.
      This subcommand initializes a ksonnet application, including generating
      the default directory tree and generating the appropriate ksonnet-lib.
    • Alex Clemmer's avatar
      Implement ClusterSpec.data for `version:` scheme · 4664eaa6
      Alex Clemmer authored
      `metadata.ClusterSpec` represents a specification for an abstract
      Kubernetes cluster. For example, `version:1.7.0` represents a Kubernetes
      cluster running a build from 1.7.0. This specification is primarily used
      to generate ksonnet-lib.
      This struct exposes a method, `data` that will retrieve the OpenAPI JSON
      that specifies the API for a Kubernetes cluster. Eventually, `data` will
      be able to read a file, pull from a URL, pull from a live cluster, or
      pull a specific version of the API from the official Kubernetes
      This commit introduces the the last of these options.
    • Alex Clemmer's avatar
      Generate ksonnet-lib as part of `metadata.Manager` initialization · ccd74079
      Alex Clemmer authored
      `metadata.Init` is meant to initialize a ksonnet application, including
      its directory structure and the initial versions of various metadata
      files in the tree. But, this implementation is incomplete: currently
      only the directory tree is initialized.
      This commit will change init to generate ksonnet-lib as part of the
      initialization process.
    • Alex Clemmer's avatar
      Vendor ksonnet-lib/ksonnet-gen · ee31939b
      Alex Clemmer authored
      The ksonnet-lib codebase exposes a package, ksonnet-gen, which will
      automatically generate the ksonnet library for a given OpenAPI
      specification of the Kubernetes API.
      This commit vendors only the source in the ksonnet-gen package (rather
      than the entire repository) as a dependency in the kubecfg project.
    • Alex Clemmer's avatar
      Drop support for go 1.7 · 408a5925
      Alex Clemmer authored
      The codegen routines for ksonnet-lib depend on some Go 1.8 features
      (e.g., `sort.Slice`). Once we vendor the dependency, this will cause the
      build to fail perpetually for Go 1.7.
      This commit therefore drops support for 1.7, making 1.8 the line of
      supportability. This decision was made together with @anguslees, in
      slack PMs.
    • Angus Lees's avatar
      Trivial debugging log message fixes · b2123661
      Angus Lees authored
      Noticed and then audited in the course of other work.
    • Angus Lees's avatar
      Vendor updates from previous commit · 2ae97e9f
      Angus Lees authored
    • Angus Lees's avatar
      Add basic integration test framework · b01b1647
      Angus Lees authored
      Currently contains basic "update" and "delete" tests.
      More cases will be added in followup patches.
  9. 16 Aug, 2017 1 commit
  10. 15 Aug, 2017 2 commits
    • Alex Clemmer's avatar
      First cut at core app metadata management facilities · 57351df8
      Alex Clemmer authored
      Much of the tooling build around ksonnet applications will be powered by
      metadata presented in a structured directory format. This is similar in
      principle to how Hugo and Rails structure web applications.
      This commit will begin the process of introducing a FS-based state
      machine that manages this directory structure. Primarily, this involves
      1. Init routines for the directory structure
      2. Routines to search parent directories for a ksonnet application
         (similar to how git does this with repositories)
      Initially, the directory structures looks like this:
          .ksonnet/   Metadata for ksonnet
          components/ Top-level Kubernetes objects defining application
          lib/        User-written .libsonnet files
          vendor/     Mixin libraries, prototypes
      The `.ksonnet` file marks the application root, making it possible to
      search parent directories for the root.
      As time continues, more verbs will be introduced to manipulate this
      metadata (including, e.g., vendoring dependencies, searching prototypes,
      and so on).
    • Alex Clemmer's avatar
      Add Afero as vendored dependency · 11efba2b
      Alex Clemmer authored
      Despite being seemingly the most popular mockable FS library, Afero does
      not tag releases in git, and does not appear to have cut a release in
      about a year. Hence, the following considerations were taken into
      account when we vendored the dependency:
      * The commits since the last release (2015) appear to be almost entirely
        bug fixes.
      * In the case that we are calling to the OS's FS (rather than, say, a
        testable, memory-mapped FS), the Afero is a simple wrapper, and hence
        introduces little risk into the CLI tool. We verified this by looking
        at the actual source.
      * We opened issue #129 to attempt to nudge the committers into using
        stable software engineering practices (e.g., tagging your releases),
        and we will see how this issue evolves.
  11. 14 Aug, 2017 1 commit
  12. 09 Aug, 2017 3 commits