Skip to content

Remove pointers for slices preferring omitempty tag instead - #316

Merged
vishh merged 1 commit into
opencontainers:masterfrom
mrunalp:cgroup_ptrs
Jan 26, 2016
Merged

Remove pointers for slices preferring omitempty tag instead #316
vishh merged 1 commit into
opencontainers:masterfrom
mrunalp:cgroup_ptrs

Conversation

@mrunalp

Copy link
Copy Markdown
Contributor

Converting to pointers to be consistent with other cgroups settings.

Signed-off-by: Mrunal Patel mrunalp@gmail.com

@mrunalpmrunalp changed the title Add pointers to couple of cgroups settingsConvert couple of cgroups settings to pointersJan 26, 2016
@mrunalp

Copy link
Copy Markdown
ContributorAuthor

@crosbymichael@vishh PTAL

@mrunalp

Copy link
Copy Markdown
ContributorAuthor

We can wait for #284 to merge before this.

Comment threadruntime_config_linux.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? If we add an omitempty tag, even an empty list signifies non-existence of this field.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vishh I am fine one way or the other. But we have them as pointers in more places compared to where we don't.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we don't need pointers for slices and maps. I can go cleanup
the Spec again once I get some spare cycles.

On Mon, Jan 25, 2016 at 4:46 PM, Mrunal Patel notifications@github.com
wrote:

In runtime_config_linux.go
#316 (comment):

@@ -195,7 +195,7 @@ type Network struct {
// Set class identifier for container's network packets
ClassID *uint32 json:"classID"
// Set priority of network traffic for container

  • Priorities []InterfacePriority json:"priorities"
  • Priorities []*InterfacePriority json:"priorities"

@vishhhttps://github.com/vishh I am fine one way or the other. But we
have them as pointers in more places compared to where we don't.


Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/316/files#r50781540.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vishh No issues going one way or the other. I can change the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

On Mon, Jan 25, 2016 at 5:03 PM, Mrunal Patel notifications@github.com
wrote:

In runtime_config_linux.go
#316 (comment):

@@ -195,7 +195,7 @@ type Network struct {
// Set class identifier for container's network packets
ClassID *uint32 json:"classID"
// Set priority of network traffic for container

  • Priorities []InterfacePriority json:"priorities"
  • Priorities []*InterfacePriority json:"priorities"

@vishhhttps://github.com/vishh No issues going one way or the other. I
can change the PR.


Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/316/files#r50783105.

Comment threadruntime_config_linux.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR just adding omitempty here should do. Kindly revert the pointer changes.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
@mrunalpmrunalp changed the title Convert couple of cgroups settings to pointersRemove pointers for slices preferring omitempty tag instead Jan 26, 2016
@mrunalp

Copy link
Copy Markdown
ContributorAuthor

@vishh Updated to remove pointers from slices.

@vishh

Copy link
Copy Markdown
Contributor

LGTM. Thanks for the cleanup @mrunalp 👍

@hqhq

hqhq commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

LGTM

vishh added a commit that referenced this pull request Jan 26, 2016
Remove pointers for slices preferring omitempty tag instead
@vishh
vishh merged commit 07bce39 into opencontainers:masterJan 26, 2016
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mrunalp@vishh@hqhq