utils

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 15 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

This section is empty.

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 DiffRemediationList added in v0.1.6

func DiffRemediationList(oldList, newList []*compv1alpha1.ComplianceRemediation) bool

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

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 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 ParseRemediationFromContentAndResults

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

ParseRemediationFromContentAndResults parses the content DS and the results from the scan, and generates the necessary remediations

Types

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