added command and args to status
Some checks failed
Build and Push Docker Image / Build image (push) Has been cancelled
Some checks failed
Build and Push Docker Image / Build image (push) Has been cancelled
This commit is contained in:
parent
39f1c0d92c
commit
7ef824830e
@ -44,6 +44,8 @@ type ServerStatus struct {
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Running bool `json:"running,omitempty"`
|
||||
HostPorts []PortMapping `json:"host_ports,omitempty"`
|
||||
Args []string `json:"args,omitempty"`
|
||||
Command []string `json:"command,omitempty"`
|
||||
}
|
||||
|
||||
type ServerSpec struct {
|
||||
|
@ -333,6 +333,16 @@ func (in *ServerStatus) DeepCopyInto(out *ServerStatus) {
|
||||
*out = make([]PortMapping, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Args != nil {
|
||||
in, out := &in.Args, &out.Args
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Command != nil {
|
||||
in, out := &in.Command, &out.Command
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerStatus.
|
||||
|
@ -94,6 +94,14 @@ spec:
|
||||
INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
Important: Run "make" to regenerate code after modifying this file
|
||||
properties:
|
||||
args:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
command:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
domain:
|
||||
type: string
|
||||
host_ports:
|
||||
|
@ -2,81 +2,69 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: server-manager-role
|
||||
name: manager-role
|
||||
rules:
|
||||
- resources:
|
||||
- persistentvolumeclaims
|
||||
- services
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
apiGroups:
|
||||
- ""
|
||||
- resources:
|
||||
- pods
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
apiGroups:
|
||||
- ""
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- images
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- servermanagers
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- servermanagers/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- servermanagers/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- traefik.io
|
||||
resources:
|
||||
- ingressroutes
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- resources:
|
||||
- persistentvolumeclaims
|
||||
- services
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- resources:
|
||||
- pods
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- images
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- servermanagers
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- servermanagers/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- server-manager.acooldomain.co
|
||||
resources:
|
||||
- servermanagers/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- traefik.io
|
||||
resources:
|
||||
- ingressroutes
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
|
@ -185,11 +185,27 @@ func (r *ServerManagerReconciler) Reconcile(ctx context.Context, req ctrl.Reques
|
||||
s.Status.Server.Running = true
|
||||
statusChanged = true
|
||||
}
|
||||
if s.Status.Server.Command == nil {
|
||||
s.Status.Server.Command = serverPod.Spec.Containers[0].Command
|
||||
statusChanged = true
|
||||
}
|
||||
if s.Status.Server.Args == nil {
|
||||
s.Status.Server.Args = serverPod.Spec.Containers[0].Args
|
||||
statusChanged = true
|
||||
}
|
||||
default:
|
||||
if s.Status.Server.Running {
|
||||
s.Status.Server.Running = false
|
||||
statusChanged = true
|
||||
}
|
||||
if len(s.Status.Server.Args) != 0 {
|
||||
s.Status.Server.Args = nil
|
||||
statusChanged = true
|
||||
}
|
||||
if len(s.Status.Server.Command) != 0 {
|
||||
s.Status.Server.Command = nil
|
||||
statusChanged = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,6 +214,14 @@ func (r *ServerManagerReconciler) Reconcile(ctx context.Context, req ctrl.Reques
|
||||
s.Status.Server.Running = false
|
||||
statusChanged = true
|
||||
}
|
||||
if len(s.Status.Server.Args) != 0 {
|
||||
s.Status.Server.Args = nil
|
||||
statusChanged = true
|
||||
}
|
||||
if len(s.Status.Server.Command) != 0 {
|
||||
s.Status.Server.Command = nil
|
||||
statusChanged = true
|
||||
}
|
||||
}
|
||||
|
||||
logging.Info("verified pod")
|
||||
|
Loading…
x
Reference in New Issue
Block a user