This commit is contained in:
parent
a98c76ba84
commit
ebd16d7c50
3 changed files with 22 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
organization = "edp-developer-framework"
|
||||
region = "EU"
|
||||
log_file = "./lala.log"
|
||||
credentials_file = "/home/chris/ipcei/projects/garm-provider-edge-connect/config/creds.toml"
|
||||
|
||||
[cloudlet]
|
||||
name = "Munich"
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ func (e *EdgeConnect) ShowApps(ctx context.Context, appkey AppKey, region string
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if !responses.IsSuccessful() {
|
||||
if !responses.IsSuccessful() && responses.StatusCode != http.StatusNotFound {
|
||||
return nil, responses.Error()
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ func (e *EdgeConnect) ShowAppInstances(ctx context.Context, appinstkey AppInstan
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if !responses.IsSuccessful() {
|
||||
if !responses.IsSuccessful() && responses.StatusCode != http.StatusNotFound {
|
||||
return nil, responses.Error()
|
||||
}
|
||||
|
||||
|
|
@ -278,6 +278,12 @@ func call[T any](ctx context.Context, client *EdgeConnect, path string, body []b
|
|||
|
||||
responses := Responses[T]{}
|
||||
responses.StatusCode = resp.StatusCode
|
||||
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
log.Printf("Error in call %s: %v", path, ErrNotFound)
|
||||
return responses, nil
|
||||
}
|
||||
|
||||
decoder := json.NewDecoder(resp.Body)
|
||||
for {
|
||||
var d Response[T]
|
||||
|
|
@ -285,7 +291,8 @@ func call[T any](ctx context.Context, client *EdgeConnect, path string, body []b
|
|||
if err.Error() == "EOF" {
|
||||
break
|
||||
}
|
||||
log.Fatal(err)
|
||||
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)
|
||||
}
|
||||
|
|
|
|||
11
testdelete.sh
Executable file
11
testdelete.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
export GARM_COMMAND="DeleteInstance"
|
||||
export GARM_CONTROLLER_ID="50cb196d"
|
||||
export GARM_INTERFACE_VERSION="v0.1.0"
|
||||
export GARM_POOL_ID="50fa68a5"
|
||||
export GARM_PROVIDER_CONFIG_FILE="/home/chris/ipcei/projects/garm-provider-edge-connect/config/config.toml"
|
||||
export GARM_INSTANCE_ID="garm-FbqZV9JufazZ"
|
||||
|
||||
cat <<EOF | go run main.go
|
||||
EOF
|
||||
Loading…
Add table
Add a link
Reference in a new issue