-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add annotations to clusters Signed-off-by: Waleed Malik <[email protected]> * Annotation handling for nodes and clusters Signed-off-by: Waleed Malik <[email protected]> * Don't show hidden annotations Signed-off-by: Waleed Malik <[email protected]> * Annotations for cluster templates Signed-off-by: Waleed Malik <[email protected]> * Force close the SSH keys dropdown in e2e tests * Fix unit tests Signed-off-by: Waleed Malik <[email protected]> * Handle empty annotation values for admin setting defaults --------- Signed-off-by: Waleed Malik <[email protected]> Co-authored-by: Waseem Abbas <[email protected]>
- Loading branch information
1 parent
8a66036
commit c0bf02c
Showing
50 changed files
with
941 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,15 +43,15 @@ func TestGetGlobalSettings(t *testing.T) { | |
// scenario 1 | ||
{ | ||
name: "scenario 1: user gets settings first time", | ||
expectedResponse: `{"customLinks":[],"defaultNodeCount":2,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":false,"enableDashboard":true,"enableOIDCKubeconfig":false,"userProjectsLimit":0,"restrictProjectCreation":false,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{},"opaOptions":{},"mlaOptions":{},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"webTerminalOptions":{"enabled":false},"machineDeploymentVMResourceQuota":{"minCPU":2,"maxCPU":32,"minRAM":2,"maxRAM":128,"enableGPU":false},"machineDeploymentOptions":{}}`, | ||
expectedResponse: `{"customLinks":[],"defaultNodeCount":2,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":false,"enableDashboard":true,"enableOIDCKubeconfig":false,"userProjectsLimit":0,"restrictProjectCreation":false,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{},"opaOptions":{},"mlaOptions":{},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"webTerminalOptions":{"enabled":false},"machineDeploymentVMResourceQuota":{"minCPU":2,"maxCPU":32,"minRAM":2,"maxRAM":128,"enableGPU":false},"machineDeploymentOptions":{},"annotations":{"hiddenAnnotations":["kubectl.kubernetes.io/last-applied-configuration","kubermatic.io/initial-application-installations-request","kubermatic.io/initial-machinedeployment-request"],"protectedAnnotations":["presetName"]}}`, | ||
httpStatus: http.StatusOK, | ||
existingKubermaticObjs: []ctrlruntimeclient.Object{genUser("Bob", "[email protected]", true)}, | ||
existingAPIUser: test.GenDefaultAPIUser(), | ||
}, | ||
// scenario 2 | ||
{ | ||
name: "scenario 2: user gets existing global settings", | ||
expectedResponse: `{"customLinks":[{"label":"label","url":"url:label","icon":"icon","location":"EU"}],"defaultNodeCount":5,"displayDemoInfo":true,"displayAPIDocs":true,"displayTermsOfService":true,"enableDashboard":false,"enableShareCluster":true,"enableOIDCKubeconfig":false,"enableEtcdBackup":true,"userProjectsLimit":0,"restrictProjectCreation":false,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{"enabled":true,"enforced":true},"opaOptions":{"enabled":true,"enforced":true},"mlaOptions":{"loggingEnabled":true,"loggingEnforced":true,"monitoringEnabled":true,"monitoringEnforced":true},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"defaultQuota":{"quota":{"cpu":2,"memory":5,"storage":10}},"machineDeploymentOptions":{}}`, | ||
expectedResponse: `{"customLinks":[{"label":"label","url":"url:label","icon":"icon","location":"EU"}],"defaultNodeCount":5,"displayDemoInfo":true,"displayAPIDocs":true,"displayTermsOfService":true,"enableDashboard":false,"enableShareCluster":true,"enableOIDCKubeconfig":false,"enableEtcdBackup":true,"userProjectsLimit":0,"restrictProjectCreation":false,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{"enabled":true,"enforced":true},"opaOptions":{"enabled":true,"enforced":true},"mlaOptions":{"loggingEnabled":true,"loggingEnforced":true,"monitoringEnabled":true,"monitoringEnforced":true},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"defaultQuota":{"quota":{"cpu":2,"memory":5,"storage":10}},"machineDeploymentOptions":{},"annotations":{"hiddenAnnotations":["kubectl.kubernetes.io/last-applied-configuration","kubermatic.io/initial-application-installations-request","kubermatic.io/initial-machinedeployment-request"],"protectedAnnotations":["presetName"]}}`, | ||
httpStatus: http.StatusOK, | ||
existingKubermaticObjs: []ctrlruntimeclient.Object{genUser("Bob", "[email protected]", true), | ||
test.GenDefaultGlobalSettings()}, | ||
|
@@ -107,7 +107,7 @@ func TestUpdateGlobalSettings(t *testing.T) { | |
{ | ||
name: "scenario 2: authorized user updates default settings", | ||
body: `{"customLinks":[{"label":"label","url":"url:label","icon":"icon","location":"EU"}],"cleanupOptions":{"enabled":true,"enforced":true},"defaultNodeCount":100,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":true,"machineDeploymentOptions":{}}`, | ||
expectedResponse: `{"customLinks":[{"label":"label","url":"url:label","icon":"icon","location":"EU"}],"defaultNodeCount":100,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":true,"enableDashboard":true,"enableOIDCKubeconfig":false,"userProjectsLimit":0,"restrictProjectCreation":false,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{"enabled":true,"enforced":true},"opaOptions":{},"mlaOptions":{},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"webTerminalOptions":{"enabled":false},"machineDeploymentVMResourceQuota":{"minCPU":2,"maxCPU":32,"minRAM":2,"maxRAM":128,"enableGPU":false},"machineDeploymentOptions":{}}`, | ||
expectedResponse: `{"customLinks":[{"label":"label","url":"url:label","icon":"icon","location":"EU"}],"defaultNodeCount":100,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":true,"enableDashboard":true,"enableOIDCKubeconfig":false,"userProjectsLimit":0,"restrictProjectCreation":false,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{"enabled":true,"enforced":true},"opaOptions":{},"mlaOptions":{},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"webTerminalOptions":{"enabled":false},"machineDeploymentVMResourceQuota":{"minCPU":2,"maxCPU":32,"minRAM":2,"maxRAM":128,"enableGPU":false},"machineDeploymentOptions":{},"annotations":{"hiddenAnnotations":["kubectl.kubernetes.io/last-applied-configuration","kubermatic.io/initial-application-installations-request","kubermatic.io/initial-machinedeployment-request"],"protectedAnnotations":["presetName"]}}`, | ||
httpStatus: http.StatusOK, | ||
existingKubermaticObjs: []ctrlruntimeclient.Object{genUser("Bob", "[email protected]", true)}, | ||
existingAPIUser: test.GenDefaultAPIUser(), | ||
|
@@ -116,7 +116,7 @@ func TestUpdateGlobalSettings(t *testing.T) { | |
{ | ||
name: "scenario 3: authorized user updates existing global settings", | ||
body: `{"customLinks":[],"cleanupOptions":{"enabled":true,"enforced":true},"defaultNodeCount":100,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":true,"userProjectsLimit":10,"restrictProjectCreation":true,"restrictProjectDeletion":false,"defaultQuota":{"cpu":4,"storage":12},"machineDeploymentOptions":{}}`, | ||
expectedResponse: `{"customLinks":[],"defaultNodeCount":100,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":true,"enableDashboard":false,"enableShareCluster":true,"enableOIDCKubeconfig":false,"enableEtcdBackup":true,"userProjectsLimit":10,"restrictProjectCreation":true,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{"enabled":true,"enforced":true},"opaOptions":{"enabled":true,"enforced":true},"mlaOptions":{"loggingEnabled":true,"loggingEnforced":true,"monitoringEnabled":true,"monitoringEnforced":true},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"defaultQuota":{"quota":{"cpu":2,"memory":5,"storage":10}},"machineDeploymentOptions":{}}`, | ||
expectedResponse: `{"customLinks":[],"defaultNodeCount":100,"displayDemoInfo":false,"displayAPIDocs":false,"displayTermsOfService":true,"enableDashboard":false,"enableShareCluster":true,"enableOIDCKubeconfig":false,"enableEtcdBackup":true,"userProjectsLimit":10,"restrictProjectCreation":true,"restrictProjectDeletion":false,"enableExternalClusterImport":true,"cleanupOptions":{"enabled":true,"enforced":true},"opaOptions":{"enabled":true,"enforced":true},"mlaOptions":{"loggingEnabled":true,"loggingEnforced":true,"monitoringEnabled":true,"monitoringEnforced":true},"mlaAlertmanagerPrefix":"","mlaGrafanaPrefix":"","notifications":{},"providerConfiguration":{"openStack":{},"vmwareCloudDirector":{}},"defaultQuota":{"quota":{"cpu":2,"memory":5,"storage":10}},"machineDeploymentOptions":{},"annotations":{"hiddenAnnotations":["kubectl.kubernetes.io/last-applied-configuration","kubermatic.io/initial-application-installations-request","kubermatic.io/initial-machinedeployment-request"],"protectedAnnotations":["presetName"]}}`, | ||
httpStatus: http.StatusOK, | ||
existingKubermaticObjs: []ctrlruntimeclient.Object{genUser("Bob", "[email protected]", true), | ||
test.GenDefaultGlobalSettings()}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.