Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateClusterScopedRuntimeObjects(path string) (crd []runtime.Object, clusterObjs []runtime.Object, err error)
- func GenerateNamespacedRuntimeObjects(path string) (nonpods []runtime.Object, pods []runtime.Object, err error)
- func GenerateObjects(file string) (obj []runtime.Object, err error)
- func GenerateUnstructuredObjects(file string) (objs []*unstructured.Unstructured, err error)
- func ReadContent(f *zip.File) ([]byte, error)
- type ObjectManager
- func (o *ObjectManager) ApplyObjects(objs []runtime.Object, patchStatus bool, skipGVR *schema.GroupVersionResource) error
- func (o *ObjectManager) CreateNodeZipObjects() error
- func (o *ObjectManager) CreateUnstructuredClusterObjects() error
- func (o *ObjectManager) CreateUnstructuredObjects() error
- func (o *ObjectManager) CreatedFailedObjectsList() error
- func (o *ObjectManager) FetchObject(obj runtime.Object) (*unstructured.Unstructured, error)
- func (o *ObjectManager) ProcessNodeZipObjects() (noStatusObjs []runtime.Object, withStatusObjs []runtime.Object, err error)
- func (o *ObjectManager) WaitForNamespaces(timeout time.Duration) error
Constants ¶
const ( DefaultNodeDir = "nodes" DefaultPodNamespace = "support-bundle-node-info" )
Variables ¶
var NodeInfoNS = v1.Namespace{ TypeMeta: metav1.TypeMeta{ Kind: "Namespace", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: DefaultPodNamespace, }, }
var NodeInfoSA = v1.ServiceAccount{ TypeMeta: metav1.TypeMeta{ Kind: "ServiceAccount", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "default", Namespace: DefaultPodNamespace, }, Secrets: []v1.ObjectReference{ { Name: "default", Kind: "Secret", APIVersion: "v1", Namespace: DefaultPodNamespace, }, }, }
var NodeInfoSASecret = v1.Secret{ TypeMeta: metav1.TypeMeta{ Kind: "Secret", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "default", Namespace: DefaultPodNamespace, }, StringData: make(map[string]string), }
Functions ¶
func GenerateClusterScopedRuntimeObjects ¶
func GenerateClusterScopedRuntimeObjects(path string) (crd []runtime.Object, clusterObjs []runtime.Object, err error)
GenerateClusterScopedRuntimeObjects will parse the yaml directory in the bundle directory and apply the cluster and namespaced objects
func GenerateNamespacedRuntimeObjects ¶
func GenerateNamespacedRuntimeObjects(path string) (nonpods []runtime.Object, pods []runtime.Object, err error)
GenerateNamespacedRuntimeObjects will return a map[string][]runtime.Object. the map key is the namespace and the list of objects associated with this namespaced. Two maps to split workloads into pods and nonpod types as pods may have dependency on other objects like service accounts.
func GenerateUnstructuredObjects ¶
func GenerateUnstructuredObjects(file string) (objs []*unstructured.Unstructured, err error)
Types ¶
type ObjectManager ¶
type ObjectManager struct {
// contains filtered or unexported fields
}
func NewObjectManager ¶
func NewObjectManager(ctx context.Context, config *rest.Config, path string) (*ObjectManager, error)
NewObjectManager is a wrapper around apply and support bundle path
func (*ObjectManager) ApplyObjects ¶
func (o *ObjectManager) ApplyObjects(objs []runtime.Object, patchStatus bool, skipGVR *schema.GroupVersionResource) error
ApplyObjects is a wrapper to convert runtime.Objects to unstructured.Unstructured, perform some housekeeping before submitting the same to apiserver
func (*ObjectManager) CreateNodeZipObjects ¶
func (o *ObjectManager) CreateNodeZipObjects() error
CreateNodeZipObjects will create associated objects in the cluster
func (*ObjectManager) CreateUnstructuredClusterObjects ¶
func (o *ObjectManager) CreateUnstructuredClusterObjects() error
CreateUnstructuredClusterObjects will use the dynamic client to create all cluster scoped objects from the support bundle
func (*ObjectManager) CreateUnstructuredObjects ¶
func (o *ObjectManager) CreateUnstructuredObjects() error
CreateUnstructuredObjects will use the dynamic client to create all namespace scoped objects from the support bundle
func (*ObjectManager) CreatedFailedObjectsList ¶
func (o *ObjectManager) CreatedFailedObjectsList() error
func (*ObjectManager) FetchObject ¶
func (o *ObjectManager) FetchObject(obj runtime.Object) (*unstructured.Unstructured, error)
FetchObject will use the dynamic client to fetch runtime.Object from apiserver.
func (*ObjectManager) ProcessNodeZipObjects ¶
func (o *ObjectManager) ProcessNodeZipObjects() (noStatusObjs []runtime.Object, withStatusObjs []runtime.Object, err error)
ProcessNodeZipObjects will read the contents of the zip file and generate associated runtime.Objects
func (*ObjectManager) WaitForNamespaces ¶
func (o *ObjectManager) WaitForNamespaces(timeout time.Duration) error
WaitForNamespaces ensures apiserver is ready and namespaces can be listed before it times out