Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3284774
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3284774
Commits
177abfb7
Commit
177abfb7
authored
5 years ago
by
Yas Naoi
Committed by
Yas Naoi
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3086957
by yas, Xiaohua Guan: Fix to create a machine name for a cloud service provider
parent
c5f55eb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/cloud_service_providers/aws_cloud/aws_cloud.module
+3
-2
3 additions, 2 deletions
modules/cloud_service_providers/aws_cloud/aws_cloud.module
modules/cloud_service_providers/k8s/k8s.module
+3
-2
3 additions, 2 deletions
modules/cloud_service_providers/k8s/k8s.module
with
6 additions
and
4 deletions
modules/cloud_service_providers/aws_cloud/aws_cloud.module
+
3
−
2
View file @
177abfb7
...
...
@@ -2194,8 +2194,9 @@ function aws_cloud_form_cloud_config_aws_ec2_add_form_submit_batch(
* The cloud context
*/
function
aws_cloud_form_cloud_config_aws_ec2_add_form_create_cloud_context
(
$name
,
$region_name
)
{
// Convert " " to "_".
$cloud_context
=
str_replace
(
' '
,
'_'
,
strtolower
(
$name
));
// Convert ' ' or '-' to '_'.
$cloud_context
=
preg_replace
(
'/[ \-]/'
,
'_'
,
strtolower
(
$name
));
// Remove special characters.
$cloud_context
=
preg_replace
(
'/[^a-z0-9_]/'
,
''
,
$cloud_context
);
...
...
This diff is collapsed.
Click to expand it.
modules/cloud_service_providers/k8s/k8s.module
+
3
−
2
View file @
177abfb7
...
...
@@ -136,8 +136,9 @@ function k8s_form_cloud_config_k8s_add_form_validate(array &$form, FormStateInte
* The cloud context
*/
function
k8s_form_cloud_config_k8s_add_form_create_cloud_context
(
$name
)
{
// Convert " " to "_".
$cloud_context
=
str_replace
(
' '
,
'_'
,
strtolower
(
$name
));
// Convert ' ' or '-' to '_'.
$cloud_context
=
preg_replace
(
'/[ \-]/'
,
'_'
,
strtolower
(
$name
));
// Remove special characters.
$cloud_context
=
preg_replace
(
'/[^a-z0-9_]/'
,
''
,
$cloud_context
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment