Documentation
¶
Index ¶
- func EquivalentResources(field string, lhses, rhses []*Resource) []string
- func IdentifierForExactResourceRef(resourceReference *ExactResourceID) string
- func IdentifyResource(in *Resource) string
- func NewDiscoveryClientFromMustGather(mustGatherDir string) (discovery.AggregatedDiscoveryInterface, error)
- func NewDynamicClientFromMustGather(mustGatherDir string) (dynamic.Interface, error)
- func NewInputResourcesCommand(inputResourcesFn InputResourcesFunc, ...) *cobra.Command
- func WriteRequiredInputResourcesFromMustGather(ctx context.Context, inputResources *InputResources, ...) error
- func WriteResource(in *Resource, parentDir string) error
- type ClusterScopedReference
- type ExactResourceID
- func ExactClusterOperator(name string) ExactResourceID
- func ExactClusterRole(name string) ExactResourceID
- func ExactClusterRoleBinding(name string) ExactResourceID
- func ExactConfigMap(namespace, name string) ExactResourceID
- func ExactConfigResource(resource string) ExactResourceID
- func ExactDaemonSet(namespace, name string) ExactResourceID
- func ExactDeployment(namespace, name string) ExactResourceID
- func ExactLowLevelOperator(resource string) ExactResourceID
- func ExactNamespace(name string) ExactResourceID
- func ExactResource(group, version, resource, namespace, name string) ExactResourceID
- func ExactRole(namespace, name string) ExactResourceID
- func ExactRoleBinding(namespace, name string) ExactResourceID
- func ExactSecret(namespace, name string) ExactResourceID
- func ExactServiceAccount(namespace, name string) ExactResourceID
- type ExplicitNamespacedReference
- type GeneratedResourceID
- type ImplicitNamespacedReference
- type InputResourceTypeIdentifier
- type InputResources
- type InputResourcesFunc
- type LabelSelectedResource
- type OperandResourceList
- type Resource
- func GetRequiredInputResourcesForResourceList(ctx context.Context, resourceList ResourceList, ...) ([]*Resource, error)
- func GetRequiredInputResourcesFromMustGather(ctx context.Context, inputResources *InputResources, mustGatherDir string) ([]*Resource, error)
- func LenientResourcesFromDirRecursive(location string) ([]*Resource, error)
- func ResourcesFromFile(gvkToResources map[schema.GroupVersionKind][]schema.GroupVersionResource, ...) ([]*Resource, error)
- type ResourceList
- type ResourceReference
- type ResourceReferenceType
- type UniqueResourceSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EquivalentResources ¶
func IdentifierForExactResourceRef ¶
func IdentifierForExactResourceRef(resourceReference *ExactResourceID) string
func IdentifyResource ¶
func NewDiscoveryClientFromMustGather ¶
func NewDiscoveryClientFromMustGather(mustGatherDir string) (discovery.AggregatedDiscoveryInterface, error)
func NewInputResourcesCommand ¶
func NewInputResourcesCommand(inputResourcesFn InputResourcesFunc, outputResourcesFn libraryoutputresources.OutputResourcesFunc, streams genericiooptions.IOStreams) *cobra.Command
func WriteRequiredInputResourcesFromMustGather ¶
func WriteRequiredInputResourcesFromMustGather(ctx context.Context, inputResources *InputResources, mustGatherDir, targetDir string) error
func WriteResource ¶
Types ¶
type ClusterScopedReference ¶
type ClusterScopedReference struct {
InputResourceTypeIdentifier `json:",inline"`
// may have multiple matches
// TODO CEL may be more appropriate
NameJSONPath string `json:"nameJSONPath"`
}
type ExactResourceID ¶
type ExactResourceID struct {
InputResourceTypeIdentifier `json:",inline"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
}
func ExactClusterOperator ¶
func ExactClusterOperator(name string) ExactResourceID
func ExactClusterRole ¶
func ExactClusterRole(name string) ExactResourceID
func ExactClusterRoleBinding ¶
func ExactClusterRoleBinding(name string) ExactResourceID
func ExactConfigMap ¶
func ExactConfigMap(namespace, name string) ExactResourceID
func ExactConfigResource ¶
func ExactConfigResource(resource string) ExactResourceID
func ExactDaemonSet ¶
func ExactDaemonSet(namespace, name string) ExactResourceID
func ExactDeployment ¶
func ExactDeployment(namespace, name string) ExactResourceID
func ExactLowLevelOperator ¶
func ExactLowLevelOperator(resource string) ExactResourceID
func ExactNamespace ¶
func ExactNamespace(name string) ExactResourceID
func ExactResource ¶
func ExactResource(group, version, resource, namespace, name string) ExactResourceID
func ExactRole ¶
func ExactRole(namespace, name string) ExactResourceID
func ExactRoleBinding ¶
func ExactRoleBinding(namespace, name string) ExactResourceID
func ExactSecret ¶
func ExactSecret(namespace, name string) ExactResourceID
func ExactServiceAccount ¶
func ExactServiceAccount(namespace, name string) ExactResourceID
type ExplicitNamespacedReference ¶
type ExplicitNamespacedReference struct {
InputResourceTypeIdentifier `json:",inline"`
// may have multiple matches
// TODO CEL may be more appropriate
NamespaceJSONPath string `json:"namespaceJSONPath"`
NameJSONPath string `json:"nameJSONPath"`
}
type GeneratedResourceID ¶
type GeneratedResourceID struct {
InputResourceTypeIdentifier `json:",inline"`
Namespace string `json:"namespace,omitempty"`
GeneratedName string `json:"name"`
}
type ImplicitNamespacedReference ¶
type ImplicitNamespacedReference struct {
InputResourceTypeIdentifier `json:",inline"`
Namespace string `json:"namespace"`
// may have multiple matches
// TODO CEL may be more appropriate
NameJSONPath string `json:"nameJSONPath"`
}
type InputResourceTypeIdentifier ¶
type InputResourceTypeIdentifier struct {
Group string `json:"group"`
// version is very important because it must match the version of serialization that your operator expects.
// All Group,Resource tuples must use the same Version.
Version string `json:"version"`
Resource string `json:"resource"`
}
func SecretIdentifierType ¶
func SecretIdentifierType() InputResourceTypeIdentifier
type InputResources ¶
type InputResources struct {
// applyConfigurationResources are the list of resources used as input to the apply-configuration command.
// It is the responsibility of the MOM to determine where the inputs come from.
ApplyConfigurationResources ResourceList `json:"applyConfigurationResources,omitempty"`
// operandResources is the list of resources that are important for determining check-health
OperandResources OperandResourceList `json:"operandResources,omitempty"`
}
InputResources contains the items that an operator needs to make a decision about what needs to be create, modified, or removed.
type InputResourcesFunc ¶
type InputResourcesFunc func(ctx context.Context) (*InputResources, error)
type LabelSelectedResource ¶
type LabelSelectedResource struct {
InputResourceTypeIdentifier `json:",inline"`
Namespace string `json:"namespace,omitempty"`
// validation prevents setting matchExpressions
LabelSelector metav1.LabelSelector `json:"labelSelector"`
}
type OperandResourceList ¶
type OperandResourceList struct {
ConfigurationResources ResourceList `json:"configurationResources,omitempty"`
ManagementResources ResourceList `json:"managementResources,omitempty"`
UserWorkloadResources ResourceList `json:"userWorkloadResources,omitempty"`
}
type Resource ¶
type Resource struct {
Filename string
ResourceType schema.GroupVersionResource
Content *unstructured.Unstructured
}
TODO this is a good target to move to library-go so we all agree how to reference these.
func ResourcesFromFile ¶
func ResourcesFromFile(gvkToResources map[schema.GroupVersionKind][]schema.GroupVersionResource, location, fileTrimPrefix string) ([]*Resource, error)
type ResourceList ¶
type ResourceList struct {
ExactResources []ExactResourceID `json:"exactResources,omitempty"`
GeneratedNameResources []GeneratedResourceID `json:"generatedNameResources,omitempty"`
LabelSelectedResources []LabelSelectedResource `json:"labelSelectedResources,omitempty"`
// use resourceReferences when one resource (apiserver.config.openshift.io/cluster) refers to another resource
// like a secret (.spec.servingCerts.namedCertificates[*].servingCertificates.name).
ResourceReferences []ResourceReference `json:"resourceReferences,omitempty"`
}
type ResourceReference ¶
type ResourceReference struct {
// TODO determine if we need the ability to select multiple containing resources. I don’t think we’ll need to given the shape of our configuration.
ReferringResource ExactResourceID `json:"referringResource"`
Type ResourceReferenceType `json:"type"`
ExplicitNamespacedReference *ExplicitNamespacedReference `json:"explicitNamespacedReference,omitempty"`
ImplicitNamespacedReference *ImplicitNamespacedReference `json:"implicitNamespacedReference,omitempty"`
ClusterScopedReference *ClusterScopedReference `json:"clusterScopedReference,omitempty"`
}
type ResourceReferenceType ¶
type ResourceReferenceType string
const ( ExplicitNamespacedReferenceType ResourceReferenceType = "ExplicitNamespacedReference" ImplicitNamespacedReferenceType ResourceReferenceType = "ImplicitNamespacedReference" ClusterScopedReferenceType ResourceReferenceType = "ClusterScopedReference" )
type UniqueResourceSet ¶
type UniqueResourceSet struct {
// contains filtered or unexported fields
}
func NewUniqueResourceSet ¶
func NewUniqueResourceSet(resources ...*Resource) *UniqueResourceSet
func (*UniqueResourceSet) Insert ¶
func (u *UniqueResourceSet) Insert(resources ...*Resource)
func (*UniqueResourceSet) List ¶
func (u *UniqueResourceSet) List() []*Resource
Click to show internal directories.
Click to hide internal directories.