Skip to content

Commit

Permalink
Update API reference (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybolovlev authored Oct 29, 2024
1 parent e76626f commit 07ec203
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 31 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha2/agentpool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ type AgentDeploymentAutoscalingCooldownPeriod struct {
type AgentDeployment struct {
Replicas *int32 `json:"replicas,omitempty"`
Spec *v1.PodSpec `json:"spec,omitempty"`
// Annotations that will be applied to the pod template in the deployment.
// The annotations that the operator will apply to the pod template in the deployment.
//
//+optional
Annotations map[string]string `json:"annotations,omitempty"`
// Labels that will be applied to the pod template in the deployment.
// The labels that the operator will apply to the pod template in the deployment.
//+optional
Labels map[string]string `json:"labels,omitempty"`
}
Expand Down
14 changes: 6 additions & 8 deletions api/v1alpha2/workspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,12 @@ type SSHKey struct {
// +kubebuilder:validation:Pattern:="^[A-Za-z0-9][A-Za-z0-9:_-]*$"
type Tag string

// DeletionPolicy defines the strategies for resource deletion in the Kubernetes operator.
// It controls how the operator should handle the deletion of resources when triggered by
// a user action or system event.
// DeletionPolicy defines the strategy the Kubernetes operator uses when you delete a resource, either manually or by a system event.
//
// There are four possible values:
// - `retain`: When the custom resource is deleted, the associated workspace is retained.
// You must use one of the following values:
// - `retain`: When you delete the custom resource, the operator does not delete the workspace.
// - `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.
// - `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the workspace itself is deleted, followed by the removal of the custom resource.
// - `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the operator deletes the workspace, and then deletes the custom resource.
// - `force`: Forcefully and immediately deletes the workspace and the custom resource.
type DeletionPolicy string

Expand Down Expand Up @@ -580,9 +578,9 @@ type WorkspaceSpec struct {
//+optional
Project *WorkspaceProject `json:"project,omitempty"`
// The Deletion Policy specifies the behavior of the custom resource and its associated workspace when the custom resource is deleted.
// - `retain`: When the custom resource is deleted, the associated workspace is retained.
// - `retain`: When you delete the custom resource, the operator does not delete the workspace.
// - `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.
// - `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the workspace itself is deleted, followed by the removal of the custom resource.
// - `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the operator deletes the workspace, and then deletes the custom resource.
// - `force`: Forcefully and immediately deletes the workspace and the custom resource.
// Default: `retain`.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations that will be applied to the pod template
in the deployment.
description: The annotations that the operator will apply to the
pod template in the deployment.
type: object
labels:
additionalProperties:
type: string
description: Labels that will be applied to the pod template in
the deployment.
description: The labels that the operator will apply to the pod
template in the deployment.
type: object
replicas:
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ spec:
default: retain
description: |-
The Deletion Policy specifies the behavior of the custom resource and its associated workspace when the custom resource is deleted.
- `retain`: When the custom resource is deleted, the associated workspace is retained.
- `retain`: When you delete the custom resource, the operator does not delete the workspace.
- `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.
- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the workspace itself is deleted, followed by the removal of the custom resource.
- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the operator deletes the workspace, and then deletes the custom resource.
- `force`: Forcefully and immediately deletes the workspace and the custom resource.
Default: `retain`.
enum:
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/app.terraform.io_agentpools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ spec:
annotations:
additionalProperties:
type: string
description: Annotations that will be applied to the pod template
in the deployment.
description: The annotations that the operator will apply to the
pod template in the deployment.
type: object
labels:
additionalProperties:
type: string
description: Labels that will be applied to the pod template in
the deployment.
description: The labels that the operator will apply to the pod
template in the deployment.
type: object
replicas:
format: int32
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/app.terraform.io_workspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ spec:
default: retain
description: |-
The Deletion Policy specifies the behavior of the custom resource and its associated workspace when the custom resource is deleted.
- `retain`: When the custom resource is deleted, the associated workspace is retained.
- `retain`: When you delete the custom resource, the operator does not delete the workspace.
- `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.
- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the workspace itself is deleted, followed by the removal of the custom resource.
- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the operator deletes the workspace, and then deletes the custom resource.
- `force`: Forcefully and immediately deletes the workspace and the custom resource.
Default: `retain`.
enum:
Expand Down
16 changes: 7 additions & 9 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ _Appears in:_
| --- | --- |
| `replicas` _integer_ | |
| `spec` _[PodSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#podspec-v1-core)_ | |
| `annotations` _object (keys:string, values:string)_ | Annotations that will be applied to the pod template in the deployment. |
| `labels` _object (keys:string, values:string)_ | Labels that will be applied to the pod template in the deployment. |
| `annotations` _object (keys:string, values:string)_ | The annotations that the operator will apply to the pod template in the deployment. |
| `labels` _object (keys:string, values:string)_ | The labels that the operator will apply to the pod template in the deployment. |


#### AgentDeploymentAutoscaling
Expand Down Expand Up @@ -230,15 +230,13 @@ _Appears in:_

_Underlying type:_ _string_

DeletionPolicy defines the strategies for resource deletion in the Kubernetes operator.
It controls how the operator should handle the deletion of resources when triggered by
a user action or system event.
DeletionPolicy defines the strategy the Kubernetes operator uses when you delete a resource, either manually or by a system event.


There are four possible values:
- `retain`: When the custom resource is deleted, the associated workspace is retained.
You must use one of the following values:
- `retain`: When you delete the custom resource, the operator does not delete the workspace.
- `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.
- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the workspace itself is deleted, followed by the removal of the custom resource.
- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the operator deletes the workspace, and then deletes the custom resource.
- `force`: Forcefully and immediately deletes the workspace and the custom resource.

_Appears in:_
Expand Down Expand Up @@ -824,7 +822,7 @@ _Appears in:_
| `sshKey` _[SSHKey](#sshkey)_ | SSH key used to clone Terraform modules.<br />More information:<br /> - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/ssh-keys |
| `notifications` _[Notification](#notification) array_ | Notifications allow you to send messages to other applications based on run and workspace events.<br />More information:<br /> - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/notifications |
| `project` _[WorkspaceProject](#workspaceproject)_ | Projects let you organize your workspaces into groups.<br />Default: default organization project.<br />More information:<br /> - https://developer.hashicorp.com/terraform/tutorials/cloud/projects |
| `deletionPolicy` _[DeletionPolicy](#deletionpolicy)_ | The Deletion Policy specifies the behavior of the custom resource and its associated workspace when the custom resource is deleted.<br />- `retain`: When the custom resource is deleted, the associated workspace is retained.<br />- `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.<br />- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the workspace itself is deleted, followed by the removal of the custom resource.<br />- `force`: Forcefully and immediately deletes the workspace and the custom resource.<br />Default: `retain`. |
| `deletionPolicy` _[DeletionPolicy](#deletionpolicy)_ | The Deletion Policy specifies the behavior of the custom resource and its associated workspace when the custom resource is deleted.<br />- `retain`: When you delete the custom resource, the operator does not delete the workspace.<br />- `soft`: Attempts to delete the associated workspace only if it does not contain any managed resources.<br />- `destroy`: Executes a destroy operation to remove all resources managed by the associated workspace. Once the destruction of these resources is successful, the operator deletes the workspace, and then deletes the custom resource.<br />- `force`: Forcefully and immediately deletes the workspace and the custom resource.<br />Default: `retain`. |



Expand Down

0 comments on commit 07ec203

Please sign in to comment.