Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/cluster/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ func NewCmdCluster(streams genericclioptions.IOStreams, client *k8s.LazyClient,
clusterCmd.AddCommand(newCmdResync())
clusterCmd.AddCommand(newCmdContext())
clusterCmd.AddCommand(newCmdTransferOwner(streams, globalOpts))
clusterCmd.AddCommand(newCmdPullSecret(streams, globalOpts))
clusterCmd.AddCommand(newCmdReplacePullSecretDeprecated(streams, globalOpts))
clusterCmd.AddCommand(access.NewCmdAccess(streams, client))
clusterCmd.AddCommand(newCmdCpd())
clusterCmd.AddCommand(newCmdCheckBannedUser())
clusterCmd.AddCommand(newCmdValidatePullSecret())
clusterCmd.AddCommand(newCmdValidatePullSecretExt())
clusterCmd.AddCommand(newCmdValidatePullSecretExtDeprecated())
clusterCmd.AddCommand(newCmdEtcdHealthCheck())
clusterCmd.AddCommand(newCmdEtcdMemberReplacement())
clusterCmd.AddCommand(newCmdFromInfraId(globalOpts))
Expand Down
37 changes: 37 additions & 0 deletions cmd/cluster/pullsecret.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package cluster

import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/openshift/osdctl/internal/utils/globalflags"
)

func newCmdPullSecret(streams genericclioptions.IOStreams, globalOpts *globalflags.GlobalOptions) *cobra.Command {
cmd := &cobra.Command{
Use: "pull-secret",
Short: "Diagnose and manage cluster pull secrets",
Long: "Diagnose and manage cluster pull secrets.",
DisableAutoGenTag: true,
}

cmd.AddCommand(newCmdPullSecretAudit(streams, globalOpts))
cmd.AddCommand(newCmdPullSecretUpdate(streams, globalOpts))
cmd.AddCommand(newCmdPullSecretValidate())

return cmd
}

func newCmdPullSecretValidate() *cobra.Command {
cmd := newCmdValidatePullSecretExt()
cmd.Use = "validate"
cmd.Example = ` # Compare OCM Access-Token, OCM Registry-Credentials, and OCM Account Email against cluster's pull secret
osdctl cluster pull-secret validate --cluster-id ${CLUSTER_ID} --reason "OSD-XYZ"

# Exclude Access-Token, and Registry-Credential checks...
osdctl cluster pull-secret validate --cluster-id ${CLUSTER_ID} --reason "OSD-XYZ" --skip-access-token --skip-registry-creds

# Skip sending service logs (useful for testing)
osdctl cluster pull-secret validate --cluster-id ${CLUSTER_ID} --reason "OSD-XYZ" --skip-service-logs`
return cmd
}
Loading