refactor(client): ♻️ Imported edge connect client from remote repository
Some checks failed
Go Tests / go-tests (push) Failing after 1m28s
Some checks failed
Go Tests / go-tests (push) Failing after 1m28s
This commit is contained in:
parent
fc8ed4029b
commit
a5a9f2e982
5 changed files with 33 additions and 439 deletions
15
go.mod
15
go.mod
|
|
@ -1,12 +1,14 @@
|
||||||
module edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect
|
module edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect
|
||||||
|
|
||||||
go 1.24.0
|
go 1.25.1
|
||||||
|
|
||||||
toolchain go1.24.2
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
edp.buildth.ing/DevFW-CICD/edge-connect-client v0.0.0-20250918115109-c539eb2210da
|
||||||
github.com/BurntSushi/toml v1.5.0
|
github.com/BurntSushi/toml v1.5.0
|
||||||
github.com/cloudbase/garm-provider-common v0.1.7
|
github.com/cloudbase/garm-provider-common v0.1.7
|
||||||
|
k8s.io/api v0.34.0
|
||||||
|
k8s.io/apimachinery v0.34.0
|
||||||
|
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
@ -14,21 +16,18 @@ require (
|
||||||
github.com/go-logr/logr v1.4.2 // indirect
|
github.com/go-logr/logr v1.4.2 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/stretchr/testify v1.10.0 // indirect
|
|
||||||
github.com/x448/float16 v0.8.4 // indirect
|
github.com/x448/float16 v0.8.4 // indirect
|
||||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||||
golang.org/x/net v0.41.0 // indirect
|
golang.org/x/net v0.41.0 // indirect
|
||||||
golang.org/x/sys v0.34.0 // indirect
|
golang.org/x/sys v0.34.0 // indirect
|
||||||
golang.org/x/text v0.26.0 // indirect
|
golang.org/x/text v0.28.0 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
k8s.io/api v0.34.0 // indirect
|
|
||||||
k8s.io/apimachinery v0.34.0 // indirect
|
|
||||||
k8s.io/klog/v2 v2.130.1 // indirect
|
k8s.io/klog/v2 v2.130.1 // indirect
|
||||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
|
|
||||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
||||||
|
|
|
||||||
27
go.sum
27
go.sum
|
|
@ -1,7 +1,10 @@
|
||||||
|
edp.buildth.ing/DevFW-CICD/edge-connect-client v0.0.0-20250918115109-c539eb2210da h1:977DSXOnzdm6u1S8Mre330VCe+VdbPNBRnSmgNVcs8c=
|
||||||
|
edp.buildth.ing/DevFW-CICD/edge-connect-client v0.0.0-20250918115109-c539eb2210da/go.mod h1:mJUAgpq7ivwNQTMpjsuJG+I1YJY/NoyByWuawdiKx0o=
|
||||||
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
||||||
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||||
github.com/cloudbase/garm-provider-common v0.1.7 h1:V0upTejFRDiyFBO4hhkMWmPtmRTguyOt/4i1u9/rfbg=
|
github.com/cloudbase/garm-provider-common v0.1.7 h1:V0upTejFRDiyFBO4hhkMWmPtmRTguyOt/4i1u9/rfbg=
|
||||||
github.com/cloudbase/garm-provider-common v0.1.7/go.mod h1:2O51WbcfqRx5fDHyyJgIFq7KdTZZnefsM+aoOchyleU=
|
github.com/cloudbase/garm-provider-common v0.1.7/go.mod h1:2O51WbcfqRx5fDHyyJgIFq7KdTZZnefsM+aoOchyleU=
|
||||||
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
|
@ -11,11 +14,17 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
|
@ -27,6 +36,10 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWu
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||||
|
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||||
|
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
||||||
|
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||||
|
|
@ -59,8 +72,8 @@ golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
|
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
||||||
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
|
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
|
@ -70,21 +83,31 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/api v0.34.0 h1:L+JtP2wDbEYPUeNGbeSa/5GwFtIA662EmT2YSLOkAVE=
|
k8s.io/api v0.34.0 h1:L+JtP2wDbEYPUeNGbeSa/5GwFtIA662EmT2YSLOkAVE=
|
||||||
k8s.io/api v0.34.0/go.mod h1:YzgkIzOOlhl9uwWCZNqpw6RJy9L2FK4dlJeayUoydug=
|
k8s.io/api v0.34.0/go.mod h1:YzgkIzOOlhl9uwWCZNqpw6RJy9L2FK4dlJeayUoydug=
|
||||||
|
k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM=
|
||||||
|
k8s.io/api v0.34.1/go.mod h1:SB80FxFtXn5/gwzCoN6QCtPD7Vbu5w2n1S0J5gFfTYk=
|
||||||
k8s.io/apimachinery v0.34.0 h1:eR1WO5fo0HyoQZt1wdISpFDffnWOvFLOOeJ7MgIv4z0=
|
k8s.io/apimachinery v0.34.0 h1:eR1WO5fo0HyoQZt1wdISpFDffnWOvFLOOeJ7MgIv4z0=
|
||||||
k8s.io/apimachinery v0.34.0/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
|
k8s.io/apimachinery v0.34.0/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
|
||||||
|
k8s.io/apimachinery v0.34.1 h1:dTlxFls/eikpJxmAC7MVE8oOeP1zryV7iRyIjB0gky4=
|
||||||
|
k8s.io/apimachinery v0.34.1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
|
||||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
|
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
|
||||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
|
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0=
|
||||||
|
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
|
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
|
||||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
|
||||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
||||||
|
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||||
|
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||||
|
|
|
||||||
|
|
@ -1,303 +0,0 @@
|
||||||
package client
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
)
|
|
||||||
|
|
||||||
var ErrResourceNotFound = fmt.Errorf("resource not found")
|
|
||||||
|
|
||||||
type EdgeConnect struct {
|
|
||||||
BaseURL string
|
|
||||||
HttpClient *http.Client
|
|
||||||
Credentials Credentials
|
|
||||||
}
|
|
||||||
|
|
||||||
type Credentials struct {
|
|
||||||
Username string
|
|
||||||
Password string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) RetrieveToken(ctx context.Context) (string, error) {
|
|
||||||
json_data, err := json.Marshal(map[string]string{
|
|
||||||
"username": e.Credentials.Username,
|
|
||||||
"password": e.Credentials.Password,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
request, err := http.NewRequestWithContext(ctx, "POST", e.BaseURL+"/api/v1/login", bytes.NewBuffer(json_data))
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
request.Header.Set("Content-Type", "application/json")
|
|
||||||
|
|
||||||
resp, err := e.HttpClient.Do(request)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
var respData struct {
|
|
||||||
Token string `json:"token"`
|
|
||||||
}
|
|
||||||
err = json.NewDecoder(resp.Body).Decode(&respData)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return respData.Token, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) CreateApp(ctx context.Context, input NewAppInput) error {
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
response, err := call[App](ctx, e, "/api/v1/auth/ctrl/CreateApp", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return response.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) ShowApp(ctx context.Context, appkey AppKey, region string) (App, error) {
|
|
||||||
input := struct {
|
|
||||||
App App `json:"App"`
|
|
||||||
Region string `json:"Region"`
|
|
||||||
}{
|
|
||||||
App: App{Key: appkey},
|
|
||||||
Region: region,
|
|
||||||
}
|
|
||||||
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return App{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
responses, err := call[App](ctx, e, "/api/v1/auth/ctrl/ShowApp", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return App{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if responses.StatusCode == http.StatusNotFound {
|
|
||||||
return App{}, fmt.Errorf("Error retrieving App: %w", ErrResourceNotFound)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !responses.IsSuccessful() {
|
|
||||||
return App{}, responses.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
apps := responses.GetData()
|
|
||||||
if len(apps) > 0 {
|
|
||||||
return apps[0], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return App{}, fmt.Errorf("could not find app with region/key: %s/%v: %w", region, appkey, ErrResourceNotFound)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) ShowApps(ctx context.Context, appkey AppKey, region string) ([]App, error) {
|
|
||||||
input := struct {
|
|
||||||
App App `json:"App"`
|
|
||||||
Region string `json:"Region"`
|
|
||||||
}{
|
|
||||||
App: App{Key: appkey},
|
|
||||||
Region: region,
|
|
||||||
}
|
|
||||||
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
responses, err := call[App](ctx, e, "/api/v1/auth/ctrl/ShowApp", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !responses.IsSuccessful() && responses.StatusCode != http.StatusNotFound {
|
|
||||||
return nil, responses.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
return responses.GetData(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) DeleteApp(ctx context.Context, appkey AppKey, region string) error {
|
|
||||||
input := struct {
|
|
||||||
App App `json:"App"`
|
|
||||||
Region string `json:"Region"`
|
|
||||||
}{
|
|
||||||
App: App{Key: appkey},
|
|
||||||
Region: region,
|
|
||||||
}
|
|
||||||
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
response, err := call[App](ctx, e, "/api/v1/auth/ctrl/DeleteApp", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !response.IsSuccessful() && response.StatusCode != 404 {
|
|
||||||
return response.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) CreateAppInstance(ctx context.Context, input NewAppInstanceInput) error {
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("failed to marshal NewAppInstanceInput %v\n", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
responses, err := call[AppInstance](ctx, e, "/api/v1/auth/ctrl/CreateAppInst", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return responses.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) ShowAppInstance(ctx context.Context, appinstkey AppInstanceKey, region string) (AppInstance, error) {
|
|
||||||
input := struct {
|
|
||||||
App AppInstance `json:"appinst"`
|
|
||||||
Region string `json:"Region"`
|
|
||||||
}{
|
|
||||||
App: AppInstance{Key: appinstkey},
|
|
||||||
Region: region,
|
|
||||||
}
|
|
||||||
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return AppInstance{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
responses, err := call[AppInstance](ctx, e, "/api/v1/auth/ctrl/ShowAppInst", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return AppInstance{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if responses.StatusCode == http.StatusNotFound {
|
|
||||||
return AppInstance{}, fmt.Errorf("Error retrieving AppInstance: %w", ErrResourceNotFound)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !responses.IsSuccessful() {
|
|
||||||
return AppInstance{}, responses.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
data := responses.GetData()
|
|
||||||
if len(data) > 0 {
|
|
||||||
return data[0], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return AppInstance{}, fmt.Errorf("could not find app instance: %v: %w", responses, ErrResourceNotFound)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) ShowAppInstances(ctx context.Context, appinstkey AppInstanceKey, region string) ([]AppInstance, error) {
|
|
||||||
input := struct {
|
|
||||||
App AppInstance `json:"appinst"`
|
|
||||||
Region string `json:"Region"`
|
|
||||||
}{
|
|
||||||
App: AppInstance{Key: appinstkey},
|
|
||||||
Region: region,
|
|
||||||
}
|
|
||||||
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
responses, err := call[AppInstance](ctx, e, "/api/v1/auth/ctrl/ShowAppInst", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !responses.IsSuccessful() && responses.StatusCode != http.StatusNotFound {
|
|
||||||
return nil, responses.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
return responses.GetData(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EdgeConnect) DeleteAppInstance(ctx context.Context, appinstancekey AppInstanceKey, region string) error {
|
|
||||||
input := struct {
|
|
||||||
AppInstance AppInstance `json:"appinst"`
|
|
||||||
Region string `json:"Region"`
|
|
||||||
}{
|
|
||||||
AppInstance: AppInstance{Key: appinstancekey},
|
|
||||||
Region: region,
|
|
||||||
}
|
|
||||||
|
|
||||||
json_data, err := json.Marshal(input)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
responses, err := call[AppInstance](ctx, e, "/api/v1/auth/ctrl/DeleteAppInst", json_data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return responses.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
func call[T Message](ctx context.Context, client *EdgeConnect, path string, body []byte) (Responses[T], error) {
|
|
||||||
token, err := client.RetrieveToken(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return Responses[T]{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
request, err := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("%s%s", client.BaseURL, path), bytes.NewBuffer(body))
|
|
||||||
if err != nil {
|
|
||||||
return Responses[T]{}, err
|
|
||||||
}
|
|
||||||
request.Header.Set("Content-Type", "application/json")
|
|
||||||
request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))
|
|
||||||
|
|
||||||
resp, err := client.HttpClient.Do(request)
|
|
||||||
if err != nil {
|
|
||||||
return Responses[T]{}, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
responses := Responses[T]{}
|
|
||||||
responses.StatusCode = resp.StatusCode
|
|
||||||
|
|
||||||
if responses.StatusCode == http.StatusNotFound {
|
|
||||||
return responses, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
decoder := json.NewDecoder(resp.Body)
|
|
||||||
for {
|
|
||||||
var d Response[T]
|
|
||||||
if err := decoder.Decode(&d); err != nil {
|
|
||||||
if err.Error() == "EOF" {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
log.Printf("Error in call %s: %v", path, err)
|
|
||||||
return Responses[T]{}, fmt.Errorf("Error in call %s: %w", path, err)
|
|
||||||
}
|
|
||||||
responses.Responses = append(responses.Responses, d)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("call(): %s resulting in http status %v and %v responses\n", path, resp.StatusCode, len(responses.GetMessages()))
|
|
||||||
for i, v := range responses.GetMessages() {
|
|
||||||
log.Printf("call(): response[%v]: %s\n", i, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
return responses, nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,125 +0,0 @@
|
||||||
package client
|
|
||||||
|
|
||||||
import "fmt"
|
|
||||||
|
|
||||||
type Responses[T Message] struct {
|
|
||||||
Responses []Response[T]
|
|
||||||
StatusCode int
|
|
||||||
}
|
|
||||||
|
|
||||||
type Message interface {
|
|
||||||
GetMessage() string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Responses[T]) GetData() []T {
|
|
||||||
var data []T
|
|
||||||
for _, v := range r.Responses {
|
|
||||||
if v.HasData() {
|
|
||||||
data = append(data, v.Data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Responses[T]) GetMessages() []string {
|
|
||||||
var messages []string
|
|
||||||
for _, v := range r.Responses {
|
|
||||||
if v.IsMessage() {
|
|
||||||
messages = append(messages, v.Data.GetMessage())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return messages
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Responses[T]) IsSuccessful() bool {
|
|
||||||
return r.StatusCode < 400 && r.StatusCode > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Responses[T]) Error() error {
|
|
||||||
if r.IsSuccessful() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Errorf("error with status code %v and messages %v", r.StatusCode, r.GetMessages())
|
|
||||||
}
|
|
||||||
|
|
||||||
type Response[T Message] struct {
|
|
||||||
Data T `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (res *Response[T]) HasData() bool {
|
|
||||||
return !res.IsMessage()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (res *Response[T]) IsMessage() bool {
|
|
||||||
return res.Data.GetMessage() != ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type NewAppInstanceInput struct {
|
|
||||||
Region string `json:"region"`
|
|
||||||
AppInst AppInstance `json:"appinst"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type msg struct {
|
|
||||||
Message string `json:"message"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (msg msg) GetMessage() string {
|
|
||||||
return msg.Message
|
|
||||||
}
|
|
||||||
|
|
||||||
type AppInstance struct {
|
|
||||||
msg `json:",inline"`
|
|
||||||
Key AppInstanceKey `json:"key"`
|
|
||||||
AppKey AppKey `json:"app_key,omitzero"`
|
|
||||||
Flavor Flavor `json:"flavor,omitzero"`
|
|
||||||
State string `json:"state,omitempty"`
|
|
||||||
PowerState string `json:"power_state,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type AppInstanceKey struct {
|
|
||||||
Organization string `json:"organization"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
CloudletKey CloudletKey `json:"cloudlet_key"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type CloudletKey struct {
|
|
||||||
Organization string `json:"organization"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type AppKey struct {
|
|
||||||
Organization string `json:"organization"`
|
|
||||||
Name string `json:"name,omitempty"`
|
|
||||||
Version string `json:"version,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Flavor struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type NewAppInput struct {
|
|
||||||
Region string `json:"region"`
|
|
||||||
App App `json:"app"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SecurityRule struct {
|
|
||||||
PortRangeMax int `json:"port_range_max"`
|
|
||||||
PortRangeMin int `json:"port_range_min"`
|
|
||||||
Protocol string `json:"protocol"`
|
|
||||||
RemoteCIDR string `json:"remote_cidr"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type App struct {
|
|
||||||
msg `json:",inline"`
|
|
||||||
Key AppKey `json:"key"`
|
|
||||||
Deployment string `json:"deployment,omitempty"`
|
|
||||||
ImageType string `json:"image_type,omitempty"`
|
|
||||||
ImagePath string `json:"image_path,omitempty"`
|
|
||||||
AllowServerless bool `json:"allow_serverless,omitempty"`
|
|
||||||
DefaultFlavor Flavor `json:"defaultFlavor,omitempty"`
|
|
||||||
ServerlessConfig any `json:"serverless_config,omitempty"`
|
|
||||||
DeploymentGenerator string `json:"deployment_generator,omitempty"`
|
|
||||||
DeploymentManifest string `json:"deployment_manifest,omitempty"`
|
|
||||||
RequiredOutboundConnections []SecurityRule `json:"required_outbound_connections"`
|
|
||||||
}
|
|
||||||
|
|
@ -24,8 +24,8 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"edp.buildth.ing/DevFW-CICD/edge-connect-client/client"
|
||||||
"edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect/config"
|
"edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect/config"
|
||||||
"edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect/internal/client"
|
|
||||||
"edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect/internal/spec"
|
"edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect/internal/spec"
|
||||||
|
|
||||||
batchv1 "k8s.io/api/batch/v1"
|
batchv1 "k8s.io/api/batch/v1"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue