Skip to content

Commit 015b099

Browse files
authored
Fix ui-server schema (#244)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent a13b1fa commit 015b099

20 files changed

+169
-54
lines changed

apis/installer/v1alpha1/stash_ui_server_types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type StashUiServerSpec struct {
4949
//+optional
5050
FullnameOverride string `json:"fullnameOverride"`
5151
ReplicaCount int32 `json:"replicaCount"`
52+
RegistryFQDN string `json:"registryFQDN"`
5253
Image Container `json:"image"`
5354
ImagePullPolicy string `json:"imagePullPolicy"`
5455
//+optional
@@ -74,10 +75,8 @@ type StashUiServerSpec struct {
7475
// +optional
7576
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
7677
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
77-
Apiserver WebHookSpec `json:"apiserver"`
78-
//+optional
79-
EnableAnalytics bool `json:"enableAnalytics"`
80-
Monitoring Monitoring `json:"monitoring"`
78+
Apiserver EASSpec `json:"apiserver"`
79+
Monitoring EASMonitoring `json:"monitoring"`
8180
}
8281

8382
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

apis/installer/v1alpha1/types.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ type HealthcheckSpec struct {
8787
Enabled bool `json:"enabled"`
8888
}
8989

90+
// +kubebuilder:validation:Enum=prometheus.io;prometheus.io/operator;prometheus.io/builtin
91+
type MonitoringAgent string
92+
9093
type Monitoring struct {
91-
Agent string `json:"agent"`
94+
Agent MonitoringAgent `json:"agent"`
9295
//+optional
9396
Backup bool `json:"backup"`
9497
//+optional
@@ -101,6 +104,24 @@ type ServiceMonitorLabels struct {
101104
Labels map[string]string `json:"labels"`
102105
}
103106

107+
type EASSpec struct {
108+
GroupPriorityMinimum int32 `json:"groupPriorityMinimum"`
109+
VersionPriority int32 `json:"versionPriority"`
110+
UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"`
111+
Healthcheck EASHealthcheckSpec `json:"healthcheck"`
112+
ServingCerts ServingCerts `json:"servingCerts"`
113+
}
114+
115+
type EASHealthcheckSpec struct {
116+
// +optional
117+
Enabled bool `json:"enabled"`
118+
}
119+
120+
type EASMonitoring struct {
121+
Agent MonitoringAgent `json:"agent"`
122+
ServiceMonitor *ServiceMonitorLabels `json:"serviceMonitor"`
123+
}
124+
104125
type SecuritySpec struct {
105126
Apparmor ApparmorSpec `json:"apparmor"`
106127
Seccomp SeccompSpec `json:"seccomp"`

apis/installer/v1alpha1/types_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func TestDefaultValues(t *testing.T) {
3131
v1alpha1.StashCommunitySpec{},
3232
v1alpha1.StashEnterpriseSpec{},
3333
v1alpha1.StashSpec{},
34+
v1alpha1.StashUiServerSpec{},
3435
)
3536
checker.TestAll(t)
3637
}

apis/installer/v1alpha1/zz_generated.deepcopy.go

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/stash-community/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The following table lists the configurable parameters of the `stash-community` c
9696
| apiserver.servingCerts.caCrt | CA certficate used by serving certificate of webhook server. | <code>""</code> |
9797
| apiserver.servingCerts.serverCrt | Serving certficate used by webhook server. | <code>""</code> |
9898
| apiserver.servingCerts.serverKey | Private key for the serving certificate used by webhook server. | <code>""</code> |
99-
| monitoring.agent | Name of monitoring agent (either "prometheus.io/operator" or "prometheus.io/builtin") | <code>"none"</code> |
99+
| monitoring.agent | Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin") | <code>""</code> |
100100
| monitoring.backup | Specify whether to monitor Stash backup and recovery | <code>false</code> |
101101
| monitoring.operator | Specify whether to monitor Stash operator | <code>false</code> |
102102
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |

charts/stash-community/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ spec:
6666
ports:
6767
- containerPort: 8443
6868
env:
69-
- name: MY_POD_NAME
69+
- name: POD_NAME
7070
valueFrom:
7171
fieldRef:
7272
fieldPath: metadata.name
73-
- name: MY_POD_NAMESPACE
73+
- name: POD_NAMESPACE
7474
valueFrom:
7575
fieldRef:
7676
fieldPath: metadata.namespace

charts/stash-community/values.openapiv3_schema.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,10 @@ properties:
844844
monitoring:
845845
properties:
846846
agent:
847+
enum:
848+
- prometheus.io
849+
- prometheus.io/operator
850+
- prometheus.io/builtin
847851
type: string
848852
backup:
849853
type: boolean

charts/stash-community/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ apiserver:
147147
# Private key for the serving certificate used by webhook server.
148148
serverKey: ""
149149
monitoring:
150-
# Name of monitoring agent (either "prometheus.io/operator" or "prometheus.io/builtin")
151-
agent: "none"
150+
# Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin")
151+
agent: ""
152152
# Specify whether to monitor Stash backup and recovery
153153
backup: false
154154
# Specify whether to monitor Stash operator

charts/stash-enterprise/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The following table lists the configurable parameters of the `stash-enterprise`
9696
| apiserver.servingCerts.caCrt | CA certficate used by serving certificate of webhook server. | <code>""</code> |
9797
| apiserver.servingCerts.serverCrt | Serving certficate used by webhook server. | <code>""</code> |
9898
| apiserver.servingCerts.serverKey | Private key for the serving certificate used by webhook server. | <code>""</code> |
99-
| monitoring.agent | Name of monitoring agent (either "prometheus.io/operator" or "prometheus.io/builtin") | <code>"none"</code> |
99+
| monitoring.agent | Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin") | <code>""</code> |
100100
| monitoring.backup | Specify whether to monitor Stash backup and recovery | <code>false</code> |
101101
| monitoring.operator | Specify whether to monitor Stash operator | <code>false</code> |
102102
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |

charts/stash-enterprise/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ spec:
7171
ports:
7272
- containerPort: 8443
7373
env:
74-
- name: MY_POD_NAME
74+
- name: POD_NAME
7575
valueFrom:
7676
fieldRef:
7777
fieldPath: metadata.name
78-
- name: MY_POD_NAMESPACE
78+
- name: POD_NAMESPACE
7979
valueFrom:
8080
fieldRef:
8181
fieldPath: metadata.namespace

0 commit comments

Comments
 (0)