Skip to content

Respect the EC multi-node license option #5257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sgalsaleh
Copy link
Member

@sgalsaleh sgalsaleh commented Apr 4, 2025

What this PR does / why we need it:

Adds the ability to limit Embedded Cluster installations to a single node.

Which issue(s) this PR fixes:

SC-121720

Does this PR require a test?

Yes

Does this PR require a release note?

* Adds the ability to limit Embedded Cluster installations to a single node.

Does this PR require documentation?

Single node:

Zight 2025-04-04 at 9 07 09 AM
Zight 2025-04-04 at 9 07 32 AM

Multi node:

Zight 2025-04-04 at 9 25 49 AM
Zight 2025-04-04 at 9 25 59 AM

License field icon:

License default-kots-app-4 Admin Console 2025-04-07 at 11 01 28 AM

@sgalsaleh sgalsaleh added the type::feature New feature or request label Apr 4, 2025
@sgalsaleh sgalsaleh requested review from miaawong and laverya April 4, 2025 19:53
miaawong
miaawong previously approved these changes Apr 4, 2025
Copy link
Member

@miaawong miaawong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great Salah! 🔥 Just a few suggestions but non blocking!

@@ -472,6 +472,14 @@ const AppLicenseComponent = () => {
enabled{" "}
</span>
) : null}
{isEmbeddedCluster &&
!appLicense?.isEmbeddedClusterMultinodeDisabled ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can leave out the ternary and use logical && operator here for improved readability

const getStepNumber = (stepId: string) => {
return getSidebarSteps().findIndex((s) => s.id === stepId);
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional but we can refactor this so we can separate presentation logic with step rendering and prevent multiple calls to getStepProps

interface StepProps {
  step: {
    id: string;
    title: string;
    children?: React.ReactNode;
  };
  stepProps: {
    icon: string;
    fontClass: string;
    textColor: string;
  };
}

const SidebarStep = ({ step, stepProps }: StepProps) => {
  const { icon, fontClass, textColor } = stepProps;
  
  return (
    <div
      key={step.id}
      className="tw-p-8 tw-shadow-[0_1px_0_#c4c8ca] tw-font-medium"
    >
      <div className="tw-flex">
        <Icon
          icon={icon}
          size={16}
          className="tw-mr-2"
        />
        <span
         className={`${fontClass} ${textColor} tw-flex-1`}
        >
          {step.title}
        </span>
      </div>
      {step.children}
    </div>
  );
};

</span>
</div>

{getSidebarSteps().map((step, index) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


 {steps.map((step, index) => (
        <SidebarStep
          key={step.id}
          step={step}
          stepProps={getStepProps(index)}
        />
      ))}


const GetStartedSidebar = () => {
const { adminConsoleMetadata, appsList } = state;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const steps = getSidebarSteps();

laverya
laverya previously approved these changes Apr 4, 2025
Copy link
Member

@laverya laverya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go code looks fine, I'll leave the JS to Mia

@sgalsaleh sgalsaleh dismissed stale reviews from laverya and miaawong via 3492061 April 7, 2025 17:59
@sgalsaleh sgalsaleh merged commit 038ef52 into main Apr 7, 2025
94 checks passed
@sgalsaleh sgalsaleh deleted the salah/sc-121720/respect-the-ec-multi-node-license-option branch April 7, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants