MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / initSubCommand

Function initSubCommand

internal/cmd/manager/instance/initdb/cmd.go:154–168  ·  view source on GitHub ↗
(ctx context.Context, info postgres.InitInfo)

Source from the content-addressed store, hash-verified

152}
153
154func initSubCommand(ctx context.Context, info postgres.InitInfo) error {
155 contextLogger := log.FromContext(ctx)
156 err := info.EnsureTargetDirectoriesDoNotExist(ctx)
157 if err != nil {
158 return err
159 }
160
161 err = info.Bootstrap(ctx)
162 if err != nil {
163 contextLogger.Error(err, "Error while bootstrapping data directory")
164 return err
165 }
166
167 return nil
168}

Callers 1

NewCmdFunction · 0.85

Calls 3

BootstrapMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected