Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Oct 3, 2023
1 parent fd5b6e3 commit aff8897
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cmd/eksctl-anywhere/cmd/aflag/aflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func StringSlice(f Flag[[]string], dst *[]string, fs *pflag.FlagSet) {
}
}

// StringSlice applies f to fs and writes the value to dst.
// StringString applies f to fs and writes the value to dst.
func StringString(f Flag[map[string]string], dst *map[string]string, fs *pflag.FlagSet) {
switch {
case f.Short != "":
Expand All @@ -55,6 +55,7 @@ func StringString(f Flag[map[string]string], dst *map[string]string, fs *pflag.F
}
}

// HTTPHeader applies f to fs and writes the value to dst.
func HTTPHeader(f Flag[Header], dst *Header, fs *pflag.FlagSet) {
switch {
case f.Short != "":
Expand Down
4 changes: 2 additions & 2 deletions cmd/eksctl-anywhere/cmd/aflag/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
)

// -- Header Value
// Header Value.
type Header http.Header

// NewHeader returns a new Header pointer.
Expand All @@ -26,7 +26,7 @@ func (h *Header) String() string {
}

// Set sets the value of the Header.
// Format: "a=1;2,b=2;4;5"
// Format: "a=1;2,b=2;4;5".
func (h *Header) Set(val string) error {
var ss []string
n := strings.Count(val, "=")
Expand Down
25 changes: 16 additions & 9 deletions cmd/eksctl-anywhere/cmd/aflag/tinkerbell.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ var TinkerbellBMCConsumerURL = Flag[string]{
}

// TinkerbellBMCHTTPContentType is a Rufio RPC provider option.
// The content type header to use for the rpc request notification
// The content type header to use for the rpc request notification.
var TinkerbellBMCHTTPContentType = Flag[string]{
Name: "tinkerbell-bmc-http-content-type",
Usage: "The HTTP content type used for the RPC BMC interactions",
}

// TinkerbellBMCHTTPMethod is a Rufio RPC provider option.
// The HTTP method to use for the rpc request notification
// The HTTP method to use for the rpc request notification.
var TinkerbellBMCHTTPMethod = Flag[string]{
Name: "tinkerbell-bmc-http-method",
Usage: "The HTTP method used for the RPC BMC interactions",
}

// TinkerbellBMCTimestampHeader is a Rufio RPC provider option.
// The the header name that should contain the timestamp. Example: X-BMCLIB-Timestamp (in RFC3339 format)
// The the header name that should contain the timestamp.
// Example: X-BMCLIB-Timestamp (in RFC3339 format)
// .
var TinkerbellBMCTimestampHeader = Flag[string]{
Name: "tinkerbell-bmc-timestamp-header",
Usage: "The HTTP timestamp header used for the RPC BMC interactions",
Expand All @@ -38,20 +40,25 @@ var TinkerbellBMCTimestampHeader = Flag[string]{
// TinkerbellBMCStaticHeaders is a Rufio RPC provider option.
// Predefined headers that will be added to every request (comma separated, values are semicolon separated)
// Example: "X-My-Header=1;2;3,X-Custom-Header=abc;def"
// .
var TinkerbellBMCStaticHeaders = Flag[Header]{
Name: "tinkerbell-bmc-static-headers",
Usage: "Static HTTP headers added to all RPC BMC interactions",
}

// TinkerbellBMCSignatureHeaderName is a Rufio RPC provider option.
// The header name that should contain the signature(s). Example: X-BMCLIB-Signature
// TinkerbellBMCSigHeaderName is a Rufio RPC provider option.
// The header name that should contain the signature(s).
// Example: X-BMCLIB-Signature
// .
var TinkerbellBMCSigHeaderName = Flag[string]{
Name: "tinkerbell-bmc-sig-header-name",
Usage: "The HTTP header name for the HMAC signature used in RPC BMC interactions",
}

// TinkerbellBMCAppendAlgoToHeaderDisabled is a Rufio RPC provider option.
// decides whether to append the algorithm to the signature header or not. Example: X-BMCLIB-Signature becomes X-BMCLIB-Signature-256
// decides whether to append the algorithm to the signature header or not.
// Example: X-BMCLIB-Signature becomes X-BMCLIB-Signature-256
// .
var TinkerbellBMCAppendAlgoToHeaderDisabled = Flag[bool]{
Name: "tinkerbell-bmc-append-algo-to-header-disabled",
Usage: "This disables appending of the algorithm type to the signature header used in RPC BMC interactions",
Expand All @@ -61,21 +68,21 @@ var TinkerbellBMCAppendAlgoToHeaderDisabled = Flag[bool]{
// The headers whose values will be included in the signature payload.
// Example: given these headers in a request: X-My-Header=123,X-Another=456,
// and IncludedPayloadHeaders := []string{"X-Another"}, the value of "X-Another"
// will be included in the signature payload (comma separated)
// will be included in the signature payload (comma separated).
var TinkerbellBMCSigIncludedPayloadHeaders = Flag[[]string]{
Name: "tinkerbell-bmc-sig-included-payload-headers",
Usage: "The HTTP headers to be included in the HMAC signature payload used in RPC BMC interactions",
}

// TinkerbellBMCPrefixSigDisabled is a Rufio RPC provider option.
// determines whether the algorithm will be prefixed to the signature. Example: sha256=abc123
// Example: sha256=abc123 ; Determines whether the algorithm will be prefixed to the signature.
var TinkerbellBMCPrefixSigDisabled = Flag[bool]{
Name: "tinkerbell-bmc-prefix-sig-disabled",
Usage: "This disables prefixing the signature with the algorithm type used in RPC BMC interactions",
}

// TinkerbellBMCHMACSecrets is a Rufio RPC provider option.
// secrets used for signing the payload, all secrets with used to sign with both sha256 and sha512
// secrets used for signing the payload, all secrets with used to sign with both sha256 and sha512.
var TinkerbellBMCHMACSecrets = Flag[[]string]{
Name: "tinkerbell-bmc-hmac-secrets",
Usage: "The secrets used to HMAC sign a payload, used in RPC BMC interactions",
Expand Down

0 comments on commit aff8897

Please sign in to comment.