Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Mar 20, 2024
1 parent 7bb91c7 commit d783241
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 43 deletions.
8 changes: 4 additions & 4 deletions cli/internal/cmd/configfetchmeasurements.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ package cmd

import (
"context"
"encoding/hex"
"errors"
"fmt"
"net/http"
"net/url"
"time"
"encoding/hex"

"github.com/edgelesssys/constellation/v2/internal/api/attestationconfigapi"
"github.com/edgelesssys/constellation/v2/internal/api/versionsapi"
Expand Down Expand Up @@ -105,8 +105,8 @@ func runConfigFetchMeasurements(cmd *cobra.Command, _ []string) error {
if err := cfm.flags.parse(cmd.Flags()); err != nil {
return fmt.Errorf("parsing flags: %w", err)
}
cfm.log.Debug(fmt.Sprintf(
`Using flags:
cfm.log.Debug(fmt.Sprintf(
`Using flags:
insecure: %t
measurements-url: %q
signature-url: %q
Expand Down Expand Up @@ -158,7 +158,7 @@ func (cfm *configFetchMeasurementsCmd) configFetchMeasurements(
return fmt.Errorf("fetching and verifying measurements: %w", err)
}
}
measurementsToPrint := "";
measurementsToPrint := ""
for i, measurement := range fetchedMeasurements {
measurementsToPrint += fmt.Sprintf("\t%d: 0x%s\n", i, hex.EncodeToString(measurement.Expected))
}
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/cmd/configgenerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func runConfigGenerate(cmd *cobra.Command, args []string) error {
if err := cg.flags.parse(cmd.Flags()); err != nil {
return fmt.Errorf("parsing flags: %w", err)
}
log.Debug(fmt.Sprintf(
`Parsed flags:
log.Debug(fmt.Sprintf(
`Parsed flags:
kubernetes: %q
attestation: %q
`, cg.flags.k8sVersion, cg.flags.attestationVariant))
Expand Down
4 changes: 2 additions & 2 deletions cli/internal/cmd/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ func runRecover(cmd *cobra.Command, _ []string) error {
return err
}
r.log.Debug(fmt.Sprintf(
`Using flags:
`Using flags:
debug: %t
endpoint: %q
force: %t`,
r.flags.debug, r.flags.endpoint, r.flags.force))
r.flags.debug, r.flags.endpoint, r.flags.force))
return r.recover(cmd, fileHandler, 5*time.Second, &recoverDoer{log: r.log}, newDialer)
}

Expand Down
4 changes: 2 additions & 2 deletions cli/internal/cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ func runVerify(cmd *cobra.Command, _ []string) error {
return err
}
v.log.Debug(fmt.Sprintf(
`Using flags:
`Using flags:
cluster-id: %q
node-endpoint: %q
owner-id: %q`,
v.flags.clusterID, v.flags.endpoint, v.flags.ownerID))
v.flags.clusterID, v.flags.endpoint, v.flags.ownerID))
fetcher := attestationconfigapi.NewFetcher()
return v.verify(cmd, verifyClient, formatterFactory, fetcher)
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/malicious-join/malicious-join.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (j *maliciousJoiner) join(ctx context.Context) (*joinproto.IssueJoinTicketR
}
res, err := protoClient.IssueJoinTicket(ctx, req)
j.logger.Debug(fmt.Sprintf(
`Got join ticket response:
`Got join ticket response:
ApiServerEndpoint: %q
KubernetesVersion: %q
`, res.ApiServerEndpoint, res.KubernetesVersion))
Expand Down
2 changes: 1 addition & 1 deletion hack/bazel-deps-mirror/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func runCheck(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
mirror: %t
mirror-unauthenticated: %t
`, flags.mirror, flags.mirrorUnauthenticated))
Expand Down
4 changes: 2 additions & 2 deletions hack/bazel-deps-mirror/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func runFix(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
unauthenticated: %t
dry-run: %t`,
flags.unauthenticated, flags.dryRun))
flags.unauthenticated, flags.dryRun))

fileHelper, err := bazelfiles.New()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion hack/bazel-deps-mirror/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func runUpgrade(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
unauthenticated: %t
dry-run: %t
`, flags.unauthenticated, flags.dryRun))
Expand Down
4 changes: 2 additions & 2 deletions hack/oci-pin/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ func runCodegen(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
identifier: %q
repoimage-tag-file: %q
oci-path: %q
package: %q`,
flags.identifier, flags.imageRepoTag, flags.ociPath, flags.pkg))
flags.identifier, flags.imageRepoTag, flags.ociPath, flags.pkg))

