-
Notifications
You must be signed in to change notification settings - Fork 6
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
Send appname as header on DCL upload #94
Conversation
pkg/supply/supply.go
Outdated
UserAgent: fmt.Sprintf("cloud-authorization-buildpack/%s", s.BuildpackVersion), | ||
ExtraHeaders: map[string]string{ | ||
"User-Agent": fmt.Sprintf("cloud-authorization-buildpack/%s", s.BuildpackVersion), | ||
"X-Cf-Appname": vcapApp.ApplicationName, |
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.
Let's use a more generic name that also fits for other use cases, e.g. if we provide some functionality to upload via CAP or as a k8s job. E.g. just remove the cf part? X-App-Name
or X-Appname
?
pkg/supply/env/config.go
Outdated
ApplicationID string `json:"application_id"` | ||
ApplicationName string `json:"application_name"` | ||
ApplicationUris []string `json:"application_uris"` | ||
CfAPI string `json:"cf_api"` | ||
Limits struct { | ||
Fds int `json:"fds"` | ||
} `json:"limits"` | ||
Name string `json:"name"` | ||
OrganizationID string `json:"organization_id"` | ||
OrganizationName string `json:"organization_name"` | ||
SpaceID string `json:"space_id"` | ||
SpaceName string `json:"space_name"` | ||
Uris []string `json:"uris"` | ||
Users any `json:"users"` |
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.
From what I can see, only the ApplicationName
is used in the coding. Let's strip down the struct to what we need exactly, no need to parse the other values.
pkg/supply/env/config.go
Outdated
Users any `json:"users"` | ||
} | ||
|
||
func LoadVcapApplication(log *libbuildpack.Logger) (VcapApplication, error) { |
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.
This func always returns error = nil. Remove error return value?
3030efe
to
1aac254
Compare
commited suggested changes |
Send appname as header
X-Appname
on dcl-upload