Skip to content

Commit

Permalink
address linter and adds comments
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Feb 20, 2024
1 parent f986000 commit bb45994
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (

var rootCmd = &cobra.Command{
Use: "uds COMMAND",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
// Skip for vendor-only commands
if common.CheckVendorOnlyFromPath(cmd) {
return
Expand All @@ -46,7 +46,7 @@ var rootCmd = &cobra.Command{
cliSetup()
},
Short: lang.RootCmdShort,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
_, _ = fmt.Fprintln(os.Stderr)
err := cmd.Help()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/uds.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var createCmd = &cobra.Command{
Aliases: []string{"c"},
Args: cobra.MaximumNArgs(1),
Short: lang.CmdBundleCreateShort,
PreRun: func(cmd *cobra.Command, args []string) {
PreRun: func(_ *cobra.Command, args []string) {
pathToBundleFile := ""
if len(args) > 0 {
if !zarfUtils.IsDir(args[0]) {
Expand All @@ -44,7 +44,7 @@ var createCmd = &cobra.Command{
message.Fatalf(err, "Neither %s or %s found", config.BundleYAML, bundleYml)
}
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, args []string) {
srcDir, err := os.Getwd()
if err != nil {
message.Fatalf(err, "error reading the current working directory")
Expand All @@ -69,7 +69,7 @@ var deployCmd = &cobra.Command{
Aliases: []string{"d"},
Short: lang.CmdBundleDeployShort,
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, args []string) {
bundleCfg.DeployOpts.Source = chooseBundle(args)
configureZarf()

Expand Down
4 changes: 3 additions & 1 deletion src/pkg/bundler/pusher/remote.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023-Present The UDS Authors

// Package pusher contains functionality to push Zarf pkgs to remote bundles
package pusher

import (
Expand All @@ -23,6 +24,7 @@ type RemotePusher struct {
cfg Config
}

// Config contains the configuration for the remote pusher
type Config struct {
PkgRootManifest *oci.ZarfOCIManifest
RemoteSrc *oci.OrasRemote
Expand Down Expand Up @@ -81,7 +83,7 @@ func (p *RemotePusher) PushManifest() (ocispec.Descriptor, error) {
return zarfManifestDesc, nil
}

// todo: what does this fn return?
// LayersToRemoteBundle pushes the Zarf pkg's layers to a remote bundle
func (p *RemotePusher) LayersToRemoteBundle(spinner *message.Spinner, currentPackageIter int, totalPackages int) ([]ocispec.Descriptor, error) {
spinner.Updatef("Fetching %s package layer metadata (package %d of %d)", p.pkg.Name, currentPackageIter, totalPackages)
// get only the layers that are required by the components
Expand Down
2 changes: 2 additions & 0 deletions src/test/e2e/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ func TestBundleTmpDir(t *testing.T) {
done := make(chan bool)
// Channel to receive errors
errCh := make(chan error)

// Watch for file creation in the temporary directory
go func() {
for {
select {
Expand Down

0 comments on commit bb45994

Please sign in to comment.