Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisht13 committed Jul 30, 2023
1 parent 2089f59 commit 1ed4e2c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions configs/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ var (

ClusterConfig = KatanaConfig.Cluster

ChallengeDeployerConfig = ServicesConfig.ChallengeDeployer

SSHProviderConfig = ServicesConfig.SSHProvider

AdminConfig = KatanaConfig.AdminConfig
Expand Down
2 changes: 1 addition & 1 deletion lib/mongo/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

var ctx, _ = context.WithTimeout(context.Background(), time.Duration(g.KatanaConfig.TimeOut)*time.Second)
var client, err = mongo.Connect(ctx, options.Client().ApplyURI("mongodb://"+configs.MongoConfig.Username+":"+configs.MongoConfig.Password+"@"+configs.ServicesConfig.ChallengeDeployer.Host+":"+configs.MongoConfig.Port+"/?directConnection=true&appName=mongosh+"+configs.MongoConfig.Version))
var client, err = mongo.Connect(ctx, options.Client().ApplyURI("mongodb://"+configs.MongoConfig.Username+":"+configs.MongoConfig.Password+"@mongo."+configs.KatanaConfig.IngressHost+":"+configs.MongoConfig.Port+"/?directConnection=true&appName=mongosh+"+configs.MongoConfig.Version))
var link = client.Database(projectDatabase)

func setupAdmin() {
Expand Down
2 changes: 1 addition & 1 deletion lib/mysql/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var db *sql.DB

func setup() {
database, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp("+configs.ServicesConfig.ChallengeDeployer.Host+":"+configs.MySQLConfig.Port+")/mysql")
database, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp(mysql."+configs.KatanaConfig.IngressHost+":"+configs.MySQLConfig.Port+")/mysql")
if err != nil {
panic(err.Error())
}
Expand Down
6 changes: 3 additions & 3 deletions lib/mysql/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func CreateDatabase(database string) error {
func CreateGogsUser(username, password string) error {

// Get time in unix format and convert it to string
gogs, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp("+configs.ServicesConfig.ChallengeDeployer.Host+":"+configs.MySQLConfig.Port+")/gogs")
gogs, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp(mysql."+configs.KatanaConfig.IngressHost+":"+configs.MySQLConfig.Port+")/gogs")
if err != nil {
return err
}
Expand Down Expand Up @@ -64,7 +64,7 @@ func CreateGogsUser(username, password string) error {

func CreateGogsAdmin(username, password string) error {
// Get time in unix format and convert it to string
gogs, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp("+configs.ServicesConfig.ChallengeDeployer.Host+":"+configs.MySQLConfig.Port+")/gogs")
gogs, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp(mysql."+configs.KatanaConfig.IngressHost+":"+configs.MySQLConfig.Port+")/gogs")
if err != nil {
return err
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func CreateGogsAdmin(username, password string) error {
}

func CreateAccessToken(username, token string) error {
gogs, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp("+configs.ServicesConfig.ChallengeDeployer.Host+":"+configs.MySQLConfig.Port+")/gogs")
gogs, err := sql.Open("mysql", configs.MySQLConfig.Username+":"+configs.MySQLConfig.Password+"@tcp(mysql."+configs.KatanaConfig.IngressHost+":"+configs.MySQLConfig.Port+")/gogs")
if err != nil {
return err
}
Expand Down

0 comments on commit 1ed4e2c

Please sign in to comment.