registry, prefix, name, tag, err := splitRepoTag(flags.imageRepoTag)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion hack/oci-pin/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func runMerge(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
input: %v
output: %q
verbose: %q
Expand Down
4 changes: 2 additions & 2 deletions hack/oci-pin/sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func runSum(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
image-repo-tag: %q
oci-path: %q`,
flags.imageRepoTag, flags.ociPath))
flags.imageRepoTag, flags.ociPath))

registry, prefix, name, tag, err := splitRepoTag(flags.imageRepoTag)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion image/upload/internal/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func runInfo(cmd *cobra.Command, args []string) error {

log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
region: %q
bucket: %q
distribution-id: %q
Expand Down
2 changes: 1 addition & 1 deletion image/upload/internal/cmd/measurementsenvelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func runEnvelopeMeasurements(cmd *cobra.Command, _ []string) error {

log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
version: %q
csp: %q
attestation-variant: %q
Expand Down
4 changes: 2 additions & 2 deletions image/upload/internal/cmd/measurementsmerge.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func runMergeMeasurements(cmd *cobra.Command, args []string) error {
}

log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
log.Debug(fmt.Sprintf(
`Parsed flags:
out: %q
verbose: %q`, flags.out, flags.logLevel))

Expand Down
6 changes: 3 additions & 3 deletions image/upload/internal/cmd/measurementsupload.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ func runMeasurementsUpload(cmd *cobra.Command, _ []string) error {

log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
measurements: %q
signature: %q
region: %q
bucket: %q
distribution-id: %q
`, flags.measurementsPath, flags.signaturePath, flags.region,
flags.bucket, flags.distributionID))
`, flags.measurementsPath, flags.signaturePath, flags.region,
flags.bucket, flags.distributionID))

uploadC, uploadCClose, err := measurementsuploader.New(cmd.Context(), flags.region, flags.bucket, flags.distributionID, log)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions image/upload/internal/cmd/uplosi.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func runUplosi(cmd *cobra.Command, _ []string) error {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
raw-image: %q
attestation-variant: %q
csp: %q
Expand All @@ -69,7 +69,7 @@ func runUplosi(cmd *cobra.Command, _ []string) error {
bucket: %q
distribution-id: %q
`, flags.rawImage, flags.attestationVariant, flags.provider, flags.version.Version(), flags.region,
flags.bucket, flags.distributionID))
flags.bucket, flags.distributionID))

archiveC, archiveCClose, err := archive.New(cmd.Context(), flags.region, flags.bucket, flags.distributionID, log)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/api/versionsapi/cli/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ func runAdd(cmd *cobra.Command, _ []string) (retErr error) {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
dryrun: %t
kind: %q
latest: %t
ref: %q
release: %t
stream: %q
version: %q`,
flags.dryRun, flags.kind, flags.latest, flags.ref,
flags.release, flags.stream, flags.version))
flags.dryRun, flags.kind, flags.latest, flags.ref,
flags.release, flags.stream, flags.version))

log.Debug("Validating flags")
if err := flags.validate(log); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/versionsapi/cli/latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func runLatest(cmd *cobra.Command, _ []string) (retErr error) {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
ref: %q
stream: %q
json: %t
Expand Down
6 changes: 3 additions & 3 deletions internal/api/versionsapi/cli/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func runList(cmd *cobra.Command, _ []string) (retErr error) {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
bucket: %q
distribution-id: %q
json: %t
Expand All @@ -54,8 +54,8 @@ func runList(cmd *cobra.Command, _ []string) (retErr error) {
ref: %q
region: %q
stream: %q`,
flags.bucket, flags.distributionID, flags.json, flags.logLevel, flags.minorVersion,
flags.ref, flags.region, flags.stream))
flags.bucket, flags.distributionID, flags.json, flags.logLevel, flags.minorVersion,
flags.ref, flags.region, flags.stream))

log.Debug("Validating flags")
if err := flags.validate(); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions internal/api/versionsapi/cli/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func runRemove(cmd *cobra.Command, _ []string) (retErr error) {
}
log := logger.NewTextLogger(flags.logLevel)
log.Debug(fmt.Sprintf(
`Parsed flags:
`Parsed flags:
all: %t
az-location: %q
az-resource-group: %q
Expand All @@ -90,9 +90,9 @@ func runRemove(cmd *cobra.Command, _ []string) (retErr error) {
stream: %q
version: %q
version-path: %q`,
flags.all, flags.azLocation, flags.azResourceGroup, flags.azSubscription,
flags.bucket, flags.distributionID, flags.dryrun, flags.gcpProject,
flags.ref, flags.region, flags.stream, flags.version, flags.versionPath))
flags.all, flags.azLocation, flags.azResourceGroup, flags.azSubscription,
flags.bucket, flags.distributionID, flags.dryrun, flags.gcpProject,
flags.ref, flags.region, flags.stream, flags.version, flags.versionPath))

log.Debug("Validating flags")
if err := flags.validate(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/constellation/applyinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func (a *Applier) Init(
}

// Perform the RPC
a.log.Debug(fmt.Sprintf(
`Making initialization call, doer has the following parameters:
a.log.Debug(fmt.Sprintf(
`Making initialization call, doer has the following parameters:
endpoint: %q
req.KmsUri: %q
req.StorageUri: %q
Expand Down
2 changes: 1 addition & 1 deletion joinservice/internal/watcher/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"context"
"crypto/x509"
"encoding/asn1"
"encoding/hex"
"fmt"
"log/slog"
"path/filepath"
"sync"
"encoding/hex"

"github.com/edgelesssys/constellation/v2/internal/atls"
"github.com/edgelesssys/constellation/v2/internal/attestation/choose"
Expand Down

0 comments on commit d783241

Please sign in to comment.