@@ -9,34 +9,38 @@ import (
99// RedfishOptions contains the redfish provider specific options.
1010type RedfishOptions struct {
1111 // Port that redfish will use for calls.
12- Port int `json:"port"`
12+ // +optional
13+ Port int `json:"port,omitempty"`
1314 // UseBasicAuth for redfish calls. The default is false which means token based auth is used.
14- UseBasicAuth bool `json:"useBasicAuth"`
15+ // +optional
16+ UseBasicAuth bool `json:"useBasicAuth,omitempty"`
1517 // SystemName is the name of the system to use for redfish calls.
1618 // With redfish implementations that manage multiple systems via a single endpoint, this allows for specifying the system to manage.
17- SystemName string `json:"systemName"`
19+ // +optional
20+ SystemName string `json:"systemName,omitempty"`
1821}
1922
2023// IPMITOOLOptions contains the ipmitool provider specific options.
2124type IPMITOOLOptions struct {
2225 // Port that ipmitool will use for calls.
2326 // +optional
24- Port int `json:"port"`
27+ Port int `json:"port,omitempty "`
2528 // CipherSuite that ipmitool will use for calls.
2629 // +optional
27- CipherSuite string `json:"cipherSuite"`
30+ CipherSuite string `json:"cipherSuite,omitempty "`
2831}
2932
3033// IntelAMTOptions contains the intelAMT provider specific options.
3134type IntelAMTOptions struct {
3235 // Port that intelAMT will use for calls.
33- Port int `json:"port"`
36+ // +optional
37+ Port int `json:"port,omitempty"`
3438
3539 // HostScheme determines whether to use http or https for intelAMT calls.
3640 // +optional
3741 // +kubebuilder:validation:Enum=http;https
3842 // +kubebuilder:default:=http
39- HostScheme string `json:"hostScheme"`
43+ HostScheme string `json:"hostScheme,omitempty "`
4044}
4145
4246// HMACAlgorithm is a type for HMAC algorithms.
@@ -53,72 +57,72 @@ type RPCOptions struct {
5357 ConsumerURL string `json:"consumerURL"`
5458 // LogNotificationsDisabled determines whether responses from rpc consumer/listeners will be logged or not.
5559 // +optional
56- LogNotificationsDisabled bool `json:"logNotificationsDisabled"`
60+ LogNotificationsDisabled bool `json:"logNotificationsDisabled,omitempty "`
5761 // Request is the options used to create the rpc HTTP request.
5862 // +optional
59- Request * RequestOpts `json:"request"`
63+ Request * RequestOpts `json:"request,omitempty "`
6064 // Signature is the options used for adding an HMAC signature to an HTTP request.
6165 // +optional
62- Signature * SignatureOpts `json:"signature"`
66+ Signature * SignatureOpts `json:"signature,omitempty "`
6367 // HMAC is the options used to create a HMAC signature.
6468 // +optional
65- HMAC * HMACOpts `json:"hmac"`
69+ HMAC * HMACOpts `json:"hmac,omitempty "`
6670 // Experimental options.
6771 // +optional
68- Experimental * ExperimentalOpts `json:"experimental"`
72+ Experimental * ExperimentalOpts `json:"experimental,omitempty "`
6973}
7074
7175// RequestOpts are the options used when creating an HTTP request.
7276type RequestOpts struct {
7377 // HTTPContentType is the content type to use for the rpc request notification.
7478 // +optional
75- HTTPContentType string `json:"httpContentType"`
79+ HTTPContentType string `json:"httpContentType,omitempty "`
7680 // HTTPMethod is the HTTP method to use for the rpc request notification.
7781 // +optional
78- HTTPMethod string `json:"httpMethod"`
82+ HTTPMethod string `json:"httpMethod,omitempty "`
7983 // StaticHeaders are predefined headers that will be added to every request.
8084 // +optional
81- StaticHeaders http.Header `json:"staticHeaders"`
85+ StaticHeaders http.Header `json:"staticHeaders,omitempty "`
8286 // TimestampFormat is the time format for the timestamp header.
8387 // +optional
84- TimestampFormat string `json:"timestampFormat"`
88+ TimestampFormat string `json:"timestampFormat,omitempty "`
8589 // TimestampHeader is the header name that should contain the timestamp. Example: X-BMCLIB-Timestamp
8690 // +optional
87- TimestampHeader string `json:"timestampHeader"`
91+ TimestampHeader string `json:"timestampHeader,omitempty "`
8892}
8993
9094// SignatureOpts are the options used for adding an HMAC signature to an HTTP request.
9195type SignatureOpts struct {
9296 // HeaderName is the header name that should contain the signature(s). Example: X-BMCLIB-Signature
9397 // +optional
94- HeaderName string `json:"headerName"`
98+ HeaderName string `json:"headerName,omitempty "`
9599 // AppendAlgoToHeaderDisabled decides whether to append the algorithm to the signature header or not.
96100 // Example: X-BMCLIB-Signature becomes X-BMCLIB-Signature-256
97101 // When set to true, a header will be added for each algorithm. Example: X-BMCLIB-Signature-256 and X-BMCLIB-Signature-512
98102 // +optional
99- AppendAlgoToHeaderDisabled bool `json:"appendAlgoToHeaderDisabled"`
103+ AppendAlgoToHeaderDisabled bool `json:"appendAlgoToHeaderDisabled,omitempty "`
100104 // IncludedPayloadHeaders are headers whose values will be included in the signature payload. Example: X-BMCLIB-My-Custom-Header
101105 // All headers will be deduplicated.
102106 // +optional
103- IncludedPayloadHeaders []string `json:"includedPayloadHeaders"`
107+ IncludedPayloadHeaders []string `json:"includedPayloadHeaders,omitempty "`
104108}
105109
106110// HMACOpts are the options used to create an HMAC signature.
107111type HMACOpts struct {
108112 // PrefixSigDisabled determines whether the algorithm will be prefixed to the signature. Example: sha256=abc123
109113 // +optional
110- PrefixSigDisabled bool `json:"prefixSigDisabled"`
114+ PrefixSigDisabled bool `json:"prefixSigDisabled,omitempty "`
111115 // Secrets are a map of algorithms to secrets used for signing.
112116 // +optional
113- Secrets HMACSecrets `json:"secrets"`
117+ Secrets HMACSecrets `json:"secrets,omitempty "`
114118}
115119
116120// ExperimentalOpts are options we're still learning about and should be used carefully.
117121type ExperimentalOpts struct {
118122 // CustomRequestPayload must be in json.
119123 // +optional
120- CustomRequestPayload string `json:"customRequestPayload"`
124+ CustomRequestPayload string `json:"customRequestPayload,omitempty "`
121125 // DotPath is the path to the json object where the bmclib RequestPayload{} struct will be embedded. For example: object.data.body
122126 // +optional
123- DotPath string `json:"dotPath"`
127+ DotPath string `json:"dotPath,omitempty "`
124128}
0 commit comments