Adding multiple adapters using mesheryctl context command

Could someone please tell me how to add multiple adapters using this command

mesheryctl system context create context-name --adapters meshery-osm --platform docker --url http://localhost:9081 --set --yes 

Good question. To do so, simply repeat the --adapters flag for each adapter you would like included in the context.

mesheryctl system context create test --adapters meshery-osm --adapters meshery-linkerd --platform docker --url http://localhost:9081 --set --yes
1 Like

Thank you @Lee, could we use commas too?

Another way is to use a comma to separate each adapter (to make the “adapters” an array as input to the CLI), for example:

mesheryctl system context create example-context --adapters meshery-istio,meshery-nsm --platform kubernetes --url http://localhost:9081 --set --yes

Added `example-context` context

Source code reference (notice that “Adapters” is an array):

To view the newly added context:

mesheryctl system context view

Current Context: example-context

endpoint: http://localhost:9081
token: Default
token-location: auth.json
platform: kubernetes
adapters:
- meshery-istio,meshery-nsm
channel: stable
version: latest
1 Like

@panyuenlau Thanks for the response, after our conversation on slack i checked out this method using commas, but it doesn’t seem to work. Though the context is added successfully, but while trying to run it there’s an error saying

unable to read config /Users/adityachatterjee/.meshery/manifests/meshery-istio,meshery-kuma,meshery-consul,meshery-osm,meshery-consul-deployment.yaml | open /Users/adityachatterjee/.meshery/manifests/meshery-istio,meshery-kuma,meshery-consul,meshery-osm,meshery-consul-deployment.yaml: no such file or directory

This is probably because without the --adapters flag mesheryctl is not being able to distinguish between the different adapter names and is reading meshery-istio,meshery-consul as one adapter, thus, the error.