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
5b527863
Commit
5b527863
authored
Nov 12, 2015
by
jackgr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix two bugs in replicatedservice.py
parent
c7d35e3a
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 @
5b527863
...
@@ -41,9 +41,9 @@ def GenerateConfig(context):
...
@@ -41,9 +41,9 @@ def GenerateConfig(context):
'properties'
:
{
'properties'
:
{
'apiVersion'
:
'v1'
,
'apiVersion'
:
'v1'
,
'kind'
:
'Service'
,
'kind'
:
'Service'
,
'namespace'
:
namespace
,
'metadata'
:
{
'metadata'
:
{
'name'
:
service_name
,
'name'
:
service_name
,
'namespace'
:
namespace
,
'labels'
:
GenerateLabels
(
context
,
service_name
),
'labels'
:
GenerateLabels
(
context
,
service_name
),
},
},
'spec'
:
{
'spec'
:
{
...
@@ -63,9 +63,9 @@ def GenerateConfig(context):
...
@@ -63,9 +63,9 @@ def GenerateConfig(context):
'properties'
:
{
'properties'
:
{
'apiVersion'
:
'v1'
,
'apiVersion'
:
'v1'
,
'kind'
:
'ReplicationController'
,
'kind'
:
'ReplicationController'
,
'namespace'
:
namespace
,
'metadata'
:
{
'metadata'
:
{
'name'
:
rc_name
,
'name'
:
rc_name
,
'namespace'
:
namespace
,
'labels'
:
GenerateLabels
(
context
,
rc_name
),
'labels'
:
GenerateLabels
(
context
,
rc_name
),
},
},
'spec'
:
{
'spec'
:
{
...
@@ -101,11 +101,11 @@ def GenerateConfig(context):
...
@@ -101,11 +101,11 @@ def GenerateConfig(context):
def
GenerateLabels
(
context
,
name
):
def
GenerateLabels
(
context
,
name
):
"""Generates labels either from the context.properties['labels'] or
"""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
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
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:
Args:
context: Template context, which can contain the following properties:
context: Template context, which can contain the following properties:
...
@@ -115,7 +115,7 @@ def GenerateLabels(context, name):
...
@@ -115,7 +115,7 @@ def GenerateLabels(context, name):
A dict containing labels in a name:value format
A dict containing labels in a name:value format
"""
"""
tmp_labels
=
context
.
properties
.
get
(
'labels'
,
None
)
tmp_labels
=
context
.
properties
.
get
(
'labels'
,
None
)
ret_labels
=
{
'
name
'
:
name
}
ret_labels
=
{
'
app
'
:
name
}
if
isinstance
(
tmp_labels
,
dict
):
if
isinstance
(
tmp_labels
,
dict
):
for
key
,
value
in
tmp_labels
.
iteritems
():
for
key
,
value
in
tmp_labels
.
iteritems
():
ret_labels
[
key
]
=
value
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