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

Allow the troubleshooting commands to use the IPC endpoint #171

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

arbll
Copy link
Member

@arbll arbll commented Apr 16, 2018

This PR makes it possible to give configs to list_* commands using the HTTPS IPC endpoint.

@arbll arbll changed the title Allow the troubleshooting commands to use the https endpoint Allow the troubleshooting commands to use the IPC endpoint Apr 16, 2018
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Can we make sure nothing breaks on agent5?

@@ -136,6 +136,11 @@ public static void main(String[] args) {

App app = new App(config);

// Get config from the ipc endpoint for "list_*" actions
if (!config.getAction().equals(AppConfig.ACTION_COLLECT)) {
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if this might break stuff on agent5? Can you verify? Maybe we should add a flag to enable this behavior?

Copy link
Member Author

@arbll arbll Apr 16, 2018

Choose a reason for hiding this comment

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

It should not since the A5 does not give the IPC config parameters.

if (this.client == null) {

if (appConfig.remoteEnabled()) {
client = new HttpClient(appConfig.getIPCHost(), appConfig.getIPCPort(), false);
}

public boolean remoteEnabled() {
return (ipcHost != null && ipcPort > 0);
}

^ getJSONConfigs is a no-op in A5

@@ -107,7 +107,7 @@ public HttpResponse request(String method, String body, String path) {
con.setRequestMethod(method.toUpperCase());
con.setRequestProperty("Authorization", "Bearer "+ this.token);
con.setRequestProperty("User-Agent", USER_AGENT);
if (method.toUpperCase() == "GET") {
if (method.toUpperCase().equals("GET")) {
Copy link
Member

Choose a reason for hiding this comment

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

🍪

@arbll arbll added this to the 0.20.0 milestone Apr 16, 2018
@arbll arbll force-pushed the arbll/https-config-troubleshooting branch from 1e163cf to 2c61140 Compare April 18, 2018 16:06
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Go for it! :shipit:

@arbll arbll merged commit f1f633e into master Apr 19, 2018
@arbll arbll deleted the arbll/https-config-troubleshooting branch April 19, 2018 13:12
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 this pull request may close these issues.

2 participants