MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / IsReady

Method IsReady

app/controlplane/pkg/biz/casclient.go:164–183  ·  view source on GitHub ↗

If the CAS server can be reached and reports readiness

(ctx context.Context)

Source from the content-addressed store, hash-verified

162
163// If the CAS server can be reached and reports readiness
164func (uc *CASClientUseCase) IsReady(ctx context.Context) (bool, error) {
165 ctx, span := otelx.Start(ctx, casClientTracer, "CASClientUseCase.IsReady")
166 defer span.End()
167
168 if uc.casServerConf == nil {
169 return false, errors.New("missing CAS server configuration")
170 }
171
172 if err := protovalidate.Validate(uc.casServerConf); err != nil {
173 return false, fmt.Errorf("invalid CAS client configuration: %w", err)
174 }
175
176 c, closeFn, err := uc.casClientFactory(uc.casServerConf, "")
177 if err != nil {
178 return false, fmt.Errorf("failed to create CAS client: %w", err)
179 }
180 defer closeFn()
181
182 return c.IsReady(ctx)
183}

Callers 1

TestIsReadyFunction · 0.95

Calls 3

StartFunction · 0.92
IsReadyMethod · 0.65
ValidateMethod · 0.45

Tested by 1

TestIsReadyFunction · 0.76