Closed MikeSpreitzer closed 4 months ago
Note that success is claimed because the control plane does get created. What is not successful is applying the PCH, which comes after. The status for the control planes reflects the outcome of applying the PCH:
$ kubectl get cp its2
NAME SYNCED READY TYPE AGE
its2 False True vcluster 9m40s
and you can see more in detail the problem here:
$ kubectl describe cp its2
Name: its2
Namespace:
Labels: <none>
Annotations: <none>
API Version: tenancy.kflex.kubestellar.org/v1alpha1
Kind: ControlPlane
Metadata:
Creation Timestamp: 2024-04-23T13:52:02Z
Finalizers:
kflex.kubestellar.org/finalizer
Generation: 1
Resource Version: 1717699
UID: 88383724-77b3-4c55-9066-e3def75270d9
Spec:
Backend: shared
Post Create Hook: flagrant-garbage
Type: vcluster
Status:
Conditions:
Last Transition Time: 2024-04-23T13:53:02Z
Last Update Time: 2024-04-23T13:53:02Z
Message:
Reason: Available
Status: True
Type: Ready
Last Transition Time: 2024-04-23T13:53:02Z
Last Update Time: 2024-04-23T13:53:02Z
Message: error retrieving post create hook flagrant-garbage PostCreateHook.tenancy.kflex.kubestellar.org "flagrant-garbage" not found
Reason: ReconcileError
Status: False
Type: Synced
Observed Generation: 0
Secret Ref:
In Cluster Key: config-incluster
Key: config
Name: vc-vcluster
Namespace: its2-system
Events: <none>
I may be wrong, but since all kflex create
is doing here is generating the yaml for the control plane (with the PCH set) the behavior should be somehow consistent with kubectl create -f
- if you apply for the example the yaml for a pod that reference a resource that is not there (be that a secret, a config map or service account), you won't get an error from kubectl, but you'll see the problem when you run kubectl get
or kubectl describe
.
That is a plausible stance. I think it warrants an explicit mention in the User Guide section on PostCreateHooks.
Working as designed.
Describe the bug
kflex create
claims success when told to use a PostCreateHook that does not exist. The following typescript shows an example.Steps To Reproduce
Shown above.
Expected Behavior
Error message and non-zero exit status in this case.
Additional Context
https://github.com/kubestellar/kubestellar/issues/2069