Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
b7ee2f89
Commit
b7ee2f89
authored
Nov 12, 2015
by
vaikas-google
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #48 from jackgr/fix-replicated-service
Fix two bugs in replicatedservice.py
parents
488dc041
5b527863
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
replicatedservice.py
types/replicatedservice/v1/replicatedservice.py
+5
-5
No files found.
types/replicatedservice/v1/replicatedservice.py
View file @
b7ee2f89
...
...
@@ -41,9 +41,9 @@ def GenerateConfig(context):
'properties'
:
{
'apiVersion'
:
'v1'
,
'kind'
:
'Service'
,
'namespace'
:
namespace
,
'metadata'
:
{
'name'
:
service_name
,
'namespace'
:
namespace
,
'labels'
:
GenerateLabels
(
context
,
service_name
),
},
'spec'
:
{
...
...
@@ -63,9 +63,9 @@ def GenerateConfig(context):
'properties'
:
{
'apiVersion'
:
'v1'
,
'kind'
:
'ReplicationController'
,
'namespace'
:
namespace
,
'metadata'
:
{
'name'
:
rc_name
,
'namespace'
:
namespace
,
'labels'
:
GenerateLabels
(
context
,
rc_name
),
},
'spec'
:
{
...
...
@@ -101,11 +101,11 @@ def GenerateConfig(context):
def
GenerateLabels
(
context
,
name
):
"""Generates labels either from the context.properties['labels'] or
generates a default label '
name
':name
generates a default label '
app
':name
We make a deep copy of the context.properties['labels'] section to avoid
linking in the yaml document, which I believe reduces readability of the
expanded template. If no labels are given, generate a default '
name
':name.
expanded template. If no labels are given, generate a default '
app
':name.
Args:
context: Template context, which can contain the following properties:
...
...
@@ -115,7 +115,7 @@ def GenerateLabels(context, name):
A dict containing labels in a name:value format
"""
tmp_labels
=
context
.
properties
.
get
(
'labels'
,
None
)
ret_labels
=
{
'
name
'
:
name
}
ret_labels
=
{
'
app
'
:
name
}
if
isinstance
(
tmp_labels
,
dict
):
for
key
,
value
in
tmp_labels
.
iteritems
():
ret_labels
[
key
]
=
value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment