Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] console-operator based on client-go #2

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

benjaminapetersen
Copy link

Renamed all occurance of "example" to "console". Regenerate pkg/generated/

@benjaminapetersen
Copy link
Author

@enj for all the review fun :)

README.md Outdated

```shell
cd "${GOPATH}/src/github.com/enj/example-operator"
An operator for OpenShift Console built using the operator-sdk.
Copy link
Owner

Choose a reason for hiding this comment

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

?


FILE=examples/cr.yaml
echo "creating ${FILE}"
oc create -f $FILE
Copy link
Owner

Choose a reason for hiding this comment

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

delete??

Copy link
Author

Choose a reason for hiding this comment

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

quick copy paste, haven't tested that one yet.
obviously :)

String = fmt.Sprintf("ConsoleOperator %s", Raw)
)

func NewVersion() *cobra.Command {
Copy link
Owner

Choose a reason for hiding this comment

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

This is not useful - you need git info like pkg/console/version/version.go

Copy link
Author

Choose a reason for hiding this comment

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

Agree, quick stub in, ill have to look into how that is done & how it maps to our releases since we want things formatted specifically.


// only watch a specific resource name
tweakListOptions := func(options *v1.ListOptions) {
options.FieldSelector = fields.OneTermEqualSelector("metadata.name", operator.ResourceName).String()
Copy link
Owner

Choose a reason for hiding this comment

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

you will need to figure out if you can actually only watch a single name since you had multiple object names

Copy link
Author

Choose a reason for hiding this comment

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

Right, or if i need more than one tweakListOptionsFor____

Copy link
Owner

Choose a reason for hiding this comment

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

You would need to explicitly create different informers since there is no OR in field selectors. It would likely be simpler to filter at the queue.

}

func (p *operatorStatusProvider) CurrentStatus() (operatorv1alpha1.OperatorStatus, error) {
instance, err := p.informers.Console().V1alpha1().Consoles().Lister().Consoles(operator.TargetNamespace).Get(operator.ResourceName)
Copy link
Author

Choose a reason for hiding this comment

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

seems to work...

- Temporarily drop ApplyRoute() to more carefully GetOrCreate route
	- ensures we don't stomp on the Spec.host
- Update Secret to manually create encoded secret
	- ApplySecret() from library-go ignores Spec.StringData
		- PR this to library-go in future
- Stub in func for CR.Status via Sync loop
	- will be a follow-up PR
- Stub in some specific status fields on Cr.Status
	- will be a follow-up PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants