Skip to content

Commit

Permalink
Merge pull request RedHatInsights#2570 from lzap/pulp-client
Browse files Browse the repository at this point in the history
feat: add pulp client
  • Loading branch information
loadtheaccumulator authored Jun 26, 2024
2 parents bd97191 + c1b1ace commit 7c6e76f
Show file tree
Hide file tree
Showing 26 changed files with 76,793 additions and 8 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ help:
@echo "lint Runs 'golint' on the project"
@echo "golangci-lint Runs 'golangci-lint' on the project"
@echo "openapi Generates an openapi.{json,yaml} file in /cmd/spec/"
@echo "update-clients Updates sources for OpenAPI clients"
@echo "pre-commit Runs fmt, vet, lint, and clean on the project"
@echo "restart-app Scales the edge-api-service deployment down to 0 then up to 1 in the given namespace"
@echo " @param NAMESPACE - (optional) the namespace to use"
Expand Down Expand Up @@ -164,6 +165,14 @@ lint:
openapi:
go run cmd/spec/main.go

# This needs github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
# Also workarounds a bug: https://github.com/oapi-codegen/oapi-codegen/issues/243
.PHONY: update-clients
update-clients:
curl -s "https://pulp.stage.devshift.net/api/pulp/api/v3/docs/api.json?pk_path=1" > pkg/clients/pulp/pulp_openapi.json
perl -i -pe 'BEGIN{undef $$/;} s/"additionalProperties": {\s*"type": "object"\s*}/"additionalProperties": true/g' pkg/clients/pulp/pulp_openapi.json
oapi-codegen -config pkg/clients/pulp/pulp_config.yaml pkg/clients/pulp/pulp_openapi.json

pre-commit:
$(MAKE) golangci-lint
$(MAKE) test-clean
Expand Down
113 changes: 113 additions & 0 deletions cmd/pulpcli/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package main

import (
"context"
"fmt"
"math/rand"
"os"
"time"

"github.com/google/uuid"
"github.com/redhatinsights/edge-api/config"
"github.com/redhatinsights/edge-api/logger"
"github.com/redhatinsights/edge-api/pkg/clients/pulp"
"github.com/sirupsen/logrus"
)

func domainList(ctx context.Context, c *pulp.PulpService) {
domains, err := c.DomainsList(ctx, "")
if err != nil {
panic(err)
}

for _, d := range domains {
fmt.Println(d.Name, *d.PulpHref)
}
}

// nolint: gosec
var rnd = rand.New(rand.NewSource(time.Now().UnixNano()))

func fixtureCreate(ctx context.Context, c *pulp.PulpService, orgID, tarFilename string) {
resourceName := fmt.Sprintf("test-%d", rnd.Int())

artifact, err := c.ArtifactsCreatePipe(ctx, tarFilename)
if err != nil {
panic(err)
}
fmt.Println("Artifact uploaded", *artifact.PulpHref)
fmt.Println("--------------------------------")

repo, err := c.RepositoriesCreate(ctx, resourceName)
if err != nil {
panic(err)
}
fmt.Println("Repository created", *repo.PulpHref)
fmt.Println("--------------------------------")

hcg, err := c.HeaderGuardReadOrCreate(ctx, pulp.JQOrgID, orgID)
if err != nil {
panic(err)
}
fmt.Println("Header guard found or created", *hcg.PulpHref)
fmt.Println("--------------------------------")

dist, err := c.DistributionsCreate(ctx, resourceName, resourceName, *repo.PulpHref, *hcg.PulpHref)
if err != nil {
panic(err)
}
fmt.Println("Distribution created", *dist.PulpHref)
fmt.Println("--------------------------------")

repoImported, err := c.RepositoriesImport(ctx, pulp.ScanUUID(*repo.PulpHref), "repo", *artifact.PulpHref)
if err != nil {
panic(err)
}
fmt.Println("Repository imported", *repoImported.PulpHref)
fmt.Println("--------------------------------")

fmt.Printf("curl -L --proxy http://squid.xxxx.redhat.com:3128 --cert /etc/pki/consumer/cert.pem --key /etc/pki/consumer/key.pem https://cert.console.stage.redhat.com/api/pulp-content/%s/%s/\n", c.Domain(), resourceName)
fmt.Println("--------------------------------")
}

