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: IR config was not getting properly unmarshalled leading to empty containers in the deployment yamls #912

Merged
merged 1 commit into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1247,15 +1247,17 @@ func getGitRemoteByName(remotes []*git.Remote, remoteName string) *git.Remote {

// GetObjFromInterface loads from map[string]interface{} to struct
func GetObjFromInterface(obj interface{}, loadinto interface{}) error {
decoder, _ := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
Metadata: nil,
Result: &loadinto,
TagName: "yaml",
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
Result: &loadinto,
TagName: "yaml",
Squash: true,
})
if err != nil {
return fmt.Errorf("failed to get the mapstructure decoder for the type %T . Error: %w", loadinto, err)
}
// logrus.Debugf("Loading data into %+v from %+v", loadinto, obj)
if err := decoder.Decode(obj); err != nil {
logrus.Errorf("Unable to load obj %+v into %T : %s", obj, loadinto, err)
return err
return fmt.Errorf("failed to decode the object of type %T and value %+v into the type %T . Error: %w", obj, obj, loadinto, err)
}
// logrus.Debugf("Object Loaded is %+v", loadinto)
return nil
Expand Down
2 changes: 1 addition & 1 deletion qaengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func SetupConfigFile(writeConfigFile string, configStrings, configFiles, presets

// FetchAnswer fetches the answer for the question
func FetchAnswer(prob qatypes.Problem) (qatypes.Problem, error) {
logrus.Debugf("Fetching answer for problem:\n%v", prob)
logrus.Debugf("Fetching answer for the problem: %#v", prob)
if prob.Answer != nil {
logrus.Debugf("Problem already solved.")
return prob, nil
Expand Down
2 changes: 1 addition & 1 deletion transformer/kubernetes/apiresource/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func convertVolumeBySupportedKind(volume core.Volume, cluster collecttypes.Clust
if volume.VolumeSource.HostPath != nil || volume.VolumeSource.EmptyDir != nil {
return volume
}
logrus.Warnf("Unsupported storage type (volume) detected")
logrus.Warnf("Unsupported storage type (volume) detected: %#v", volume)

return core.Volume{}
}