Comments (2)
- Completed pods are selected by
func GenerateContainersReadyCondition(spec *v1.PodSpec, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition {
// Find if all containers are ready or not.
if containerStatuses == nil {
return v1.PodCondition{
Type: v1.ContainersReady,
Status: v1.ConditionFalse,
Reason: UnknownContainerStatuses,
}
}
unknownContainers := []string{}
unreadyContainers := []string{}
for _, container := range spec.Containers {
if containerStatus, ok := podutil.GetContainerStatus(containerStatuses, container.Name); ok {
if !containerStatus.Ready {
unreadyContainers = append(unreadyContainers, container.Name)
}
} else {
unknownContainers = append(unknownContainers, container.Name)
}
}
// If all containers are known and succeeded, just return PodCompleted.
if podPhase == v1.PodSucceeded && len(unknownContainers) == 0 {
return v1.PodCondition{
Type: v1.ContainersReady,
Status: v1.ConditionFalse,
Reason: PodCompleted,
}
}
// Generate message for containers in unknown condition.
unreadyMessages := []string{}
if len(unknownContainers) > 0 {
unreadyMessages = append(unreadyMessages, fmt.Sprintf("containers with unknown status: %s", unknownContainers))
}
if len(unreadyContainers) > 0 {
unreadyMessages = append(unreadyMessages, fmt.Sprintf("containers with unready status: %s", unreadyContainers))
}
unreadyMessage := strings.Join(unreadyMessages, ", ")
if unreadyMessage != "" {
return v1.PodCondition{
Type: v1.ContainersReady,
Status: v1.ConditionFalse,
Reason: ContainersNotReady,
Message: unreadyMessage,
}
}
return v1.PodCondition{
Type: v1.ContainersReady,
Status: v1.ConditionTrue,
}
}
- Evicted pods are selected by
PodIsEvicted returns true if the reported pod status is due to an eviction.
func PodIsEvicted(podStatus v1.PodStatus) bool {
return podStatus.Phase == v1.PodFailed && podStatus.Reason == Reason
}
from hybridnet.
close via #84
from hybridnet.
Related Issues (20)
- Separate IPv4 and IPv6 storage in network HOT 1
- Unexpected route decision after accessing nodeport across nodes HOT 1
- Failed to add IP v4 route (src: , dst: , gtw: 169.254.1.1,Err: Network unreachable (os error 101)) when use kata HOT 1
- most pods can still be created even if webhook inactive
- Unexpected panics will not restart controllers and can be logged HOT 1
- IPAM controllers get stuck in processing subnet which starts with IP address like 0.X.X.X HOT 1
- Cannot connect to nodeport from inside the cluster while externalTrafficPolicy is Local
- Create 0.1.0.0/22 subnet error
- why not use 4094 but 4096 here HOT 1
- sts pod get stuck in 'ContainerCreating' HOT 1
- Int64 will cause OutOfRange
- Retained IPInstance might be deleted if pod is evicted
- Felix panic because of failing to execute ipset
- hybridnet 在k8s1.26.3中使用异常 HOT 1
- hybridnet容器镜像建议使用类似docker buildx产品一键构建跨CPU架构的镜像,不用一个架构对应一个镜像版本 HOT 1
- Pod name can't be more than 63 characters in length HOT 1
- hostport方式部署的ingress controller无法更新本地iptables规则 HOT 2
- The wrong interfaces in CNI result generated by hybridnet plugin
- Unexpect flooding of unicast vxlan traffic
- Statefulset's pod got stuck in terminating forever after deleting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hybridnet.