@@ -2,6 +2,7 @@ package v1alphaExamples
2
2
3
3
import (
4
4
"fmt"
5
+ "slices"
5
6
6
7
"github.com/nobl9/nobl9-go/manifest"
7
8
"github.com/nobl9/nobl9-go/manifest/v1alpha"
@@ -14,6 +15,10 @@ type directExample struct {
14
15
typ v1alpha.DataSourceType
15
16
}
16
17
18
+ func (d directExample ) GetDataSourceType () v1alpha.DataSourceType {
19
+ return d .typ
20
+ }
21
+
17
22
func Direct () []Example {
18
23
types := v1alpha .DataSourceTypeValues ()
19
24
examples := make ([]Example , 0 , len (types ))
@@ -33,6 +38,13 @@ func Direct() []Example {
33
38
return examples
34
39
}
35
40
41
+ var betaChannelDirects = []v1alpha.DataSourceType {
42
+ v1alpha .AzureMonitor ,
43
+ v1alpha .Honeycomb ,
44
+ v1alpha .LogicMonitor ,
45
+ v1alpha .GoogleCloudMonitoring ,
46
+ }
47
+
36
48
func (d directExample ) Generate () v1alphaDirect.Direct {
37
49
titleName := dataSourceTypePrettyName (d .typ )
38
50
direct := v1alphaDirect .New (
@@ -64,6 +76,11 @@ func (d directExample) Generate() v1alphaDirect.Direct {
64
76
Unit : defaultQueryDelay .Unit ,
65
77
},
66
78
}
79
+ if slices .Contains (betaChannelDirects , typ ) {
80
+ direct .Spec .ReleaseChannel = v1alpha .ReleaseChannelBeta
81
+ } else {
82
+ direct .Spec .ReleaseChannel = v1alpha .ReleaseChannelStable
83
+ }
67
84
return direct
68
85
}
69
86
@@ -77,6 +94,7 @@ func (d directExample) generateVariant(direct v1alphaDirect.Direct) v1alphaDirec
77
94
ClientSecret : "[secret]" ,
78
95
}
79
96
case v1alpha .AzureMonitor :
97
+ direct .Spec .ReleaseChannel = v1alpha .ReleaseChannelBeta
80
98
direct .Spec .AzureMonitor = & v1alphaDirect.AzureMonitorConfig {
81
99
TenantID : "5cdecca3-c2c5-4072-89dd-5555faf05202" ,
82
100
ClientID : "70747025-9367-41a5-98f1-59b18b5793c3" ,
@@ -106,6 +124,7 @@ func (d directExample) generateVariant(direct v1alphaDirect.Direct) v1alphaDirec
106
124
ServiceAccountKey : gcloudServiceAccountKey ,
107
125
}
108
126
case v1alpha .Honeycomb :
127
+ direct .Spec .ReleaseChannel = v1alpha .ReleaseChannelBeta
109
128
direct .Spec .Honeycomb = & v1alphaDirect.HoneycombConfig {
110
129
APIKey : "[secret]" ,
111
130
}
@@ -144,10 +163,8 @@ func (d directExample) generateVariant(direct v1alphaDirect.Direct) v1alphaDirec
144
163
}
145
164
case v1alpha .Redshift :
146
165
direct .Spec .Redshift = & v1alphaDirect.RedshiftConfig {
147
- AccessKeyID : "AKIA4NPYKXO34R341XUX" ,
148
- SecretAccessKey : "[secret]" ,
149
- SecretARN : "arn:aws:secretsmanager:eu-central-1:123456578901:secret:prod-redshift-db-user" ,
150
- RoleARN : "arn:aws:iam::123456578901:role/awsCrossAccountProdRedshift-prod-app" ,
166
+ SecretARN : "arn:aws:secretsmanager:eu-central-1:123456578901:secret:prod-redshift-db-user" ,
167
+ RoleARN : "arn:aws:iam::123456578901:role/awsCrossAccountProdRedshift-prod-app" ,
151
168
}
152
169
case v1alpha .Splunk :
153
170
direct .Spec .Splunk = & v1alphaDirect.SplunkConfig {
0 commit comments