Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] system model command #8284

Merged
merged 43 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e1d4211
"system model list" command is added
zakisk Jul 19, 2023
25389b6
error and links are added for list command
zakisk Jul 20, 2023
8e516a2
"system model list" command is added
zakisk Jul 19, 2023
a989e4e
error and links are added for list command
zakisk Jul 20, 2023
8c78182
"system model view" command is added
zakisk Jul 22, 2023
59821db
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 24, 2023
62c8f58
minor changes
zakisk Jul 24, 2023
c707a22
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Jul 26, 2023
d149bff
[TEST] Add Unit Test for `mesheryctl system model list` command
zakisk Jul 26, 2023
6377c27
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 26, 2023
cea9125
[TEST] Add Unit Test for `mesheryctl system model view` command
zakisk Jul 26, 2023
f19f89a
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 26, 2023
dabd8b7
Revert "[TEST] Add Unit Test for `mesheryctl system model view` command"
zakisk Jul 26, 2023
88d8809
minor rename
zakisk Jul 26, 2023
6fd6987
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Jul 28, 2023
c6b2dea
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 28, 2023
468fa1c
Merge branch 'add_system_model_command' of https://github.com/zakisk/…
zakisk Jul 28, 2023
1bd4baf
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 29, 2023
183e62a
Merged latest changes from origin
zakisk Jul 29, 2023
ff6e87c
used utils.MakeRequest
zakisk Jul 29, 2023
fbe5ea2
renamed variable cfg and deleted unused comments
zakisk Jul 29, 2023
45f0132
added error.go file
zakisk Jul 30, 2023
5f44d18
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 30, 2023
4c7b439
changes suggested by @suhail34
zakisk Jul 31, 2023
20ac6ef
deleted duplicate errors
zakisk Jul 31, 2023
f44ef28
Merge branch 'meshery:master' into add_system_model_command
zakisk Jul 31, 2023
0e5787a
Merge branch 'meshery:master' into add_system_model_command
zakisk Aug 1, 2023
a3e9cc8
Merge branch 'meshery:master' into add_system_model_command
zakisk Aug 1, 2023
d784e1d
Merge branch 'meshery:master' into add_system_model_command
zakisk Aug 5, 2023
d0261a3
Merge branch 'meshery:master' into add_system_model_command
zakisk Aug 12, 2023
a42df4d
formatted output of model list command in tabular form
zakisk Aug 12, 2023
e04c3e8
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Aug 13, 2023
60427ca
minor changes
zakisk Aug 13, 2023
0ede87c
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Aug 15, 2023
f1f2c41
minor error messages changes
zakisk Aug 15, 2023
67054c7
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Aug 26, 2023
eda44e5
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Sep 1, 2023
aad1845
"system model list" command is added
zakisk Jul 19, 2023
8db6406
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Sep 25, 2023
100c595
added server running status check before executing system model subco…
zakisk Sep 25, 2023
5e487f2
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Oct 30, 2023
436f2e8
Merge remote-tracking branch 'upstream/master' into add_system_model_…
zakisk Nov 22, 2023
b3afb62
moved `model` command behind `exp` command
zakisk Nov 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 0 additions & 59 deletions mesheryctl/internal/cli/root/error.go

This file was deleted.

45 changes: 45 additions & 0 deletions mesheryctl/internal/cli/root/system/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
ErrInitPortForwardCode = "1047"
ErrRunPortForwardCode = "1048"
ErrFailedGetEphemeralPortCode = "1049"
ErrProcessingConfigCode = "1050"
ErrCreatingConfigFileCode = "1051"
ErrAddingTokenToConfigCode = "1052"
ErrAddingContextToConfigCode = "1053"
ErrUnmarshallingConfigFileCode = "1054"
ErrGettingRequestContextCode = "1055"
ErrInvalidAPIResponseCode = "1056"
ErrUnmarshallingAPIDataCode = "1057"
ErrConnectingToServerCode = "1058"
zakisk marked this conversation as resolved.
Show resolved Hide resolved
zakisk marked this conversation as resolved.
Show resolved Hide resolved
ErrCreatingDockerClientCode = "1060"
)

