Skip to content

Conversation

@enxebre
Copy link
Member

@enxebre enxebre commented Jan 16, 2020

This is so baremetal can fetch the provisioning.metal3.io object and parameterize their deployment. Related openshift/api#540 and #460

This is so baremetal can fetch the provisioning.metal3.io object and parametarise their deployment. Related openshift/api#540 and openshift#460
@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 16, 2020
@enxebre
Copy link
Member Author

enxebre commented Jan 16, 2020

cc @sadasu you can then just fetch the provisioning object and parameterise the baremetal deployment at your convenience.
You can unit test your code the likes of:

yamlContent := `apiVersion: metal3.io/v1alpha1
kind: Provisioning
metadata:
  name: test
spec:
  provisioningInterface: "test"
`
	u := &unstructured.Unstructured{Object: map[string]interface{}{}}
	if err := yaml.Unmarshal([]byte(yamlContent), &u); err != nil {
		t.Errorf("unmarshall %v", err)
	}
	t.Logf("Unstructured %+v", u)
	dynamicClient := dynamicfake.NewSimpleDynamicClient(runtime.NewScheme(), u)
	o, err := dynamicClient.Resource(schema.GroupVersionResource{
		Group: "metal3.io", Version: "v1alpha1", Resource: "provisionings"}).Get("test", metav1.GetOptions{})
	if err != nil {
		t.Errorf("Error on get %v", err)
	}
	t.Logf("All good %v", o)

Once all get merged please make sure to reflect the latest discussions here https://github.com/openshift/enhancements/blob/master/enhancements/baremetal/baremetal-provisioning-config.md

@enxebre enxebre changed the title Dynamic client Expose a dynamic client in the Operator struct Jan 16, 2020
Copy link
Contributor

@bison bison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bison

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2020
@openshift-merge-robot openshift-merge-robot merged commit a3345f5 into openshift:master Jan 16, 2020
@openshift-ci-robot
Copy link
Contributor

@enxebre: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-azure-operator fc66ffb link /test e2e-azure-operator

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@enxebre
Copy link
Member Author

enxebre commented Jan 16, 2020

Alternative in case we transition the baremetal components into its own operator to watch these resources https://github.com/openshift/machine-api-operator/compare/master...enxebre:dynamic-informer?expand=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants