omit deleted when not provided

Signed-off-by: Nicholas Brink <nbrink7@gmail.com>
pull/6229/head
Nicholas Brink 6 years ago committed by Nick Brink
parent f73e3235c2
commit 131ba9ec94

@ -1 +1 @@
{"name":"flummoxed-chickadee","info":{"first_deployed":"0001-01-01T00:00:00Z","last_deployed":"2016-01-16T00:00:00Z","deleted":"0001-01-01T00:00:00Z","status":"deployed","notes":"release notes"},"namespace":"default"} {"name":"flummoxed-chickadee","info":{"first_deployed":"0001-01-01T00:00:00Z","last_deployed":"2016-01-16T00:00:00Z","status":"deployed","notes":"release notes"},"namespace":"default"}

@ -1,5 +1,4 @@
info: info:
deleted: "0001-01-01T00:00:00Z"
first_deployed: "0001-01-01T00:00:00Z" first_deployed: "0001-01-01T00:00:00Z"
last_deployed: "2016-01-16T00:00:00Z" last_deployed: "2016-01-16T00:00:00Z"
resources: | resources: |

@ -72,6 +72,7 @@ func TestInstallRelease(t *testing.T) {
is.NotEqual(len(rel.Manifest), 0) is.NotEqual(len(rel.Manifest), 0)
is.Contains(rel.Manifest, "---\n# Source: hello/templates/hello\nhello: world") is.Contains(rel.Manifest, "---\n# Source: hello/templates/hello\nhello: world")
is.Equal(rel.Info.Description, "Install complete") is.Equal(rel.Info.Description, "Install complete")
is.Nil(rel.Info.Deleted)
} }
func TestInstallReleaseClientOnly(t *testing.T) { func TestInstallReleaseClientOnly(t *testing.T) {

@ -85,7 +85,8 @@ func (u *Uninstall) Run(name string) (*release.UninstallReleaseResponse, error)
u.cfg.Log("uninstall: Deleting %s", name) u.cfg.Log("uninstall: Deleting %s", name)
rel.Info.Status = release.StatusUninstalling rel.Info.Status = release.StatusUninstalling
rel.Info.Deleted = time.Now() deleted := time.Now()
rel.Info.Deleted = &deleted
rel.Info.Description = "Deletion in progress (or silently failed)" rel.Info.Description = "Deletion in progress (or silently failed)"
res := &release.UninstallReleaseResponse{Release: rel} res := &release.UninstallReleaseResponse{Release: rel}

@ -55,6 +55,7 @@ func TestUpgradeRelease_Wait(t *testing.T) {
req.Error(err) req.Error(err)
is.Contains(res.Info.Description, "I timed out") is.Contains(res.Info.Description, "I timed out")
is.Equal(res.Info.Status, release.StatusFailed) is.Equal(res.Info.Status, release.StatusFailed)
is.Nil(res.Info.Deleted)
} }
func TestUpgradeRelease_Atomic(t *testing.T) { func TestUpgradeRelease_Atomic(t *testing.T) {

@ -24,7 +24,7 @@ type Info struct {
// LastDeployed is when the release was last deployed. // LastDeployed is when the release was last deployed.
LastDeployed time.Time `json:"last_deployed,omitempty"` LastDeployed time.Time `json:"last_deployed,omitempty"`
// Deleted tracks when this object was deleted. // Deleted tracks when this object was deleted.
Deleted time.Time `json:"deleted,omitempty"` Deleted *time.Time `json:"deleted,omitempty"`
// Description is human-friendly "log entry" about this release. // Description is human-friendly "log entry" about this release.
Description string `json:"Description,omitempty"` Description string `json:"Description,omitempty"`
// Status is the current state of the release // Status is the current state of the release

Loading…
Cancel
Save