Merge branch 'master' into auth-srv-srv
This commit is contained in:
commit
9fb1d476a2
@ -129,7 +129,7 @@ func (k *kubernetes) getService(labels map[string]string) ([]*service, error) {
|
||||
// parse out deployment status and inject into service metadata
|
||||
if len(kdep.Status.Conditions) > 0 {
|
||||
svc.Metadata["status"] = kdep.Status.Conditions[0].Type
|
||||
svc.Metadata["started"] = kdep.Status.Conditions[0].LastUpdate
|
||||
svc.Metadata["started"] = kdep.Status.Conditions[0].LastUpdateTime
|
||||
delete(svc.Metadata, "error")
|
||||
} else {
|
||||
svc.Metadata["status"] = "n/a"
|
||||
|
@ -3,6 +3,7 @@ package client
|
||||
var templates = map[string]string{
|
||||
"deployment": deploymentTmpl,
|
||||
"service": serviceTmpl,
|
||||
"namespace": namespaceTmpl,
|
||||
}
|
||||
|
||||
// stripped image pull policy always
|
||||
@ -108,3 +109,16 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
`
|
||||
|
||||
var namespaceTmpl = `
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: "{{ .Metadata.Name }}"
|
||||
labels:
|
||||
{{- with .Metadata.Labels }}
|
||||
{{- range $key, $value := . }}
|
||||
{{ $key }}: "{{ $value }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
`
|
||||
|
@ -39,10 +39,10 @@ type DeploymentSpec struct {
|
||||
|
||||
// DeploymentCondition describes the state of deployment
|
||||
type DeploymentCondition struct {
|
||||
LastUpdate string `json:lastUpdateTime`
|
||||
LastUpdateTime string `json:"lastUpdateTime"`
|
||||
Type string `json:"type"`
|
||||
reason string `json:"reason,omitempty"`
|
||||
message string `json:"message,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentStatus is returned when querying deployment
|
||||
@ -178,3 +178,8 @@ type Template struct {
|
||||
Metadata *Metadata `json:"metadata,omitempty"`
|
||||
PodSpec *PodSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// Namespace is a Kubernetes Namespace
|
||||
type Namespace struct {
|
||||
Metadata *Metadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user