This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return Values as part of the helm.Chart object so that chart comparison
done during dry-run will take into account the charts base values which ultimately results in ensure we perform a release when a charts base values change.
- Loading branch information
1 parent
448897b
commit 0f03935
Showing
8 changed files
with
72 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package helm | ||
|
||
import ( | ||
"crypto/sha256" | ||
"encoding/hex" | ||
|
||
"github.com/ghodss/yaml" | ||
) | ||
|
||
// Values represents a collection of (Helm) values. | ||
// We define our own type to avoid working with two `chartutil` | ||
// versions. | ||
type Values map[string]interface{} | ||
|
||
// YAML encodes the values into YAML bytes. | ||
func (v Values) YAML() ([]byte, error) { | ||
b, err := yaml.Marshal(v) | ||
return b, err | ||
} | ||
|
||
// Checksum calculates and returns the SHA256 checksum of the YAML | ||
// encoded values. | ||
func (v Values) Checksum() string { | ||
b, _ := v.YAML() | ||
|
||
hasher := sha256.New() | ||
hasher.Write(b) | ||
return hex.EncodeToString(hasher.Sum(nil)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters