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: ignore nil elements to avoid panic #1245

Merged
merged 5 commits into from
Oct 1, 2022

Conversation

suzuki-shunsuke
Copy link
Member

Close #1244

@suzuki-shunsuke suzuki-shunsuke added the bug Something isn't working label Sep 30, 2022
@suzuki-shunsuke suzuki-shunsuke added this to the v1.19.5 milestone Oct 1, 2022
@@ -38,6 +38,9 @@ func (reader *ConfigReader) Read(configFilePath string, cfg *aqua.Config) error
func (reader *ConfigReader) readImports(configFilePath string, cfg *aqua.Config) error {
pkgs := []*aqua.Package{}
for _, pkg := range cfg.Packages {
if pkg == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Check aqua.yaml's packages.

@@ -74,6 +74,9 @@ func (registries *Registries) UnmarshalYAML(unmarshal func(interface{}) error) e
}
m := make(map[string]*Registry, len(arr))
for _, registry := range arr {
if registry == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Check aqua.yaml's registries.

@@ -31,6 +31,10 @@ func (pkgInfos *PackageInfos) toMap(logE *logrus.Entry, logLevel logrus.Level) m
for _, pkgInfo := range *pkgInfos {
logE := logE
pkgInfo := pkgInfo
if pkgInfo == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Check registry.yaml's packages.

@@ -41,6 +40,10 @@ func (inst *Installer) InstallRegistries(ctx context.Context, cfg *aqua.Config,
registryContents := make(map[string]*registry.Config, len(cfg.Registries)+1)

for _, registry := range cfg.Registries {
if registry == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Check aqua.yaml's registries.

@suzuki-shunsuke suzuki-shunsuke merged commit 80a331d into main Oct 1, 2022
@suzuki-shunsuke suzuki-shunsuke deleted the fix/ignore-empty-element branch October 1, 2022 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"invalid" aqua.yaml results in SIGSEGV
1 participant