Skip to content

Commit

Permalink
Merge pull request #10 from robbkidd/cookbooksite-to-supermarket
Browse files Browse the repository at this point in the history
swap out CookbookSite classes for Supermarket classes
  • Loading branch information
eyalbe4 authored Sep 16, 2019
2 parents 31b8724 + cae6c77 commit 8c85545
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/chef/knife/artifactory_show.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

require 'chef/knife'
require 'chef/knife/cookbook_site_show'
require 'chef/knife/supermarket_show'

class Chef
class Knife
class ArtifactoryShow < Knife::CookbookSiteShow
class ArtifactoryShow < Knife::SupermarketShow

dependency_loaders.concat(superclass.dependency_loaders)
options.merge!(superclass.options)
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/knife_art_download.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Overrides the default Chef::Knife::CookbookSiteShare to allow basic authentication against an Artifactory backend.
# Overrides the default Chef::Knife::SupermarketShare to allow basic authentication against an Artifactory backend.
# Ideally we would like to use a mechanism that allows injecting pluggable authentication middleware into the Chef::Http
# REST clients, but in the interest of allowing not-only-newest knife client versions to work with Artifactory we chose
# this solution for now.

require 'chef/knife'
require 'chef/knife/cookbook_site_download'
require 'chef/knife/supermarket_download'
require 'knife-art/knife_art_utils'

class Chef
class Knife
class ArtifactoryDownload < Knife::CookbookSiteDownload
class ArtifactoryDownload < Knife::SupermarketDownload

dependency_loaders.concat(superclass.dependency_loaders)
options.merge!(superclass.options)
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/knife_art_install.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Overrides the default Chef::Knife::CookbookSiteInstall to allow basic authentication against an Artifactory backend.
# Overrides the default Chef::Knife::SupermarketInstall to allow basic authentication against an Artifactory backend.
# Ideally we would like to use a mechanism that allows injecting pluggable authentication middleware into the Chef::Http
# REST clients, but in the interest of allowing not-only-newest knife client versions to work with Artifactory we chose
# this solution for now.


require 'chef/knife'
require 'chef/knife/cookbook_site_install'
require 'chef/knife/supermarket_install'

class Chef
class Knife
class ArtifactoryInstall < Knife::CookbookSiteInstall
class ArtifactoryInstall < Knife::SupermarketInstall

dependency_loaders.concat(superclass.dependency_loaders)
options.merge!(superclass.options)
Expand Down
4 changes: 2 additions & 2 deletions lib/chef/knife/knife_art_list.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

require 'chef/knife'
require 'chef/knife/cookbook_site_list'
require 'chef/knife/supermarket_list'

class Chef
class Knife
class ArtifactoryList < Knife::CookbookSiteList
class ArtifactoryList < Knife::SupermarketList

dependency_loaders.concat(superclass.dependency_loaders)
options.merge!(superclass.options)
Expand Down
4 changes: 2 additions & 2 deletions lib/chef/knife/knife_art_search.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

require 'chef/knife'
require 'chef/knife/cookbook_site_search'
require 'chef/knife/supermarket_search'

class Chef
class Knife
class ArtifactorySearch < Knife::CookbookSiteSearch
class ArtifactorySearch < Knife::SupermarketSearch

dependency_loaders.concat(superclass.dependency_loaders)
options.merge!(superclass.options)
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/knife/knife_art_share.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# 1. allow passing flags to the super class so that the do_upload method of this
# class is called and that signing key verification is skipped by the underlying Chef::HTTP::Authenticator that's
# used with the rest client (see comment below).
# 2. Override (monkey patch) the required methods in Chef::HTTP::Authenticator and Knife::CookbookSiteShare
# 2. Override (monkey patch) the required methods in Chef::HTTP::Authenticator and Knife::SupermarketShare
# to allow inserting our own logic that deploys a cookbook to Artifactory.
#
# The Supermarket API is kept (post /api/v1/cookbooks/cookbook_name) by Artifactory although it does not currently
# return a correct response (it simply returns 200) due to performance considerations.


require 'chef/knife'
require 'chef/knife/cookbook_site_share'
require 'chef/knife/supermarket_share'

class Chef
class Knife
class ArtifactoryShare < Knife::CookbookSiteShare
class ArtifactoryShare < Knife::SupermarketShare

dependency_loaders.concat(superclass.dependency_loaders)
options.merge!(superclass.options)
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/knife_art_unshare.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# More or less copy-pasted from cookbook_site_unshare because the http call happens inside the run method, not much
# More or less copy-pasted from supermarket_unshare because the http call happens inside the run method, not much
# sense in extending it

require 'chef/knife'
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-art/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module KnifeArt
VERSION = '1.0.0'
VERSION = '1.0.1'
end

0 comments on commit 8c85545

Please sign in to comment.