MCPcopy Index your code
hub / github.com/kubernetes/sample-controller / TestUpdateDeployment

Function TestUpdateDeployment

controller_test.go:280–299  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

278}
279
280func TestUpdateDeployment(t *testing.T) {
281 f := newFixture(t)
282 foo := newFoo("test", ptr.To[int32](1))
283 _, ctx := ktesting.NewTestContext(t)
284
285 d := newDeployment(foo)
286
287 // Update replicas
288 foo.Spec.Replicas = ptr.To[int32](2)
289 expDeployment := newDeployment(foo)
290
291 f.fooLister = append(f.fooLister, foo)
292 f.objects = append(f.objects, foo)
293 f.deploymentLister = append(f.deploymentLister, d)
294 f.kubeobjects = append(f.kubeobjects, d)
295
296 f.expectUpdateFooStatusAction(foo)
297 f.expectUpdateDeploymentAction(expDeployment)
298 f.run(ctx, getRef(foo, t))
299}
300
301func TestNotControlledByUs(t *testing.T) {
302 f := newFixture(t)

Callers

nothing calls this directly

Calls 7

newFixtureFunction · 0.85
newFooFunction · 0.85
newDeploymentFunction · 0.85
getRefFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…