Skip to content
Permalink
Branch: master
Commits on Aug 16, 2019
  1. README: link to the list of available plugins (#304)

    ahmetb authored and k8s-ci-robot committed Aug 16, 2019
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 31, 2019
  1. Validate plugins can be removed without local manifest (#300)

    ahmetb authored and k8s-ci-robot committed Jul 31, 2019
    * Validate plugins can be removed without local manifest
    
    This validates the scenario that we can remove/rename plugins in the index
    without breaking local user installations (since this is now possible with
    the install receipts).
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * address comments
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * address comments
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 23, 2019
  1. pkg/installation: cleanup refactoring (#296)

    ahmetb authored and k8s-ci-robot committed Jul 23, 2019
    - `getDownloadTarget()`: removed, it didn't do anything interesting.
    - `downloadAndMove()`:
        - renamed to `downloadAndExtract()` which better reflects the functionality
        - reduced methods from 7 to 4
        - refactored the "move" operation out of this method (decouples "move"
          from "download+extract") and we now call "move" from install().
        - added unit tests (both for downloading a file, and --archive override)
    
    - introduced `installOperation` which contains the minimal information to
      perform installation operation.
    
    - introduced `InstallOpts` type to scale out (in the future)
    
    - `install()`:
        - accepts fewer arguments (2) than before (8)
        - no longer knows about index.Plugin, or environment.Paths
    
    - cmd/install: removed a redundant check detecting specifying plugin names
      along with --manifest option.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. integration_test: add more test cases (#297)

    ahmetb authored and k8s-ci-robot committed Jul 23, 2019
    * integration_test: add more test cases
    
    Added more tests or expanded existing tests to:
    
    - cover args/stdin handling edge cases for `install` cmd
    - cover status code of re-runs of `install`, `update`, and `remove`.
    - cover status when index not initialized in `remove`, `upgrade`, `install`
    - several other minor adjustments
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Update TestKrewList to parse structured output
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 22, 2019
  1. pkg/installation: unused pluginVersionFromPath (#290)

    ahmetb authored and k8s-ci-robot committed Jul 22, 2019
    Removing unused method.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. pkg/validation: add selector validation (#288)

    ahmetb authored and k8s-ci-robot committed Jul 22, 2019
    * pkg/validation: add selector validation
    
    - unexport validatePlatform as it's not used outside pkg/validation.
    - introduce validateSelector that validates selectors for:
      - unsupported keys
      - nil selector
      - empty selector (both for matchLabels and matchExpressions)
      as these situations are not supported, such as no plugin is valid for all
      platforms supported by krew.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Address code review comments
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  3. Move platform detection to pkg/installation (#286)

    ahmetb authored and k8s-ci-robot committed Jul 22, 2019
    * Move platform detection to pkg/installation
    
    - moved Platform matching methods to pkg/installation, where:
      - they make more sense
      - they can be tested without worrying about cyclic imports due to pkg/testutil.
    - rewrote some tests in platform_test.go to be shorter.
    - added a test for "no platforms specified" case in TestValidatePlugin.
    
    - added a check to verify-code-patterns that uses a heuristic to detect inline
      initializations of index.(Plugin|Platform) structs.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Address code review comments
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Fix regexp
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  4. test: remove -v from tests (#285)

    ahmetb authored and k8s-ci-robot committed Jul 22, 2019
    -v is only useful if you want to see all the test cases that are being run.
    I don't think this is useful locally or in the build system. I've been having
    trouble scrolling a lot and trying to find the FAIL: line.
    
    Any failed test will still print its t.Log or stdout/stderr printing along with
    the test method name, so this should be fine.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  5. pkg/receipt: move under pkg/installation (#280)

    ahmetb authored and k8s-ci-robot committed Jul 22, 2019
    Moving to somewhere more logically relevant.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 21, 2019
  1. Add --no-update-index option to bypass updates (#279)

    ahmetb authored and k8s-ci-robot committed Jul 21, 2019
    This option added to 'install' and 'upgrade' sub-commands allows users
    (primarily developers) to test behavior locally (such as upgrades) while
    preventing krew from auto-{updating,reverting,resetting} changes to the
    local copy of the index repository at $KREW_ROOT/index.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. pkg/testutil: add in-memory Plugin builder (#283)

    ahmetb authored and k8s-ci-robot committed Jul 21, 2019
    Introducing builder-pattern methods to create in-memory Plugin/Platform objects
    that has good defaults, but can be overwritten for test purposes. Readability
    of the test files (e.g. validation/*_test.go) now speak for themselves.
    
    The testutil.NewPlugin() returns a _valid_ index.Plugin instance. Any tests
    expected to fail can modify its values with the builder pattern. (ditto for
    testutil.NewPlatform()).
    
    - had to move validation code to pkg/index/validation due to a cyclic
      import situation that occurred. This should be fine.
    - renamed some test cases for ease of readability
    - I've thought about adding code validation for **_test.go to not to have any
      index.Plugin{ or index.Platform{ strings. But this might be an overkill atm.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  3. pkg/index: validate sha256 values (#281)

    ahmetb authored and k8s-ci-robot committed Jul 21, 2019
    This makes sure the code only deals with valid lowercase sha256 values
    (i.e. all lowercase) while doing comparisons etc.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 20, 2019
  1. Refactor upgrade machinery to use semver versions (#278)

    ahmetb authored and k8s-ci-robot committed Jul 20, 2019
    This change starts using semver version of plugin manifests to:
    - determine if upgrade is needed
    - determine if a plugin is installed
    by looking at receipts installation directory.
    
    Other commands are probably not yet using receipts entirely.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 18, 2019
  1. Update plugin listings to use install receipts (#276)

    ahmetb authored and k8s-ci-robot committed Jul 18, 2019
    * Update plugin listings to use install receipts
    
    - Changed the way we determine the list of "installed plugins" by looking at
      install receipts directory.
    - Added a receipt.Load() method for reading saved install receipts.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Add TODOs about requested fixes.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. semver: add wrapper for SemVer functionality (#273)

    ahmetb authored and k8s-ci-robot committed Jul 18, 2019
    This package introduces a wrapper for `k8s.io/apimachinery/pkg/util/version`
    package for its parts that we rely on for our handling of semver values.
    
    go.{mod,sum} will likely conflict soon as there are other in-flight PRs.
    
    Also refactored the validation code to verify 'version' value can be parsed.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 17, 2019
  1. minor: rename environment.Path receipt path methods (#275)

    ahmetb authored and k8s-ci-robot committed Jul 17, 2019
    Purely method rename patch.
    
    - InstallReceiptPath --> InstallReceiptsPath: indicating the path is containng
      multiple receipts.
    - PluginReceiptPath --> PluginInstallReceiptPath: making it clear to answer
      "what receipt?" (A: install receipt), similarly consistent with the method
      name above, just prefixed+singular.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. Unify yaml serialization dependencies (#266)

    ahmetb authored and k8s-ci-robot committed Jul 17, 2019
    Standardize on sigs.k8s.io/yaml.
    Bump k8s.io/apimachinery depenceny as it used to depend on module
    github.com/ghodss/yaml
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  3. Make version field required (#269)

    ahmetb authored and k8s-ci-robot committed Jul 17, 2019
    No semver validation specifically just yet. Making the field required, and
    planning to make it more strict later by actually parsing it.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  4. hack: make run-lint.sh work with go modules (#268)

    ahmetb authored and k8s-ci-robot committed Jul 17, 2019
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 16, 2019
  1. hack: verify builds are installable (#262)

    ahmetb authored and k8s-ci-robot committed Jul 16, 2019
    This script tests if a build is installable (as documented in the readme)
    from its tarball+yaml file.
    
    I felt like adding this as extra confidence on all the refactoring we're doing,
    and I know we have integration tests that cover this. Since installation is
    almost like our API, I thought it would be good to test.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. hack: add make-binay.sh for local builds (#259)

    ahmetb authored and k8s-ci-robot committed Jul 16, 2019
    I've been finding myself doing a lot of:
    
        OSARCH=darwin/amd64 hack/make-binaries.sh
    
    this should help with that. I'm mostly making this change for myself.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 15, 2019
  1. README: add github stars from shields.io (#257)

    ahmetb authored and k8s-ci-robot committed Jul 15, 2019
    Since we passed 1k recently, worth celebrating.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. hack: add script to verify receipts migration (#255)

    ahmetb authored and k8s-ci-robot committed Jul 15, 2019
    This script makes sure as long as we have the 'system receipts-upgrade' command
    upgrades from krew v0.2.1 to the currently built version works.
    
    This should be deleted once the 'system receipts-upgrade' command is gone.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 9, 2019
  1. hack/run-in-docker: refactoring (#206)

    ahmetb authored and k8s-ci-robot committed Jul 9, 2019
    - build krew binary outside container (do not duplicate build process)
      - allows binary to be refreshed without rebuilding container
        this way, we preserve container session/state
    - mount KUBECONFIG inside the container (not sure if it's actually useful)
      I probably won't use it (since GKE clusters require gcloud to work, too)
    - made the script a bit friendlier to follow as a user.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jul 2, 2019
  1. integration_test: split tests into separate files (#240)

    ahmetb authored and k8s-ci-robot committed Jul 2, 2019
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. vendor: rename leftover vendor/ directory (#241)

    ahmetb authored and k8s-ci-robot committed Jul 2, 2019
    Forgot to clean this up while resolving merge conflicts.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  3. pkg/installation: reorder receipt save & install() (#237)

    ahmetb authored and k8s-ci-robot committed Jul 2, 2019
    * pkg/installation: reorder receipt save & install()
    
    Looks like we didn't address the code review comment at
    #195 (comment).
    
    Copying the conversation from there:
    
    > This is better because:
    >
    > - actually installing a plugin (extract files, symlink binary) but then failing
    >   to store the receipt is okay (at most you'd be leaking some files)
    > - claiming the plugin is installed (i.e. receipt exists) while it's not
    >   installed is not okay.
    > - tens of things can go wrong in `install()`, much fewer things can go wrong
    >  in `receipt.Store()`, so makes sense to do it last.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * pkg/installation: reorder receipt saving in uninstall()
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  4. Move to go modules (vgo) (#235)

    ahmetb authored and k8s-ci-robot committed Jul 2, 2019
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  5. Rename /test --> /integration_test (#236)

    ahmetb authored and k8s-ci-robot committed Jul 2, 2019
    - move directory
    - remove 'krew' subpackage (merge with main package)
    - make the package _test.go-only, by merging /test/krew package
    - fix a bug with run-integration-tests.sh where it silently failed when the
      binary file didn't exist (due to readlink failing inside the subshell).
    - use testutil.TempDir() in the integration tests (per validate-code-patterns)
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jun 27, 2019
  1. hack: update verify-code-patterns.sh (#221)

    ahmetb committed Jun 27, 2019
    This fixes an issue where sometimes bash returns 1 instead of 123
    in the exitcode of the pipe. This simplifies the find|xargs|grep with
    just grep.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  2. Various fixes to integration tests (#228)

    ahmetb committed Jun 27, 2019
    * Various fixes to integration tests
    
    I fixed a few things about the integration tests that bugged me a litle bit.
    
    - do not actually run the test plugin, it's out of our tool's scope
    - run only integration tests from the script (previously ./...)
    - use the installed krew when host-krew is present
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Address code review feedback
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  3. Cleanup some TODOs (#218)

    ahmetb and corneliusweig committed Jun 27, 2019
    * Cleanup some TODOs
    
    - cleaned up some obsolete todos (ref: #213), some still relevant
    - removed PluginIndex type, as it wasn't used for any reason
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    
    * Apply suggestions from code review
    
    Note: trying github's code review suggestions feature. Might cause CLA check to break.
    
    Co-Authored-By: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
  4. hack: move out install_kubectl_if_needed (#220)

    ahmetb committed Jun 27, 2019
    - install appropriate kubectl (goos/goarch)
    - save it to $GOPATH/bin since "export $PATH" won't work outside a particular
      script
    - lowercase naming for local variables
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Jun 18, 2019
  1. Make corneliusweig a maintainer (#214)

    ahmetb committed Jun 18, 2019
    Adding corneliusweig to owners. He has been consistently helping both with
    krew and krew-index repositories in terms of:
    - developing plugins himself
    - taking a stab at krew machinery with large scale code refactors
    - adding integration test suite to the project
    - adding more validation and test cases
    - increasing developer documentation
    
    Some of his notable work:
    - #195
    - #183
    - #191
    - #201
    - #202
    - #203
    - #208
    
    He is familiar with the codebase enough to officially review and approve code.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Commits on Apr 3, 2019
  1. Update license headers to reassign copyright (#169)

    ahmetb authored and k8s-ci-robot committed Apr 3, 2019
    Reference: kubernetes/community#3427
    
    Updating the source code copyright per the kubernetes/org#599
    as someone from the Google organization which has donated the krew code.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Older
You can’t perform that action at this time.