Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gtopper authored May 12, 2022
1 parent bd71199 commit 0e919bf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/controller/sparkapplication/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,16 @@ func (c *Controller) submitSparkApplication(app *v1beta2.SparkApplication) *v1be
}
}

driverInfo := v1beta2.DriverInfo{}

if c.enableUIService {
service, err := createSparkUIService(app, c.kubeClient)
if err != nil {
glog.Errorf("failed to create UI service for SparkApplication %s/%s: %v", app.Namespace, app.Name, err)
} else {
app.Status.DriverInfo.WebUIServiceName = service.serviceName
app.Status.DriverInfo.WebUIPort = service.servicePort
app.Status.DriverInfo.WebUIAddress = fmt.Sprintf("%s:%d", service.serviceIP, app.Status.DriverInfo.WebUIPort)
driverInfo.WebUIServiceName = service.serviceName
driverInfo.WebUIPort = service.servicePort
driverInfo.WebUIAddress = fmt.Sprintf("%s:%d", service.serviceIP, app.Status.DriverInfo.WebUIPort)
// Create UI Ingress if ingress-format is set.
if c.ingressURLFormat != "" {
// We are going to want to use an ingress url.
Expand All @@ -703,15 +705,16 @@ func (c *Controller) submitSparkApplication(app *v1beta2.SparkApplication) *v1be
if err != nil {
glog.Errorf("failed to create UI Ingress for SparkApplication %s/%s: %v", app.Namespace, app.Name, err)
} else {
app.Status.DriverInfo.WebUIIngressAddress = ingress.ingressURL.String()
app.Status.DriverInfo.WebUIIngressName = ingress.ingressName
driverInfo.WebUIIngressAddress = ingress.ingressURL.String()
driverInfo.WebUIIngressName = ingress.ingressName
}
}
}
}
}

driverPodName := getDriverPodName(app)
driverInfo.PodName = driverPodName
submissionID := uuid.New().String()
submissionCmdArgs, err := buildSubmissionCommandArgs(app, driverPodName, submissionID)
if err != nil {
Expand Down Expand Up @@ -753,9 +756,7 @@ func (c *Controller) submitSparkApplication(app *v1beta2.SparkApplication) *v1be
AppState: v1beta2.ApplicationState{
State: v1beta2.SubmittedState,
},
DriverInfo: v1beta2.DriverInfo{
PodName: driverPodName,
},
DriverInfo: driverInfo,
SubmissionAttempts: app.Status.SubmissionAttempts + 1,
ExecutionAttempts: app.Status.ExecutionAttempts + 1,
LastSubmissionAttemptTime: metav1.Now(),
Expand Down

0 comments on commit 0e919bf

Please sign in to comment.