Skip to content

Commit

Permalink
Allow snapshot stack versions to query EPR for serverless (#1484)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodm authored Oct 4, 2023
1 parent ce18328 commit 47677f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/serverless/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io"
"net/http"
"net/url"
"strings"
"time"

"github.com/elastic/elastic-package/internal/elasticsearch"
Expand Down Expand Up @@ -178,13 +179,13 @@ func (p *Project) getFleetHealth(ctx context.Context) error {

func (p *Project) CreateAgentPolicy(stackVersion string, kibanaClient *kibana.Client) error {
systemPackages, err := registry.Production.Revisions("system", registry.SearchOptions{
KibanaVersion: stackVersion,
KibanaVersion: strings.TrimSuffix(stackVersion, kibana.SNAPSHOT_SUFFIX),
})
if err != nil {
return fmt.Errorf("could not get the system package version for kibana %v: %w", stackVersion, err)
return fmt.Errorf("could not get the system package version for Kibana %v: %w", stackVersion, err)
}
if len(systemPackages) != 1 {
return fmt.Errorf("unexpected number of system package versions - found %d expected 1", len(systemPackages))
return fmt.Errorf("unexpected number of system package versions for Kibana %s - found %d expected 1", stackVersion, len(systemPackages))
}
logger.Debugf("Found %s package - version %s", systemPackages[0].Name, systemPackages[0].Version)

Expand Down

0 comments on commit 47677f1

Please sign in to comment.