1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-06 09:22:46 +03:00

Fail on InvalidImageName (#4007)

This commit is contained in:
Thomas Anderson
2024-08-06 18:07:07 +03:00
committed by GitHub
parent 08b44b95c3
commit c5746ccb50
2 changed files with 15 additions and 3 deletions

View File

@@ -65,6 +65,18 @@ func isImagePullBackOffState(pod *v1.Pod) bool {
return false
}
func isInvalidImageName(pod *v1.Pod) bool {
for _, containerState := range pod.Status.ContainerStatuses {
if containerState.State.Waiting != nil {
if containerState.State.Waiting.Reason == "InvalidImageName" {
return true
}
}
}
return false
}
// getClientOutOfCluster returns a k8s client set to the request from outside of cluster.
func getClientOutOfCluster() (kubernetes.Interface, error) {
kubeConfigPath := os.Getenv("KUBECONFIG") // cspell:words KUBECONFIG