
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr   " S S	\R                  \R                  \
R                  5      rg
)z.Manages content bundles for Policy Controller.    )absolute_import)division)unicode_literals)base)command)contentc                   <    \ rS rSrSrSrSr\S 5       rS r	S r
Srg)	Set   a  Sets bundle installation for Policy Controller content.

Google-defined policy bundles of constraints can be installed onto Policy
Controller installations.

The namespace exclusion flag (`--exempted-namespaces`) will specify a set of
namespaces that the installed bundle will ignore. Subsequent calls with the
same bundle name and this flag will overwrite what namespaces are being
ignored. Using `--no-exempted-namespaces` or specifying no namespaces with
`--exempted-namespaces` will remove all namespaces from the ignore list.

To uninstall a bundle, use the `remove` command.

## EXAMPLES

To install a policy bundle:

  $ {command} cis-k8s-v1.5.1

To install a policy bundle, while ignoring (exempting) certain namespaces from
being affected by the bundle:

  $ {command} cis-k8s-v1.5.1
      --exempted-namespaces=kube-system,gatekeeper-system

To remove all exempted namespaces from a particular bundles ignore list:

  $ {command} cis-k8s-v1.5.1 --no-exempted-namespaces
policycontrollerc                     [         R                  " US5      nUR                  5         UR                  5         UR	                  [         R
                  SS9  g )Nbundlesz6The constraint bundle to install in Policy Controller.)help)r   Flagsadd_membershipsadd_exempted_namespacesadd_argumentARG_LABEL_BUNDLE)clsparser	cmd_flagss      Clib/surface/container/fleet/policycontroller/content/bundles/set.pyArgsSet.Args<   sI    fi0I%%'
  E      c           	          [         R                  " XR                  5      nU R                  US5      nUR	                  5        VVs0 s H  u  pEX@R                  XR5      _M     nnnU R                  U5      $ s  snnf )NT)r   
FlagParsermessages
path_specsitemsmodifyupdate_specs)selfargsr   specspathsupdated_specss          r   RunSet.RunG   se    mm4FOOD$'EAFOgdT;;q11MO]++ Ps   A7c                     UR                   R                  R                  nUR                  U5      UR                   R                  l        U$ )N)r   policyControllerHubConfigpolicyContentinstall_bundle)r#   specr   policy_contents       r   r!   
Set.modifyM   sG    77EE  	n- 	33A Kr    N)__name__
__module____qualname____firstlineno____doc__feature_namemf_nameclassmethodr   r)   r!   __static_attributes__r2   r   r   r
   r
      s/    < $,' ,r   r
   N)r7   
__future__r   r   r   3googlecloudsdk.command_lib.container.fleet.featuresr   =googlecloudsdk.command_lib.container.fleet.membershipfeaturesmf_base;googlecloudsdk.command_lib.container.fleet.policycontrollerr   r   UpdateCommandPocoCommandr
   r2   r   r   <module>rC      sA    5 &  ' D Y O O:$

g33W5H5H :r   