Skip to content

Commit

Permalink
Fix helm patch error (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
hangyan authored Feb 13, 2020
1 parent 2be3eea commit fc10da6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/alauda/captain

go 1.13

replace helm.sh/helm => github.com/alauda/helm v3.0.0-beta.3.0.20200207054522-eb9e84f51079+incompatible
replace helm.sh/helm => github.com/alauda/helm v3.0.0-beta.3.0.20200213022433-e8e5bacb4aeb+incompatible

replace github.com/deislabs/oras => github.com/deislabs/oras v0.7.0

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/O
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/alauda/component-base v0.0.0-20190628064654-a4dafcfd3446 h1:gtzuHCPURUuSWz5y/gkLQyxJn/W3pqG74YpzghVG7bY=
github.com/alauda/component-base v0.0.0-20190628064654-a4dafcfd3446/go.mod h1:tbaXeIWDl6zX1b7O53FSXClDS1YmEDRnVJszgcLXzpk=
github.com/alauda/helm v3.0.0-beta.3.0.20200207054522-eb9e84f51079+incompatible h1:QHshOB/ToWd+78RLzXcba8Q0Do5x4aT0kEyOC834Grs=
github.com/alauda/helm v3.0.0-beta.3.0.20200207054522-eb9e84f51079+incompatible/go.mod h1:puN71hQ/dtLbcyDOPyhZw19FrLSYCak3EvJBT2OaRvQ=
github.com/alauda/helm v3.0.0-beta.3.0.20200213022433-e8e5bacb4aeb+incompatible h1:0KlDSbeIQst5WOwSZRh4z7fAcPyO5pAqi9e/BdW5Hh0=
github.com/alauda/helm v3.0.0-beta.3.0.20200213022433-e8e5bacb4aeb+incompatible/go.mod h1:puN71hQ/dtLbcyDOPyhZw19FrLSYCak3EvJBT2OaRvQ=
github.com/alauda/helm-crds v0.0.0-20191219064609-456571553411 h1:M+RR0vQ2Sd/X4atIZsvMjtFjgGrBnQchLTZ6Vy3R4mM=
github.com/alauda/helm-crds v0.0.0-20191219064609-456571553411/go.mod h1:QzPKCROcmAchx7bBj6NrNM34bmMQCrJCb+GrXtYi72o=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (c *Controller) sync(info *cluster.Info, helmRequest *v1alpha1.HelmRequest)

// found exist release here, this is logic from helm, and we skip the decode part to
// avoid OOM. This may be removed in the feature
// TODO: may be a bug ,if installToAllCluster, may be get the wrong release.
client := c.getAppClientForRelease(helmRequest)
if client == nil {
// may be not inited yet
Expand Down
1 change: 1 addition & 0 deletions pkg/helm/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (d *Deploy) install() (*release.Release, error) {
log.Info("chart name is", "name", chrt)

client.ReleaseName = getReleaseName(hr)
client.Replace = true

if hr.Spec.Version != "" {
client.ChartPathOptions = action.ChartPathOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/release/storagedriver/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (rel *Releases) Query(labels map[string]string) ([]*rspb.Release, error) {

var results []*rspb.Release
for _, item := range list.Items {
rls, err := decodeRawRelease(&item)
rls, err := decodeRelease(&item)
if err != nil {
rel.Log("query: failed to decode release: %s", err)
continue
Expand Down
1 change: 1 addition & 0 deletions pkg/release/storagedriver/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func encodeData(data interface{}) (string, error) {
return b64.EncodeToString(buf.Bytes()), nil
}

// TODO: remote this
func decodeRawRelease(rel *v1alpha1.Release) (*rspb.Release, error) {
var rls rspb.Release
rls.Info = rel.Status.ToReleaseInfo()
Expand Down

0 comments on commit fc10da6

Please sign in to comment.