Skip to content

Conversation

@deads2k
Copy link
Contributor

@deads2k deads2k commented Oct 15, 2018

Uses openshift/cluster-version-operator#31, a dynamic client, and the operator status used by several operator to create a control loop that will keep the ClusterOperator synchronized if the API is available.

/cc @abhinavdahiya
/assign @mfojtik @sttts @sanchezl

/hold

hold until we roughly agree on the upstream shape. This will require us to re-fit some conditions.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 15, 2018
@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 15, 2018
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 15, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

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 Oct 15, 2018
// sync reacts to a change in prereqs by finding information that is required to match another value in the cluster. This
// must be information that is logically "owned" by another component.
func (c StatusSyncer) sync() error {
currentDetailedStatus, err := c.operatorStatusProvider.CurrentStatus()
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we just set the ownerRef and let GC to deal with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can't we just set the ownerRef and let GC to deal with this?

GC doesn't do cluster scoped resources.

return operatorv1alpha1.OperatorStatus{}, err
}

return instance.Status.OperatorStatus, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want DeepCopy here?

defer utilruntime.HandleCrash()
defer c.queue.ShutDown()

glog.Infof("Starting ConfigObserver")
Copy link
Contributor

Choose a reason for hiding this comment

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

copy&paste

@deads2k
Copy link
Contributor Author

deads2k commented Oct 15, 2018

@tnozicka any idea what is up with Travis and tide?

return err
}

operatorConfig, err := c.clusterOperatorClient.Get(c.clusterOperatorName, metav1.GetOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

odd the get the same object again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

odd the get the same object again.

Uncommon, but dynamic informers/listers are in 1.13 and this is fairly slow moving.

return createErr
}
}
if updateErr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: return updateErr

return nil, nil
}
buf := &bytes.Buffer{}
if err := json.NewEncoder(buf).Encode(condition); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

ugly. I guess we don't have go types yet of this object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugly. I guess we don't have go types yet of this object?

For the CVO ClusterOperator status? Not yet.

@sttts
Copy link
Contributor

sttts commented Oct 16, 2018

some nits

@deads2k deads2k changed the title [wip] report status to the CVO report status to the CVO Oct 16, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 16, 2018
@deads2k
Copy link
Contributor Author

deads2k commented Oct 16, 2018

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2018
@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2018
@openshift-merge-robot openshift-merge-robot merged commit 5027960 into openshift:master Oct 16, 2018
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants