MCPcopy
hub / github.com/grafana/tempo / internalNew

Function internalNew

tempodb/backend/azure/azure.go:76–104  ·  view source on GitHub ↗
(cfg *Config, confirm bool)

Source from the content-addressed store, hash-verified

74}
75
76func internalNew(cfg *Config, confirm bool) (*Azure, error) {
77 ctx := context.Background()
78
79 c, err := getContainerClient(ctx, cfg, false)
80 if err != nil {
81 return nil, fmt.Errorf("getting storage container: %w", err)
82 }
83
84 hedgedContainer, err := getContainerClient(ctx, cfg, true)
85 if err != nil {
86 return nil, fmt.Errorf("getting hedged storage container: %w", err)
87 }
88
89 if confirm {
90 // Getting container properties to check if container exists
91 _, err = c.GetProperties(ctx, &container.GetPropertiesOptions{})
92 if err != nil {
93 return nil, fmt.Errorf("failed to GetProperties: %w", err)
94 }
95 }
96
97 rw := &Azure{
98 cfg: cfg,
99 containerClient: c,
100 hedgedContainerClient: hedgedContainer,
101 }
102
103 return rw, nil
104}
105
106func readError(err error) error {
107 if bloberror.HasCode(err, bloberror.BlobNotFound) {

Callers 3

NewNoConfirmFunction · 0.70
NewFunction · 0.70
NewVersionedReaderWriterFunction · 0.70

Calls 1

getContainerClientFunction · 0.85

Tested by

no test coverage detected