forked from hyperledger-labs/fabric-builder-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Improve kubernetes object names
Resolves hyperledger-labs#105 Signed-off-by: James Taylor <[email protected]>
- Loading branch information
Showing
8 changed files
with
234 additions
and
56 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
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,21 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package util | ||
|
||
import "strings" | ||
|
||
type ChaincodePackageID struct { | ||
Label string | ||
Hash string | ||
} | ||
|
||
// NewChaincodePackageID returns a ChaincodePackageID created from the provided string. | ||
func NewChaincodePackageID(chaincodeID string) *ChaincodePackageID { | ||
// TODO add tests! | ||
substrings := strings.Split(chaincodeID, ":") | ||
|
||
return &ChaincodePackageID{ | ||
Label: strings.Join(substrings[:len(substrings)-1], ":"), | ||
Hash: substrings[len(substrings)-1], | ||
} | ||
} |
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
Oops, something went wrong.