Skip to content

Commit f76ca55

Browse files
committed
fix: ignore missing ssl paths error
1 parent b42798a commit f76ca55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/config/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,15 +757,19 @@ func (c *config) Validate(fsys fs.FS) error {
757757
if len(c.Api.Tls.KeyPath) == 0 {
758758
return errors.New("Missing required field in config: api.tls.key_path")
759759
}
760-
if c.Api.Tls.CertContent, err = fs.ReadFile(fsys, c.Api.Tls.CertPath); err != nil {
760+
if c.Api.Tls.CertContent, err = fs.ReadFile(fsys, c.Api.Tls.CertPath); errors.Is(err, os.ErrNotExist) {
761+
// Ignore missing ssl cert path on CI
762+
} else if err != nil {
761763
return errors.Errorf("failed to read TLS cert: %w", err)
762764
}
763765
}
764766
if len(c.Api.Tls.KeyPath) > 0 {
765767
if len(c.Api.Tls.CertPath) == 0 {
766768
return errors.New("Missing required field in config: api.tls.cert_path")
767769
}
768-
if c.Api.Tls.KeyContent, err = fs.ReadFile(fsys, c.Api.Tls.KeyPath); err != nil {
770+
if c.Api.Tls.KeyContent, err = fs.ReadFile(fsys, c.Api.Tls.KeyPath); errors.Is(err, os.ErrNotExist) {
771+
// Ignore missing ssl key path on CI
772+
} else if err != nil {
769773
return errors.Errorf("failed to read TLS key: %w", err)
770774
}
771775
}

0 commit comments

Comments
 (0)