Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 883acf1

Browse files
committed
final changes
Signed-off-by: ashish <[email protected]>
1 parent fb0f7f8 commit 883acf1

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

osm/operations.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ import (
1212

1313
// ApplyOperation function contains the operation handlers
1414
func (h *Handler) ApplyOperation(ctx context.Context, request adapter.OperationRequest, hchan *chan interface{}) error {
15+
err := h.CreateKubeconfigs(request.K8sConfigs)
16+
if err != nil {
17+
return err
18+
}
1519
h.SetChannel(hchan)
1620
kubeconfigs := request.K8sConfigs
1721
operations := make(adapter.Operations)
18-
err := h.Config.GetObject(adapter.OperationsKey, &operations)
22+
err = h.Config.GetObject(adapter.OperationsKey, &operations)
1923
if err != nil {
2024
return err
2125
}

osm/osm.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"github.com/layer5io/meshery-osm/osm/oam"
2222
meshkitCfg "github.com/layer5io/meshkit/config"
2323
"github.com/layer5io/meshkit/logger"
24+
"github.com/layer5io/meshkit/models"
2425
"github.com/layer5io/meshkit/models/oam/core/v1alpha1"
25-
"github.com/layer5io/meskit/models"
2626
"gopkg.in/yaml.v2"
2727
)
2828

@@ -35,8 +35,9 @@ type Handler struct {
3535
func New(config meshkitCfg.Handler, log logger.Handler, kc meshkitCfg.Handler) adapter.Handler {
3636
return &Handler{
3737
Adapter: adapter.Adapter{
38-
Config: config,
39-
Log: log,
38+
Config: config,
39+
Log: log,
40+
KubeconfigHandler: kc,
4041
},
4142
}
4243
}
@@ -88,6 +89,10 @@ func (osm *Handler) CreateKubeconfigs(kubeconfigs []string) error {
8889

8990
// ProcessOAM will handles the grpc invocation for handling OAM objects
9091
func (h *Handler) ProcessOAM(ctx context.Context, oamReq adapter.OAMRequest, hchan *chan interface{}) (string, error) {
92+
err := h.CreateKubeconfigs(oamReq.K8sConfigs)
93+
if err != nil {
94+
return "", err
95+
}
9196
kubeconfigs := oamReq.K8sConfigs
9297
h.SetChannel(hchan)
9398
var comps []v1alpha1.Component

0 commit comments

Comments
 (0)