Closed UmfintechWtc closed 7 months ago
Hi @UmfintechWtc I'm not sure I understand the question. It seems like you want to move metadata.namespace
to spec.namespace
. but pre K8s API conventions spec.namespace
is required on every object that is created. This isn't an operator-sdk convention this is a K8's convention . I hope this helps
+1 to what @acornett21 mentioned. Also, could you elaborate on what you mean by "customizing namespace". I would highly discourage from doing req.NamespacedName.Namespace = nginx.Spec.Namespace
-- the request has already been added to the queue based on what namespaces are being watched by the controller. There is no use of over-writing them, and they shouldn't be overwritten either.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen
.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Exclude this issue from closing again by commenting /lifecycle frozen
.
/close
@openshift-bot: Closing this issue.
Bug Report
What did you do?
i specify namespace with spec.namespace, not metadata.namespace, because i want to customize the namespace, like "lweim" ns
What did you expect to see?
nginx_v1_nginx.yaml
nginx_controller.go
func NodePortForNginx(service nginxv1.Nginx) corev1.Service {
}
Operator type:
Kubernetes cluster type:
$ operator-sdk version
$ go version
(if language is Go)[root@k8s-master-1:operator-sdk-example-with-nginx_0]# go version go version go1.20 linux/amd64
$ kubectl version