fix: add support for creating operator based resource#599
Conversation
|
@DuncanDoyle This is working end to end, but I need to perform some minor code cleanup for it. |
pkg/cluster/serviceBinding.go
Outdated
| var deploymentResource = schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"} | ||
|
|
||
| func ExecuteServiceBinding(logger logging.Logger, serviceName string, ns string, appName string, forceCreationWithoutAsk bool) error { | ||
| // TODO extract arguments |
There was a problem hiding this comment.
I have this almost there - moving arguments to structure.
pkg/cmd/cluster/bind/bind.go
Outdated
| cmd.Flags().BoolVarP(&opts.forceCreationWithoutAsk, "yes", "y", false, localizer.MustLocalizeFromID("cluster.common.flag.yes.description")) | ||
| cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "", localizer.MustLocalizeFromID("cluster.common.flag.namespace.description")) | ||
| cmd.Flags().BoolVarP(&opts.ignoreContext, "ignore-context", "", false, localizer.MustLocalizeFromID("cluster.common.flag.ignoreContext.description")) | ||
| cmd.Flags().BoolVarP(&opts.useOperator, "force-operator", "", false, localizer.MustLocalizeFromID("cluster.bind.flag.onlyOperator.description")) |
There was a problem hiding this comment.
@pmuir We assume to use Operator by default when installed. If this flag is added and CLI fails to detect operator it will fail. Otherwise if operator is not detected SDK is used.
Would you prefer to have more complex flags like:
--useOperator=true
--useSDK=true
Additionally we should provide name override for the service binding (as it is currently generated which might look bad)
There was a problem hiding this comment.
I like --force-operator - it's clear what's it's doing :-D What about --force-sdk as well?
There was a problem hiding this comment.
Yes. Adding SDK here will be easy. I was hoping to have single flag but that is not possible due to this fallback logic
|
@craicoverflow ready for review :) |
|
Is that a fix or feat? |
|
I seen that as fix initially but when you have asked I think it is feat :D |
* fix: add support for creating operator based resource * chore: refactor logic to use additional flags * fix: allow to override bindAsFiles in SDK * fix: reduce size of random characters in binding name * fix: problem when having no kafkas available * style: ignore lint warning Co-authored-by: Enda Phelan <ephelan@redhat.com>
Add option to create CR instead of using SDK for binding.
Issue #595