condkptsdk

package
v0.0.0-...-4b974b3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 16

Documentation

Overview

Copyright 2023 The Nephio Authors.

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.

Copyright 2023 The Nephio Authors.

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 (
	SpecializerOwner         = "specializer.nephio.org/owner"
	SpecializerDelete        = "specializer.nephio.org/delete"
	SpecializerDebug         = "specializer.nephio.org/debug"
	SpecializerFor           = "specializer.nephio.org/for"
	SpecializervlanClaimName = "specializer.nephio.org/vlanClaimName"
	SpecializerNamespace     = "specializer.nephio.org/namespace"
)

Variables

This section is empty.

Functions

func UpdateResourceFnNop

func UpdateResourceFnNop(*fn.KubeObject, fn.KubeObjects) (fn.KubeObjects, error)

Types

type ConditionReason

type ConditionReason string
const (
	ConditionReasonReady      ConditionReason = "Ready"
	ConditionReasonFailed     ConditionReason = "Failed"
	ConditionReasonSpecialize ConditionReason = "Specialize"
)

Reasons the specialization is at

type Config

type Config struct {
	Root                   bool
	For                    corev1.ObjectReference
	Owns                   map[corev1.ObjectReference]ResourceKind    // ResourceKind distinguishes different types of child resources.
	Watch                  map[corev1.ObjectReference]WatchCallbackFn // Used for watches to non specific resources
	PopulateOwnResourcesFn PopulateOwnResourcesFn
	UpdateResourceFn       UpdateResourceFn
}

type KptCondSDK

type KptCondSDK interface {
	Run() (bool, error)
}

func New

func New(rl *fn.ResourceList, cfg *Config) (KptCondSDK, error)

type PopulateOwnResourcesFn

type PopulateOwnResourcesFn func(*fn.KubeObject) (fn.KubeObjects, error)

type ResourceKind

type ResourceKind string
const (
	// ChildRemoteCondition defines a GVK resource for which only conditions need to be created
	ChildRemoteCondition ResourceKind = "remoteCondition"
	// ChildRemote defines a GVK resource for which conditions and resources need to be created
	ChildRemote ResourceKind = "remote"
	// ChildLocal defines a GVK resource for which conditions will be created as true
	ChildLocal ResourceKind = "local"
	// ChildInitial defines a GVK resource which is an initial resource part fo the package and should not be deleted
	ChildInitial ResourceKind = "initial"
)

type UpdateResourceFn

type UpdateResourceFn func(*fn.KubeObject, fn.KubeObjects) (fn.KubeObjects, error)

the list of objects contains the owns and the specific watches

type WatchCallbackFn

type WatchCallbackFn func(*fn.KubeObject) error

Jump to

Keyboard shortcuts

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