@@ -54,16 +54,6 @@ func (r *FakeCartridge) WithStoragePodsCreated() *FakeCartridge {
5454func (r * FakeCartridge ) WithAllPodsRunning () * FakeCartridge {
5555 for _ , pod := range r .Pods {
5656 r .setPodRunning (pod )
57- r .setPodContainerReady (pod , PodContainerName )
58- }
59-
60- return r
61- }
62-
63- func (r * FakeCartridge ) WithAllPodsReady () * FakeCartridge {
64- for _ , pod := range r .Pods {
65- r .setPodReady (pod )
66- r .setPodContainerReady (pod , PodContainerName )
6757 }
6858
6959 return r
@@ -79,25 +69,6 @@ func (r *FakeCartridge) WithPodsRunning(names ...string) *FakeCartridge {
7969 _ , ok := namesMap [pod .GetName ()]
8070 if ok {
8171 r .setPodRunning (pod )
82- r .setPodContainerReady (pod , PodContainerName )
83- }
84- }
85-
86- return r
87- }
88-
89- func (r * FakeCartridge ) WithPodsReady (names ... string ) * FakeCartridge {
90- namesMap := make (map [string ]bool , len (names ))
91- for _ , name := range names {
92- namesMap [name ] = true
93- }
94-
95- for _ , pod := range r .Pods {
96- _ , ok := namesMap [pod .GetName ()]
97- if ok {
98- r .setPodRunning (pod )
99- r .setPodReady (pod )
100- r .setPodContainerReady (pod , PodContainerName )
10172 }
10273 }
10374
@@ -107,7 +78,6 @@ func (r *FakeCartridge) WithPodsReady(names ...string) *FakeCartridge {
10778func (r * FakeCartridge ) WithAllPodsDeleting () * FakeCartridge {
10879 for _ , pod := range r .Pods {
10980 r .setPodDeleting (pod )
110- r .setPodContainerReady (pod , PodContainerName )
11181 }
11282
11383 return r
@@ -117,38 +87,7 @@ func (r *FakeCartridge) setPodRunning(pod *v1.Pod) {
11787 pod .Status .Phase = v1 .PodRunning
11888}
11989
120- func (r * FakeCartridge ) setPodReady (pod * v1.Pod ) {
121- if pod .Status .Conditions == nil {
122- pod .Status .Conditions = []v1.PodCondition {}
123- }
124-
125- pod .Status .Conditions = append (pod .Status .Conditions , v1.PodCondition {
126- Type : v1 .PodReady ,
127- Status : v1 .ConditionTrue ,
128- Reason : "Ready" ,
129- Message : "Ready" ,
130- })
131- }
132-
13390func (r * FakeCartridge ) setPodDeleting (pod * v1.Pod ) {
13491 now := metav1 .Now ()
13592 pod .DeletionTimestamp = & now
13693}
137-
138- //nolint:unparam
139- func (r * FakeCartridge ) setPodContainerReady (pod * v1.Pod , containerName string ) {
140- if pod .Status .ContainerStatuses == nil {
141- pod .Status .ContainerStatuses = []v1.ContainerStatus {}
142- }
143-
144- started := true
145-
146- pod .Status .ContainerStatuses = append (
147- pod .Status .ContainerStatuses ,
148- v1.ContainerStatus {
149- Name : containerName ,
150- Ready : true ,
151- Started : & started ,
152- },
153- )
154- }
0 commit comments