Skip to content
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
10 changes: 6 additions & 4 deletions client/k8s/application/Application.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ type K8sRequestBean struct {
}

type PodLogsRequest struct {
SinceTime *metav1.Time `json:"sinceTime,omitempty"`
TailLines int `json:"tailLines"`
Follow bool `json:"follow"`
ContainerName string `json:"containerName"`
SinceTime *metav1.Time `json:"sinceTime,omitempty"`
TailLines int `json:"tailLines"`
Follow bool `json:"follow"`
ContainerName string `json:"containerName"`
IsPrevContainerLogsEnabled bool `json:"previous"`
}

type ResourceIdentifier struct {
Expand Down Expand Up @@ -236,6 +237,7 @@ func (impl K8sClientServiceImpl) GetPodLogs(ctx context.Context, restConfig *res
TailLines: &tailLines,
Container: podLogsRequest.ContainerName,
Timestamps: true,
Previous: podLogsRequest.IsPrevContainerLogsEnabled,
}
if podLogsRequest.SinceTime != nil {
podLogOptions.SinceTime = podLogsRequest.SinceTime
Expand Down
2 changes: 0 additions & 2 deletions pkg/pipeline/CiCdPipelineOrchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,6 @@ func (impl CiCdPipelineOrchestratorImpl) CreateCDPipelines(pipelineRequest *bean
return 0, err
}



env, err := impl.envRepository.FindById(pipelineRequest.EnvironmentId)
if err != nil {
impl.logger.Errorw("error in getting environment by id", "err", err)
Expand Down
2 changes: 1 addition & 1 deletion util/ValidatorHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func AutoScale(dat map[string]interface{}) (bool, error) {
if dat["kedaAutoscaling"] != nil {
kedaAutoScale, ok := dat["kedaAutoscaling"].(map[string]interface{})["enabled"]
if ok {
kedaAutoScaleEnabled=kedaAutoScale.(bool)
kedaAutoScaleEnabled = kedaAutoScale.(bool)
}
}
if dat["autoscaling"] != nil {
Expand Down
12 changes: 9 additions & 3 deletions util/k8s/k8sApplicationService.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func (impl *K8sApplicationServiceImpl) ValidatePodLogsRequestQuery(r *http.Reque
sinceSeconds = 0
}*/
containerName, clusterIdString := v.Get("containerName"), v.Get("clusterId")
prevContainerLogs := v.Get("previous")
isPrevLogs, err := strconv.ParseBool(prevContainerLogs)
if err != nil {
isPrevLogs = false
}
appId := v.Get("appId")
follow, err := strconv.ParseBool(v.Get("follow"))
if err != nil {
Expand All @@ -165,9 +170,10 @@ func (impl *K8sApplicationServiceImpl) ValidatePodLogsRequestQuery(r *http.Reque
},
PodLogsRequest: application.PodLogsRequest{
//SinceTime: sinceSeconds,
TailLines: tailLines,
Follow: follow,
ContainerName: containerName,
TailLines: tailLines,
Follow: follow,
ContainerName: containerName,
IsPrevContainerLogsEnabled: isPrevLogs,
},
}
request.K8sRequest = k8sRequest
Expand Down