Skip to content

Commit

Permalink
Moving environment as an object in the helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
pubudu538 committed Oct 13, 2023
1 parent 1363c8a commit d32b39c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ spec:
type: string
environment:
description: Environment denotes the environment of the API.
nullable: true
type: string
isDefaultVersion:
description: IsDefaultVersion indicates whether this API version should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ func getResolvedClaimMapping(claimMappings []dpv1alpha1.ClaimMapping) map[string

func getTokenIssuerEnvironments(environments []string) []string {

resolvedEnvirenvironments := []string{}
resolvedEnvironments := []string{}
if len(environments) == 0 {
resolvedEnvirenvironments = append(resolvedEnvirenvironments, defaultAllEnvironments)
resolvedEnvironments = append(resolvedEnvironments, defaultAllEnvironments)
} else {
resolvedEnvirenvironments = environments
resolvedEnvironments = environments
}

return resolvedEnvirenvironments
return resolvedEnvironments
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void setApiContext(String apiContext) {
this.apiContext = apiContext;
}

public String getEnvironment() {
public String getEnvironmentId() {
return environmentId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class APIConstants {
public static final String API_KEY_TYPE_PRODUCTION = "PRODUCTION";
public static final String API_KEY_TYPE_SANDBOX = "SANDBOX";
public static final String DEFAULT_ENVIRONMENT_NAME = "Default";
public static final String DEFAULT_ENVIRONMENT_ID = "Default-ID";

public static final String AUTHORIZATION_HEADER_BASIC = "Basic";
public static final String API_SECURITY_OAUTH2 = "oauth2";
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A Helm chart for APK components
| wso2.apk.idp.signing.secretName | string | `""` | IDP jwt signing certificate secret name |
| wso2.apk.idp.signing.fileName | string | `""` | IDP jwt signing certificate file name |
| wso2.apk.dp.enabled | bool | `true` | Enable the deployment of the Data Plane |
| wso2.apk.dp.environment | string | `Default` | Environment of the Data Plane |
| wso2.apk.dp.environment.name | string | `Default` | Environment of the Data Plane |
| wso2.apk.dp.gateway.listener.hostname | string | `"gw.wso2.com"` | Gateway Listener Hostname |
| wso2.apk.dp.gateway.listener.secretName | string | `""` | Gateway Listener Certificate Secret Name |
| wso2.apk.dp.gateway.listener.dns | list | `["*.gw.wso2.com","*.sandbox.gw.wso2.com","prod.gw.wso2.com"]` | DNS entries for gateway listener certificate |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
data:
config.toml: |
[commoncontroller]
{{- if .Values.wso2.apk.dp.environment }}
environment = "{{ .Values.wso2.apk.dp.environment }}"
{{- if and .Values.wso2.apk.dp.environment .Values.wso2.apk.dp.environment.name }}
environment = "{{ .Values.wso2.apk.dp.environment.name }}"
{{- end }}
[commoncontroller.server]
label = "ratelimiter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
data:
config.toml: |
[adapter]
{{- if .Values.wso2.apk.dp.environment }}
environment = "{{ .Values.wso2.apk.dp.environment }}"
{{- if and .Values.wso2.apk.dp.environment .Values.wso2.apk.dp.environment.name }}
environment = "{{ .Values.wso2.apk.dp.environment.name }}"
{{- end }}
{{ if and .Values.wso2.apk.dp.adapter.configs .Values.wso2.apk.dp.adapter.configs.apiNamespaces }}
[adapter.operator]
Expand Down
5 changes: 3 additions & 2 deletions helm-charts/values.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ wso2:
dp:
# -- Enable the deployment of the Data Plane
enabled: true
# -- Environment Name of the Data Plane
environment: "Development"
environment:
# -- Environment Name of the Data Plane
name: "Development"
gateway:
listener:
# -- Gateway Listener Hostname
Expand Down

0 comments on commit d32b39c

Please sign in to comment.