-
Notifications
You must be signed in to change notification settings - Fork 196
Fix duplicated providers listed in application form #3836
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
Conversation
|
||
func (s *pipedStore) UpdateMetadata(ctx context.Context, id, version, config string, pps []*model.Piped_PlatformProvider, repos []*model.ApplicationGitRepository, se *model.Piped_SecretEncryption, startedAt int64) error { | ||
return s.update(ctx, id, func(piped *model.Piped) error { | ||
piped.CloudProviders = nil |
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.
Nice catch! I have one point I would like to confirm.
Is this safe for the user using only cloudProviders
settings in piped?
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.
The piped execution only refers to its local configuration and itself knows about the CloudProvider (suppose it has only CloudProviders and the piped runs the old version since the new one will merge all CloudProviders -> PlatformProviders), so I think it's okay since they know which "cloudProvider" to use on its side.
Otherwise, though we remove CloudProviders information from the piped model here, it only be used to show on the application adding form selection, so I think it's okay 🤔
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 got your point! Thanks.
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.
Nice catch!
Co-authored-by: Khanh Tran <[email protected]>
What this PR does / why we need it:
The root cause of this issue is that when the currently running piped reports its metadata to the controlplane, only piped's platformProviders values in controlplane database are updated, but we forget to remove the old cloudProviders value, such that it exists and will be returned later in the web console application adding form.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: