Skip to content

Bug - command bug for server state #5

@hhgyu

Description

@hhgyu

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch haproxy-sdk@1.0.5 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/haproxy-sdk/server.js b/node_modules/haproxy-sdk/server.js
index 5005b0b..c233c33 100644
--- a/node_modules/haproxy-sdk/server.js
+++ b/node_modules/haproxy-sdk/server.js
@@ -319,9 +319,9 @@ class Server {
           ? util.format("%s server %s/%s", state, this._backendname, this._name)
           : util.format(
               "set server %s/%s state %s",
-              state,
               this._backendname,
-              this._name
+              this._name,
+              state
             )
       )
       .then((values) => _Utils.checkCommand(values));

This issue body was partially generated by patch-package.

There is something wrong order in above code.

image

https://www.haproxy.com/blog/dynamic-configuration-haproxy-runtime-api/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions