Skip to content

Commit

Permalink
Improve design of ProcessTweak
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Oct 31, 2023
1 parent 4cddab7 commit 36d264a
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ Class | Method | HTTP request | Description
- [AppId](docs/AppId.md)
- [AppInternalAddresses](docs/AppInternalAddresses.md)
- [AppLock](docs/AppLock.md)
- [AppProcessesTweak](docs/AppProcessesTweak.md)
- [AppRouter](docs/AppRouter.md)
- [AppRouters](docs/AppRouters.md)
- [AppRunOpts](docs/AppRunOpts.md)
Expand Down Expand Up @@ -262,6 +261,7 @@ Class | Method | HTTP request | Description
- [PoolConstraintSet](docs/PoolConstraintSet.md)
- [PoolCreateData](docs/PoolCreateData.md)
- [PoolUpdateData](docs/PoolUpdateData.md)
- [ProcessTweak](docs/ProcessTweak.md)
- [Provisioner](docs/Provisioner.md)
- [Quota](docs/Quota.md)
- [RecommendedResources](docs/RecommendedResources.md)
Expand Down
97 changes: 73 additions & 24 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6186,6 +6186,7 @@ components:
value: value
delete: true
name: name
plan: plan
- metadata:
annotations:
- name: name
Expand All @@ -6202,6 +6203,7 @@ components:
value: value
delete: true
name: name
plan: plan
tags:
- tags
- tags
Expand Down Expand Up @@ -6278,7 +6280,7 @@ components:
$ref: '#/components/schemas/Metadata'
processesTweak:
items:
$ref: '#/components/schemas/App_processesTweak'
$ref: '#/components/schemas/ProcessTweak'
type: array
router:
description: App router.
Expand Down Expand Up @@ -8841,6 +8843,7 @@ components:
value: value
delete: true
name: name
plan: plan
- metadata:
annotations:
- name: name
Expand All @@ -8857,6 +8860,7 @@ components:
value: value
delete: true
name: name
plan: plan
tags:
- tags
- tags
Expand Down Expand Up @@ -9038,6 +9042,7 @@ components:
value: value
delete: true
name: name
plan: plan
- metadata:
annotations:
- name: name
Expand All @@ -9054,6 +9059,7 @@ components:
value: value
delete: true
name: name
plan: plan
tags:
- tags
- tags
Expand Down Expand Up @@ -9117,29 +9123,6 @@ components:
contextvalue:
type: string
type: object
App_processesTweak:
example:
metadata:
annotations:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
labels:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
name: name
properties:
metadata:
$ref: '#/components/schemas/Metadata'
name:
type: string
Cluster_kubeConfig:
example:
cluster:
Expand Down Expand Up @@ -9535,6 +9518,33 @@ components:
type: string
Protocol:
type: string
ProcessTweak:
example:
metadata:
annotations:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
labels:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
name: name
plan: plan
properties:
name:
type: string
plan:
type: string
metadata:
$ref: '#/components/schemas/Metadata'
type: object
EnvSetData:
description: Data sent to the environment set endpoint.
example:
Expand Down Expand Up @@ -9897,6 +9907,41 @@ components:
description: description
plan: plan
platform: platform
processesTweak:
- metadata:
annotations:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
labels:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
name: name
plan: plan
- metadata:
annotations:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
labels:
- name: name
value: value
delete: true
- name: name
value: value
delete: true
name: name
plan: plan
tags:
- tags
- tags
Expand Down Expand Up @@ -9934,6 +9979,10 @@ components:
type: string
metadata:
$ref: '#/components/schemas/Metadata'
processesTweak:
items:
$ref: '#/components/schemas/ProcessTweak'
type: array
required:
- name
type: object
Expand Down
2 changes: 1 addition & 1 deletion docs/App.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Name | Type | Description | Notes
**VolumeBinds** | [**[]AppVolumeBinds**](App_volumeBinds.md) | | [optional]
**Tags** | **[]string** | App tags. | [optional]
**Metadata** | [**Metadata**](Metadata.md) | | [optional]
**ProcessesTweak** | [**[]AppProcessesTweak**](App_processesTweak.md) | | [optional]
**ProcessesTweak** | [**[]ProcessTweak**](ProcessTweak.md) | | [optional]
**Router** | **string** | App router. | [optional]
**Routeropts** | **map[string]string** | Custom router options. | [optional]
**Plan** | [**Plan**](Plan.md) | | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/InputApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name | Type | Description | Notes
**Description** | **string** | App description. | [optional]
**TeamOwner** | **string** | Team that owns the app. | [optional]
**Metadata** | [**Metadata**](Metadata.md) | | [optional]
**ProcessesTweak** | [**[]ProcessTweak**](ProcessTweak.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
5 changes: 3 additions & 2 deletions docs/AppProcessesTweak.md → docs/ProcessTweak.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# AppProcessesTweak
# ProcessTweak

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Metadata** | [**Metadata**](Metadata.md) | | [optional]
**Name** | **string** | | [optional]
**Plan** | **string** | | [optional]
**Metadata** | [**Metadata**](Metadata.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
6 changes: 3 additions & 3 deletions pkg/tsuru/model_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ type App struct {
InternalAddresses []AppInternalAddresses `json:"internalAddresses,omitempty"`
VolumeBinds []AppVolumeBinds `json:"volumeBinds,omitempty"`
// App tags.
Tags []string `json:"tags,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
ProcessesTweak []AppProcessesTweak `json:"processesTweak,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
ProcessesTweak []ProcessTweak `json:"processesTweak,omitempty"`
// App router.
Router string `json:"router,omitempty"`
// Custom router options.
Expand Down
5 changes: 3 additions & 2 deletions pkg/tsuru/model_input_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type InputApp struct {
// App description.
Description string `json:"description,omitempty"`
// Team that owns the app.
TeamOwner string `json:"teamOwner,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
TeamOwner string `json:"teamOwner,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
ProcessesTweak []ProcessTweak `json:"processesTweak,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

package tsuru

type AppProcessesTweak struct {
Metadata Metadata `json:"metadata,omitempty"`
type ProcessTweak struct {
Name string `json:"name,omitempty"`
Plan string `json:"plan,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
}

0 comments on commit 36d264a

Please sign in to comment.