Skip to content

Commit

Permalink
Merge branch 'dapr-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
l0ll098 committed Sep 2, 2021
2 parents 812fdae + 2772fc4 commit 6d50176
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
12 changes: 9 additions & 3 deletions pkg/instances/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ func (i *instances) GetControlPlaneStatus() []StatusOutput {
// GetMetadata returns the result from the /v1.0/metadata endpoint
func (i *instances) GetMetadata(scope string, id string) MetadataOutput {
url := ""
secondaryUrl := ""
if i.kubeClient != nil {
resp, err := i.kubeClient.AppsV1().Deployments(scope).List((meta_v1.ListOptions{}))
if err != nil || len(resp.Items) == 0 {
Expand All @@ -339,7 +340,8 @@ func (i *instances) GetMetadata(scope string, id string) MetadataOutput {

if len(pods.Items) > 0 {
p := pods.Items[0]
url = fmt.Sprintf("http://%v:%v/v1.0/metadata", p.Status.PodIP, 3500)
url = fmt.Sprintf("http://%v:%v/v1.0/metadata", p.Status.PodIP, 3501)
secondaryUrl = fmt.Sprintf("http://%v:%v/v1.0/metadata", p.Status.PodIP, 3500)
}
}
}
Expand All @@ -351,9 +353,13 @@ func (i *instances) GetMetadata(scope string, id string) MetadataOutput {
}
if url != "" {
resp, err := http.Get(url)
if err != nil {
if err != nil && secondaryUrl != "" {
log.Println(err)
return MetadataOutput{}
resp, err = http.Get(secondaryUrl)
if err != nil {
log.Println(err)
return MetadataOutput{}
}
}

defer resp.Body.Close()
Expand Down
6 changes: 0 additions & 6 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"electron-builder": "^22.11.7",
"fs-extra": "^10.0.0",
"git-describe": "^4.1.0",
"husky": "^7.0.2",
"jasmine-core": "^3.9.0",
"jasmine-spec-reporter": "^7.0.0",
"karma": "~6.3.4",
Expand All @@ -71,11 +70,5 @@
},
"build": {
"appId": "com.daprio.dapr-dashboard"
},
"sideEffects": false,
"husky": {
"hooks": {
"pre-push": "ng lint"
}
}
}

0 comments on commit 6d50176

Please sign in to comment.