Skip to content

bug: fix annotation bug#1887

Merged
TessaIO merged 1 commit intokubernetes:mainfrom
cdrage:fix-annotations
Jun 2, 2024
Merged

bug: fix annotation bug#1887
TessaIO merged 1 commit intokubernetes:mainfrom
cdrage:fix-annotations

Conversation

@cdrage
Copy link
Copy Markdown
Member

@cdrage cdrage commented May 30, 2024

bug: fix annotation bug

What type of PR is this?

What this PR does / why we need it:

When supplying a label in the compose file, it should stay in the output
too.

Which issue(s) this PR fixes:

Fixes #1885

Special notes for your reviewer:

Signed-off-by: Charlie Drage charlie@charliedrage.com

@k8s-ci-robot k8s-ci-robot requested review from TessaIO and kadel May 30, 2024 14:13
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 30, 2024
@cdrage cdrage force-pushed the fix-annotations branch from 716471d to 51999c6 Compare May 30, 2024 15:53
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 30, 2024
@cdrage cdrage force-pushed the fix-annotations branch from 51999c6 to e9d3411 Compare May 30, 2024 15:54
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 30, 2024
@cdrage cdrage force-pushed the fix-annotations branch from e9d3411 to 0906e6e Compare May 30, 2024 19:38
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 30, 2024
@cdrage cdrage force-pushed the fix-annotations branch from 0906e6e to b3a24f5 Compare May 30, 2024 19:43
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 30, 2024
@cdrage cdrage force-pushed the fix-annotations branch from b3a24f5 to b9f66dd Compare May 30, 2024 19:49
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 30, 2024
#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->

#### What this PR does / why we need it:

When supplying a label in the compose file, it should stay in the output
too.

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes kubernetes#1885

#### Special notes for your reviewer:

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
@cdrage cdrage force-pushed the fix-annotations branch from b9f66dd to 19499d4 Compare May 30, 2024 20:10
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 30, 2024
@cdrage
Copy link
Copy Markdown
Member Author

cdrage commented May 30, 2024

I also fixed the test here: https://github.com/kubernetes/kompose/blob/main/script/test/fixtures/configmap-file-configs/compose-3.yaml

We cannot do this on mac M1 testing since /var/lib/docker isn't available. So I changed it to use /tmp in this PR

Copy link
Copy Markdown
Member

@TessaIO TessaIO left a comment

Choose a reason for hiding this comment

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

LGTM! Just some small nits

# Test label in compose.yaml appears in the output annotation
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/label/compose.yaml convert --stdout --with-kompose-annotation=false"
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/label/output-k8s.yaml"
convert::expect_success "$k8s_cmd" "$k8s_output" || exit 1 No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing EOF here

- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /tmp:/tmp:ro No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing EOF

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdrage, TessaIO

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@TessaIO TessaIO merged commit 1f74418 into kubernetes:main Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] --with-kompose-annotation=false flag removes custom annotations defined in labels as well

3 participants