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

[release/v1.4] nodeinstaller: ignore absence of containerd config template #1207

Merged
merged 1 commit into from
Feb 4, 2025
Merged
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
7 changes: 6 additions & 1 deletion nodeinstaller/node-installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"flag"
"fmt"
"io/fs"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -275,7 +277,10 @@ func parseExistingContainerdConfig(path string) ([]byte, config.ContainerdConfig
// they are overwriting the template file and not the rendered file, we need to return the
// template file here.
configData, err = os.ReadFile(path)
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
// The template file will be created by us, pretend that it's empty right now.
return []byte{}, cfg, nil
} else if err != nil {
return nil, config.ContainerdConfig{}, fmt.Errorf("reading containerd config template %s: %w", path, err)
}
return configData, cfg, nil
Expand Down