-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run dashboard as separate deployment (#684)
* Run dashboard in a dedicated deployment * Add info how to fix go imports * Include dashboard image into release process * Regenerate CRD & manifests * Update nightly bundle Signed-off-by: Anatolii Bazko <abazko@redhat.com> Co-authored-by: Anatolii Bazko <abazko@redhat.com>
- Loading branch information
1 parent
3c1dafe
commit 0353a44
Showing
20 changed files
with
594 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// Copyright (c) 2021 Red Hat, Inc. | ||
// This program and the accompanying materials are made | ||
// available under the terms of the Eclipse Public License 2.0 | ||
// which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 | ||
// | ||
// Contributors: | ||
// Red Hat, Inc. - initial API and implementation | ||
// | ||
package dashboard | ||
|
||
import ( | ||
"github.com/eclipse-che/che-operator/pkg/deploy" | ||
"github.com/eclipse-che/che-operator/pkg/deploy/expose" | ||
) | ||
|
||
const ( | ||
// DashboardComponent which is supposed to be used for the naming related objects | ||
DashboardComponent = "dashboard" | ||
) | ||
|
||
type Dashboard struct { | ||
deployContext *deploy.DeployContext | ||
} | ||
|
||
func NewDashboard(deployContext *deploy.DeployContext) *Dashboard { | ||
return &Dashboard{ | ||
deployContext: deployContext, | ||
} | ||
} | ||
|
||
func (d *Dashboard) SyncAll() (done bool, err error) { | ||
// Create a new dashboard service | ||
done, err = deploy.SyncServiceToCluster(d.deployContext, DashboardComponent, []string{"http"}, []int32{8080}, DashboardComponent) | ||
if !done { | ||
return false, err | ||
} | ||
|
||
// Expose dashboard service with route or ingress | ||
_, done, err = expose.ExposeWithHostPath(d.deployContext, DashboardComponent, d.deployContext.CheCluster.Spec.Server.CheHost, | ||
"/dashboard", | ||
d.deployContext.CheCluster.Spec.Server.CheServerRoute, | ||
d.deployContext.CheCluster.Spec.Server.CheServerIngress, | ||
) | ||
if !done { | ||
return false, err | ||
} | ||
|
||
// Deploy dashboard | ||
spec, err := d.getDashboardDeploymentSpec() | ||
if err != nil { | ||
return false, err | ||
} | ||
return deploy.SyncDeploymentSpecToCluster(d.deployContext, spec, deploy.DefaultDeploymentDiffOpts) | ||
} |
Oops, something went wrong.