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: e2e test by updating Secret output TemplateData #467

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

punkwalker
Copy link
Contributor

No description provided.

@punkwalker punkwalker requested a review from a team as a code owner December 27, 2024 01:44
.goreleaser.yaml Outdated
@@ -5,7 +5,7 @@ before:
- go mod tidy
release:
# Mark nightly build as prerelease based on tag
prerelease: '{{ contains .Tag "-nightly" }}'
prerelease: auto
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Earlier expression was not evaluating correctly and nightly releases were not marked as prerelease. So this is another way of achieving the same.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's do this in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 49 to 56
type TemplateData struct {
IsCore bool `json:"isCore"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Username string `json:"username"`
Password string `json:"password"`
Data map[string]string `json:"data"`
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we duplicating fields from the secret struct? I thought this struct isn't used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can use struct from entity package in that case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This struct isn't used anywhere now, correct? We should remove it.

Comment on lines -278 to 282
for i := range secs {
if secs[i].Name == name {
out.Password = secs[i].Data["password"]
out.Username = secs[i].Data["username"]
for _, sec := range secs {
if sec.Name == name {
out.Password = sec.Password
out.Username = sec.Username
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are probably unmarshaing to wrong type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's the right type, the sec slice is made from TemplateData struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it, Now using Secret struct from entity package

Signed-off-by: punkwalker <[email protected]>
Sign up for free to 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.

2 participants