socketcluster icon indicating copy to clipboard operation
socketcluster copied to clipboard

updated cli with async/await

Open maarteNNNN opened this issue 5 years ago • 4 comments

  • [x] Added package.json as version for run command and added it to the docker run command (take a look if you want this)
  • [x] transformK8sConfigs to Promise
  • [x] promptInput, promptConfirm to async await
  • [x] If statement wrapped in async function
  • [x] removed unused vars absoluteAppPath, targetCPUUtilization, deploymentYAMLRegex and maxPodsPerService
  • [x] significally improved promptSecret, promptK8sTLSCredentials, promptDockerAuthDetails with async await
  • [x] Removed prompt and handle callback functions
  • [x] Username toLowerCase for docker registry
  • [x] Test create
  • [x] Test run
  • [x] Test restart
  • [x] Test list
  • [x] Test stop
  • [x] Test logs
  • [x] Test deploy (without TLS!)
  • [x] Test deploy-update
  • [x] Test undeploy
  • [ ] Test add-secret
  • [ ] Test remove-secret

Most changes are made within the deploy command. I've tested it and it's working inside my minikube. However I didn't test the TLS encryption.

maarteNNNN avatar Feb 06 '21 14:02 maarteNNNN

@maarteNNNN Thanks for this contribution! I've been meaning to refactor that logic so it's great that you've taken the incentive. I'll try to make some time to review sometime this week.

jondubois avatar Feb 08 '21 15:02 jondubois

@jondubois I implemented cli-builder, but it's not tested thoroughly. Do not merge yet.

maarteNNNN avatar Feb 19 '21 21:02 maarteNNNN

Testing

  • [x] Create (getting a bug code 243 but it has to do with my npm permissions)
  • [x] Run
  • [x] Restart
  • [x] Stop
  • [x] List
  • [x] Logs
    • [x] Argument -f
  • [x] Undeploy
  • [x] Deploy
    • [x] Creating socketcluster-k8s.json
    • [ ] Creating with certificates
    • [x] Docker username (added string.toLowerCase())
    • [x] Docker password
    • [x] Docker image name
    • [x] Docker tag
  • [x] Deploy Update
  • [ ] Add secret
  • [ ] Remove secret

I didn't test the secret parts because I have no clue how.

maarteNNNN avatar Feb 20 '21 13:02 maarteNNNN

I bumped cli-builder and checked all functions

See this link on how to install minikube for deploying and testing on a tiny k8s cluster.

Same functions are tested as the checked above. I didn't check TLS though.

maarteNNNN avatar Aug 09 '21 00:08 maarteNNNN

Merged manually with some fixes. Thanks :)

jondubois avatar Aug 21 '22 22:08 jondubois