Skip to content

Commit

Permalink
feat: support for passing new env service info to api
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jan 9, 2024
1 parent 12e74a1 commit c5c260a
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 151 deletions.
64 changes: 37 additions & 27 deletions apis/lagoon/v1beta1/lagoonmessaging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,46 @@ type LagoonLog struct {

// LagoonLogMeta is the metadata that is used by logging in Lagoon.
type LagoonLogMeta struct {
BranchName string `json:"branchName,omitempty"`
BuildName string `json:"buildName,omitempty"`
BuildPhase string `json:"buildPhase,omitempty"` // @TODO: deprecate once controller-handler is fixed
BuildStatus string `json:"buildStatus,omitempty"`
BuildStep string `json:"buildStep,omitempty"`
EndTime string `json:"endTime,omitempty"`
Environment string `json:"environment,omitempty"`
EnvironmentID *uint `json:"environmentId,omitempty"`
JobName string `json:"jobName,omitempty"` // used by tasks/jobs
JobStatus string `json:"jobStatus,omitempty"` // used by tasks/jobs
JobStep string `json:"jobStep,omitempty"` // used by tasks/jobs
LogLink string `json:"logLink,omitempty"`
Project string `json:"project,omitempty"`
ProjectID *uint `json:"projectId,omitempty"`
ProjectName string `json:"projectName,omitempty"`
RemoteID string `json:"remoteId,omitempty"`
Route string `json:"route,omitempty"`
Routes []string `json:"routes,omitempty"`
StartTime string `json:"startTime,omitempty"`
Services []string `json:"services,omitempty"`
ServicesV2 []LagoonService `json:"servicesv2,omitempty"`
Task *LagoonTaskInfo `json:"task,omitempty"`
Key string `json:"key,omitempty"`
AdvancedData string `json:"advancedData,omitempty"`
Cluster string `json:"clusterName,omitempty"`
BranchName string `json:"branchName,omitempty"`
BuildName string `json:"buildName,omitempty"`
BuildPhase string `json:"buildPhase,omitempty"` // @TODO: deprecate once controller-handler is fixed
BuildStatus string `json:"buildStatus,omitempty"`
BuildStep string `json:"buildStep,omitempty"`
EndTime string `json:"endTime,omitempty"`
Environment string `json:"environment,omitempty"`
EnvironmentID *uint `json:"environmentId,omitempty"`
JobName string `json:"jobName,omitempty"` // used by tasks/jobs
JobStatus string `json:"jobStatus,omitempty"` // used by tasks/jobs
JobStep string `json:"jobStep,omitempty"` // used by tasks/jobs
LogLink string `json:"logLink,omitempty"`
Project string `json:"project,omitempty"`
ProjectID *uint `json:"projectId,omitempty"`
ProjectName string `json:"projectName,omitempty"`
RemoteID string `json:"remoteId,omitempty"`
Route string `json:"route,omitempty"`
Routes []string `json:"routes,omitempty"`
StartTime string `json:"startTime,omitempty"`
Services []string `json:"services,omitempty"`
EnvironmentServices []LagoonService `json:"environmentServices,omitempty"`
Task *LagoonTaskInfo `json:"task,omitempty"`
Key string `json:"key,omitempty"`
AdvancedData string `json:"advancedData,omitempty"`
Cluster string `json:"clusterName,omitempty"`
}

// LagoonService is the same as EnvironmentService type from the lagoon Schema
type LagoonService struct {
Name string `json:"name"`
Type string `json:"type"`
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Updated string `json:"updated,omitempty"`
Containers []EnvironmentContainer `json:"containers,omitempty"`
Created string `json:"created,omitempty"`
}

// EnvironmentService is based on the Lagoon API type.
type EnvironmentContainer struct {
Name string `json:"name,omitempty"`
}

// LagoonMessage is used for sending build info back to Lagoon
Expand Down
4 changes: 2 additions & 2 deletions apis/lagoon/v1beta1/zz_generated.deepcopy.go

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

108 changes: 60 additions & 48 deletions config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@ spec:
type: string
environmentId:
type: integer
environmentServices:
items:
properties:
created:
type: string
id:
type: integer
name:
type: string
type:
type: string
updated:
type: string
type: object
type: array
jobName:
type: string
jobStatus:
Expand Down Expand Up @@ -265,18 +280,6 @@ spec:
items:
type: string
type: array
servicesv2:
items:
properties:
name:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
startTime:
type: string
task:
Expand Down Expand Up @@ -338,6 +341,21 @@ spec:
type: string
environmentId:
type: integer
environmentServices:
items:
properties:
created:
type: string
id:
type: integer
name:
type: string
type:
type: string
updated:
type: string
type: object
type: array
jobName:
type: string
jobStatus:
Expand Down Expand Up @@ -366,18 +384,6 @@ spec:
items:
type: string
type: array
servicesv2:
items:
properties:
name:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
startTime:
type: string
task:
Expand Down Expand Up @@ -441,6 +447,21 @@ spec:
type: string
environmentId:
type: integer
environmentServices:
items:
properties:
created:
type: string
id:
type: integer
name:
type: string
type:
type: string
updated:
type: string
type: object
type: array
jobName:
type: string
jobStatus:
Expand Down Expand Up @@ -469,18 +490,6 @@ spec:
items:
type: string
type: array
servicesv2:
items:
properties:
name:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
startTime:
type: string
task:
Expand Down Expand Up @@ -546,6 +555,21 @@ spec:
type: string
environmentId:
type: integer
environmentServices:
items:
properties:
created:
type: string
id:
type: integer
name:
type: string
type:
type: string
updated:
type: string
type: object
type: array
jobName:
type: string
jobStatus:
Expand Down Expand Up @@ -574,18 +598,6 @@ spec:
items:
type: string
type: array
servicesv2:
items:
properties:
name:
type: string
type:
type: string
required:
- name
- type
type: object
type: array
startTime:
type: string
task:
Expand Down
Loading

0 comments on commit c5c260a

Please sign in to comment.