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

fix issue 1793 #1798

Merged
merged 1 commit into from
Feb 1, 2024
Merged

fix issue 1793 #1798

merged 1 commit into from
Feb 1, 2024

Conversation

sosan
Copy link
Contributor

@sosan sosan commented Jan 9, 2024

What type of PR is this?
/kind bug

Which issue(s) this PR fixes:

Special notes for your reviewer:

  • Created new function checkUsableNameEnvFile

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 9, 2024
Copy link

linux-foundation-easycla bot commented Jan 9, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: sosan / name: Jose Luis (578fa72)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 9, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @sosan!

It looks like this is your first PR to kubernetes/kompose 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kompose has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 9, 2024
@AhmedGrati
Copy link
Contributor

@sosan thanks for working on this. You should update files in script/test/fixtures to make the e2e tests pass.

Copy link
Contributor

@AhmedGrati AhmedGrati left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Left some comments below!

Comment on lines 901 to 903
if len(envName) > 63 {
envName = envName[len(envName)-63:]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we should delete this bloc here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

applied

Copy link
Contributor Author

@sosan sosan Jan 14, 2024

Choose a reason for hiding this comment

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

from k8sutils_test.go this test gets last 63 characters

{
			name: "check that ./ is removed",
			args: args{
				name: "abcdefghijklnmopqrstuvxyzabcdefghijklmnopqrstuvwxyzabcdejghijkl$Hereisadditional",
			},
			want: "rstuvxyzabcdefghijklmnopqrstuvwxyzabcdejghijkl$Hereisadditional",
		},

and gets affected by this removed code:

if len(envName) > 63 {
		envName = envName[len(envName)-63:]
	}

pkg/transformer/kubernetes/k8sutils.go Outdated Show resolved Hide resolved
pkg/transformer/kubernetes/k8sutils.go Outdated Show resolved Hide resolved
@cdrage
Copy link
Member

cdrage commented Jan 15, 2024

The code LGTM. Are you able to add some fixture tests?

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 22, 2024
@sosan
Copy link
Contributor Author

sosan commented Jan 22, 2024

@cdrage rebased

@AhmedGrati
Copy link
Contributor

@sosan For some reason your rebase went wrong.

@sosan
Copy link
Contributor Author

sosan commented Jan 24, 2024

@AhmedGrati done :)

@cdrage
Copy link
Member

cdrage commented Jan 24, 2024

@AhmedGrati done :)

looks like something still went wrong.. over 30 commits in this PR? Maybe your main branch isn't synced to the upstream kubernetes/kompose branch?

* fix issue 1793  kubernetes#1793
*add tests

Signed-off-by: jose luis <[email protected]>

formated k8utils_test.go

Signed-off-by: jose luis <[email protected]>

labels formatted as name"-"envName to match fixtures when performing the gitHub action

Signed-off-by: jose luis <[email protected]>

removed this piece code because apply it later, and it is redundant

Signed-off-by: jose luis <[email protected]>

Refactor test in k8sutils_test.go to extract the last 63 characters. This addresses the impact of the removed code that previously truncated the input with if len(envName) > 63 { envName = envName[len(envName)-63:] }

Signed-off-by: jose luis <[email protected]>

changed to name function to getUsableNameEnvFile

Signed-off-by: jose luis <[email protected]>

fix issue 1793

* fix issue 1793  kubernetes#1793
*add tests

Signed-off-by: jose luis <[email protected]>

labels formatted as name"-"envName to match fixtures when performing the gitHub action

Signed-off-by: jose luis <[email protected]>

changed to name function to getUsableNameEnvFile

Signed-off-by: jose luis <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 24, 2024
@sosan
Copy link
Contributor Author

sosan commented Jan 24, 2024

@cdrage squashed and rebased again :)

@cdrage
Copy link
Member

cdrage commented Feb 1, 2024

/approve

@cdrage
Copy link
Member

cdrage commented Feb 1, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 1, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 1, 2024
@k8s-ci-robot k8s-ci-robot merged commit 52e5dbd into kubernetes:main Feb 1, 2024
10 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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] Conflicting name assigned to configmap generated for compose referencing ".env" files
4 participants