-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: punkwalker <[email protected]>
.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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/cmd/get/secrets.go
Outdated
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"` | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
4fe11d8
to
89a5431
Compare
Signed-off-by: punkwalker <[email protected]>
No description provided.