Dont require credential for Container Groups

Might want to follow up and make this only apply to Tower on Kubernetes
This commit is contained in:
Shane McDonald 2021-03-02 19:11:56 -05:00
parent 29ff69a774
commit aab58f5ae7
2 changed files with 2 additions and 4 deletions

View File

@ -37,7 +37,7 @@ function ContainerGroupEdit({ instanceGroup }) {
try {
await InstanceGroupsAPI.update(instanceGroup.id, {
name: values.name,
credential: values.credential.id,
credential: values.credential ? values.credential.id : null,
pod_spec_override: values.override ? values.pod_spec_override : null,
});
history.push(detailsIUrl);

View File

@ -25,7 +25,6 @@ function ContainerGroupFormFields({ i18n, instanceGroup }) {
const { setFieldValue } = useFormikContext();
const [credentialField, credentialMeta, credentialHelpers] = useField({
name: 'credential',
validate: required(i18n._(t`Select a value for this field`), i18n),
});
const [overrideField] = useField('override');
@ -55,9 +54,8 @@ function ContainerGroupFormFields({ i18n, instanceGroup }) {
onBlur={() => credentialHelpers.setTouched()}
onChange={onCredentialChange}
value={credentialField.value}
required
tooltip={i18n._(
t`Credential to authenticate with Kubernetes or OpenShift. Must be of type "Kubernetes/OpenShift API Bearer Token.`
t`Credential to authenticate with Kubernetes or OpenShift. Must be of type "Kubernetes/OpenShift API Bearer Token". If left blank, the underlying Pod's service account will be used.`
)}
autoPopulate={!instanceGroup?.id}
/>