readmeio / readmeio/api

Unable to change server.

Open
#921 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
697
Forks
31
Avg merge
3d 21h
Merged PRs (30d)
10

Description

I am trying to use this: https://orkadocs.macstadium.com/reference/listvms

There isn't a public orka cluster, so the URL you need to use is your own private one for your own cluster. In the docs they are simply using example.com as an example. On the right, you can get it to generate code for you in different languages. When you select Node, it suggests that you use this library to generate a library for the API. I did that, but it doesn't work, because it is trying to send the requests to example.com. I checked the docs on how to change the server, but it doesn't seem to be working. Here's the code:

const orkaConfig = require("../../../config/orka.json")
const secrets = require("../../secrets")
const orka = require("@api/orka")

async function main() {
    console.log(orkaConfig.url)
    orka.server(orkaConfig.url)
    orka.auth(secrets.orkaId)
    await orka.listVMs({namespace: 'orka-default'})
        .then(({ data }) => console.log(data))
        .catch(err => {
            console.log(err.res.url)
            console.error(err)
        });
}

This prints:

https://my.orka.domain
https://example.com/api/v1/namespaces/orka-default/vms

Followed by the error message. I'm clearly passing the correct URL to orka.server(), but as you can see, it makes no difference and it keeps using example.com. This seems like a bug to me, as I seem to be doing everything in accordance with the documentation. I'm using version 6.1.2 and ideally this should be fixed and a new version released, but if there are any workarounds in the meantime, please let me know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown config/orka.json value, secrets, @api/orka version 6.1.2, and listVMs call. Inspect how the generated client handles orka.server() and compare the resulting request URL with the configured private server; done means listVMs no longer targets example.com when a custom server is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.