Skip to content

Commit 7cb243f

Browse files
author
Arta Asadi
committed
fix: fix get labels and annotations
1 parent e1acd72 commit 7cb243f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

discovery/pkg/task/run-task.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,21 @@ func GetIntegrationsFromQuery(coreServiceClient coreClient.CoreServiceClient, pa
252252
integ.Secret = rc.(string)
253253
case "annotations":
254254
if rc != nil {
255-
if jsonStr, ok := rc.(string); ok {
256-
var ann map[string]string
257-
if err := json.Unmarshal([]byte(jsonStr), &ann); err == nil {
258-
integ.Annotations = ann
255+
if obj, ok := rc.(map[string]interface{}); ok {
256+
for k, v := range obj {
257+
if vStr, ok := v.(string); ok {
258+
integ.Annotations[k] = vStr
259+
}
259260
}
260261
}
261262
}
262263
case "labels":
263264
if rc != nil {
264-
if jsonStr, ok := rc.(string); ok {
265-
var lbl map[string]string
266-
if err := json.Unmarshal([]byte(jsonStr), &lbl); err == nil {
267-
integ.Labels = lbl
265+
if obj, ok := rc.(map[string]interface{}); ok {
266+
for k, v := range obj {
267+
if vStr, ok := v.(string); ok {
268+
integ.Labels[k] = vStr
269+
}
268270
}
269271
}
270272
}

manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ api_version: v1
33
type: plugin # Specifies this is a plugin specification
44

55
# --- Plugin-specific details (now at the top level) ---
6-
name: "plugin-kubernetes" # Name of the plugin
6+
name: "kubernetes" # Name of the plugin
77
version: "1.2.0" # Semantic version of the plugin
88
supported_platform_versions: # Platform versions this plugin is compatible with
99
- ">=2.1.0, <3.0.0"

0 commit comments

Comments
 (0)