Skip to content
Snippets Groups Projects
  1. Oct 26, 2017
    • Alex Clemmer's avatar
      c3fcf414
    • Jessica Yuen's avatar
      Support `diff` between two environments · 2687c6d8
      Jessica Yuen authored
      This change enables the user to diff between two environments that are
      either local or remote.
      
      i.e.,
      
      `kubecfg diff local:dev local:prod` will diff between the expanded
      templates for each environment on disk.
      
      `kubecfg diff remote:dev remote:prod` will diff between two remote
      environment clusters. It does this by first expanding the component
      templates of each environment. Then, the live objects are fetched from
      each of the clusters and the diff is performed against the live objects.
      
      `kubecfg diff local:dev remote:prod` is also an option. This will diff
      between the expanded templates for 'dev' on disk and the live objects
      on 'prod's server.
      2687c6d8
  2. Aug 09, 2017
  3. Aug 08, 2017
  4. Aug 02, 2017
  5. Jul 27, 2017
    • Angus Lees's avatar
      Add manifestJson and manifestYaml functions · 1f85d5dd
      Angus Lees authored
      jsonnet's `std.toString()` returns "compact" JSON.  Sometimes this is
      not appropriate, particularly when generating large output that might
      need to be viewed/debugged by a human.
      
      This change implements manifestYaml and manifestJson functions, which
      generate YAML and "pretty" JSON respectively.
      
      A slight implementation wrinkle is that libjsonnet currently only
      supports passing primitive (scalar) types to native functions, so
      these arguments need to be JSON-serialised/unserialised across the
      native function call boundary.
      1f85d5dd
  6. Jul 17, 2017
    • 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)
      c7885722
  7. Jul 06, 2017
  8. Jun 30, 2017
    • 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
      e7f9b9fd
    • Angus Lees's avatar
      Add per-file license headers · 3d8873ce
      Angus Lees authored
      Fixes #35
      3d8873ce
  9. Jun 29, 2017
    • 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
      9f31300b
  10. Jun 28, 2017
  11. Jun 23, 2017
    • Angus Lees's avatar
      Add new `resolveImage` native function · 54405b18
      Angus Lees authored
      Add a new native function that resolves docker image names into more
      specific forms.  In particular, it can look up a docker registry and
      convert image:tag to image@digest at jsonnet-eval time.
      
      Limitations: Does not currently support private docker
      registries (that require authentication).
      
      Controlled via two new command line flags:
      - `--resolve-images` Change implementation of resolveImage native
        function. One of: noop, registry (default "noop")
      - `--resolve-images-error` Action when resolveImage fails. One of
        ignore,warn,error (default "warn")
      
      Note in particular that the defaults will *not* do remote registry
      lookups, and will only add an explicit ":latest" tag where no tag was
      given.
      
      Fixes #13
      54405b18
  12. Jun 22, 2017
  13. Jun 09, 2017
    • Angus Lees's avatar
      Implement diff subcommand · 01e5f51b
      Angus Lees authored
      Uses github.com/yudai/gojsondiff for the heavy lifting.
      01e5f51b
    • 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
      bdefc0bf
  14. May 29, 2017
  15. May 23, 2017
    • Angus Lees's avatar
      Accept a wider range of jsonnet result structures · e1285841
      Angus Lees authored
      There is some variation in jsonnet "result" conventions.  This change
      assumes the top level is a JSON object, and then walks down looking
      for objects with `apiVersion` & `kind` fields.
      
      While walking down, the current code will expand JSON arrays, and
      object values.
      
      In particular, this should correctly accept:
      - single-value JSON files
      - arrays (jsonnet --yaml-stream)
      - "filename->object" objects (jsonnet --multi)
      
      (Note that any v1.Lists encountered are still expanded in a
      second-pass, as before)
      e1285841
  16. May 19, 2017
    • Angus Lees's avatar
      Attempt to topologically sort resources before updating · fad478f6
      Angus Lees authored
      The goal is to make a best-effort attempt at reducing the number of
      "crash-restart" loops required to bring up a group of interdependent
      resources.
      
      The current implementation is very simple and just sorts into 3 tiers:
      - Namespace, ThirdPartyResource, StorageClass
      - everything else
      - Pods or similar (Pod/Job/Deployment/DaemonSet/StatefulSet)
      fad478f6
  17. May 18, 2017
    • Angus Lees's avatar
      Implement "update" subcommand · d0327629
      Angus Lees authored
      - Support the standard client-go/kubectl flags
      - Switch object types to use client-go rather than apimachinery
      - Implement update subcommand
      d0327629
  18. May 16, 2017
    • Angus Lees's avatar
      gofmt · 4ab98f60
      Angus Lees authored
      4ab98f60
    • Angus Lees's avatar
      Add ability to read json/yaml/jsonnet input files · 9ddea438
      Angus Lees authored
      File format is recognised via simple file extension check.
      
      Any "List" objects found will be expanded into their constituent
      items, so single-element formats like json and jsonnet can use a
      v1.List to capture multiple resource objects.
      9ddea438