Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes out-of-scope fields from Connect API request #206

Merged
merged 8 commits into from
Oct 10, 2023
Merged
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
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)');
});
});