Skip to content

Commit 8b6395a

Browse files
authored
[Feature] Generate docs from Objects (#1358)
1 parent ba649d5 commit 8b6395a

25 files changed

+4267
-17
lines changed

docs/api/ArangoDeployment.V1.md

Lines changed: 3675 additions & 0 deletions
Large diffs are not rendered by default.

internal/docs_test.go

Lines changed: 447 additions & 0 deletions
Large diffs are not rendered by default.

pkg/apis/deployment/v1/deployment_metrics_spec.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ type MetricsSpec struct {
7878
// deprecated
7979
Image *string `json:"image,omitempty"`
8080
Authentication MetricsAuthenticationSpec `json:"authentication,omitempty"`
81-
Resources core.ResourceRequirements `json:"resources,omitempty"`
81+
// Resources holds resource requests & limits
82+
// +doc/type: core.ResourceRequirements
83+
// +doc/link: Documentation of core.ResourceRequirements|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#resourcerequirements-v1-core
84+
Resources core.ResourceRequirements `json:"resources,omitempty"`
8285
// deprecated
8386
Mode *MetricsMode `json:"mode,omitempty"`
8487
TLS *bool `json:"tls,omitempty"`

pkg/apis/deployment/v1/deployment_spec.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ type DeploymentSpec struct {
178178

179179
Timeouts *Timeouts `json:"timeouts,omitempty"`
180180

181+
// ClusterDomain define domain used in the kubernetes cluster.
182+
// Required only of domain is not set to default (cluster.local)
183+
// +doc/default: cluster.local
181184
ClusterDomain *string `json:"ClusterDomain,omitempty"`
182185

183186
// CommunicationMethod define communication method used in deployment

pkg/apis/deployment/v1/lifecycle_spec.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -25,6 +25,9 @@ import (
2525
)
2626

2727
type LifecycleSpec struct {
28+
// Resources holds resource requests & limits
29+
// +doc/type: core.ResourceRequirements
30+
// +doc/link: Documentation of core.ResourceRequirements|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#resourcerequirements-v1-core
2831
Resources core.ResourceRequirements `json:"resources,omitempty"`
2932
}
3033

pkg/apis/deployment/v1/member_status.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ type MemberStatus struct {
8686
SecondaryPersistentVolumeClaim *MemberPersistentVolumeClaimStatus `json:"secondaryPersistentVolumeClaim,omitempty"`
8787

8888
// deprecated
89-
// SideCarSpecs contains list of specifications specified for side cars
89+
// SideCarSpecs contains map of specifications specified for side cars
90+
// +doc/type: map[string]core.Container
91+
// +doc/link: Documentation of core.Container|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#container-v1-core
9092
SideCarSpecs map[string]core.Container `json:"sidecars-specs,omitempty"`
9193
// deprecated
9294
// PodName holds the name of the Pod that currently runs this member

pkg/apis/deployment/v1/server_group_ephemeral_volumes.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -58,6 +58,9 @@ func (e *EphemeralVolumes) getTempSize(d *resource.Quantity) *resource.Quantity
5858

5959
// EphemeralVolume keeps information about ephemeral volumes.
6060
type EphemeralVolume struct {
61+
// Size define size of the ephemeral volume
62+
// +doc/type: resource.Quantity
63+
// +doc/link: Documentation of resource.Quantity|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#quantity-resource-core
6164
Size *resource.Quantity `json:"size"`
6265
}
6366

pkg/apis/deployment/v1/server_group_init_containers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -86,6 +86,8 @@ const (
8686

8787
type ServerGroupInitContainers struct {
8888
// Containers contains list of containers
89+
// +doc/type: []core.Container
90+
// +doc/link: Documentation of core.Container|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#container-v1-core
8991
Containers []core.Container `json:"containers,omitempty"`
9092

9193
// Mode keep container replace mode

pkg/apis/deployment/v1/server_group_security_context_spec.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ type ServerGroupSpecSecurityContext struct {
5151
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
5252
FSGroup *int64 `json:"fsGroup,omitempty"`
5353

54+
// SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.
55+
// +doc/type: core.SeccompProfile
56+
// +doc/link: Documentation of core.SeccompProfile|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#seccompprofile-v1-core
5457
SeccompProfile *core.SeccompProfile `json:"seccompProfile,omitempty" protobuf:"bytes,11,opt,name=seccompProfile"`
58+
59+
// SELinuxOptions are the labels to be applied to the container
60+
// +doc/type: core.SELinuxOptions
61+
// +doc/link: Documentation of core.SELinuxOptions|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#selinuxoptions-v1-core
5562
SELinuxOptions *core.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,3,opt,name=seLinuxOptions"`
5663
}
5764

pkg/apis/deployment/v1/server_group_spec.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,16 @@ type ServerGroupSpec struct {
8383
// StorageClassName specifies the classname for storage of the servers.
8484
StorageClassName *string `json:"storageClassName,omitempty"`
8585
// Resources holds resource requests & limits
86+
// +doc/type: core.ResourceRequirements
87+
// +doc/link: Documentation of core.ResourceRequirements|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#resourcerequirements-v1-core
8688
Resources core.ResourceRequirements `json:"resources,omitempty"`
8789
// OverrideDetectedTotalMemory determines if memory should be overrided based on values in resources.
8890
OverrideDetectedTotalMemory *bool `json:"overrideDetectedTotalMemory,omitempty"`
8991
// OverrideDetectedNumberOfCores determines if number of cores should be overrided based on values in resources.
9092
OverrideDetectedNumberOfCores *bool `json:"overrideDetectedNumberOfCores,omitempty"`
9193
// Tolerations specifies the tolerations added to Pods in this group.
94+
// +doc/type: []core.Toleration
95+
// +doc/link: Documentation of core.Toleration|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#toleration-v1-core
9296
Tolerations []core.Toleration `json:"tolerations,omitempty"`
9397
// Annotations specified the annotations added to Pods in this group.
9498
Annotations map[string]string `json:"annotations,omitempty"`
@@ -113,27 +117,39 @@ type ServerGroupSpec struct {
113117
// PriorityClassName specifies a priority class name
114118
PriorityClassName string `json:"priorityClassName,omitempty"`
115119
// VolumeClaimTemplate specifies a template for volume claims
120+
// +doc/type: core.PersistentVolumeClaim
121+
// +doc/link: Documentation of core.PersistentVolumeClaim|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#persistentvolumeclaim-v1-core
116122
VolumeClaimTemplate *core.PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"`
117123
// VolumeResizeMode specified resize mode for pvc
118124
VolumeResizeMode *PVCResizeMode `json:"pvcResizeMode,omitempty"`
119125
// Deprecated: VolumeAllowShrink allows shrink the volume
120126
VolumeAllowShrink *bool `json:"volumeAllowShrink,omitempty"`
121127
// AntiAffinity specified additional antiAffinity settings in ArangoDB Pod definitions
128+
// +doc/type: core.PodAntiAffinity
129+
// +doc/link: Documentation of core.Pod.AntiAffinity|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#podantiaffinity-v1-core
122130
AntiAffinity *core.PodAntiAffinity `json:"antiAffinity,omitempty"`
123131
// Affinity specified additional affinity settings in ArangoDB Pod definitions
132+
// +doc/type: core.PodAffinity
133+
// +doc/link: Documentation of core.PodAffinity|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#podaffinity-v1-core
124134
Affinity *core.PodAffinity `json:"affinity,omitempty"`
125135
// NodeAffinity specified additional nodeAffinity settings in ArangoDB Pod definitions
136+
// +doc/type: core.NodeAffinity
137+
// +doc/link: Documentation of code.NodeAffinity|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#nodeaffinity-v1-core
126138
NodeAffinity *core.NodeAffinity `json:"nodeAffinity,omitempty"`
127139
// SidecarCoreNames is a list of sidecar containers which must run in the pod.
128140
// Some names (e.g.: "server", "worker") are reserved, and they don't have any impact.
129141
SidecarCoreNames []string `json:"sidecarCoreNames,omitempty"`
130142
// Sidecars specifies a list of additional containers to be started
143+
// +doc/type: []core.Container
144+
// +doc/link: Documentation of core.Container|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#container-v1-core
131145
Sidecars []core.Container `json:"sidecars,omitempty"`
132146
// SecurityContext specifies security context for group
133147
SecurityContext *ServerGroupSpecSecurityContext `json:"securityContext,omitempty"`
134148
// Volumes define list of volumes mounted to pod
135149
Volumes ServerGroupSpecVolumes `json:"volumes,omitempty"`
136150
// VolumeMounts define list of volume mounts mounted into server container
151+
// +doc/type: []ServerGroupSpecVolumeMount
152+
// +doc/link: Documentation of ServerGroupSpecVolumeMount|https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#volumemount-v1-core
137153
VolumeMounts ServerGroupSpecVolumeMounts `json:"volumeMounts,omitempty"`
138154
// EphemeralVolumes keeps information about ephemeral volumes.
139155
EphemeralVolumes *EphemeralVolumes `json:"ephemeralVolumes,omitempty"`

0 commit comments

Comments
 (0)