Skip to content

Commit

Permalink
Merge pull request #206 from rstudio/tdstein/192
Browse files Browse the repository at this point in the history
Removes out-of-scope fields from Connect API request
  • Loading branch information
tdstein authored Oct 10, 2023
2 parents 71e7e71 + 2c68d8d commit 782f037
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 49 deletions.
36 changes: 18 additions & 18 deletions internal/state/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ type ConnectDeployment struct {
}

type ConnectContent struct {
Name types.ContentName `json:"name,omitempty"`
Name types.ContentName `json:"name"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
AccessType string `json:"access_type,omitempty"`
ConnectionTimeout types.NullInt32 `json:"connection_timeout"`
ReadTimeout types.NullInt32 `json:"read_timeout"`
InitTimeout types.NullInt32 `json:"init_timeout"`
IdleTimeout types.NullInt32 `json:"idle_timeout"`
MaxProcesses types.NullInt32 `json:"max_processes"`
MinProcesses types.NullInt32 `json:"min_processes"`
MaxConnsPerProcess types.NullInt32 `json:"max_conns_per_process" kong:"name='max-connections'"`
LoadFactor types.NullFloat64 `json:"load_factor"`
RunAs string `json:"run_as,omitempty"`
RunAsCurrentUser types.NullBool `json:"run_as_current_user"`
MemoryRequest types.NullInt64 `json:"memory_request"`
MemoryLimit types.NullInt64 `json:"memory_limit"`
CPURequest types.NullFloat64 `json:"cpu_request"`
CPULimit types.NullFloat64 `json:"cpu_limit"`
ServiceAccountName string `json:"service_account_name,omitempty"`
DefaultImageName string `json:"default_image_name,omitempty"`
AccessType string `json:"-"`
ConnectionTimeout types.NullInt32 `json:"-"`
ReadTimeout types.NullInt32 `json:"-"`
InitTimeout types.NullInt32 `json:"-"`
IdleTimeout types.NullInt32 `json:"-"`
MaxProcesses types.NullInt32 `json:"-"`
MinProcesses types.NullInt32 `json:"-"`
MaxConnsPerProcess types.NullInt32 `json:"-"`
LoadFactor types.NullFloat64 `json:"-"`
RunAs string `json:"-"`
RunAsCurrentUser types.NullBool `json:"-"`
MemoryRequest types.NullInt64 `json:"-"`
MemoryLimit types.NullInt64 `json:"-"`
CPURequest types.NullFloat64 `json:"-"`
CPULimit types.NullFloat64 `json:"-"`
ServiceAccountName string `json:"-"`
DefaultImageName string `json:"-"`
}

func (d *ConnectDeployment) Merge(other *ConnectDeployment) {
Expand Down
17 changes: 0 additions & 17 deletions web/src/api/types/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@ export type ConnectContent = {
name: string;
title?: string;
description?: string;
accessType?: string;
connectionTimeout: number | null;
readTimeout: number | null;
initTimeout: number | null;
idleTimeout: number | null;
maxProcesses: number | null;
minProcesses: number | null;
maxConnsPerProcess: number | null;
loadFactor: number | null;
runAs?: string;
runAsCurrentUser: boolean | null;
memoryRequest: number | null;
memoryLimit: number | null;
cpuRequest: number | null;
cpuLimit: number | null;
serviceAccountName?: string;
defaultImageName?: string;
}

export type ConnectEnvironmentVariable = {
Expand Down
14 changes: 0 additions & 14 deletions web/tests/unit/components/configurePublish/FilesToPublish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ describe('description', () => {
connect: {
connect: {
name: '',
connectionTimeout: null,
readTimeout: null,
initTimeout: null,
idleTimeout: null,
maxProcesses: null,
minProcesses: null,
maxConnsPerProcess: null,
loadFactor: null,
runAsCurrentUser: null,
memoryRequest: null,
memoryLimit: null,
cpuRequest: null,
cpuLimit: null
},
environment: [
{
Expand All @@ -200,4 +187,3 @@ describe('description', () => {
expect(wrapper.text()).toContain('4 files selected from test/sample-content/fastapi-simple (total = 1.0 KB)');
});
});

0 comments on commit 782f037

Please sign in to comment.