-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
releases: support enterprise versions (#148)
* releases: support enterprise versions * releases: refactor enterprise options into struct * fix: readme spelling/grammar * releases: support enterprise options for ExactVersion and Versions * releases: require enterprise license installation * releases: e2e test for enterprise installation * releases: example of installing enterprise versions * releases: add missing copywrite header * installer: fix failing windows test * simplify destination path conditional * releases: make EnterpriseOptions a pointer instead * fix error messages * refactoring: reduce nil checks * releases: revert to copying EnterpriseOptions I'm not entirely sure this is actually necessary or beneficial (from memory consumption perspective) but I'm keeping it as-is as it should do no harm to existing users who do not install enterprise products. --------- Co-authored-by: Radek Simko <[email protected]>
- Loading branch information
1 parent
850464c
commit 89c9d1a
Showing
14 changed files
with
351 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
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,38 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package releases | ||
|
||
import "fmt" | ||
|
||
type EnterpriseOptions struct { | ||
// LicenseDir represents directory path where to install license files (required) | ||
LicenseDir string | ||
|
||
// Meta represents optional version metadata (e.g. hsm, fips1402) | ||
Meta string | ||
} | ||
|
||
func enterpriseVersionMetadata(eo *EnterpriseOptions) string { | ||
if eo == nil { | ||
return "" | ||
} | ||
|
||
metadata := "ent" | ||
if eo.Meta != "" { | ||
metadata += "." + eo.Meta | ||
} | ||
return metadata | ||
} | ||
|
||
func validateEnterpriseOptions(eo *EnterpriseOptions) error { | ||
if eo == nil { | ||
return nil | ||
} | ||
|
||
if eo.LicenseDir == "" { | ||
return fmt.Errorf("LicenseDir must be provided when requesting enterprise versions") | ||
} | ||
|
||
return 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
Oops, something went wrong.