Skip to content

Commit

Permalink
add release old tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bearslyricattack committed Sep 9, 2024
1 parent 47001c9 commit e11189c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/devbox/api/v1alpha1/devboxrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type DevBoxReleaseStatus struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=Pending
Phase DevboxReleasePhase `json:"phase"`
// +kubebuilder:validation:Optional
OldTag string `json:"oldTag"`
}

// +kubebuilder:object:root=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
status:
description: DevBoxReleaseStatus defines the observed state of DevBoxRelease
properties:
oldTag:
type: string
phase:
default: Pending
type: string
Expand Down
2 changes: 2 additions & 0 deletions controllers/devbox/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,8 @@ spec:
status:
description: DevBoxReleaseStatus defines the observed state of DevBoxRelease
properties:
oldTag:
type: string
phase:
default: Pending
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ func (r *DevBoxReleaseReconciler) CreateReleaseTag(ctx context.Context, devboxRe
return err
}
logger.Info("Tagging image", "host", hostName, "image", imageName, "oldTag", oldTag, "newTag", devboxRelease.Spec.NewTag)
devboxRelease.Status.OldTag = oldTag
if err = r.Status().Update(ctx, devboxRelease); err != nil {
logger.Error(err, "Failed to update status", "devbox", devboxRelease.Spec.DevboxName, "newTag", devboxRelease.Spec.NewTag)
return err
}
return r.Registry.TagImage(hostName, imageName, oldTag, devboxRelease.Spec.NewTag)
}

Expand Down

0 comments on commit e11189c

Please sign in to comment.