Skip to content

Commit

Permalink
Add api key environment variable set command to the list of connect t…
Browse files Browse the repository at this point in the history
…o enclave CLI commands.
  • Loading branch information
laurentluce committed Feb 21, 2024
1 parent ad00ee1 commit 0a87080
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import { EnclaveFullInfo } from "../../types";
export type ConnectEnclaveModalProps = {
enclave: EnclaveFullInfo;
instanceUUID: string;
apiKey: string;
isOpen: boolean;
onClose: () => void;
};

export const ConnectEnclaveModal = ({ isOpen, onClose, enclave, instanceUUID }: ConnectEnclaveModalProps) => {
export const ConnectEnclaveModal = ({ isOpen, onClose, enclave, instanceUUID, apiKey }: ConnectEnclaveModalProps) => {
const commands = `
export KURTOSIS_CLOUD_API_KEY="${apiKey}"
kurtosis cloud load ${instanceUUID}
kurtosis enclave connect ${enclave.name}
kurtosis enclave inspect ${enclave.name}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { ConnectEnclaveModal } from "../modals/ConnectEnclaveModal";
type ConnectEnclaveButtonProps = ButtonProps & {
enclave: EnclaveFullInfo;
instanceUUID: string;
apiKey: string;
};

export const ConnectEnclaveButton = ({ enclave, instanceUUID, ...buttonProps }: ConnectEnclaveButtonProps) => {
export const ConnectEnclaveButton = ({ enclave, instanceUUID, apiKey, ...buttonProps }: ConnectEnclaveButtonProps) => {
const [showModal, setShowModal] = useState(false);

return (
Expand All @@ -29,6 +30,7 @@ export const ConnectEnclaveButton = ({ enclave, instanceUUID, ...buttonProps }:
<ConnectEnclaveModal
enclave={enclave}
instanceUUID={instanceUUID}
apiKey={apiKey}
isOpen={showModal}
onClose={() => setShowModal(false)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const EnclaveImpl = ({ enclave }: EnclaveImplProps) => {
};

const instanceUUID = Cookies.get("_kurtosis_instance_id") || "";
const apiKey = Cookies.get("_kurtosis_api_key") || "";

return (
<Tabs isManual isLazy index={activeIndex} onChange={handleTabChange} variant={"kurtosisHeaderLine"}>
Expand All @@ -58,7 +59,7 @@ const EnclaveImpl = ({ enclave }: EnclaveImplProps) => {
<Flex gap={"8px"} alignItems={"center"} pb={"16px"}>
<DeleteEnclavesButton enclaves={[enclave]} />
<EditEnclaveButton enclave={enclave} />
<ConnectEnclaveButton enclave={enclave} instanceUUID={instanceUUID} />
<ConnectEnclaveButton enclave={enclave} instanceUUID={instanceUUID} apiKey={apiKey} />
</Flex>
</Flex>
<TabPanels>
Expand Down

0 comments on commit 0a87080

Please sign in to comment.