func main() {
ctx := context.Background()
config.Init()
logger.InitLogger(os.Stdout)
logrus.SetLevel(logrus.TraceLevel)

// when changing the domain, please delete all artifacts, repos, distros via CLI and then delete the domain
domainName := "edge-integration-test-2"
domainHref := uuid.MustParse("0190360e-c33e-73d3-a666-591cd2730da9")

c, err := pulp.NewPulpServiceDefaultDomain(ctx)
if err != nil {
panic(err)
}

_, err = c.DomainsRead(ctx, domainName, domainHref)
if err != nil {
createdDomain, err := c.DomainsCreate(ctx, domainName)
if err != nil {
panic(err)
}
fmt.Println("Created domain:", pulp.ScanUUID(*createdDomain.PulpHref), ", please update the domainHref in the test source!")
return
}

c, err = pulp.NewPulpServiceWithDomain(ctx, domainName)
if err != nil {
panic(err)
}

// nolint: gocritic
if len(os.Args) > 1 && os.Args[1] == "domain_list" {
domainList(ctx, c)
} else if len(os.Args) > 3 && os.Args[1] == "fixture_create" {
fixtureCreate(ctx, c, os.Args[2], os.Args[3])
} else {
fmt.Println("Usage:")
fmt.Println("cli domain_list: list all domains")
fmt.Println("cli fixture_create org_id tar_file: create a fixture test repo")
}
}
70 changes: 64 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ type EdgeConfig struct {
RbacTimeout uint `mapstructure:"rbac_timeout,omitempty"`
SubscriptionServerURL string `json:"subscription_server_url"`
SubscriptionBaseUrl string `json:"subscription_base_url"`
PulpURL string `json:"pulp_url,omitempty"`
PulpUsername string `json:"pulp_username,omitempty"`
PulpPassword string `json:"pulp_password,omitempty"`
PulpIdentityName string `json:"pulp_identity_name,omitempty"`
PulpProxyURL string `json:"pulp_proxy_url,omitempty"`
PulpOauth2URL string `json:"pulp_oauth2_url,omitempty"`
PulpOauth2ClientID string `json:"pulp_oauth2_client_id,omitempty"`
PulpOauth2ClientSecret string `json:"pulp_oauth2_client_secret,omitempty"`
PulpS3BucketName string `json:"pulp_s3_bucket_name,omitempty"`
PulpS3Region string `json:"pulp_s3_region,omitempty"`
PulpS3SecretKey string `json:"pulp_s3_secret_key,omitempty"`
PulpS3AccessKey string `json:"pulp_s3_access_key,omitempty"`
}

