Skip to content

Commit

Permalink
doc: add missing comments in API
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Rolland <frolland@nvidia.com>
  • Loading branch information
rollandf committed Sep 11, 2024
1 parent 95ad211 commit f45695e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/v1alpha1/hostdevicenetwork_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ type HostDeviceNetwork struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Defines the desired state of HostDeviceNetwork
Spec HostDeviceNetworkSpec `json:"spec,omitempty"`
// Defines the observed state of HostDeviceNetwork
Status HostDeviceNetworkStatus `json:"status,omitempty"`
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/ipoibnetwork_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ type IPoIBNetwork struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Defines the desired state of IPoIBNetwork
Spec IPoIBNetworkSpec `json:"spec,omitempty"`
// Defines the observed state of IPoIBNetwork
Status IPoIBNetworkStatus `json:"status,omitempty"`
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/macvlannetwork_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ type MacvlanNetwork struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Defines the desired state of MacvlanNetworkSpec
Spec MacvlanNetworkSpec `json:"spec,omitempty"`
// Defines the observed state of MacvlanNetwork
Status MacvlanNetworkStatus `json:"status,omitempty"`
}

Expand Down
16 changes: 16 additions & 0 deletions api/v1alpha1/nicclusterpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (is *ImageSpec) GetContainerResources() []ResourceRequirements {

// ImageSpecWithConfig Contains ImageSpec and optional configuration
type ImageSpecWithConfig struct {
// Image information for the component
ImageSpec `json:""`
// Configuration for the component as a string
Config *string `json:"config,omitempty"`
Expand Down Expand Up @@ -191,6 +192,7 @@ type DrainSpec struct {
// 1. Image information for device plugin
// 2. Device plugin configuration
type DevicePluginSpec struct {
// Image information for the device plugin and optional configuration
ImageSpecWithConfig `json:""`
// Enables use of container device interface (CDI)
UseCdi bool `json:"useCdi,omitempty"`
Expand All @@ -201,6 +203,7 @@ type DevicePluginSpec struct {
// 2. Multus CNI config if config is missing or empty then multus config will be automatically generated from the CNI
// configuration file of the master plugin (the first file in lexicographical order in cni-conf-dir)
type MultusSpec struct {
// Image information for Multus and optional configuration
ImageSpecWithConfig `json:""`
}

Expand Down Expand Up @@ -255,11 +258,13 @@ type IBKubernetesSpec struct {
type NVIPAMSpec struct {
// Enable deployment of the validation webhook
EnableWebhook bool `json:"enableWebhook,omitempty"`
// Image information for nv-ipam
ImageSpec `json:""`
}

// NICFeatureDiscoverySpec describes configuration options for nic-feature-discovery
type NICFeatureDiscoverySpec struct {
// Image information for nic-feature-discovery
ImageSpec `json:""`
}

Expand All @@ -273,6 +278,7 @@ type DOCATelemetryServiceConfig struct {

// DOCATelemetryServiceSpec is the configuration for DOCA Telemetry Service.
type DOCATelemetryServiceSpec struct {
// Image information for DOCA Telemetry Service
ImageSpec `json:""`
// +optional
// Config contains custom config for the DOCATelemetryService.
Expand All @@ -289,13 +295,21 @@ type NicClusterPolicySpec struct {
NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"`
// Additional tolerations to inject to the DaemonSets objects that are managed by the operator
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// Configuration options for OFED driver
OFEDDriver *OFEDDriverSpec `json:"ofedDriver,omitempty"`
// Configuration options for RDMA shared device plugin
RdmaSharedDevicePlugin *DevicePluginSpec `json:"rdmaSharedDevicePlugin,omitempty"`
// Configuration options for SRIOV device plugin
SriovDevicePlugin *DevicePluginSpec `json:"sriovDevicePlugin,omitempty"`
// Configuration options for ib-kubernetes
IBKubernetes *IBKubernetesSpec `json:"ibKubernetes,omitempty"`
// Configuration options for secondary network
SecondaryNetwork *SecondaryNetworkSpec `json:"secondaryNetwork,omitempty"`
// Configuration options nv-ipam
NvIpam *NVIPAMSpec `json:"nvIpam,omitempty"`
// Configuration options nic-feature-discovery
NicFeatureDiscovery *NICFeatureDiscoverySpec `json:"nicFeatureDiscovery,omitempty"`
// Configuration options DOCA Telemetry Service
DOCATelemetryService *DOCATelemetryServiceSpec `json:"docaTelemetryService,omitempty"`
}

Expand Down Expand Up @@ -335,7 +349,9 @@ type NicClusterPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Defines the desired state of NicClusterPolicy
Spec NicClusterPolicySpec `json:"spec,omitempty"`
// Defines the observed state of NicClusterPolicy
Status NicClusterPolicyStatus `json:"status,omitempty"`
}

Expand Down

0 comments on commit f45695e

Please sign in to comment.