-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add commands to run commands and check cluster connectivity #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting some threads where it would be great to have people thoughts
if len(res.Value) == 0 || res.Value[0] == nil { | ||
return "", errors.New("no response received after command execution") | ||
} | ||
val := res.Value[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have multiple values after using PollUntilDone()
?
cmd/utils/vmss.go
Outdated
if to.String(val.Code) != "ProvisioningState/succeeded" { | ||
return "", errors.New("command execution didn't succeed") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there a constant in the SDK to compare this?
KUBECTL_AZ_TARGETS = \ | ||
kubectl-az-linux-amd64 \ | ||
kubectl-az-linux-arm64 \ | ||
kubectl-az-darwin-amd64 \ | ||
kubectl-az-darwin-arm64 \ | ||
kubectl-az-windows-amd64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, I have tested it only on Linux and Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. I'm testing and it's working as intended.
I think SIGINT needs some special handling. If I interrupt a running command I need to wait some timeout before I'm able to run a command again.
|
According to the documentation, we can't cancel a running script. However, BeginRunCommand receives a context, maybe there is something we can do with it. I will create an issue to work on this. |
bfa23a8
to
b487698
Compare
b487698
to
d6b55ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments but LGTM!
d6b55ce
to
344a4f3
Compare
I created issue #5 to further investigate this behaviour and try to understand how it can be improved (if possible). |
This change is necessary to ensure spinner and suffix are correctly cleaned up when we call Stop. When we print something between Start and Stop, the snipper and suggix remains there: BEFORE THIS PR: Example #1: $ ./kubectl-aks config import / Importing...WARN[0030] Could not get VMSS VMs via Kubernetes API WARN[0030] Please provide '--subscription', '--resource-group' and '--cluster-name' flags to get VMSS VMs via Azure API Error: getting VMSS VMs via Kuberntes API: listing nodes: Get "https://172.28.128.4:6443/api/v1/nodes": dial tcp 172.28.128.4:6443: i/o timeout Example #2: $ ./kubectl-aks check-apiserver-connectivity / Checking connectivity...Connectivity check: failed with returned value 1 AFTER THIS PR: Example #1: $ ./kubectl-aks config import WARN[0030] Could not get VMSS VMs via Kubernetes API WARN[0030] Please provide '--subscription', '--resource-group' and '--cluster-name' flags to get VMSS VMs via Azure API Error: getting VMSS VMs via Kuberntes API: listing nodes: Get "https://172.28.128.4:6443/api/v1/nodes": dial tcp 172.28.128.4:6443: i/o timeout Example #2: $ ./kubectl-aks check-apiserver-connectivity Connectivity check: failed with returned value 1: Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
This change is necessary to ensure spinner and suffix are correctly cleaned up when we call Stop. When we print something between Start and Stop, the snipper and suggix remains there: BEFORE THIS PR: Example #1: $ ./kubectl-aks config import / Importing...WARN[0030] Could not get VMSS VMs via Kubernetes API WARN[0030] Please provide '--subscription', '--resource-group' and '--cluster-name' flags to get VMSS VMs via Azure API Error: getting VMSS VMs via Kuberntes API: listing nodes: Get "https://172.28.128.4:6443/api/v1/nodes": dial tcp 172.28.128.4:6443: i/o timeout Example #2: $ ./kubectl-aks check-apiserver-connectivity / Checking connectivity...Connectivity check: failed with returned value 1 AFTER THIS PR: Example #1: $ ./kubectl-aks config import WARN[0030] Could not get VMSS VMs via Kubernetes API WARN[0030] Please provide '--subscription', '--resource-group' and '--cluster-name' flags to get VMSS VMs via Azure API Error: getting VMSS VMs via Kuberntes API: listing nodes: Get "https://172.28.128.4:6443/api/v1/nodes": dial tcp 172.28.128.4:6443: i/o timeout Example #2: $ ./kubectl-aks check-apiserver-connectivity Connectivity check: failed with returned value 1: Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
Add commands to run commands and check cluster connectivity
This PR adds commands
run-command
andcheck-apiserver-connectivity
with an initial documentation.How to use
As described in the README, it can be tested by doing:
Then, check specific documentation to test each command: docs or the Testing done section below.
Testing done
Tests were executed on Linux with kernel 5.4 and Windows 11:
Testing run-command
Testing check-apiserver-connectivity