-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added environment link and describe dump for supportablity #12038
Added environment link and describe dump for supportablity #12038
Conversation
…ttps://github.com/microsoft/azure-pipelines-tasks into users/shigupt/supportabilityForKubernetesManifest
requestUrl = tl.getVariable('System.TeamFoundationCollectionUri') + tl.getVariable('System.TeamProject') + '/_environments/' + tl.getVariable('Environment.Id'); | ||
const resourceId = tl.getVariable('Environment.ResourceId'); | ||
requestUrl = resourceId ? requestUrl + '/providers/kubernetes/' + resourceId : requestUrl; |
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.
Can this be done at server side? Where you dump a variable called Environment.ResourceUrl
or something like that?
@vithati thoughts?
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.
We can do that enhancement later.
} | ||
} | ||
} | ||
|
||
utils.checkForErrors(rolloutStatusResults); | ||
if (rolloutStatusHasErrors) { | ||
throw new Error('Rollout status check failed.'); |
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.
this message should come from task.json
} else { | ||
kubectl.describe(KubernetesConstants.KubernetesWorkload.pod, podName); | ||
if (environmentUrl) | ||
console.log('For more information go to ' + environmentUrl); |
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.
This should come from task.json too
} | ||
break; | ||
case 'Pending': | ||
if (!isPodReady(podStatus)) { | ||
tl.warning(`pod/${podName} rollout status check timedout`); | ||
kubectl.describe(KubernetesConstants.KubernetesWorkload.pod, podName); | ||
if (environmentUrl) | ||
console.log('For more information go to ' + environmentUrl); |
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.
Every message shown to user should come from task.json.
If it's a debug statement you can skip it. This would end up raising localization errors later on otherwise.
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.
Okay. I'll change that
} | ||
break; | ||
case 'Failed': | ||
tl.error(`pod/${podName} rollout failed`); | ||
kubectl.describe(KubernetesConstants.KubernetesWorkload.pod, podName); | ||
if (environmentUrl) | ||
console.log('For more information go to ' + environmentUrl); |
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.
Same
…ttps://github.com/microsoft/azure-pipelines-tasks into users/shigupt/supportabilityForKubernetesManifest
utils.checkForErrors([result]); | ||
} catch (ex) { | ||
tl.error(ex); | ||
kubectl.describe(resource.type, resource.name); |
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.
Move this to private function and use other places.
requestUrl = tl.getVariable('System.TeamFoundationCollectionUri') + tl.getVariable('System.TeamProject') + '/_environments/' + tl.getVariable('Environment.Id'); | ||
const resourceId = tl.getVariable('Environment.ResourceId'); | ||
requestUrl = resourceId ? requestUrl + '/providers/kubernetes/' + resourceId : requestUrl; |
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.
We can do that enhancement later.
…ttps://github.com/microsoft/azure-pipelines-tasks into users/shigupt/supportabilityForKubernetesManifest
Added environment link and describe dump for supportablity