delete

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeleteCmd = &cobra.Command{
	Use:   "delete",
	Short: "Delete Aperture Policies",
	Long: `
Use this command to delete the Aperture Policies.`,
	SilenceErrors: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		if policyName == "" {
			return errors.New("policy name is required")
		}

		var err error
		kubeRestConfig, err = utils.GetKubeConfig(kubeConfig)
		if err != nil {
			return err
		}

		controllerNs, err = cmd.Flags().GetString("controller-ns")
		if err != nil {
			return err
		}

		controllerAddr, err := cmd.Flags().GetString("controller")
		if err != nil {
			return err
		}

		kube, err := cmd.Flags().GetBool("kube")
		if err != nil {
			return err
		}

		if controllerAddr == "" && !kube {
			err = cmd.Flags().Set("kube", "true")
			if err != nil {
				return err
			}
		}

		err = controller.PreRunE(cmd, args)
		if err != nil {
			return err
		}

		client, err = controller.Client()
		if err != nil {
			return err
		}
		return nil
	},
	PersistentPostRun: controller.PostRun,
}

DeleteCmd is the command to delete a policy from the cluster.

View Source
var DeletePolicyCmd = &cobra.Command{
	Use:           "policy",
	Short:         "Delete Aperture Policy from the cluster",
	Long:          `Use this command to delete the Aperture Policy from the cluster.`,
	SilenceErrors: true,
	Example:       `aperturectl delete policy --policy=static-rate-limiting`,
	RunE: func(_ *cobra.Command, _ []string) error {
		return deletePolicy()
	},
}

DeletePolicyCmd is the command to apply a policy to the cluster.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL