-
Notifications
You must be signed in to change notification settings - Fork 48
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
🐛 Use API Server DNS Names by default when logging into VM Web Console #735
base: main
Are you sure you want to change the base?
🐛 Use API Server DNS Names by default when logging into VM Web Console #735
Conversation
4296bf1
to
60882f1
Compare
cdb36ef
to
4f4742b
Compare
} | ||
|
||
// ProxyAddressFromVirtualIP retrieves the virtual IP, which will be used as the Proxy Address. | ||
func (r *Reconciler) ProxyAddressFromVirtualIP(ctx *pkgctx.WebConsoleRequestContextV1) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if this method can also go into the pkg/util/webconsole/ now? @dilyar85 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that the contexts for this and the v1alpha1 function are different data types. Does this matter?
If we move this to the webconsole directory, could we just use context.Context as the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the contexts for this and the v1alpha1 function are different data types. Does this matter?
shouldn't matter. cause it's only doing client.Get() with the ctx.
could we just use context.Context as the type?
yep.
I'll let @dilyar85 comment if we need to keep it here or move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep agree better to move to the util package (also commented on it below).
controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_controller.go
Outdated
Show resolved
Hide resolved
641051a
to
374470e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this change to support the web console feature in Simplified Supervisor. Left some comments/suggestions and overall LGTM.
controllers/virtualmachinewebconsolerequest/v1alpha1/webconsolerequest_unit_test.go
Outdated
Show resolved
Hide resolved
pkg/webconsoleurl/url_lookup.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better place and name for this file could be pkg/util/proxy_address.go
, as none of the functions inside are exclusive to the web console URL.
Also, can we add a test file for this? It should be easy to reach 100% CC since it simply gets the CR and returns the proxy address.
) | ||
}) | ||
|
||
scenarios := []struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using DescribeTable
- https://onsi.github.io/ginkgo/#table-specs - is the more conventional way to write tests like this for Ginkgo.
Why is there a webconsolerequest.NewReconciler()
in both the inner and outer JustBeforeEach()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set the FSS in each iteration (in the same newreconciler call as the API Server DNS Name setting), then it will not actually set the FSS properly in fail. Hence, I do it up above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem that I am facing is that I am trying to modify the config (reconciler) just before each entry. It seems that JustBeforeEach and DescribeTable are not compatible with each other, so whenever I try to update proxySvcDNS within each Entry, the changes aren't actually going in affect.
controllers/virtualmachinewebconsolerequest/v1alpha2/webconsolerequest_controller.go
Outdated
Show resolved
Hide resolved
Minimum allowed line rate is |
4f3d1dc
to
a3823cf
Compare
What does this PR do, and why is it needed?
In certain environments, a load balancer, and therefore a virtual IP, may not be present. In these cases, rather than relying on the virtual IP to log into the VM web console, we need to instead rely on an FQDN / DNS name to login.
This change plumbs the API Server DNS Names from the app platform CRD, and uses that by default to login to the VM Web Console. If no DNS Name is found, then we fall back to the previous method of using the virtual IP to login.
Testing Done:
Used an existing testbed - note that this setup has a load balancer already
Setup steps:
my-vm
ontest-namespace
/usr/lib/vmware-wcp/objects/PodVM-GuestCluster/30-vmop/vmop.yaml
file to add rbac permissions for appplatform (since vmop tar won't load those changes) and re-applied yamlmake docker-build
,docker save docker.io/library/vmoperator-controller:latest > vmopfqdn.tar
, anddeploy-wcp.sh
Next, verified that web console returns API Server DNS name for login:
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
Please add a release note if necessary: