Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

argov1beta1api "github.com/argoproj-labs/argocd-operator/api/v1beta1"
gitopsv1alpha1 "github.com/hybrid-cloud-patterns/patterns-operator/api/v1alpha1"
Expand Down Expand Up @@ -85,6 +86,9 @@ func main() {
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "f2850479.hybrid-cloud-patterns.io",
Metrics: server.Options{
BindAddress: "0",
},
//LeaderElectionNamespace: "default", // Use this if we ever want to enforce a single instance per cluster
})
if err != nil {
Expand Down
60 changes: 33 additions & 27 deletions console/integration-tests/tests/pattern-catalog-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ describe('Pattern Catalog Page', () => {

it('pattern cards show tier labels', () => {
visitCatalog();
cy.get('.patterns-operator__card').first().within(() => {
cy.get('.pf-v6-c-label').should('exist');
});
cy.get('.patterns-operator__card')
.first()
.within(() => {
cy.get('.pf-v6-c-label').should('exist');
});
});

it('at least one pattern card displays a description', () => {
Expand All @@ -41,21 +43,21 @@ describe('Pattern Catalog Page', () => {

it('pattern cards have external Docs and Repo links', () => {
visitCatalog();
cy.get('.patterns-operator__card-links').first().within(() => {
cy.contains('a', 'Docs')
.should('have.attr', 'target', '_blank')
.and('have.attr', 'href');
cy.contains('a', 'Repo')
.should('have.attr', 'target', '_blank')
.and('have.attr', 'href');
});
cy.get('.patterns-operator__card-links')
.first()
.within(() => {
cy.contains('a', 'Docs').should('have.attr', 'target', '_blank').and('have.attr', 'href');
cy.contains('a', 'Repo').should('have.attr', 'target', '_blank').and('have.attr', 'href');
});
});

it('pattern cards have action buttons', () => {
visitCatalog();
cy.get('.patterns-operator__card-actions').first().within(() => {
cy.get('button').should('have.length.greaterThan', 0);
});
cy.get('.patterns-operator__card-actions')
.first()
.within(() => {
cy.get('button').should('have.length.greaterThan', 0);
});
});

it('tier filter dropdown shows all tier options', () => {
Expand All @@ -71,24 +73,28 @@ describe('Pattern Catalog Page', () => {

it('selecting all tiers shows at least as many cards as maintained only', () => {
visitCatalog();
cy.get('.patterns-operator__card').its('length').then((maintainedCount) => {
// Open filter and add Tested
cy.contains('button', 'Maintained').click();
cy.contains('Tested').click();
// Dropdown may close after selection; re-open to add Sandbox
cy.contains('button', /Maintained/).click();
cy.contains('Sandbox').click();
// Close dropdown
cy.get('body').click(0, 0);
// With more tiers selected, card count should be >= maintained only
cy.get('.patterns-operator__card').should('have.length.gte', maintainedCount);
});
cy.get('.patterns-operator__card')
.its('length')
.then((maintainedCount) => {
// Open filter and add Tested
cy.contains('button', 'Maintained').click();
cy.contains('Tested').click();
// Dropdown may close after selection; re-open to add Sandbox
cy.contains('button', /Maintained/).click();
cy.contains('Sandbox').click();
// Close dropdown
cy.get('body').click(0, 0);
// With more tiers selected, card count should be >= maintained only
cy.get('.patterns-operator__card').should('have.length.gte', maintainedCount);
});
});

it('clicking Install navigates to the install page', () => {
visitCatalog();
cy.get('body').then(($body) => {
const installBtn = $body.find('.patterns-operator__card-actions button:not(:disabled):contains("Install")');
const installBtn = $body.find(
'.patterns-operator__card-actions button:not(:disabled):contains("Install")',
);
if (installBtn.length === 0) {
cy.log('No Install button available (a pattern may already be installed)');
return;
Expand Down
20 changes: 8 additions & 12 deletions console/locales/en/plugin__patterns-operator-console-plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"A file upload is required.": "A file upload is required.",
"Additional requirements": "Additional requirements",
"Allow override": "Allow override",
"An INI file upload is required.": "An INI file upload is required.",
"Applications": "Applications",
"Auto-generate this value": "Auto-generate this value",
"Back to catalog": "Back to catalog",
Expand All @@ -9,17 +11,17 @@
"Catalog source": "Catalog source",
"Checking vault status": "Checking vault status",
"Cluster": "Cluster",
"Configure Secrets": "Configure Secrets",
"Configure Secrets for {{patternName}}": "Configure Secrets for {{patternName}}",
"Configure secrets for this pattern. File and INI fields are required before install.": "Configure secrets for this pattern. File and INI fields are required before install.",
"Configure secrets that will be injected into Vault for this pattern.": "Configure secrets that will be injected into Vault for this pattern.",
"Confirm Uninstall": "Confirm Uninstall",
"Continue to Install": "Continue to Install",
"Current Step": "Current Step",
"Deleting": "Deleting",
"Deletion Progress": "Deletion Progress",
"Docs": "Docs",
"Drag and drop a file or upload one": "Drag and drop a file or upload one",
"Enter manual value": "Enter manual value",
"Enter or update the secrets that will be injected into Vault for this pattern. Fields left empty will retain their existing values in Vault.": "Enter or update the secrets that will be injected into Vault for this pattern. Fields left empty will retain their existing values in Vault.",
"Enter or update the secrets that will be injected into Vault for this pattern. File and INI fields must be uploaded each time. Other fields may be left empty to keep existing Vault values.": "Enter or update the secrets that will be injected into Vault for this pattern. File and INI fields must be uploaded each time. Other fields may be left empty to keep existing Vault values.",
"Enter value for {{fieldName}}": "Enter value for {{fieldName}}",
"Error": "Error",
"Extracted value preview": "Extracted value preview",
Expand All @@ -30,11 +32,11 @@
"Failed to load secret template": "Failed to load secret template",
"Failed to parse INI file": "Failed to parse INI file",
"Failed to read file": "Failed to read file",
"File content will be automatically base64 encoded": "File content will be automatically base64 encoded",
"File will be stored at: {{path}}": "File will be stored at: {{path}}",
"Health": "Health",
"Hub": "Hub",
"I want to use my own fork": "I want to use my own fork",
"If checked this value will be automatically generated using vault policies": "If checked this value will be automatically generated using vault policies",
"If the secret already exists in the vault it will be changed if override is set to true": "If the secret already exists in the vault it will be changed if override is set to true",
"Inject Secrets": "Inject Secrets",
"Install": "Install",
"Install Pattern": "Install Pattern",
Expand Down Expand Up @@ -68,12 +70,12 @@
"Reconciliation Status": "Reconciliation Status",
"Reconciling": "Reconciling",
"Repo": "Repo",
"Secret configuration": "Secret configuration",
"Secret Configuration": "Secret Configuration",
"Secrets Configuration": "Secrets Configuration",
"Secrets submitted successfully": "Secrets submitted successfully",
"Select a section": "Select a section",
"Select INI section": "Select INI section",
"Skip Secrets": "Skip Secrets",
"Spoke": "Spoke",
"Static value": "Static value",
"Sync": "Sync",
Expand All @@ -83,23 +85,17 @@
"Tested Requirements:": "Tested Requirements:",
"The pattern and all its associated resources have been fully deleted.": "The pattern and all its associated resources have been fully deleted.",
"The vault injection job has been created.": "The vault injection job has been created.",
"This field has a pre-configured value": "This field has a pre-configured value",
"This field is required": "This field is required",
"This is the sizing that has been tested. The pattern is expected to work on any similarly-sized architecture.": "This is the sizing that has been tested. The pattern is expected to work on any similarly-sized architecture.",
"This pattern does not have a secret template defined.": "This pattern does not have a secret template defined.",
"This value will be automatically generated using vault policies": "This value will be automatically generated using vault policies",
"This will delete the pattern and all its deployed resources.": "This will delete the pattern and all its deployed resources.",
"Tier": "Tier",
"Uninstall": "Uninstall",
"Uninstall Pattern": "Uninstall Pattern",
"Upload a file that will be base64 encoded": "Upload a file that will be base64 encoded",
"Upload a text file": "Upload a text file",
"Upload an INI/configuration file to extract values": "Upload an INI/configuration file to extract values",
"Vault policy: {{policy}}": "Vault policy: {{policy}}",
"Vault Secret Injection": "Vault Secret Injection",
"Waiting for applications": "Waiting for applications",
"Waiting for ArgoCD applications to be created...": "Waiting for ArgoCD applications to be created...",
"You can manually override the auto-generated value": "You can manually override the auto-generated value",
"You can modify this pre-filled value": "You can modify this pre-filled value",
"Your pattern has been created. The operator is now reconciling it.": "Your pattern has been created. The operator is now reconciling it."
}
5 changes: 3 additions & 2 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"start": "concurrently --kill-others -c auto -n \"console,wds,ui-catalog\" -p \"{name}:{pid}\" \"yarn run start:console\" \"yarn run start:wds\" \"yarn run start:ui-catalog\"",
"start:wds": "PATTERN_UI_CATALOG_BASE_URL=http://localhost:8080 yarn run webpack -- serve --progress",
"start:console": "CONSOLE_VERSION=4.20.0 scripts/console.sh",
"start:ui-catalog": "UI_CATALOG_IMG=quay.io/validatedpatterns/pattern-ui-catalog:stable-v1 scripts/catalog.sh",
"start:ui-catalog": "scripts/catalog.sh",
"i18n": "./i18n-scripts/build-i18n.sh && node ./i18n-scripts/set-english-defaults.js",
"lint": "yarn eslint src integration-tests --fix && stylelint 'src/**/*.css' --allow-empty-input --fix",
"test-cypress": "cd integration-tests && cypress open",
Expand Down Expand Up @@ -95,7 +95,8 @@
"mocha": "^10.5.1"
},
"dependencies": {
"js-yaml": "^4.1.1"
"js-yaml": "^4.1.1",
"yaml": "^2.8.3"
},
"resolutions": {
"braces": "^3.0.3"
Expand Down
1 change: 1 addition & 0 deletions console/scripts/catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -euo pipefail
CONSOLE_IMAGE_PLATFORM=${CONSOLE_IMAGE_PLATFORM:="linux/amd64"}

UI_CATALOG_IMG=${UI_CATALOG_IMG:="quay.io/validatedpatterns/pattern-ui-catalog:stable-v1"}

echo "Starting local UI catalog image..."
echo "Console Image: $UI_CATALOG_IMG"
Expand Down
Loading