Documentation ¶
Index ¶
- Constants
- func GVR(resource string) schema.GroupVersionResource
- func GetRulesFromProfile(obj *unstructured.Unstructured) ([]string, error)
- func GetScanNamesFromSuite(obj *unstructured.Unstructured) ([]string, error)
- func PersistObjectToYaml(name string, obj *unstructured.Unstructured, w io.Writer, ...) error
- func PersistObjectToYamlFile(fileNameBase string, obj *unstructured.Unstructured, outputDir string, ...) (string, error)
- type CommandContext
- type ComplianceType
- type KubeClientUser
- type ObjectHelper
- type ObjectReference
Constants ¶
View Source
const ( CmpAPIGroup = "compliance.openshift.io" CmpResourceVersion = "v1alpha1" RetryInterval = time.Second * 2 Timeout = time.Minute * 20 )
Variables ¶
This section is empty.
Functions ¶
func GVR ¶
func GVR(resource string) schema.GroupVersionResource
func GetRulesFromProfile ¶
func GetRulesFromProfile(obj *unstructured.Unstructured) ([]string, error)
func GetScanNamesFromSuite ¶
func GetScanNamesFromSuite(obj *unstructured.Unstructured) ([]string, error)
GetScanNamesFromSuite gets the scan names used in a ComplianceSuite
func PersistObjectToYaml ¶
func PersistObjectToYaml(name string, obj *unstructured.Unstructured, w io.Writer, serializer *k8sserial.Serializer) error
func PersistObjectToYamlFile ¶
func PersistObjectToYamlFile(fileNameBase string, obj *unstructured.Unstructured, outputDir string, serializer *k8sserial.Serializer) (string, error)
PersistObjectToYamlFile persists the given object to a yaml file in the given path
Types ¶
type CommandContext ¶
type CommandContext struct { ConfigFlags *genericclioptions.ConfigFlags Kuser KubeClientUser Helper ObjectHelper Args []string genericclioptions.IOStreams }
type ComplianceType ¶
type ComplianceType int
const ( ComplianceScan ComplianceType = iota ComplianceSuite ComplianceRemediation ScanSettingBinding Profile TailoredProfile Rule ComplianceCheckResult TypeUnknown )
func GetValidObjType ¶
func GetValidObjType(rawtype string) (ComplianceType, error)
type KubeClientUser ¶
type KubeClientUser interface { DynamicClient() dynamic.Interface Clientset() kubernetes.Interface GetConfig() *rest.Config GetNamespace() string }
KubeClientUser is an interface to use kubeclients on a specific namespace
func NewKubeClientUser ¶
func NewKubeClientUser(cfgflags *genericclioptions.ConfigFlags, ns string) (KubeClientUser, error)
type ObjectHelper ¶
type ObjectHelper interface {
Handle() error
}
ObjectHelper is a generic interface to implement actions that are to be executed on an object
type ObjectReference ¶
type ObjectReference struct { Type ComplianceType Name string }
func ValidateManyObjectArgs ¶
func ValidateManyObjectArgs(args []string) ([]ObjectReference, error)
func ValidateObjectArgs ¶
func ValidateObjectArgs(args []string) (objref ObjectReference, err error)
Click to show internal directories.
Click to hide internal directories.