File tree Expand file tree Collapse file tree 3 files changed +716
-17
lines changed
Expand file tree Collapse file tree 3 files changed +716
-17
lines changed Original file line number Diff line number Diff line change @@ -2,28 +2,12 @@ package main
22
33import (
44 "github.com/opengovern/og-describer-kubernetes/global/constants"
5- "k8s.io/client-go/kubernetes"
6- "k8s.io/client-go/tools/clientcmd"
75)
86
97// Config represents the JSON input configuration
108type Config struct {
119}
1210
1311func IntegrationHealthcheck (creds constants.IntegrationCredentials , cfg Config ) (bool , error ) {
14- config , err := clientcmd .RESTConfigFromKubeConfig ([]byte (creds .KubeConfig ))
15- if err != nil {
16- return false , err
17- }
18- clientSet , err := kubernetes .NewForConfig (config )
19- if err != nil {
20- return false , err
21- }
22-
23- _ , err = clientSet .ServerVersion ()
24- if err != nil {
25- return false , err
26- }
27-
28- return true , nil
12+ return DoHealthcheck (creds .KubeConfig )
2913}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
22
33import (
44 "encoding/json"
5+ "github.com/jackc/pgtype"
56 "github.com/opengovern/og-describer-kubernetes/global"
67 constants2 "github.com/opengovern/og-describer-kubernetes/global/constants"
78 "github.com/opengovern/og-describer-kubernetes/global/maps"
@@ -55,10 +56,21 @@ func (i *Integration) DiscoverIntegrations(jsonData []byte) ([]integration.Integ
5556 return nil , err
5657 }
5758
59+ info , err := DoDiscovery (credentials .KubeConfig )
60+ if err != nil {
61+ return nil , err
62+ }
63+
64+ var labels pgtype.JSONB
65+ if err := labels .Set (info ); err != nil {
66+ return nil , err
67+ }
68+
5869 return []integration.Integration {
5970 {
6071 ProviderID : config .Host ,
6172 Name : config .Host ,
73+ Labels : labels ,
6274 },
6375 }, nil
6476}
You can’t perform that action at this time.
0 commit comments