Open namgon-kim opened 1 month ago
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackCluster
metadata:
name: bastion-test
spec:
bastion:
enabled: true
spec:
serverMetadata:
- key: "test"
value: "somedata"
Try with this instead, the serverMetadata
key must be in the bastion.Spec
.
I'm surprised how you could manage to create a cluster with this, the webhook should have complained about the wrong OpenStackCluster spec.
i'll close the bug now as I suspect this was a user error but if I was wrong and something is not working as you expect to work, please re-open and I'll take a look again.
@EmilienM Oh! I apologize for the confusion earlier. While removing internal company information, I accidentally deleted some parts of the YAML.
Here is the corrected YAML:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackCluster
metadata:
name: bastion-test
spec:
bastion:
enabled: true
...
spec:
serverMetadata:
- key: "test"
value: "somedata"
...
The CRD validation succeeded, and the OpenStackCluster resource was successfully stored in etcd. We are actually using a modified image so that this configuration can be applied.
Please kindly reconsider the issue.
If you have a fix please consider sending a PR. Thanks
/kind bug
What steps did you take and what happened: I was trying to set metadata for the Bastion server using the spec.Bastion.serverMetadata field in the OpenStackCluster Custom Resource Definition (CRD) version v1beta1. Here are the steps I took:
What did you expect to happen: I expected the Bastion server instance to have the metadata from spec.Bastion.serverMetadata applied upon creation. Specifically, I expected to see
test: somedata
in the instance’s metadata.Anything else you would like to add: To analyze the issue, you examined the bastionToInstanceSpec function in the openstackcluster_controller.go file in version v0.10.5.
Relevant code snippet:
It appears that the serverMetadata from the CRD isn’t being passed to the instanceSpec, so it’s not applied to the Bastion server during creation.
Environment: • Cluster API Provider OpenStack version (or git rev-parse HEAD if manually built): v0.10.5 • Cluster-API version: v1.6.5 • OpenStack version: 2023.1 • Minikube/KIND version: Not applicable • Kubernetes version (use kubectl version): v1.28.10 • OS (e.g., from /etc/os-release):