Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #938 from laverya/fix-ship-edit-headed-for-apps
Browse files Browse the repository at this point in the history
fix 'ship edit' for replicated.app upstreams
  • Loading branch information
laverya committed May 15, 2019
2 parents 45c9b00 + f6e27d1 commit 51124b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/lifecycle/daemon/routes_navcycle_getmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package daemon

import (
"github.com/gin-gonic/gin"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"

"github.com/replicatedhq/ship/pkg/api"
)

Expand All @@ -23,6 +26,9 @@ func (d *NavcycleRoutes) getMetadata(release *api.Release) gin.HandlerFunc {
"icon": release.Metadata.ChannelIcon,
})
return
default:
errorLog := level.Error(log.With(d.Logger, "method", "getMetadata"))
errorLog.Log("error", "release metadata type not recognized", "release.Metadata.Type", release.Metadata.Type)
}
}
}
6 changes: 6 additions & 0 deletions pkg/specs/replicatedapp/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ func (r *resolver) ResolveEditRelease(ctx context.Context) (*api.Release, error)
Metadata: *stateData.ReleaseMetadata(),
}

if r.Runbook == "" {
result.Metadata.Type = "replicated.app"
} else {
result.Metadata.Type = "runbook.replicated.app"
}

if err = yaml.Unmarshal([]byte(stateData.UpstreamContents().AppRelease.Spec), &result.Spec); err != nil {
return nil, errors.Wrapf(err, "decode spec from persisted release")
}
Expand Down

0 comments on commit 51124b5

Please sign in to comment.