-
Notifications
You must be signed in to change notification settings - Fork 0
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
issue-544, refactor externalChanges message #634
Conversation
controllers/clusters/helpers.go
Outdated
} | ||
|
||
if len(ignoreFields) == 0 { | ||
return string(k8sSpecJson), 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.
You can just return bytes in this func
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.
fixed
controllers/clusters/helpers.go
Outdated
@@ -158,8 +158,36 @@ func getSortedAppVersions(versions []*models.AppVersions, appType string) []*ver | |||
return nil | |||
} | |||
|
|||
func removeRedundantFieldsFromSpec(k8sSpec interface{}, ignoreFields ...string) (string, error) { |
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 use any
as for interface{}
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.
fixed
controllers/clusters/helpers.go
Outdated
} | ||
|
||
k8sSpecMap := map[string]interface{}{} | ||
err = json.Unmarshal([]byte(string(k8sSpecJson)), &k8sSpecMap) |
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.
err = json.Unmarshal([]byte(string(k8sSpecJson)), &k8sSpecMap) | |
err = json.Unmarshal(k8sSpecJson, &k8sSpecMap) |
try this. less conversions and it looks cleaner.
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.
fixed
controllers/clusters/helpers.go
Outdated
return string(k8sSpecJson), nil | ||
} | ||
|
||
k8sSpecMap := map[string]interface{}{} |
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.
any
over interfaces
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.
fixed
fe82e0b
to
5bf22c0
Compare
5bf22c0
to
93e0294
Compare
No description provided.