-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[installer]: general fixes for the Helm dependencies
- Loading branch information
Simon Emms
committed
Oct 26, 2021
1 parent
b44830f
commit 64117cf
Showing
18 changed files
with
232 additions
and
26 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
16 changes: 16 additions & 0 deletions
16
installer/pkg/components/mysql/init/00-create-and-init-sessions-db.sql
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,16 @@ | ||
-- Copyright (c) 2020 Gitpod GmbH. All rights reserved. | ||
-- Licensed under the MIT License. See License-MIT.txt in the project root for license information. | ||
|
||
-- must be idempotent | ||
|
||
CREATE DATABASE IF NOT EXISTS `gitpod-sessions` CHARSET utf8mb4; | ||
|
||
USE `gitpod-sessions`; | ||
|
||
CREATE TABLE IF NOT EXISTS sessions ( | ||
`session_id` varchar(128) COLLATE utf8mb4_bin NOT NULL, | ||
`expires` int(11) unsigned NOT NULL, | ||
`data` text COLLATE utf8mb4_bin, | ||
`_lastModified` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), | ||
PRIMARY KEY (`session_id`) | ||
); |
18 changes: 18 additions & 0 deletions
18
installer/pkg/components/mysql/init/01-recreate-gitpod-db.sql
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,18 @@ | ||
-- Copyright (c) 2020 Gitpod GmbH. All rights reserved. | ||
-- Licensed under the MIT License. See License-MIT.txt in the project root for license information. | ||
|
||
-- must be idempotent | ||
|
||
-- @gitpodDB contains name of the DB the script manipulates, and is replaced by the file reader | ||
SET | ||
@gitpodDB = IFNULL(@gitpodDB, '`__GITPOD_DB_NAME__`'); | ||
|
||
SET | ||
@statementStr = CONCAT('DROP DATABASE IF EXISTS ', @gitpodDB); | ||
PREPARE statement FROM @statementStr; | ||
EXECUTE statement; | ||
|
||
SET | ||
@statementStr = CONCAT('CREATE DATABASE ', @gitpodDB, ' CHARSET utf8mb4'); | ||
PREPARE statement FROM @statementStr; | ||
EXECUTE statement; |
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,44 @@ | ||
// Copyright (c) 2021 Gitpod GmbH. All rights reserved. | ||
// Licensed under the GNU Affero General Public License (AGPL). | ||
// See License-AGPL.txt in the project root for license information. | ||
|
||
package mysql | ||
|
||
import ( | ||
"github.com/gitpod-io/gitpod/installer/pkg/common" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/util/intstr" | ||
) | ||
|
||
// service this doesn't use the common.GenerateService function | ||
// because it's more complex than this caters for | ||
func service(ctx *common.RenderContext) ([]runtime.Object, error) { | ||
if !enabled(ctx) { | ||
return nil, nil | ||
} | ||
|
||
labels := common.DefaultLabels(Component) | ||
|
||
return []runtime.Object{&corev1.Service{ | ||
TypeMeta: common.TypeMetaService, | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: Component, | ||
Namespace: ctx.Namespace, | ||
Labels: labels, | ||
}, | ||
Spec: corev1.ServiceSpec{ | ||
Ports: []corev1.ServicePort{{ | ||
Protocol: *common.TCPProtocol, | ||
Port: Port, | ||
TargetPort: intstr.IntOrString{IntVal: Port}, | ||
}}, | ||
// todo(sje): selector is different if using CloudSQLProxy | ||
Selector: map[string]string{ | ||
"app.kubernetes.io/name": "mysql", | ||
}, | ||
Type: corev1.ServiceTypeClusterIP, | ||
}, | ||
}}, nil | ||
} |
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
Oops, something went wrong.