Skip to content

Commit

Permalink
Merge pull request #198 from uselagoon/remove_monitoring_urls
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon authored Feb 2, 2023
2 parents a9c5416 + bff3640 commit 3dbe104
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 78 deletions.
49 changes: 24 additions & 25 deletions apis/lagoon/v1beta1/lagoonmessaging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,30 @@ 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"`
MonitoringURLs []string `json:"monitoringUrls,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"`
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"`
Task *LagoonTaskInfo `json:"task,omitempty"`
Key string `json:"key,omitempty"`
AdvancedData string `json:"advancedData,omitempty"`
Cluster string `json:"clusterName,omitempty"`
}

// LagoonMessage is used for sending build info back to Lagoon
Expand Down
5 changes: 0 additions & 5 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.

16 changes: 0 additions & 16 deletions config/crd/bases/crd.lagoon.sh_lagoonbuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down Expand Up @@ -333,10 +329,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down Expand Up @@ -428,10 +420,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down Expand Up @@ -525,10 +513,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down
16 changes: 0 additions & 16 deletions config/crd/bases/crd.lagoon.sh_lagoontasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down Expand Up @@ -304,10 +300,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down Expand Up @@ -399,10 +391,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down Expand Up @@ -496,10 +484,6 @@ spec:
type: string
logLink:
type: string
monitoringUrls:
items:
type: string
type: array
project:
type: string
projectId:
Expand Down
8 changes: 0 additions & 8 deletions controllers/v1beta1/build_deletionhandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,6 @@ func (r *LagoonBuildReconciler) updateDeploymentAndEnvironmentTask(ctx context.C
if routes, ok := lagoonEnv.Data["LAGOON_ROUTES"]; ok {
msg.Meta.Routes = strings.Split(routes, ",")
}
msg.Meta.MonitoringURLs = []string{}
if monitoringUrls, ok := lagoonEnv.Data["LAGOON_MONITORING_URLS"]; ok {
msg.Meta.MonitoringURLs = strings.Split(monitoringUrls, ",")
}
}
msg.Meta.StartTime = time.Now().UTC().Format("2006-01-02 15:04:05")
msg.Meta.EndTime = time.Now().UTC().Format("2006-01-02 15:04:05")
Expand Down Expand Up @@ -401,10 +397,6 @@ func (r *LagoonBuildReconciler) buildStatusLogsToLagoonLogs(ctx context.Context,
if routes, ok := lagoonEnv.Data["LAGOON_ROUTES"]; ok {
msg.Meta.Routes = strings.Split(routes, ",")
}
msg.Meta.MonitoringURLs = []string{}
if monitoringUrls, ok := lagoonEnv.Data["LAGOON_MONITORING_URLS"]; ok {
msg.Meta.MonitoringURLs = strings.Split(monitoringUrls, ",")
}
}
msgBytes, err := json.Marshal(msg)
if err != nil {
Expand Down
8 changes: 0 additions & 8 deletions controllers/v1beta1/podmonitor_buildhandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ func (r *LagoonMonitorReconciler) updateDeploymentAndEnvironmentTask(ctx context
if routes, ok := lagoonEnv.Data["LAGOON_ROUTES"]; ok {
msg.Meta.Routes = strings.Split(routes, ",")
}
msg.Meta.MonitoringURLs = []string{}
if monitoringUrls, ok := lagoonEnv.Data["LAGOON_MONITORING_URLS"]; ok {
msg.Meta.MonitoringURLs = strings.Split(monitoringUrls, ",")
}
}
// we can add the build start time here
if jobPod.Status.StartTime != nil {
Expand Down Expand Up @@ -394,10 +390,6 @@ func (r *LagoonMonitorReconciler) buildStatusLogsToLagoonLogs(ctx context.Contex
msg.Meta.Routes = strings.Split(routes, ",")
addRoutes = fmt.Sprintf("\n%s", strings.Join(strings.Split(routes, ","), "\n"))
}
msg.Meta.MonitoringURLs = []string{}
if monitoringUrls, ok := lagoonEnv.Data["LAGOON_MONITORING_URLS"]; ok {
msg.Meta.MonitoringURLs = strings.Split(monitoringUrls, ",")
}
}
msg.Message = fmt.Sprintf("*[%s]* `%s` Build `%s` %s <%s|Logs>%s%s",
projectName,
Expand Down

0 comments on commit 3dbe104

Please sign in to comment.