Expand Down Expand Up @@ -148,6 +157,42 @@
)
}

func ErrProcessingConfig(err error) error {
return errors.New(ErrProcessingConfigCode, errors.Alert, []string{"Error processing config"}, []string{"Error processing config", err.Error()}, []string{}, []string{})

Check warning on line 161 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L160-L161

Added lines #L160 - L161 were not covered by tests
}

func ErrCreatingConfigFile(err error) error {
return errors.New(ErrCreatingConfigFileCode, errors.Alert, []string{"Unable to create config file"}, []string{"Unable to create config file"}, []string{}, []string{})

Check warning on line 165 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L164-L165

Added lines #L164 - L165 were not covered by tests
}

func ErrAddingTokenToConfig(err error) error {
return errors.New(ErrAddingTokenToConfigCode, errors.Alert, []string{"Unable to add token to config"}, []string{"Unable to add token to config"}, []string{}, []string{})

Check warning on line 169 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L168-L169

Added lines #L168 - L169 were not covered by tests
}

func ErrAddingContextToConfig(err error) error {
return errors.New(ErrAddingContextToConfigCode, errors.Alert, []string{"Unable to add context to config"}, []string{"Unable to add context to config"}, []string{}, []string{})

Check warning on line 173 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L172-L173

Added lines #L172 - L173 were not covered by tests
zakisk marked this conversation as resolved.
Show resolved Hide resolved
}

func ErrUnmarshallingConfigFile(err error) error {
return errors.New(ErrUnmarshallingConfigFileCode, errors.Alert, []string{"Error processing json in config file"}, []string{"Error processing json in config file"}, []string{}, []string{})

Check warning on line 177 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L176-L177

Added lines #L176 - L177 were not covered by tests
zakisk marked this conversation as resolved.
Show resolved Hide resolved
}

func ErrGettingRequestContext(err error) error {
return errors.New(ErrGettingRequestContextCode, errors.Fatal, []string{"Unable to add token to config"}, []string{"Unable to add token to config", err.Error()}, []string{}, []string{})

Check warning on line 181 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L180-L181

Added lines #L180 - L181 were not covered by tests
}

func ErrInvalidAPIResponse(err error) error {
return errors.New(ErrInvalidAPIResponseCode, errors.Fatal, []string{"Invalid API response encountered"}, []string{"Invalid API response encountered", err.Error()}, []string{}, []string{})

Check warning on line 185 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L184-L185

Added lines #L184 - L185 were not covered by tests
}

func ErrUnmarshallingAPIData(err error) error {
return errors.New(ErrUnmarshallingAPIDataCode, errors.Fatal, []string{"Error processing json API data"}, []string{"Error processing json API data", err.Error()}, []string{}, []string{})

Check warning on line 189 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L188-L189

Added lines #L188 - L189 were not covered by tests
}

func ErrConnectingToServer(err error) error {
return errors.New(ErrConnectingToServerCode, errors.Fatal, []string{"Unable to communicate with Meshery server"}, []string{"Unable to communicate with Meshery server", err.Error(), "See https://docs.meshery.io for help getting started with Meshery"}, []string{}, []string{"See https://docs.meshery.io for help getting started with Meshery"})

Check warning on line 193 in mesheryctl/internal/cli/root/system/error.go

View check run for this annotation

Codecov / codecov/patch

mesheryctl/internal/cli/root/system/error.go#L192-L193

Added lines #L192 - L193 were not covered by tests
}

