enable

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 31 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrdForAPIResource

func CrdForAPIResource(apiResource metav1.APIResource, validation *apiextv1.CustomResourceValidation, shortNames []string) *apiextv1.CustomResourceDefinition

func CreateResources

func CreateResources(cmdOut io.Writer, config *rest.Config, resources *typeResources, namespace string, dryRun bool) error

TODO(marun) Allow updates to the configuration for a type that has already been enabled for kubefed. This would likely involve updating the version of the target type and the validation of the schema.

func DecodeYAML

func DecodeYAML(r io.Reader, obj interface{}) error

func DecodeYAMLFromFile

func DecodeYAMLFromFile(filename string, obj interface{}) error

func FederatedNamespacedToScope added in v0.3.0

func FederatedNamespacedToScope(apiResource metav1.APIResource) apiextv1.ResourceScope

func GenerateTypeConfigForTarget

func GenerateTypeConfigForTarget(apiResource metav1.APIResource, enableTypeDirective *EnableTypeDirective) typeconfig.Interface

func GetResources

func GetResources(config *rest.Config, enableTypeDirective *EnableTypeDirective) (*typeResources, error)

func GetServerPreferredResources

func GetServerPreferredResources(config *rest.Config) ([]*metav1.APIResourceList, error)

func IsEquivalentAPI added in v0.3.0

func IsEquivalentAPI(existingAPI, newAPI *fedv1b1.APIResource) bool

func LookupAPIResource

func LookupAPIResource(config *rest.Config, key, targetVersion string) (*metav1.APIResource, error)

func NameMatchesResource

func NameMatchesResource(name string, apiResource metav1.APIResource, group string) bool

func NamespacedToScope added in v0.3.0

func NamespacedToScope(apiResource metav1.APIResource) apiextv1.ResourceScope

func NewCmdTypeEnable

func NewCmdTypeEnable(cmdOut io.Writer, config util.FedConfig) *cobra.Command

NewCmdTypeEnable defines the `enable` command that enables federation of a Kubernetes API type.

func ValidationSchema

func ValidationSchema(specProps v1.JSONSchemaProps) *v1.CustomResourceValidation

Types

type EnableTypeDirective

type EnableTypeDirective struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec EnableTypeDirectiveSpec `json:"spec,omitempty"`
}

TODO(marun) This should become a proper API type and drive enabling type federation via a controller. For now its only purpose is to enable loading of configuration from disk.

func NewEnableTypeDirective

func NewEnableTypeDirective() *EnableTypeDirective

func (*EnableTypeDirective) SetDefaults

func (ft *EnableTypeDirective) SetDefaults()

type EnableTypeDirectiveSpec

type EnableTypeDirectiveSpec struct {
	// The API version of the target type.
	// +optional
	TargetVersion string `json:"targetVersion,omitempty"`

	// The name of the API group to use for generated federated types.
	// +optional
	FederatedGroup string `json:"federatedGroup,omitempty"`

	// The API version to use for generated federated types.
	// +optional
	FederatedVersion string `json:"federatedVersion,omitempty"`
}

EnableTypeDirectiveSpec defines the desired state of EnableTypeDirective.

Jump to

Keyboard shortcuts

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