Documentation ¶
Index ¶
- Constants
- Variables
- func AddToStringSet(set []string, entry string) ([]string, bool)
- func CloneStringList(list []string) []string
- func CloneStringMap(map_ map[string]string) map[string]string
- func DialGRPCInsecure(address string, port int) (*grpc.ClientConn, error)
- func EncodePackage(format string, package_ Package) ([]byte, error)
- func FromKubernetesName(kubernetesName string) (string, error)
- func FromKubernetesNames(kubernetesMap map[string]string) (map[string]string, error)
- func GetApproveAnnotation(resource Resource) (string, bool)
- func GetApprovedAnnotation(resource Resource) (string, bool)
- func GetMergeAnnotation(resource Resource) (string, bool)
- func GetMetadataAnnotation(resource Resource) (string, bool)
- func GetPrepareAnnotation(resource Resource) (string, bool)
- func GetPreparedAnnotation(resource Resource) (string, bool)
- func GetRenameAnnotation(resource Resource) (string, bool)
- func IsApprovedAnnotation(resource Resource) bool
- func IsPreparedAnnotation(resource Resource) bool
- func ParseApiVersion(apiVersion string) (string, string)
- func RemoveFromStringSet(set []string, entry string) ([]string, bool)
- func SecondsToDuration(seconds float64) time.Duration
- func SetApprovedAnnotation(resource Resource, approved bool) bool
- func SetPrepareAnnotation(resource Resource, value string) bool
- func SetPreparedAnnotation(resource Resource, prepared bool) bool
- func StringMapEquals(map1 map[string]string, map2 map[string]string) bool
- func ToKubernetesName(name string) (string, error)
- func ToKubernetesNames(map_ map[string]string) (map[string]string, error)
- func ToMapList(list []any) ([]ard.Map, bool)
- func TriggerToAPI(trigger *GVK) *api.GVK
- func TriggersToAPI(triggers []GVK) []*api.GVK
- func UpdateAnnotationsForMerge(resource Resource)
- type AwxClient
- func (self *AwxClient) Get(path string) (ard.Value, error)
- func (self *AwxClient) InventoryIdFromName(name string) (int64, bool, error)
- func (self *AwxClient) JobTemplateIdFromName(name string) (int64, bool, error)
- func (self *AwxClient) LaunchJob(jobTemplateId int64, inventoryId int64, extraVars map[string]any) (ard.Value, error)
- func (self *AwxClient) ListInventories(query string) (ard.Value, error)
- func (self *AwxClient) ListJobTemplates(query string) (ard.Value, error)
- func (self *AwxClient) ListJobs(query string) (ard.Value, error)
- func (self *AwxClient) Post(path string, body any) (ard.Value, error)
- type AwxError
- type Controller
- type GVK
- func (self GVK) APIVersion() string
- func (self GVK) Equals(gvk GVK) bool
- func (self GVK) Equals3(group string, version string, kind string) bool
- func (self GVK) Is(resource Resource) bool
- func (self GVK) NewResourceIdentifier(name string) ResourceIdentifier
- func (self GVK) ShortString() string
- func (self GVK) String() string
- type Package
- func ClonePackage(package_ Package) Package
- func DecodePackage(format string, content []byte) (Package, error)
- func GetReferentPackage(objectReferences ard.List, package_ Package) (Package, error)
- func MergePackage(package_ Package, mergePackage ...Resource) Package
- func PreparePackageForMerge(package_ Package) Package
- func ReadPackage(format string, reader io.Reader) (Package, error)
- type Resource
- type ResourceIdentifier
- type ResourceIdentifiers
- type TOSCAParser
- type Ticker
Constants ¶
View Source
const ( MetadataAnnotation = "nephio.org/metadata" MetadataAnnotationNever = "Never" MetadataAnnotationHere = "Here" MetadataAnnotationPostpone = "Postpone" MergeAnnotation = "nephio.org/merge" MergeAnnotationReplace = "Replace" MergeAnnotationOverride = "Override" RenameAnnotation = "nephio.org/rename" PrepareAnnotation = "nephio.org/prepare" PrepareAnnotationNever = "Never" PrepareAnnotationHere = "Here" PrepareAnnotationPostpone = "Postpone" ApproveAnnotation = "nephio.org/approve" ApproveAnnotationDefault = "Default" ApproveAnnotationAuto = "Auto" ApproveAnnotationManual = "Manual" PreparedAnnotation = "nephio.org/prepared" ApprovedAnnotation = "nephio.org/approved" AnnotationTrue = "true" )
View Source
const KubernetesNameEscapeRune rune = '-'
View Source
const KubernetesNameMaxLength = 253
Variables ¶
View Source
var DeploymentGVK = NewGVK("deployment.nephio.org", "v1alpha1", "Deployment")
View Source
var DeploymentResourceIdentifier = DeploymentGVK.NewResourceIdentifier("deployment")
View Source
var KubernetesNameAllowedRE = regexp.MustCompile(`[^0-9A-Za-z\.]`)
View Source
var KubernetesNameEscapeString = runeToString(KubernetesNameEscapeRune)
Functions ¶
func CloneStringList ¶
func DialGRPCInsecure ¶
func DialGRPCInsecure(address string, port int) (*grpc.ClientConn, error)
func FromKubernetesName ¶
Converts names created by ToKubernetesName back to their original by unescaping the escape sequences.
Will return an error if an escape sequence is malformed.
func FromKubernetesNames ¶
func GetApproveAnnotation ¶
func GetApprovedAnnotation ¶
func GetMergeAnnotation ¶
func GetMetadataAnnotation ¶
func GetPrepareAnnotation ¶
func GetPreparedAnnotation ¶
func GetRenameAnnotation ¶
func IsApprovedAnnotation ¶
func IsPreparedAnnotation ¶
func ParseApiVersion ¶
func SecondsToDuration ¶
func SetApprovedAnnotation ¶
func SetPrepareAnnotation ¶
func SetPreparedAnnotation ¶
func ToKubernetesName ¶
Converts an arbitrary string into a valid Kubernetes name, if possible. This works by escaping illegal characters using "-" plus the Unicode code in hex, left-padded with spaces to 4 characters.
If the result is longer than is allows (253 characters), returns an error.
func TriggerToAPI ¶
func TriggersToAPI ¶
func UpdateAnnotationsForMerge ¶
func UpdateAnnotationsForMerge(resource Resource)
Types ¶
type AwxClient ¶
type AwxClient struct { Host string Username string Password string // contains filtered or unexported fields }
func (*AwxClient) InventoryIdFromName ¶
func (*AwxClient) JobTemplateIdFromName ¶
func (*AwxClient) ListInventories ¶
func (*AwxClient) ListJobTemplates ¶
type Controller ¶
type Controller struct { Run func() error Interval time.Duration Log commonlog.Logger // contains filtered or unexported fields }
func NewController ¶
func (*Controller) Start ¶
func (self *Controller) Start()
func (*Controller) Stop ¶
func (self *Controller) Stop()
type GVK ¶
type GVK struct { Group string `json:"group" yaml:"group"` Version string `json:"version" yaml:"version"` Kind string `json:"kind" yaml:"kind"` }
func TriggerFromAPI ¶
func TriggersFromAPI ¶
func (GVK) APIVersion ¶
func (GVK) NewResourceIdentifier ¶
func (self GVK) NewResourceIdentifier(name string) ResourceIdentifier
func (GVK) ShortString ¶
type Package ¶
type Package = []Resource
func ClonePackage ¶
func GetReferentPackage ¶
func MergePackage ¶
func PreparePackageForMerge ¶
type ResourceIdentifier ¶
type ResourceIdentifier struct { GVK GVK `json:",inline" yaml:",inline"` Name string `json:"name" yaml:"name"` }
func NewResourceIdentifierForObjectReference ¶
func NewResourceIdentifierForObjectReference(objectReference ard.Map) (ResourceIdentifier, bool)
func NewResourceIdentifierForResource ¶
func NewResourceIdentifierForResource(resource Resource) (ResourceIdentifier, bool)
func (ResourceIdentifier) GetResource ¶
func (self ResourceIdentifier) GetResource(package_ Package) (Resource, bool)
func (ResourceIdentifier) Is ¶
func (self ResourceIdentifier) Is(resource Resource) bool
func (ResourceIdentifier) String ¶
func (self ResourceIdentifier) String() string
(fmt.Stringer interface)
type ResourceIdentifiers ¶
type ResourceIdentifiers struct {
// contains filtered or unexported fields
}
func (*ResourceIdentifiers) Empty ¶
func (self *ResourceIdentifiers) Empty() bool
func (*ResourceIdentifiers) Pop ¶
func (self *ResourceIdentifiers) Pop() (ResourceIdentifier, bool)
func (*ResourceIdentifiers) Push ¶
func (self *ResourceIdentifiers) Push(resourceIdentifier ResourceIdentifier)
type TOSCAParser ¶
func NewTOSCAParser ¶
func NewTOSCAParser() *TOSCAParser
func (*TOSCAParser) Coerce ¶
func (self *TOSCAParser) Coerce() error
func (*TOSCAParser) Parse ¶
func (self *TOSCAParser) Parse(context contextpkg.Context, url string) error
func (*TOSCAParser) Release ¶
func (self *TOSCAParser) Release() error
Click to show internal directories.
Click to hide internal directories.