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

Proposal: I would like to know which plugins I have installed with dtm and their status #401

Closed
imxw opened this issue Apr 9, 2022 · 5 comments · Fixed by #410
Closed
Assignees

Comments

@imxw
Copy link
Member

imxw commented Apr 9, 2022

Description

As a user, I would like to know which plugins I have installed with dtm and their status by dtm command.

Describe the Proposal

Examples are as follows

  • dtm list resources gets plugins that I have installed
  • dtm show states --plugin=argo gets the state of argo plugin
  • dtm show states --plugin=all gets the full content of the state file

Has the Feature been Requested Before?

No

Describe the Alternatives You Have Considered

Now all installed plugins and their status are recorded in the state file, which can be read to output the list of installed plugins and their status.

Additional Context

N/A

@daniel-hutao
Copy link
Member

daniel-hutao commented Apr 12, 2022

Great idea!

Status is actually divided into two parts:

  1. The states recorded in the "State Backend"(devstream.state now)
  2. The real status with the resources

So maybe we need a command to get all these two "status".


Command Design:

  • dtm show status # return all plugins' status
  • dtm show status --plugin=PLUGIN_NAME # return the status with PLUGIN_NAME

The output information should cover the 2 parts status mentioned above.

@daniel-hutao
Copy link
Member

If you agree with this implementation idea, I will continue to add the specific design of output information. /cc @devstream-io/devstream

@daniel-hutao daniel-hutao self-assigned this Apr 12, 2022
@daniel-hutao
Copy link
Member

daniel-hutao commented Apr 12, 2022

The printing information design

  • We need to know the Options, it tells us the configuration we used to deploy the plugin instance.
  • And we need to know the Status, it should be "Recorded State" + "Resource Real State".
  • If "Recorded State" == "Resource Real State", just printing one "Status".

See the details below:

1. Show the status with one plugin instance - dtm show status --plugin=demo

1.1 Drifted == true

$ dtm show status --plugin=demo
Name: demo
Plugin: githubactions-golang
Drifted: true (true if State != Resource)
Options:
    Foo: bar // The options map printed. Get from the state file.
Status:
    State:
         Foo: bar // The state map is printed.
    Resource:
         Foo: bar // The resource map is printed.

$_

1.2 Drifted == false

$ dtm show status --plugin=demo
Name: demo
Plugin: githubactions-golang
Drifted: false(true if State != Resource)
Options:
     foo: bar // The options map printed. Get from the state file.
Status:
     foo: bar // The state/resource map printed.

$_

2. Show the status with all plugins instances - dtm show status

$ dtm show status

----------------------- 1/2 -----------------------

Name: demo1
Plugin: githubactions-golang
Drifted: true (true if State != Resource)
Options:
    Foo: bar // The options map printed. Get from the state file.
Status:
    State:
         Foo: bar // The state map is printed.
    Resource:
         Foo: bar // The resource map is printed.

----------------------- 2/2 -----------------------

Name: demo2
Plugin: githubactions-golang
Drifted: false (true if State != Resource)
Options:
     Foo: bar // The options map printed. Get from the state file.
Status:
     Foo: bar // The state map is printed.

$_

@devstream-io/pmc Please take a review of this design.
/cc @imxw

@IronCore864
Copy link
Member

Great. Let's continue with this design.

@daniel-hutao
Copy link
Member

There are some details that have changed, like --name flag. For more details, please see Test in #410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants