utils

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright © 2020 Red Hat Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	LOG_COLLECTOR = iota
	OPENSCAP
	RESULT_SERVER
	AGGREGATOR
	API_RESOURCE_COLLECTOR
	OPERATOR
)

Variables

This section is empty.

Functions

func AnyMcfgPoolLabelMatches added in v0.1.6

func AnyMcfgPoolLabelMatches(nodeSelector map[string]string, poolList *mcfgv1.MachineConfigPoolList) bool

AnyMcfgPoolLabelMatches verifies if the given nodeSelector matches the nodeSelector in any of the given MachineConfigPools

func ComplianceOperatorRootCA

func ComplianceOperatorRootCA(certname string, expire int) ([]byte, []byte, error)

func DNSLengthName added in v0.1.9

func DNSLengthName(hashPrefix string, format string, a ...interface{}) string

func DiffRemediationList added in v0.1.6

func DiffRemediationList(oldList, newList []*ParseResult) bool

returns true if the lists are the same, false if they differ

func GetComponentImage added in v0.1.9

func GetComponentImage(component ComplianceComponent) string

GetComponentImage returns a full image pull spec for a given component based on the component type

func GetFirstNodeRole

func GetFirstNodeRole(nodeSelector map[string]string) string

func GetFirstNodeRoleLabel

func GetFirstNodeRoleLabel(nodeSelector map[string]string) string

func GetNodeRoleSelector

func GetNodeRoleSelector(role string) map[string]string

func IsMachineConfig added in v0.1.9

func IsMachineConfig(obj *unstructured.Unstructured) bool

IsMachineConfig checks if the specified object is a MachineConfig object

func LengthName added in v0.1.9

func LengthName(maxLen int, hashPrefix string, format string, a ...interface{}) (string, error)

LengthName creates a string of maximum defined length.

func McfgPoolLabelMatches added in v0.1.6

func McfgPoolLabelMatches(nodeSelector map[string]string, pool *mcfgv1.MachineConfigPool) bool

McfgPoolLabelMatches verifies if the given nodeSelector matches the given MachineConfigPool's nodeSelector

func NewClientCert

func NewClientCert(caCert, caKey []byte, certname string, expire int) ([]byte, []byte, error)

func NewServerCert

func NewServerCert(caCert, caKey []byte, certname string, expire int) ([]byte, []byte, error)

func ParseMachineConfig added in v0.1.9

ParseMachineConfig parses a Machineconfig object from an unstructured object for a specific remediation.

Types

type ComplianceComponent added in v0.1.9

type ComplianceComponent uint

type ParseResult added in v0.1.9

type ParseResult struct {
	CheckResult *compv1alpha1.ComplianceCheckResult
	Remediation *compv1alpha1.ComplianceRemediation
}

func ParseResultsFromContentAndXccdf added in v0.1.9

func ParseResultsFromContentAndXccdf(scheme *runtime.Scheme, scanName string, namespace string,
	dsDom *XMLDocument, resultsReader io.Reader) ([]*ParseResult, error)

type XMLDocument

type XMLDocument struct {
	*xmldom.Document
}

XMLDocument is a wrapper that keeps the interface XML-parser-agnostic

func ParseContent

func ParseContent(dsReader io.Reader) (*XMLDocument, error)

ParseContent parses the DataStream and returns the XML document

Jump to

Keyboard shortcuts

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