mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-04-23 00:29:12 -04:00
tidy
This commit is contained in:
parent
a25dfbd81e
commit
0ab2947c29
@ -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"
|
||||
@ -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
|
||||
@ -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))
|
||||
}
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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))
|
||||
|
@ -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))
|
||||
|
@ -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 {
|
||||
|
@ -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))
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
@ -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 {
|
||||
|
@ -54,7 +54,7 @@ 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
|
||||
@ -62,8 +62,8 @@ func runAdd(cmd *cobra.Command, _ []string) (retErr error) {
|
||||
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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
@ -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 {
|
||||
|
@ -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
|
||||
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user