Skip to content

Commit

Permalink
Merge branch 'move-oci-lib-out' of github.com:defenseunicorns/zarf in…
Browse files Browse the repository at this point in the history
…to move-oci-lib-out
  • Loading branch information
AustinAbro321 committed Feb 29, 2024
2 parents 9d70650 + 30ecbe6 commit f967713
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cmd/tools/helm/load_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func addPluginCommands(plugin *plugin.Plugin, baseCmd *cobra.Command, cmds *plug

// Recursively add any sub-commands
for _, cmd := range cmds.Commands {
cmdCopy := cmd
// Create a fake command so that completion can be done for the sub-commands of the plugin
subCmd := &cobra.Command{
// This prevents Cobra from removing the flags. We want to keep the flags to pass them
Expand All @@ -308,7 +309,7 @@ func addPluginCommands(plugin *plugin.Plugin, baseCmd *cobra.Command, cmds *plug
Run: func(_ *cobra.Command, _ []string) {},
}
baseCmd.AddCommand(subCmd)
addPluginCommands(plugin, subCmd, &cmd)
addPluginCommands(plugin, subCmd, &cmdCopy)
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/pkg/cluster/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func (c *Cluster) InitZarfState(initOptions types.ZarfInitOptions) error {
}
// This label will tell the Zarf Agent to ignore this namespace.
namespace.Labels[agentLabel] = "ignore"
if _, err = c.UpdateNamespace(&namespace); err != nil {
namespaceCopy := namespace
if _, err = c.UpdateNamespace(&namespaceCopy); err != nil {
// This is not a hard failure, but we should log it.
message.WarnErrf(err, "Unable to mark the namespace %s as ignored by Zarf Agent", namespace.Name)
}
Expand Down
3 changes: 2 additions & 1 deletion src/pkg/cluster/zarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ func (c *Cluster) StripZarfLabelsAndSecretsFromNamespaces() {
if _, ok := namespace.Labels[agentLabel]; ok {
spinner.Updatef("Removing Zarf Agent label for namespace %s", namespace.Name)
delete(namespace.Labels, agentLabel)
if _, err = c.UpdateNamespace(&namespace); err != nil {
namespaceCopy := namespace
if _, err = c.UpdateNamespace(&namespaceCopy); err != nil {
// This is not a hard failure, but we should log it
spinner.Errorf(err, "Unable to update the namespace labels for %s", namespace.Name)
}
Expand Down

0 comments on commit f967713

Please sign in to comment.