-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(instance) prevent local volume attach to instances on another clu…
…ster member Signed-off-by: David Edler <[email protected]>
- Loading branch information
Showing
12 changed files
with
140 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { FormikProps } from "formik/dist/types"; | ||
import { CreateInstanceFormValues } from "pages/instances/CreateInstance"; | ||
import { EditInstanceFormValues } from "pages/instances/EditInstance"; | ||
import { InstanceAndProfileFormikProps } from "components/forms/instanceAndProfileFormValues"; | ||
import { useSettings } from "context/useSettings"; | ||
import { isClusteredServer } from "util/settings"; | ||
|
||
export const getInstanceLocation = (formik: InstanceAndProfileFormikProps) => { | ||
const { data: settings } = useSettings(); | ||
const isClustered = isClusteredServer(settings); | ||
|
||
if (!isClustered) { | ||
return undefined; | ||
} | ||
|
||
if (formik.values.entityType !== "instance") { | ||
return undefined; | ||
} | ||
|
||
if (formik.values.isCreating) { | ||
const createFormik = formik as FormikProps<CreateInstanceFormValues>; | ||
return createFormik.values.target ?? "any"; | ||
} | ||
|
||
const editFormik = formik as FormikProps<EditInstanceFormValues>; | ||
return editFormik.values.location; | ||
}; |
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