chore(api): upgrade edge connect client to v2
Some checks failed
Go Tests / go-tests (push) Failing after 1m13s
Some checks failed
Go Tests / go-tests (push) Failing after 1m13s
This commit is contained in:
parent
f92a4a7c06
commit
25eab2277d
3 changed files with 17 additions and 13 deletions
2
go.mod
2
go.mod
|
|
@ -3,7 +3,7 @@ module edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect
|
||||||
go 1.25.1
|
go 1.25.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
edp.buildth.ing/DevFW-CICD/edge-connect-client v1.0.0
|
edp.buildth.ing/DevFW-CICD/edge-connect-client/v2 v2.0.2
|
||||||
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.1
|
k8s.io/api v0.34.1
|
||||||
|
|
|
||||||
4
go.sum
4
go.sum
|
|
@ -1,5 +1,5 @@
|
||||||
edp.buildth.ing/DevFW-CICD/edge-connect-client v1.0.0 h1:WcQmJNHS/4dlGx3lpw3x0hZdPj+GKSdGsQrWRxpdhyI=
|
edp.buildth.ing/DevFW-CICD/edge-connect-client/v2 v2.0.2 h1:AcHIt5oOevf8NJPDRE/rpWHBWMStMWlq0A+jz7Wd5Oo=
|
||||||
edp.buildth.ing/DevFW-CICD/edge-connect-client v1.0.0/go.mod h1:qZUPl2hFLNuhtkIojGfSq/MF7DQJGwvq6KbmtqPwZws=
|
edp.buildth.ing/DevFW-CICD/edge-connect-client/v2 v2.0.2/go.mod h1:nPZ4K4BB7eXyeSrcHXvSPkNZbs+XgmxbDJOM4KhbI1A=
|
||||||
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=
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"edp.buildth.ing/DevFW-CICD/edge-connect-client/sdk/edgeconnect"
|
edgeconnect "edp.buildth.ing/DevFW-CICD/edge-connect-client/v2/sdk/edgeconnect/v2"
|
||||||
"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/spec"
|
"edp.buildth.ing/DevFW-CICD/garm-provider-edge-connect/internal/spec"
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ func (a *edgeConnectProvider) CreateInstance(ctx context.Context, bootstrapParam
|
||||||
log.Printf("Executing CreateInstance with %v\n", bootstrapParams)
|
log.Printf("Executing CreateInstance with %v\n", bootstrapParams)
|
||||||
log.Printf("Executing CreateInstance with RepoURL %v\n", bootstrapParams.RepoURL)
|
log.Printf("Executing CreateInstance with RepoURL %v\n", bootstrapParams.RepoURL)
|
||||||
|
|
||||||
instancename := fmt.Sprintf("garm-%v-%v-%v", a.controllerID[:8], bootstrapParams.PoolID[:8], strings.ToLower(bootstrapParams.Name))
|
instancename := fmt.Sprintf("garm-%v-%v", bootstrapParams.PoolID[:8], strings.ToLower(bootstrapParams.Name))
|
||||||
|
|
||||||
gitHubScopeDetails, err := spec.ExtractGitHubScopeDetails(bootstrapParams.RepoURL)
|
gitHubScopeDetails, err := spec.ExtractGitHubScopeDetails(bootstrapParams.RepoURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -147,7 +147,7 @@ func (a *edgeConnectProvider) CreateInstance(ctx context.Context, bootstrapParam
|
||||||
_, err = a.client.ShowApp(ctx, edgeconnect.AppKey{
|
_, err = a.client.ShowApp(ctx, edgeconnect.AppKey{
|
||||||
Organization: a.cfg.Organization,
|
Organization: a.cfg.Organization,
|
||||||
Name: instancename,
|
Name: instancename,
|
||||||
Version: "0.0.1",
|
Version: "1",
|
||||||
}, a.cfg.Region)
|
}, a.cfg.Region)
|
||||||
if err != nil && !errors.Is(err, edgeconnect.ErrResourceNotFound) {
|
if err != nil && !errors.Is(err, edgeconnect.ErrResourceNotFound) {
|
||||||
return params.ProviderInstance{}, err
|
return params.ProviderInstance{}, err
|
||||||
|
|
@ -159,7 +159,7 @@ func (a *edgeConnectProvider) CreateInstance(ctx context.Context, bootstrapParam
|
||||||
Key: edgeconnect.AppKey{
|
Key: edgeconnect.AppKey{
|
||||||
Organization: a.cfg.Organization,
|
Organization: a.cfg.Organization,
|
||||||
Name: instancename,
|
Name: instancename,
|
||||||
Version: "0.0.1",
|
Version: "1",
|
||||||
},
|
},
|
||||||
Deployment: "kubernetes",
|
Deployment: "kubernetes",
|
||||||
ImageType: "Docker",
|
ImageType: "Docker",
|
||||||
|
|
@ -167,18 +167,18 @@ func (a *edgeConnectProvider) CreateInstance(ctx context.Context, bootstrapParam
|
||||||
AllowServerless: true,
|
AllowServerless: true,
|
||||||
ServerlessConfig: struct{}{},
|
ServerlessConfig: struct{}{},
|
||||||
DefaultFlavor: edgeconnect.Flavor{
|
DefaultFlavor: edgeconnect.Flavor{
|
||||||
Name: "EU.small",
|
Name: "defualt",
|
||||||
},
|
},
|
||||||
DeploymentGenerator: "kubernetes-basic",
|
DeploymentGenerator: "kubernetes-basic",
|
||||||
DeploymentManifest: string(manifest),
|
DeploymentManifest: string(manifest),
|
||||||
RequiredOutboundConnections: []edgeconnect.SecurityRule{
|
RequiredOutboundConnections: []edgeconnect.SecurityRule{
|
||||||
edgeconnect.SecurityRule{
|
{
|
||||||
PortRangeMax: 65535,
|
PortRangeMax: 65535,
|
||||||
PortRangeMin: 1,
|
PortRangeMin: 1,
|
||||||
Protocol: "TCP",
|
Protocol: "TCP",
|
||||||
RemoteCIDR: "0.0.0.0/0",
|
RemoteCIDR: "0.0.0.0/0",
|
||||||
},
|
},
|
||||||
edgeconnect.SecurityRule{
|
{
|
||||||
PortRangeMax: 65535,
|
PortRangeMax: 65535,
|
||||||
PortRangeMin: 1,
|
PortRangeMin: 1,
|
||||||
Protocol: "UDP",
|
Protocol: "UDP",
|
||||||
|
|
@ -212,10 +212,10 @@ func (a *edgeConnectProvider) CreateInstance(ctx context.Context, bootstrapParam
|
||||||
AppKey: edgeconnect.AppKey{
|
AppKey: edgeconnect.AppKey{
|
||||||
Organization: a.cfg.Organization,
|
Organization: a.cfg.Organization,
|
||||||
Name: instancename,
|
Name: instancename,
|
||||||
Version: "0.0.1",
|
Version: "1",
|
||||||
},
|
},
|
||||||
Flavor: edgeconnect.Flavor{
|
Flavor: edgeconnect.Flavor{
|
||||||
Name: "EU.small",
|
Name: "defualt",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
@ -263,6 +263,10 @@ func GetRunnerEnvs(gitHubScope GitHubScopeDetails, bootstrapParams params.Bootst
|
||||||
Name: "RUNNER_LABELS",
|
Name: "RUNNER_LABELS",
|
||||||
Value: strings.Join(bootstrapParams.Labels, ","),
|
Value: strings.Join(bootstrapParams.Labels, ","),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "RUNNER_HOME",
|
||||||
|
Value: "/tmp",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "RUNNER_NO_DEFAULT_LABELS",
|
Name: "RUNNER_NO_DEFAULT_LABELS",
|
||||||
Value: "true",
|
Value: "true",
|
||||||
|
|
@ -273,7 +277,7 @@ func GetRunnerEnvs(gitHubScope GitHubScopeDetails, bootstrapParams params.Bootst
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "RUNNER_WORKDIR",
|
Name: "RUNNER_WORKDIR",
|
||||||
Value: "/runner/_work/",
|
Value: "/tmp/_work/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "GITHUB_URL",
|
Name: "GITHUB_URL",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue