Skip to content

Commit 6fef5fb

Browse files
committed
removing git interface
Signed-off-by: Michael Hoang <mhoang@redhat.com>
1 parent 7306236 commit 6fef5fb

File tree

9 files changed

+294
-169
lines changed

9 files changed

+294
-169
lines changed

go.mod

+14
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/devfile/registry-support/registry-library v0.0.0-20221018213054-47b3ffaeadba
88
github.com/fatih/color v1.7.0
99
github.com/fsnotify/fsnotify v1.6.0
10+
github.com/go-git/go-git/v5 v5.4.2
1011
github.com/gobwas/glob v0.2.3
1112
github.com/golang/mock v1.6.0
1213
github.com/google/go-cmp v0.5.9
@@ -33,6 +34,9 @@ require (
3334

3435
require (
3536
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
37+
github.com/Microsoft/go-winio v0.5.1 // indirect
38+
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
39+
github.com/acomagu/bufpipe v1.0.3 // indirect
3640
github.com/beorn7/perks v1.0.1 // indirect
3741
github.com/cespare/xxhash/v2 v2.1.2 // indirect
3842
github.com/containerd/containerd v1.5.9 // indirect
@@ -46,7 +50,10 @@ require (
4650
github.com/docker/go-metrics v0.0.1 // indirect
4751
github.com/docker/go-units v0.4.0 // indirect
4852
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
53+
github.com/emirpasic/gods v1.12.0 // indirect
4954
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
55+
github.com/go-git/gcfg v1.5.0 // indirect
56+
github.com/go-git/go-billy/v5 v5.3.1 // indirect
5057
github.com/go-logr/logr v1.2.3 // indirect
5158
github.com/go-openapi/jsonpointer v0.19.5 // indirect
5259
github.com/go-openapi/jsonreference v0.20.0 // indirect
@@ -59,14 +66,17 @@ require (
5966
github.com/gorilla/mux v1.8.0 // indirect
6067
github.com/hashicorp/errwrap v1.0.0 // indirect
6168
github.com/imdario/mergo v0.3.12 // indirect
69+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
6270
github.com/josharian/intern v1.0.0 // indirect
6371
github.com/json-iterator/go v1.1.12 // indirect
72+
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
6473
github.com/klauspost/compress v1.13.6 // indirect
6574
github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb // indirect
6675
github.com/mailru/easyjson v0.7.6 // indirect
6776
github.com/mattn/go-colorable v0.1.2 // indirect
6877
github.com/mattn/go-isatty v0.0.12 // indirect
6978
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
79+
github.com/mitchellh/go-homedir v1.1.0 // indirect
7080
github.com/mitchellh/reflectwalk v1.0.1 // indirect
7181
github.com/moby/locker v1.0.1 // indirect
7282
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
@@ -82,10 +92,13 @@ require (
8292
github.com/prometheus/client_model v0.3.0 // indirect
8393
github.com/prometheus/common v0.37.0 // indirect
8494
github.com/prometheus/procfs v0.8.0 // indirect
95+
github.com/sergi/go-diff v1.1.0 // indirect
8596
github.com/sirupsen/logrus v1.8.1 // indirect
8697
github.com/spf13/pflag v1.0.5 // indirect
98+
github.com/xanzy/ssh-agent v0.3.0 // indirect
8799
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
88100
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
101+
golang.org/x/crypto v0.1.0 // indirect
89102
golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
90103
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
91104
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
@@ -98,6 +111,7 @@ require (
98111
google.golang.org/grpc v1.49.0 // indirect
99112
google.golang.org/protobuf v1.28.1 // indirect
100113
gopkg.in/inf.v0 v0.9.1 // indirect
114+
gopkg.in/warnings.v0 v0.1.2 // indirect
101115
gopkg.in/yaml.v2 v2.4.0 // indirect
102116
k8s.io/component-base v0.26.1 // indirect
103117
k8s.io/klog/v2 v2.80.1 // indirect

go.sum

+18
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,30 @@ github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:m
8787
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
8888
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
8989
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
90+
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ=
9091
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
9192
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
9293
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
9394
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
9495
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
9596
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs=
9697
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
98+
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
9799
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
98100
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
99101
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
100102
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
101103
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
102104
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
103105
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
106+
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
104107
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
105108
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
106109
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
107110
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
108111
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
109112
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
113+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
110114
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
111115
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
112116
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
@@ -337,6 +341,7 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb
337341
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
338342
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
339343
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
344+
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
340345
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
341346
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
342347
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -368,11 +373,16 @@ github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXt
368373
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
369374
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
370375
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
376+
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
371377
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
378+
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
372379
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
373380
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
381+
github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
374382
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
383+
github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8=
375384
github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
385+
github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4=
376386
github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
377387
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
378388
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -580,6 +590,7 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
580590
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
581591
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
582592
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA=
593+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
583594
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
584595
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
585596
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
@@ -602,6 +613,7 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
602613
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
603614
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
604615
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
616+
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck=
605617
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
606618
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
607619
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
@@ -640,6 +652,7 @@ github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7
640652
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
641653
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
642654
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
655+
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
643656
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
644657
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
645658
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
@@ -662,6 +675,7 @@ github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WT
662675
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
663676
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
664677
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
678+
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
665679
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
666680
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
667681
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
@@ -829,6 +843,7 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh
829843
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
830844
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
831845
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
846+
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
832847
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
833848
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
834849
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
@@ -906,6 +921,7 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17
906921
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
907922
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
908923
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
924+
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
909925
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
910926
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
911927
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -978,6 +994,7 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
978994
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
979995
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
980996
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
997+
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
981998
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
982999
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
9831000
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1444,6 +1461,7 @@ gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76
14441461
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
14451462
gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
14461463
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
1464+
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
14471465
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
14481466
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
14491467
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

pkg/devfile/parser/context/context.go

-16
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package parser
1717

1818
import (
1919
"fmt"
20-
"github.com/devfile/library/v2/pkg/git"
2120
"net/url"
2221
"os"
2322
"path/filepath"
@@ -52,9 +51,6 @@ type DevfileCtx struct {
5251
// token is a personal access token used with a private git repo URL
5352
token string
5453

55-
// Git is an interface used for git urls
56-
git git.IGitUrl
57-
5854
// filesystem for devfile
5955
fs filesystem.Filesystem
6056

@@ -74,7 +70,6 @@ func NewDevfileCtx(path string) DevfileCtx {
7470
func NewURLDevfileCtx(url string) DevfileCtx {
7571
return DevfileCtx{
7672
url: url,
77-
git: &git.Url{},
7873
}
7974
}
8075

@@ -83,7 +78,6 @@ func NewPrivateURLDevfileCtx(url string, token string) DevfileCtx {
8378
return DevfileCtx{
8479
url: url,
8580
token: token,
86-
git: &git.Url{},
8781
}
8882
}
8983

@@ -172,11 +166,6 @@ func (d *DevfileCtx) GetToken() string {
172166
return d.token
173167
}
174168

175-
// GetGit func returns current git interface
176-
func (d *DevfileCtx) GetGit() git.IGitUrl {
177-
return d.git
178-
}
179-
180169
// SetAbsPath sets absolute file path for devfile
181170
func (d *DevfileCtx) SetAbsPath() (err error) {
182171
// Set devfile absolute path
@@ -198,8 +187,3 @@ func (d *DevfileCtx) GetConvertUriToInlined() bool {
198187
func (d *DevfileCtx) SetConvertUriToInlined(value bool) {
199188
d.convertUriToInlined = value
200189
}
201-
202-
// SetGit sets the git interface
203-
func (d *DevfileCtx) SetGit(git git.IGitUrl) {
204-
d.git = git
205-
}

pkg/devfile/parser/context/context_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package parser
1717

1818
import (
19-
"github.com/devfile/library/v2/pkg/git"
2019
"github.com/stretchr/testify/assert"
2120
"net/http"
2221
"net/http/httptest"
@@ -94,13 +93,11 @@ func TestNewURLDevfileCtx(t *testing.T) {
9493
d := NewPrivateURLDevfileCtx(url, token)
9594
assert.Equal(t, "https://github.com/devfile/registry/blob/main/stacks/go/2.0.0/devfile.yaml", d.GetURL())
9695
assert.Equal(t, "fake-token", d.GetToken())
97-
assert.Equal(t, &git.Url{}, d.GetGit())
9896
}
9997
{
10098
d := NewURLDevfileCtx(url)
10199
assert.Equal(t, "https://github.com/devfile/registry/blob/main/stacks/go/2.0.0/devfile.yaml", d.GetURL())
102100
assert.Equal(t, "", d.GetToken())
103-
assert.Equal(t, &git.Url{}, d.GetGit())
104101
}
105102
}
106103

pkg/devfile/parser/parse.go

+37-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,42 @@ import (
4747
"github.com/pkg/errors"
4848
)
4949

50+
// downloadGitRepoResources is exposed as a global variable for the purpose of running mock tests
51+
var downloadGitRepoResources = func(url string, destDir string, httpTimeout *int, token string) error {
52+
gitUrl, err := git.NewGitUrlWithURL(url)
53+
if err != nil {
54+
return err
55+
}
56+
57+
if gitUrl.IsGitProviderRepo() && gitUrl.IsFile {
58+
stackDir, err := ioutil.TempDir(os.TempDir(), fmt.Sprintf("git-resources"))
59+
if err != nil {
60+
return fmt.Errorf("failed to create dir: %s, error: %v", stackDir, err)
61+
}
62+
defer os.RemoveAll(stackDir)
63+
64+
if !gitUrl.IsPublic(httpTimeout) {
65+
err = gitUrl.SetToken(token, httpTimeout)
66+
if err != nil {
67+
return err
68+
}
69+
}
70+
71+
err = gitUrl.CloneGitRepo(stackDir)
72+
if err != nil {
73+
return err
74+
}
75+
76+
dir := path.Dir(path.Join(stackDir, gitUrl.Path))
77+
err = git.CopyAllDirFiles(dir, destDir)
78+
if err != nil {
79+
return err
80+
}
81+
}
82+
83+
return nil
84+
}
85+
5086
// ParseDevfile func validates the devfile integrity.
5187
// Creates devfile context and runtime objects
5288
func parseDevfile(d DevfileObj, resolveCtx *resolutionContextTree, tool resolverTools, flattenedDevfile bool) (DevfileObj, error) {
@@ -142,7 +178,6 @@ func ParseDevfile(args ParserArgs) (d DevfileObj, err error) {
142178
context: args.Context,
143179
k8sClient: args.K8sClient,
144180
httpTimeout: args.HTTPTimeout,
145-
git: d.Ctx.GetGit(),
146181
}
147182

148183
flattenedDevfile := true
@@ -196,8 +231,6 @@ type resolverTools struct {
196231
k8sClient client.Client
197232
// httpTimeout is the timeout value in seconds passed in from the client.
198233
httpTimeout *int
199-
// git is the interface used for git urls
200-
git git.IGitUrl
201234
}
202235

203236
func populateAndParseDevfile(d DevfileObj, resolveCtx *resolutionContextTree, tool resolverTools, flattenedDevfile bool) (DevfileObj, error) {
@@ -449,7 +482,7 @@ func parseFromURI(importReference v1.ImportReference, curDevfileCtx devfileCtx.D
449482
}
450483

451484
destDir := path.Dir(curDevfileCtx.GetAbsPath())
452-
err = tool.git.DownloadGitRepoResources(newUri, destDir, tool.httpTimeout, token)
485+
err = downloadGitRepoResources(newUri, destDir, tool.httpTimeout, token)
453486
if err != nil {
454487
return DevfileObj{}, err
455488
}

0 commit comments

Comments
 (0)