func ErrCreatingDockerClient(err error) error {
return errors.New(
ErrCreatingDockerClientCode,
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mesheryctl/internal/cli/root/system/fixtures/token.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meshery-provider":"Meshery","token":"eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SW5CMVlteHBZenBsT0dWbU5ERmpNeTFpWldWbUxUUmlZakV0T0dVNE1DMHpOakExTVRZeU4yTTJNakVpTENKMGVYQWlPaUpLVjFRaWZRLmV5SmhkV1FpT2x0ZExDSmpiR2xsYm5SZmFXUWlPaUp0WlhOb1pYSjVMV05zYjNWa0lpd2laWGh3SWpveE5qSXlPREk1TlRRMExDSmxlSFFpT250OUxDSnBZWFFpT2pFMk1qSTRNalU1TkRNc0ltbHpjeUk2SW1oMGRIQnpPaTh2YldWemFHVnllUzVzWVhsbGNqVXVhVzh2YUhsa2NtRXZJaXdpYW5ScElqb2lPRGMxT0RGbVpXSXROMlZpTnkwMFlqSTFMV0l3TURndE9XWTJaVEE0WXpabFkyVTJJaXdpYm1KbUlqb3hOakl5T0RJMU9UUXpMQ0p6WTNBaU9sc2liM0JsYm1sa0lpd2liMlptYkdsdVpTSmRMQ0p6ZFdJaU9pSmpSMncxWkZoT2IyTXliSFZhTWtaNVlWaHNhRHBhTW13d1lVaFdhU0o5Lk90aDJwYkJFNmFBcnBfUFVwR3E3b2ZsaEVWYmdsdTAtamdXNG44eWxHeVVTandOc0k4SmdoallIVGU5YjlUSzhWQUhoNVRyT0YwV1VRb0h4QVJGUmN6OHl2ZEdpbm1HcUZEZTd6RVpoSjZHZmNlZFl6bmpCc3FvVWthMTNXYzhvM0J2bGR2T2gtTjFGNzdHM3ZLenI0UEJaM2pXRHVEeWpjSUJnOTJVUzd0Nlg5Ymd6YklrT3lOOVhpWGVVNXQtbEJIamt2cklRazhqdWRKaTliOHVGaVBuMmdIMDVJbnhUdFJtSlFJdUhvSzV2WmxFQW0xN1J6ZER4WVI0cndqeTBqanFWdXdvWnBjbUJQM1dUNjdIVHhkYmo5N3hZM2IzNHh5ZFkxeVFVS09XR1NOckZVeXhMbW9QMmJUM24tQ0dVczJ1SWhnZExXNlZlNVQ1LV9tSGY0Z212X0NGWlFNelRsbjRFVmw2bTUxdjFxNXJzQmdfWmFuVmtXdGNHWF9ZSGs3WHpKdndXRDhvSmt5NzBleGUwYXJ3cmg2bjJkLU9jMi1Jc1F2OTBFM1hYeHBJcWxrckNfU3NiM1NpOU1jM1ptal9HY2JtOHVHbUZEejhaZEYxUEdpeDdKTjM3TzJyQnpaVldRaHFrZTV6MW42VUVITXJGSGJBNXBKVkxzUmE0ZUNBaFdwODVlZVV3ZjlUMnByc3FzNHBaMkh0eVpSMlBTdGFLZVFFai1SUXdvRHpDTEN4Zm85RnBvbEN6WmN3ZzRvLXhrb0Q0aS1MczIzODd0dm5xSTVESl8xaUlMX1hNTHByZXJtcDdxeGV2NEVDOW9abzdWenZmTDd4cDZTcnhIaldZQVpuZS12eURjQlhNZUlSMVVoeVdVZDQtaWJfZmxzdFVEME5XVV9ZIiwidG9rZW5fdHlwZSI6ImJlYXJlciIsInJlZnJlc2hfdG9rZW4iOiJXS3pZWW5BQkVJQkduekNfaWR2VW1IZUtsZlgzLWxjWm12TzBxY2ZCNlRzLm5kNXhXUFFIeWVTcTY0OUV2dy1tX2t3WDdqYWF1RDZiSExXTW9fQVhxZVUiLCJleHBpcnkiOiIyMDIxLTA2LTA0VDE3OjU5OjAzLjg0ODAyODAwOVoifQ"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we exposing a secret publicly like this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet answered...

alphaX86 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"page":1,"page_size":1,"total_count":1,"models":[{"name":"spire","version":"0.12.2","displayName":"SPIRE","category":{"name":"Security \u0026 Compliance","metadata":null},"metadata":{"svgColor":"ui/public/static/img/meshmodels/identity-manager/color/workloadidentity-color.svg","svgWhite":"ui/public/static/img/meshmodels/identity-manager/white/workloadidentity-white.svg"},"duplicates":0}]}