fix: whitespace linter warnings

Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
This commit is contained in:
Mario Constanti 2024-02-22 06:32:36 +01:00
parent 023652d76d
commit b3854eaf18
12 changed files with 0 additions and 13 deletions

View file

@ -78,7 +78,6 @@ func (a *Authenticator) GetJWTToken(ctx context.Context) (string, error) {
// GetJWTMetricsToken returns a JWT token that can be used to read metrics.
// This token is not tied to a user, no user is stored in the db.
func (a *Authenticator) GetJWTMetricsToken(ctx context.Context) (string, error) {
if !IsAdmin(ctx) {
return "", runnerErrors.ErrUnauthorized
}

View file

@ -23,7 +23,6 @@ func NewMetricsMiddleware(cfg config.JWTAuth) (*MetricsMiddleware, error) {
func (m *MetricsMiddleware) Middleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
authorizationHeader := r.Header.Get("authorization")
if authorizationHeader == "" {

View file

@ -175,7 +175,6 @@ var enterpriseUpdateCmd = &cobra.Command{
}
func init() {
enterpriseAddCmd.Flags().StringVar(&enterpriseName, "name", "", "The name of the enterprise")
enterpriseAddCmd.Flags().StringVar(&enterpriseWebhookSecret, "webhook-secret", "", "The webhook secret for this enterprise")
enterpriseAddCmd.Flags().StringVar(&enterpriseCreds, "credentials", "", "Credentials name. See credentials list.")

View file

@ -300,7 +300,6 @@ var orgDeleteCmd = &cobra.Command{
}
func init() {
orgAddCmd.Flags().StringVar(&orgName, "name", "", "The name of the organization")
orgAddCmd.Flags().StringVar(&orgWebhookSecret, "webhook-secret", "", "The webhook secret for this organization")
orgAddCmd.Flags().StringVar(&orgCreds, "credentials", "", "Credentials name. See credentials list.")

View file

@ -303,7 +303,6 @@ var repoDeleteCmd = &cobra.Command{
}
func init() {
repoAddCmd.Flags().StringVar(&repoOwner, "owner", "", "The owner of this repository")
repoAddCmd.Flags().StringVar(&repoName, "name", "", "The name of the repository")
repoAddCmd.Flags().StringVar(&repoWebhookSecret, "webhook-secret", "", "The webhook secret for this repository")

View file

@ -10,7 +10,6 @@ import (
// CollectOrganizationMetric collects the metrics for the enterprise objects
func CollectEnterpriseMetric(ctx context.Context, r *runner.Runner) error {
// reset metrics
metrics.EnterpriseInfo.Reset()
metrics.EnterprisePoolManagerStatus.Reset()

View file

@ -10,7 +10,6 @@ import (
// CollectInstanceMetric collects the metrics for the runner instances
// reflecting the statuses and the pool they belong to.
func CollectInstanceMetric(ctx context.Context, r *runner.Runner) error {
// reset metrics
metrics.InstanceStatus.Reset()
@ -54,7 +53,6 @@ func CollectInstanceMetric(ctx context.Context, r *runner.Runner) error {
}
for _, instance := range instances {
metrics.InstanceStatus.WithLabelValues(
instance.Name, // label: name
string(instance.Status), // label: status

View file

@ -10,7 +10,6 @@ import (
// CollectOrganizationMetric collects the metrics for the organization objects
func CollectOrganizationMetric(ctx context.Context, r *runner.Runner) error {
// reset metrics
metrics.OrganizationInfo.Reset()
metrics.OrganizationPoolManagerStatus.Reset()

View file

@ -11,7 +11,6 @@ import (
// CollectPoolMetric collects the metrics for the pool objects
func CollectPoolMetric(ctx context.Context, r *runner.Runner) error {
// reset metrics
metrics.PoolInfo.Reset()
metrics.PoolStatus.Reset()

View file

@ -8,7 +8,6 @@ import (
)
func CollectProviderMetric(ctx context.Context, r *runner.Runner) error {
// reset metrics
metrics.ProviderInfo.Reset()

View file

@ -9,7 +9,6 @@ import (
)
func CollectRepositoryMetric(ctx context.Context, r *runner.Runner) error {
// reset metrics
metrics.EnterpriseInfo.Reset()
metrics.EnterprisePoolManagerStatus.Reset()

View file

@ -145,7 +145,6 @@ func (e *external) DeleteInstance(ctx context.Context, instance string) error {
).Inc()
return garmErrors.NewProviderError("provider binary %s returned error: %s", e.execPath, err)
}
}
return nil
}