Closed etungsten closed 1 year ago
The problem I think has to do with the fact that we are only pulling vmware.datacenter
stuff with pubsys-config::DatacenterBuilder
:
https://github.com/bottlerocket-os/bottlerocket/blob/f3dfa53daca4b17a0de4e2ac7bd94c4195ab5e60/tools/testsys/src/run.rs#L243-L256
But we also should be using pubsys-config::DatacenterCredsBuilder
to fetch the vSphere credentials:
https://github.com/bottlerocket-os/bottlerocket/blob/f3dfa53daca4b17a0de4e2ac7bd94c4195ab5e60/tools/pubsys-config/src/vmware.rs#L151-L158
In addition, when we create the vsphere-k8s-cluster custom resource, we're passing the secrets
like so:
https://github.com/bottlerocket-os/bottlerocket/blob/f3dfa53daca4b17a0de4e2ac7bd94c4195ab5e60/tools/testsys/src/vmware_k8s.rs#L139
which pulls that value from Test.toml
. I think if the secrets
field is not in Test.toml
TestSys should create that secret and pass the name there.
Currently, a user is supposed to add the vSphere credentials secret beforehand and add it to Test.toml. I can have testsys automatically create the secret.
What I expected to happen: After exporting all the
GOVC_*
variables as described in https://github.com/bottlerocket-os/bottlerocket/blob/develop/TESTING.md#vmware-k8s, I expectcargo make test
for vmware-k8s variant testing to work successfully without having to manually create the vsphere credentials in the TestSys cluster prior to running the tests.What actually happened:
cargo make test
creates thevsphere-k8s-cluster-resource-agent
but it's missing vsphere credentials so the agent fails:Checking logs:
Checking resource object spec, notice how the
secret
is empty:I also tried not exporting
GOVC_*
vars and just specifying the vmware datacenter config inInfra.toml
and same thing happens.How to reproduce the problem:
Either export
GOVC_*
or specifyvmware.datacenter
inInfra.toml
. Run