opa

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OSUpgradeMap = map[string]string{
	"red hat enterprise linux 6": "Red Hat Enterprise Linux 7",
	"centos 7":                   "Red Hat Enterprise Linux 7",
	"centos 8":                   "Red Hat Enterprise Linux 8",
	"centos 9":                   "Red Hat Enterprise Linux 9",
	"amazon linux 2":             "Red Hat Enterprise Linux 8",
}

OSUpgradeMap maps unsupported operating systems to their recommended upgrade targets

Functions

func AddOSUpgradeConcernToVM

func AddOSUpgradeConcernToVM(vm *vsphere.VM, osName string)

AddOSUpgradeConcernToVM adds OS upgrade recommendation concern to a VM if its OS is in the OSUpgradeMap

Types

type PolicyReader

type PolicyReader struct{}

PolicyReader Handle policy discovery and file reading

func NewPolicyReader

func NewPolicyReader() *PolicyReader

func (*PolicyReader) ReadPolicies

func (pr *PolicyReader) ReadPolicies(policiesDir string) (map[string]string, error)

ReadPolicies Read all .rego policy files from the specified directory

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator handles policy compilation and validation

func NewValidator

func NewValidator(policies map[string]string) (*Validator, error)

func NewValidatorFromDir

func NewValidatorFromDir(policiesDir string) (*Validator, error)

func (*Validator) ValidateVM

func (v *Validator) ValidateVM(ctx context.Context, vm vsphere.VM) ([]vsphere.Concern, error)

Jump to

Keyboard shortcuts

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