mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 12:48:51 +00:00
Refactor PodCondition to PodPhase
This commit is contained in:
@@ -161,7 +161,7 @@ func init() {
|
||||
},
|
||||
|
||||
func(in *newer.PodStatus, out *PodState, s conversion.Scope) error {
|
||||
if err := s.Convert(&in.Condition, &out.Status, 0); err != nil {
|
||||
if err := s.Convert(&in.Phase, &out.Status, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.Info, &out.Info, 0); err != nil {
|
||||
@@ -173,7 +173,7 @@ func init() {
|
||||
return nil
|
||||
},
|
||||
func(in *PodState, out *newer.PodStatus, s conversion.Scope) error {
|
||||
if err := s.Convert(&in.Status, &out.Condition, 0); err != nil {
|
||||
if err := s.Convert(&in.Status, &out.Phase, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.Info, &out.Info, 0); err != nil {
|
||||
@@ -186,8 +186,8 @@ func init() {
|
||||
return nil
|
||||
},
|
||||
|
||||
// Convert all to the new PodCondition constants
|
||||
func(in *newer.PodCondition, out *PodStatus, s conversion.Scope) error {
|
||||
// Convert all to the new PodPhase constants
|
||||
func(in *newer.PodPhase, out *PodStatus, s conversion.Scope) error {
|
||||
switch *in {
|
||||
case "":
|
||||
*out = ""
|
||||
@@ -200,13 +200,13 @@ func init() {
|
||||
case newer.PodFailed:
|
||||
*out = PodTerminated
|
||||
default:
|
||||
return errors.New("The string provided is not a valid PodCondition constant value")
|
||||
return errors.New("The string provided is not a valid PodPhase constant value")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
func(in *PodStatus, out *newer.PodCondition, s conversion.Scope) error {
|
||||
func(in *PodStatus, out *newer.PodPhase, s conversion.Scope) error {
|
||||
switch *in {
|
||||
case "":
|
||||
*out = ""
|
||||
@@ -218,7 +218,7 @@ func init() {
|
||||
// Older API versions did not contain enough info to map to PodSucceeded
|
||||
*out = newer.PodFailed
|
||||
default:
|
||||
return errors.New("The string provided is not a valid PodCondition constant value")
|
||||
return errors.New("The string provided is not a valid PodPhase constant value")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
Reference in New Issue
Block a user