type dbConfig struct {
Expand Down Expand Up @@ -170,6 +182,18 @@ func CreateEdgeAPIConfig() (*EdgeConfig, error) {
options.SetDefault("DeleteFilesRetryDelay", 5)
options.SetDefault("RBAC_BASE_URL", "http://rbac-service:8080")
options.SetDefault("RbacTimeout", 30)
options.SetDefault("PulpURL", "http://pulp-service:8080")
options.SetDefault("PulpUsername", "edge-api-dev")
options.SetDefault("PulpPassword", "")
options.SetDefault("PulpIdentityName", "edge-api-dev")
options.SetDefault("PulpProxyURL", "")
options.SetDefault("PulpOauth2URL", "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token")
options.SetDefault("PulpOauth2ClientID", "")
options.SetDefault("PulpOauth2ClientSecret", "")
options.SetDefault("PulpS3BucketName", "")
options.SetDefault("PulpS3Region", "DummyRegion")
options.SetDefault("PulpS3SecretKey", "")
options.SetDefault("PulpS3AccessKey", "")
options.AutomaticEnv()

if options.GetBool("Debug") {
Expand Down Expand Up @@ -270,6 +294,18 @@ func CreateEdgeAPIConfig() (*EdgeConfig, error) {
RbacTimeout: options.GetUint("RbacTimeout"),
SubscriptionServerURL: options.GetString("SUBSCRIPTION_SERVER_URL"),
SubscriptionBaseUrl: options.GetString("SUBSCRIPTION_BASE_URL"),
PulpURL: options.GetString("PulpURL"),
PulpUsername: options.GetString("PulpUsername"),
PulpPassword: options.GetString("PulpPassword"),
PulpIdentityName: options.GetString("PulpIdentityName"),
PulpProxyURL: options.GetString("PulpProxyURL"),
PulpOauth2URL: options.GetString("PulpOauth2URL"),
PulpOauth2ClientID: options.GetString("PulpOauth2ClientID"),
PulpOauth2ClientSecret: options.GetString("PulpOauth2ClientSecret"),
PulpS3BucketName: options.GetString("PulpS3BucketName"),
PulpS3Region: options.GetString("PulpS3Region"),
PulpS3SecretKey: options.GetString("PulpS3SecretKey"),
PulpS3AccessKey: options.GetString("PulpS3AccessKey"),
}
if edgeConfig.TenantTranslatorHost != "" && edgeConfig.TenantTranslatorPort != "" {
edgeConfig.TenantTranslatorURL = fmt.Sprintf("http://%s:%s", edgeConfig.TenantTranslatorHost, edgeConfig.TenantTranslatorPort)
Expand Down Expand Up @@ -311,14 +347,36 @@ func CreateEdgeAPIConfig() (*EdgeConfig, error) {
Type: "pgsql",
}

bucket := clowder.ObjectBuckets[edgeConfig.BucketName]
// S3: Tarball bucket
bucket, ok := clowder.ObjectBuckets[edgeConfig.BucketName]
if ok {
edgeConfig.BucketName = bucket.RequestedName
if bucket.Region != nil {
edgeConfig.BucketRegion = *bucket.Region
}
if bucket.AccessKey != nil {
edgeConfig.AccessKey = *bucket.AccessKey
}
if bucket.SecretKey != nil {
edgeConfig.SecretKey = *bucket.SecretKey
}
}

edgeConfig.BucketName = bucket.RequestedName
if bucket.Region != nil {
edgeConfig.BucketRegion = *bucket.Region
// S3: Pulp bucket
bucket, ok = clowder.ObjectBuckets["edge-central-pulp-s3"]
if ok {
edgeConfig.PulpS3BucketName = bucket.Name
if bucket.Region != nil {
edgeConfig.PulpS3Region = *bucket.Region
}
if bucket.SecretKey != nil {
edgeConfig.PulpS3SecretKey = *bucket.SecretKey
}
if bucket.AccessKey != nil {
edgeConfig.PulpS3AccessKey = *bucket.AccessKey
}
}
edgeConfig.AccessKey = *bucket.AccessKey
edgeConfig.SecretKey = *bucket.SecretKey

edgeConfig.Logging = &loggingConfig{
AccessKeyID: cfg.Logging.Cloudwatch.AccessKeyId,
SecretAccessKey: cfg.Logging.Cloudwatch.SecretAccessKey,
Expand Down
7 changes: 7 additions & 0 deletions fixtures/small_repo/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ostree --repo=repo init --mode archive
mkdir tree
echo "Hello world!" > tree/hello.txt
ostree --repo=repo commit --branch=foo tree/
tar cvf small_commit1.tar repo/
echo "Hello again!" > tree/hello2.txt
ostree --repo=repo commit --branch=foo tree/
Binary file added fixtures/small_repo/small_commit1.tar
Binary file not shown.
Binary file added fixtures/small_repo/small_commit2.tar
Binary file not shown.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
github.com/knqyf263/go-rpm-version v0.0.0-20170716094938-74609b86c936
github.com/lib/pq v1.10.9
github.com/magiconair/properties v1.8.7
github.com/oapi-codegen/runtime v1.1.1
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.33.1
github.com/prometheus/client_golang v1.19.1
Expand All @@ -26,13 +27,15 @@ require (
github.com/spf13/viper v1.18.1
github.com/stretchr/testify v1.8.4
go.openly.dev/pointy v1.3.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
gorm.io/driver/postgres v1.5.4
gorm.io/driver/sqlite v1.5.4
gorm.io/gorm v1.25.6
)

require (
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand Down Expand Up @@ -81,7 +84,6 @@ require (
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.19.0 // indirect
Expand Down
15 changes: 14 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/Unleash/unleash-client-go/v4 v4.1.1 h1:2qa/hxj7AApuA/E3MvxawiTbghu3smJV4C9ia7QP538=
github.com/Unleash/unleash-client-go/v4 v4.1.1/go.mod h1:gUbLOk661ZfMpFDDHkW6rduDW/7Ru8uZHfXJDjQUs2s=
github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu1fXES56uXniYFv4yDA=
Expand All @@ -736,12 +737,15 @@ github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0I
github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI=
github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg=
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.54.8 h1:+soIjaRsuXfEJ9ts9poJD2fIIzSSRwfx+T69DrTtL2M=
github.com/aws/aws-sdk-go v1.54.8/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/bxcodec/faker/v3 v3.8.1 h1:qO/Xq19V6uHt2xujwpaetgKhraGCapqY2CRWGD/SqcM=
Expand Down Expand Up @@ -820,6 +824,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U=
github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-openapi/analysis v0.21.5 h1:3tHfEBh6Ia8eKc4M7khOGjPOAlWKJ10d877Cr9teujI=
github.com/go-openapi/analysis v0.21.5/go.mod h1:25YcZosX9Lwz2wBsrFrrsL8bmjjXdlyP6zsr2AMy29M=
Expand Down Expand Up @@ -998,9 +1003,12 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/juju/qthttptest v0.1.1/go.mod h1:aTlAv8TYaflIiTDIQYzxnl1QdPjAg8Q8qJMErpKy6A4=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
Expand Down Expand Up @@ -1052,15 +1060,19 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
github.com/nrwiersma/avro-benchmarks v0.0.0-20210913175520-21aec48c8f76/go.mod h1:iKyFMidsk/sVYONJRE372sJuX/QTRPacU7imPqqsu7g=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro=
github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down Expand Up @@ -1137,6 +1149,7 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.18.1 h1:rmuU42rScKWlhhJDyXZRKJQHXFX02chSVW1IvkPGiVM=
github.com/spf13/viper v1.18.1/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
Expand All @@ -1160,7 +1173,7 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg=
github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
Expand Down
2 changes: 2 additions & 0 deletions logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func InitLogger(writer io.Writer) {
cfg := config.Get()

switch cfg.LogLevel {
case "TRACE":
logLevel = log.TraceLevel
case "DEBUG":
logLevel = log.DebugLevel
case "ERROR":
Expand Down
Loading

0 comments on commit 7c6e76f

Please sign in to comment.