Skip to content

chore: Rename types in api/types/preflight to plural form #2281

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

Merged
merged 2 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/controllers/install/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Controller interface {
GetInstallationStatus(ctx context.Context) (*types.Status, error)
RunHostPreflights(ctx context.Context) error
GetHostPreflightStatus(ctx context.Context) (*types.Status, error)
GetHostPreflightOutput(ctx context.Context) (*types.HostPreflightOutput, error)
GetHostPreflightOutput(ctx context.Context) (*types.HostPreflightsOutput, error)
GetHostPreflightTitles(ctx context.Context) ([]string, error)
SetupNode(ctx context.Context) error
SetStatus(ctx context.Context, status *types.Status) error
Expand Down
14 changes: 7 additions & 7 deletions api/controllers/install/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,13 @@ func TestGetHostPreflightOutput(t *testing.T) {
name string
setupMock func(*preflight.MockHostPreflightManager)
expectedErr bool
expectedValue *types.HostPreflightOutput
expectedValue *types.HostPreflightsOutput
}{
{
name: "successful get output",
setupMock: func(m *preflight.MockHostPreflightManager) {
output := &types.HostPreflightOutput{
Pass: []types.HostPreflightRecord{
output := &types.HostPreflightsOutput{
Pass: []types.HostPreflightsRecord{
{
Title: "Test Check",
Message: "Test check passed",
Expand All @@ -409,8 +409,8 @@ func TestGetHostPreflightOutput(t *testing.T) {
m.On("GetHostPreflightOutput", context.Background()).Return(output, nil)
},
expectedErr: false,
expectedValue: &types.HostPreflightOutput{
Pass: []types.HostPreflightRecord{
expectedValue: &types.HostPreflightsOutput{
Pass: []types.HostPreflightsRecord{
{
Title: "Test Check",
Message: "Test check passed",
Expand Down Expand Up @@ -575,8 +575,8 @@ func TestSetupNode(t *testing.T) {
preflightStatus := &types.Status{
State: types.StateFailed,
}
preflightOutput := &types.HostPreflightOutput{
Fail: []types.HostPreflightRecord{
preflightOutput := &types.HostPreflightsOutput{
Fail: []types.HostPreflightsRecord{
{
Title: "Test Check",
Message: "Test check failed",
Expand Down
2 changes: 1 addition & 1 deletion api/controllers/install/hostpreflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *InstallController) GetHostPreflightStatus(ctx context.Context) (*types.
return c.hostPreflightManager.GetHostPreflightStatus(ctx)
}

func (c *InstallController) GetHostPreflightOutput(ctx context.Context) (*types.HostPreflightOutput, error) {
func (c *InstallController) GetHostPreflightOutput(ctx context.Context) (*types.HostPreflightsOutput, error) {
return c.hostPreflightManager.GetHostPreflightOutput(ctx)
}

Expand Down
2 changes: 1 addition & 1 deletion api/docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/docs/swagger.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"components": {"schemas":{"types.APIError":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/types.APIError"},"type":"array","uniqueItems":false},"field":{"type":"string"},"message":{"type":"string"},"status_code":{"type":"integer"}},"type":"object"},"types.AuthRequest":{"properties":{"password":{"type":"string"}},"type":"object"},"types.AuthResponse":{"properties":{"token":{"type":"string"}},"type":"object"},"types.Health":{"properties":{"status":{"type":"string"}},"type":"object"},"types.HostPreflightOutput":{"properties":{"fail":{"items":{"$ref":"#/components/schemas/types.HostPreflightRecord"},"type":"array","uniqueItems":false},"pass":{"items":{"$ref":"#/components/schemas/types.HostPreflightRecord"},"type":"array","uniqueItems":false},"warn":{"items":{"$ref":"#/components/schemas/types.HostPreflightRecord"},"type":"array","uniqueItems":false}},"type":"object"},"types.HostPreflightRecord":{"properties":{"message":{"type":"string"},"title":{"type":"string"}},"type":"object"},"types.InstallHostPreflightsStatusResponse":{"properties":{"output":{"$ref":"#/components/schemas/types.HostPreflightOutput"},"status":{"$ref":"#/components/schemas/types.Status"},"titles":{"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"types.InstallationConfig":{"properties":{"adminConsolePort":{"type":"integer"},"dataDirectory":{"type":"string"},"globalCidr":{"type":"string"},"httpProxy":{"type":"string"},"httpsProxy":{"type":"string"},"localArtifactMirrorPort":{"type":"integer"},"networkInterface":{"type":"string"},"noProxy":{"type":"string"},"podCidr":{"type":"string"},"serviceCidr":{"type":"string"}},"type":"object"},"types.State":{"type":"string","x-enum-varnames":["StatePending","StateRunning","StateSucceeded","StateFailed"]},"types.Status":{"properties":{"description":{"type":"string"},"lastUpdated":{"type":"string"},"state":{"$ref":"#/components/schemas/types.State"}},"type":"object"}},"securitySchemes":{"bearerauth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},
"components": {"schemas":{"types.APIError":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/types.APIError"},"type":"array","uniqueItems":false},"field":{"type":"string"},"message":{"type":"string"},"status_code":{"type":"integer"}},"type":"object"},"types.AuthRequest":{"properties":{"password":{"type":"string"}},"type":"object"},"types.AuthResponse":{"properties":{"token":{"type":"string"}},"type":"object"},"types.Health":{"properties":{"status":{"type":"string"}},"type":"object"},"types.HostPreflightsOutput":{"properties":{"fail":{"items":{"$ref":"#/components/schemas/types.HostPreflightsRecord"},"type":"array","uniqueItems":false},"pass":{"items":{"$ref":"#/components/schemas/types.HostPreflightsRecord"},"type":"array","uniqueItems":false},"warn":{"items":{"$ref":"#/components/schemas/types.HostPreflightsRecord"},"type":"array","uniqueItems":false}},"type":"object"},"types.HostPreflightsRecord":{"properties":{"message":{"type":"string"},"title":{"type":"string"}},"type":"object"},"types.InstallHostPreflightsStatusResponse":{"properties":{"output":{"$ref":"#/components/schemas/types.HostPreflightsOutput"},"status":{"$ref":"#/components/schemas/types.Status"},"titles":{"items":{"type":"string"},"type":"array","uniqueItems":false}},"type":"object"},"types.InstallationConfig":{"properties":{"adminConsolePort":{"type":"integer"},"dataDirectory":{"type":"string"},"globalCidr":{"type":"string"},"httpProxy":{"type":"string"},"httpsProxy":{"type":"string"},"localArtifactMirrorPort":{"type":"integer"},"networkInterface":{"type":"string"},"noProxy":{"type":"string"},"podCidr":{"type":"string"},"serviceCidr":{"type":"string"}},"type":"object"},"types.State":{"type":"string","x-enum-varnames":["StatePending","StateRunning","StateSucceeded","StateFailed"]},"types.Status":{"properties":{"description":{"type":"string"},"lastUpdated":{"type":"string"},"state":{"$ref":"#/components/schemas/types.State"}},"type":"object"}},"securitySchemes":{"bearerauth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},
"info": {"contact":{"email":"[email protected]","name":"API Support","url":"https://github.com/replicatedhq/embedded-cluster/issues"},"description":"This is the API for the Embedded Cluster project.","license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"termsOfService":"http://swagger.io/terms/","title":"Embedded Cluster API","version":"0.1"},
"externalDocs": {"description":"OpenAPI","url":"https://swagger.io/resources/open-api/"},
"paths": {"/auth/login":{"post":{"description":"Authenticate a user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.AuthRequest"}}},"description":"Auth Request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.AuthResponse"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.APIError"}}},"description":"Unauthorized"}},"summary":"Authenticate a user","tags":["auth"]}},"/health":{"get":{"description":"get the health of the API","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Health"}}},"description":"OK"}},"summary":"Get the health of the API","tags":["health"]}},"/install/host-preflights/run":{"post":{"description":"Run install host preflight checks using installation config and client-provided data","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.InstallHostPreflightsStatusResponse"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Run install host preflight checks","tags":["install"]}},"/install/host-preflights/status":{"get":{"description":"Get the current status and results of host preflight checks for install","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.InstallHostPreflightsStatusResponse"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Get host preflight status for install","tags":["install"]}},"/install/installation/config":{"get":{"description":"get the installation config","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.InstallationConfig"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Get the installation config","tags":["install"]}},"/install/installation/configure":{"post":{"description":"configure the installation for install","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.InstallationConfig"}}},"description":"Installation config","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Status"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Configure the installation for install","tags":["install"]}},"/install/installation/status":{"get":{"description":"Get the current status of the installation configuration for install","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Status"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Get installation configuration status for install","tags":["install"]}},"/install/node/setup":{"post":{"description":"Setup a node","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Status"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Setup a node","tags":["install"]}},"/install/status":{"get":{"description":"Get the current status of the install workflow","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Status"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Get the status of the install workflow","tags":["install"]},"post":{"description":"Set the status of the install workflow","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Status"}}},"description":"Status","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/types.Status"}}},"description":"OK"}},"security":[{"bearerauth":[]}],"summary":"Set the status of the install workflow","tags":["install"]}}},
Expand Down
Loading