Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added feature for placement key in v3 #813

Merged
merged 1 commit into from
Oct 6, 2017

Conversation

surajnarwade
Copy link
Contributor

it will map engine.labels.operatingsystem to beta.kubernetes.io/os and
node.hostname to kubernetes.io/hostname and all other constraints will not be supported.

@kompose-bot
Copy link
Collaborator

@surajnarwade, thank you for the pull request! We'll request some people to review your PR. @cdrage and @kadel, please review this.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 12, 2017
@cdrage
Copy link
Member

cdrage commented Sep 12, 2017

@surajnarwade Code looks good, but can you add some integration / cmd tests? Then LGTM from me 👍

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 13, 2017
@surajnarwade
Copy link
Contributor Author

@cdrage , tests added :)

@cdrage
Copy link
Member

cdrage commented Sep 26, 2017

One last thing, can you update docs/conversion.md?

Otherwise, code LGTM. Once docs are updated let's merge.

@surajnarwade surajnarwade force-pushed the placementv3 branch 2 times, most recently from 2f5c036 to 879e6f4 Compare September 27, 2017 13:50
@surajnarwade
Copy link
Contributor Author

@cdrage updated docs/conversion.md

// placement:
placement := make(map[string]string)
for _, j := range composeServiceConfig.Deploy.Placement.Constraints {
p := strings.Split(j, " == ")
Copy link
Member

Choose a reason for hiding this comment

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

missed this, but it's a pain in the butt, but can you test for:

      placement:
        constraints: [node.role == manager]

as well, as per: https://docs.docker.com/compose/compose-file/#replicas

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cdrage , added functional test for the same example and it's working

@cdrage
Copy link
Member

cdrage commented Oct 4, 2017

@surajnarwade Alright, code LGTM (thanks for adding another functional test).

Fix conflicts and then it should be good to go.

@surajnarwade
Copy link
Contributor Author

@cdrage fixed conflicts

Copy link
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

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

} else if p[0] == "engine.labels.operatingsystem" {
placement["beta.kubernetes.io/os"] = p[1]
} else {
log.Warn(p[0], " constraints in placement is not supported")
Copy link
Member

Choose a reason for hiding this comment

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

So just a second review, but maybe we should add that only node.hostname and engine.labels.operatingsystem is only supported as a constraint in the warning.

@@ -574,5 +597,7 @@ cmd="kompose convert --provider=openshift --stdout -j -f $KOMPOSE_ROOT/examples/
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/examples/output-gitlab-os.json > /tmp/output-os.json
convert::expect_success_and_warning "kompose convert --provider=openshift --stdout -j -f $KOMPOSE_ROOT/examples/docker-gitlab.yaml" "/tmp/output-os.json"



Copy link
Member

Choose a reason for hiding this comment

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

remove extra newlines

it will map `engine.labels.operatingsystem` to `beta.kubernetes.io/os` and
`node.hostname` to `kubernetes.io/hostname` and all other constraints will not be supported.
@cdrage
Copy link
Member

cdrage commented Oct 6, 2017

LGTM

@cdrage cdrage merged commit 0735470 into kubernetes:master Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants