Skip to content
Snippets Groups Projects
  1. Sep 27, 2017
  2. Sep 26, 2017
    • Alex Clemmer's avatar
      Implement 'prototype preview' · 64f78b42
      Alex Clemmer authored
      Currently the command 'prototype use' expands a prototype and prints to
      stdout. This is useful, but most of the time, users want to simply dump
      the result in 'components/'
      
      This command implements this print-to-stdout behavior in a new command,
      'prototype-preview', and reimplements 'prototype use' to drop the
      expanded prototype into 'components/'.
      
      The new form of this command is:
      
        ksonnet prototype use <prototype-name> <component-name> [type] [flags]
      
      So, for example, a command like:
      
        ksonnet prototype use deployment nginx-depl [...]
      
      would expand the 'deployment' prototype, and place it in
      'components/nginx-depl.jsonnet' (since Jsonnet is the default template
      expansion). Alternatively, something like this:
      
        ksonnet prototype use deployment nginx-depl yaml [...]
      
      would expand the prototype and place it in 'components/nginx-depl.yaml'
      (assuming that there is a YAML version of this template.
      64f78b42
  3. Sep 22, 2017
  4. Sep 21, 2017
    • Alex Clemmer's avatar
      Add `prototype list` command · f70428dd
      Alex Clemmer authored
      The `prototype list` command lists all known prototypes. It is
      functionally equivalent to a `prototype search` that returns all
      prototypes.
      f70428dd
    • Alex Clemmer's avatar
      Cause `init` to generate env using current-context · 361a62c0
      Alex Clemmer authored
      When we run `init`, currently we generate a simple environment called
      'default' with no URI. A better idea is to generate the URI from the
      current context of the active kubeconfig file, if it exists.
      361a62c0
    • Alex Clemmer's avatar
      Fix improper elision of -J flags · 4509a351
      Alex Clemmer authored
      Currently if we use a command like `apply default -f
      components/whatever.yaml`, kubecfg will fail to emit flags that add
      ksonnet-lib to the -J paths. This means that, while a command like
      `apply default` will correctly linke against (e.g.) `k.libsonnet`,
      adding the `-f` flag will not.
      
      This commit will correct this problem for all commands of this form.
      4509a351
    • 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
      kubeconfig.
      
      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.
      13f89a92
    • 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>.
      184756d8
  5. Sep 19, 2017
    • Jessica Yuen's avatar
      Set default log level to 'Info' · 3ca68ad8
      Jessica Yuen authored
      Currently 'Info' level logs are only shown with the '-v' flag. This
      makes commands without the '-v' flag of little use to users, especially
      on success cases, due to no output.
      
      This commit will set the default log level to 'Info', and passing a '-v'
      flag will log at a 'Debug' level.
      3ca68ad8
    • Alex Clemmer's avatar
      Add to 'env' command documentation · 9e9ba873
      Alex Clemmer authored
      Fixes #139.
      9e9ba873
  6. Sep 18, 2017
    • Jessica Yuen's avatar
      Add subcommand 'env set' · f86667a6
      Jessica Yuen authored
      'env set <name>' sets environment fields such as the name, and cluster
      URI. It currently accepts the flags '--name' and '--uri'. Changing the
      name of an environment will also update the directory structure in
      'environments'.
      f86667a6
  7. Sep 15, 2017
    • Jessica Yuen's avatar
      Add subcommand 'env rm' · 530f5777
      Jessica Yuen authored
      'env rm <env-name>' deletes an environment within a ksonnet project.
      This is the same as removing the <env-name> environment directory and
      all files contained.  Empty parent directories will also be removed.
      530f5777
    • Jessica Yuen's avatar
      Add subcommand 'env list' · a169d973
      Jessica Yuen authored
      'env list' will list all environments within a Ksonnet project. Each
      environment will be pretty-printed with it's name and cluster URI
      location.
      a169d973
  8. Sep 13, 2017
    • Jessica Yuen's avatar
      Add subcommand 'env add' · 56777310
      Jessica Yuen authored
      'env add <env-name> <env-uri>' will create a new environment within a
      ksonnet project, by generating a new directory, 'env-name', within the
      'envs' directory. Each environment will contain environment-specfic
      files. Notably, a new environment-specific file is 'spec.json'.
      'spec.json' currently only contains the 'env-uri' of the Kubernetes
      cluster located at the added environment.
      
      Below is an example directory structure for the environment
      'us-west/staging':
      
      app-name/
        .gitignore           Default .gitignore; can customize VCS
        .ksonnet/            Metadata for ksonnet
        environments/        Env specs (defaults: dev, test, prod)
          default/           [Default generated environment.]
          us-west/           [Example of user-generated env]
            staging/
              k.libsonnet
              k8s.libsonnet
              swagger.json
              spec.json      [This will contain the uri of the environment]
        components/          Top-level Kubernetes objects defining application
        lib/                 user-written .libsonnet files
        vendor/              mixin libraries, prototypes
      56777310
  9. Sep 11, 2017
    • 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
  10. Sep 08, 2017
  11. Sep 07, 2017
    • 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
    • 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
      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
  12. Sep 06, 2017
  13. Sep 05, 2017
  14. Sep 03, 2017
    • 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.
      ae7af0ee
  15. Sep 02, 2017
  16. Sep 01, 2017
    • 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/.
      f7d6436d
  17. Aug 30, 2017
    • 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
      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
    • 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.
      83799252
    • Angus Lees's avatar
      Trivial debugging log message fixes · b2123661
      Angus Lees authored
      Noticed and then audited in the course of other work.
  18. Aug 09, 2017
  19. Aug 08, 2017
  20. Aug 02, 2017
  21. Jul 26, 2017
  22. Jul 25, 2017
  23. Jul 17, 2017