-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from hypnoglow/helm3-support-part2
Improve Helm v3 support
- Loading branch information
Showing
22 changed files
with
929 additions
and
313 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
linters: | ||
enable-all: true | ||
disable: | ||
- lll | ||
- dupl | ||
- funlen | ||
- gochecknoglobals | ||
- godox | ||
- lll | ||
- wsl | ||
|
||
issues: | ||
|
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
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,55 @@ | ||
package helmutil | ||
|
||
import ( | ||
"io" | ||
) | ||
|
||
// Chart describes a helm chart. | ||
type Chart interface { | ||
// Name returns chart name. | ||
// Example: "foo". | ||
Name() string | ||
|
||
// Version returns chart version. | ||
// Example: "0.1.0". | ||
Version() string | ||
|
||
// Metadata returns chart metadata. | ||
Metadata() ChartMetadata | ||
} | ||
|
||
// LoadChart returns chart loaded from the file system by path. | ||
func LoadChart(fpath string) (Chart, error) { | ||
if IsHelm3() { | ||
return loadChartV3(fpath) | ||
} | ||
return loadChartV2(fpath) | ||
} | ||
|
||
// LoadArchive returns chart loaded from the archive file reader. | ||
func LoadArchive(r io.Reader) (Chart, error) { | ||
if IsHelm3() { | ||
return loadArchiveV3(r) | ||
} | ||
return loadArchiveV2(r) | ||
} | ||
|
||
// ChartMetadata describes helm chart metadata. | ||
type ChartMetadata interface { | ||
// MarshalJSON marshals chart metadata to JSON. | ||
MarshalJSON() ([]byte, error) | ||
|
||
// UnmarshalJSON unmarshals chart metadata from JSON. | ||
UnmarshalJSON([]byte) error | ||
|
||
// Value returns underlying chart metadata value. | ||
Value() interface{} | ||
} | ||
|
||
// NewChartMetadata returns a new helm chart metadata. | ||
func NewChartMetadata() ChartMetadata { | ||
if IsHelm3() { | ||
return newChartMetadataV3() | ||
} | ||
return newChartMetadataV2() | ||
} |
Oops, something went wrong.