remove_namespace

package
v0.0.0-...-b53bbfd Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

Remove Namespace from Custom Resources

This is transform used to remove the namespace from instances of cluster scoped custom resources.

It is a work around for https://github.com/kubernetes-sigs/kustomize/issues/2498

Documentation

Overview

TODO(https://github.com/kubeflow/gcp-blueprints/issues/27): We should make this configurable and follow the model of image-prefix. This means instead of using a separate main.go we should use kustomize-fns/main.go and just register this function in the dispatcher.

Index

Constants

View Source
const (
	Kind       = "RemoveNamespace"
	APIVersion = "kubeflow.org/v1alpha1"
)

Variables

This section is empty.

Functions

func Filter

func Filter() kio.Filter

Filter returns a new RemoveNamespaceFunction

Types

type ClusterKind

type ClusterKind struct {
	Kind  string `yaml:"kind"`
	Group string `yaml:"group"`
}

type Metadata

type Metadata struct {
	// Name is the name of the RemoveNamespace Resources
	Name string `yaml:"name"`

	// Namespace is the namespace of the RemoveNamespace Resources
	Namespace string `yaml:"namespace"`

	// Labels are labels applied to the RemoveNamespace Resources
	Labels map[string]string `yaml:"labels"`

	// Annotations are annotations applied to the RemoveNamespace Resources
	Annotations map[string]string `yaml:"annotations"`
}

type RemoveNamespaceFunction

type RemoveNamespaceFunction struct {
	// Kind is the API name.  Must be RemoveNamespace.
	Kind string `yaml:"kind"`

	// APIVersion is the API version.  Must be examples.kpt.dev/v1alpha1
	APIVersion string `yaml:"apiVersion"`

	// Metadata defines instance metadata.
	Metadata Metadata `yaml:"metadata"`

	// Spec defines the desired declarative configuration.
	Spec Spec `yaml:"spec"`
}

RemoveNamespaceFunction implements the RemoveNamespace Function

func (*RemoveNamespaceFunction) Filter

func (f *RemoveNamespaceFunction) Filter(inputs []*yaml.RNode) ([]*yaml.RNode, error)

Filter looks for resources of the specified kind and removes them

type Spec

type Spec struct {
	ClusterKinds []*ClusterKind `yaml:"clusterKinds"`
}

Jump to

Keyboard shortcuts

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