1. 20 Apr, 2018 2 commits
  2. 07 Apr, 2018 1 commit
  3. 03 Apr, 2018 1 commit
  4. 28 Mar, 2018 1 commit
  5. 21 Feb, 2018 1 commit
  6. 08 Feb, 2018 1 commit
  7. 30 Jan, 2018 1 commit
  8. 30 Nov, 2017 2 commits
  9. 29 Nov, 2017 1 commit
    • Alex Clemmer's avatar
      💪 Make env-name a required param in "env commands" · 4923a3f5
      Alex Clemmer authored
      Fixes #100.
      This commit will transition the ksonnet CLI away from accepting either a
      list of files or an environment (or both). A detailed explanation
      Historically, the ksonnet CLI has had several "environment commands".
      These commands (e.g., `apply`, `diff`, `delete`, `show`, etc.) all took
      one of the following:
        1. An environment name. For example, `apply us-west/dev` will `apply`
           everything in the `components/` directory to the cluster denoted by
        2. A set of files. For example, `apply -f foo.jsonnet -f bar.jsonnet`
           would apply those two specific Jsonnet files to the server
           specified by the current context in $KUBECONFIG.
        3. Both an environment name and a set of files. For example,
           `apply us-west/dev -f foo.jsonnet -f bar.jsonnet` would `apply`
           those two files to the cluster denoted by the `us-west/dev`
      This "duality" remained in place primarily because it was important for
      the ksonnet CLI to maintain functional compatibility (though not strict
      CLI-level app compatibility) with the kubecfg tool.
      Some time ago the ksonnet CLI was forked from the kubecfg CLI, but it is
      only in this commit that we abandon this duality. Specifically, this
      commit will _require_ the environment name for all commands. For
      example, the form of `apply` will now be:
      `apply <env-name> [-f <file>]`.
      There are main parts to this:
        1. Refactoring core abstractions that supports this "duality".
           Specifically, removing the `cmd.envSpec` type and several
           functions, such as `cmd.parseEnvCmd`.
        2. Updating the tests to reflect this new directory structure.
      Signed-off-by: default avatarJessica Yuen <im.jessicayuen@gmail.com>
  10. 17 Nov, 2017 1 commit
  11. 17 Oct, 2017 3 commits
  12. 05 Oct, 2017 1 commit
    • Jessica Yuen's avatar
      Remove unnecessary param from defaultNamespace() · c95cde93
      Jessica Yuen authored
      The `clientConfig` param currently being passed is not needed, because
      it exists as a package level var in root. It also makes little sense to
      pass a custom `clientConfig` because if `overrides.Context.Namespace` is
      populated, the namespace that is returned is configured as an override
      in the package level `clientConfig` and not the `clientConfig` in the
  13. 27 Sep, 2017 1 commit
  14. 22 Sep, 2017 1 commit
  15. 21 Sep, 2017 3 commits
    • Alex Clemmer's avatar
      Remove client-go flags from commands that don't use them · f9723645
      Alex Clemmer authored
      Fixes #108.
    • Jessica Yuen's avatar
      Commands using the <env> arg should deploy to the correct cluster · 13f89a92
      Jessica Yuen authored
      For example, 'apply <env' currently operates as a no-op. With the
      introduction of simple environments in PR #131, 'apply <env>' should
      perform basic validation such that:
      1. The user has added the environment that is being deployed against to
      their Ksonnet project.
      2. The URI in the environment's spec file that the user wishes to deploy
      to should correspond to at least one cluster location as listed in
      If either of those conditions are not satisfied, the kubecfg user will
      receive the corresponding error.
      In addition, this commit will set the kubectl --cluster flag to point at
      the cluster listed by the environment URI.
    • Jessica Yuen's avatar
      Make Files and Environment not be mutually exclusive · 184756d8
      Jessica Yuen authored
      Currently, commands take either an <env> or a '-f' argument but not
      both. With this commit, we are allowing both args to be provided. The
      behavior is expand the files passed by the '-f' flag and deploy the
      objects to <env>.
  16. 07 Sep, 2017 1 commit
    • 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.
  17. 06 Sep, 2017 1 commit
  18. 05 Sep, 2017 1 commit
  19. 02 Sep, 2017 1 commit
  20. 01 Sep, 2017 1 commit
    • Jessica Yuen's avatar
      Refactor cmd/ application logic to pkg/ · f7d6436d
      Jessica Yuen authored
      This commit will separate the application level logic for the 'show', 'delete',
      'validate', and 'diff' commands from the Cobra logic in the cmd/ package.  The
      application level logic will be placed in pkg/kubecfg/.
  21. 30 Aug, 2017 3 commits
    • 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
      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.
    • Angus Lees's avatar
      Trivial debugging log message fixes · b2123661
      Angus Lees authored
      Noticed and then audited in the course of other work.
  22. 08 Aug, 2017 2 commits
  23. 17 Jul, 2017 1 commit
    • Angus Lees's avatar
      Set appropriate delete option for server version · c7885722
      Angus Lees authored
      Annoyingly, delete options `OrphanDependents` and `PropagationPolicy`
      are mutually exclusive.  This change compares the k8s server version
      to see if the server is going to look for the newer PropagationPolicy.
      Fixes a78be141 (aka PR #59)
  24. 10 Jul, 2017 1 commit
    • Angus Lees's avatar
      Set delete propagation policy (to "foreground") · a78be141
      Angus Lees authored
      Kubernetes 1.6 adds a `PpropagationPolicy` to the delete options,
      obsoleting the previous `OrphanDependents` boolean.
      This change sets `PropagationPolicy=foreground`, keeping the legacy
      `OrphanDependents=false` for older k8s servers.
      Note that PropagationPolicy=background is broken in k8s 1.6 and (eg)
      leaks pods from a deployment.  See kubernetes/kubernetes#44046 for
      upstream discussion.
  25. 06 Jul, 2017 1 commit
  26. 30 Jun, 2017 2 commits
    • Angus Lees's avatar
      Switch logging from glog to logrus · e7f9b9fd
      Angus Lees authored
      Improve interactive output experience by switching to a logging
      library (logrus) that allows customising the output format.
      This also removes the glog command line flags.  Replaced with a
      simpler `--verbose`/`-v` option:
      - quiet by default (warnings and errors only)
      - `-v` for progress info
      - `-vv` for debug
      Fixes #34
    • Angus Lees's avatar
      Add per-file license headers · 3d8873ce
      Angus Lees authored
      Fixes #35
  27. 29 Jun, 2017 1 commit
    • Angus Lees's avatar
      Fix goreportcard-reported lint issues · 9f31300b
      Angus Lees authored
      - `gofmt -s utils/registry_test.go`
      - Fix missing `if err != nil` check in `cmd/delete.go` (a bug, but not critical)
      - Add goreportcard button to README
  28. 09 Jun, 2017 2 commits
    • Angus Lees's avatar
      Implement diff subcommand · 01e5f51b
      Angus Lees authored
      Uses github.com/yudai/gojsondiff for the heavy lifting.
    • Angus Lees's avatar
      Implement delete subcommand · bdefc0bf
      Angus Lees authored
      This removes all objects listed in config files (and dependents) -
      effectively reversing an `update --create`.
      Intended for short-lived "try this out; now clean up" workflows.
      Fixes #14