-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KOTS reporting to replicated-app #4202
KOTS reporting to replicated-app #4202
Conversation
pkg/replicatedapp/api.go
Outdated
} | ||
|
||
if l != nil { | ||
reportingInfo := reporting.GetReportingInfoByAppSlug(l.Spec.AppSlug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The app slug is generated and won't always match the one in the license. I think you will need to use ListInstalledApps
and then GetLatestLicenseForApp
and then just call GetReportingInfo
with the right app ID
6923957
to
730cfeb
Compare
@sgalsaleh or @cbodonnell Would love you thoughts on how to globally mock a Basically, the test is failing because of a call |
pkg/replicatedapp/api.go
Outdated
@@ -149,6 +180,14 @@ func getApplicationMetadataFromHost(host string, endpoint string, upstream *url. | |||
return nil, errors.Wrap(err, "failed to call newrequest") | |||
} | |||
|
|||
appID, err := store.GetStore().GetAppIDFromSlug(r.AppSlug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like store.GetStore()
is returning nil
here as well based on the failing e2e jobs. This function is called in the context of the KOTS CLI, which is why it does not have direct access to the store.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So store.GetStore()
, might not be returning nil
here as I had thought above, but this would get called at a time where rqlite has not yet been deployed by KOTS and is the cause of the failing tests. Looking at the CI jobs, the kots install
fails before any of the components are deployed. My suggestion would be to remove reporting from the metadata request here since it happens before a license is even installed. This initial metadata request is unauthenticated and is just used to apply branding to the initial screens.
In the SDK, we have this function, which allows setting the global store. Something like that would allow you to set and |
19dcd62
to
f1c319c
Compare
@cbodonnell However, a large number of integration tests are failing with the error |
@FourSigma I just left a follow-up comment here with my thoughts. Hopefully that is all that is causing the tests to trip up since the panic originates from the call to |
Makes sense @cbodonnell . I will make the change. |
@cbodonnell Happy Monday. Looks like we have some failures on |
the |
I would be okay for this approach esp. if it just limited to the reporting portion of KOTS. |
1160566
to
b1263f4
Compare
@cbodonnell Looks like there is a |
@FourSigma It looks like the testim branch was out-of-date since that test was added somewhat recently. I've merged in changes from the base branch and re-run the test. |
b1263f4
to
b29c25b
Compare
@cbodonnell Looks like we are now failing on the following tests:
|
@FourSigma those both looked to be flaky failures since a re-run passed. Merged this one. |
Thanks @cbodonnell! |
What this PR does / why we need it:
Injects relevant header metadata when KOTS reaches out to Replicated.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Steps to reproduce
Does this PR introduce a user-facing change?
Does this PR require documentation?