Skip to content

Commit dc0b0ed

Browse files
authored
add fix for pod updates - recreation (#83)
1 parent 1735731 commit dc0b0ed

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

internal/drivers/iosxe/pod_lifecycle.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,20 @@ func (d *XEDriver) DeployPod(ctx context.Context, pod *v1.Pod) error {
6464
return nil
6565
}
6666

67-
// UpdatePod handles pod update requests
67+
// UpdatePod handles pod update requests by performing a delete-and-redeploy cycle.
68+
// IOS-XE AppHosting does not support in-place updates to running applications;
69+
// changes to image, resources, or environment require a full teardown and reinstall.
6870
func (d *XEDriver) UpdatePod(ctx context.Context, pod *v1.Pod) error {
69-
log.G(ctx).Info("Pod UpdateContainer request received")
70-
return nil
71+
log.G(ctx).Infof("UpdatePod: delete-and-redeploy for pod %s/%s", pod.Namespace, pod.Name)
72+
73+
if err := d.DeletePod(ctx, pod); err != nil {
74+
// Log but don't block — partial cleanup is acceptable.
75+
// DeployPod's CreateAppHostingApp will fail on conflict if
76+
// any app still exists, which is a clearer error than aborting here.
77+
log.G(ctx).Warnf("UpdatePod: cleanup had errors (will attempt redeploy): %v", err)
78+
}
79+
80+
return d.DeployPod(ctx, pod)
7181
}
7282

7383
// GetPodContainers retrieves all containers belonging to a specific pod from the device.

0 commit comments

Comments
 (0)