<commit_before>import { computed, observer, get, set } from '@ember/object';
import { not } from '@ember/object/computed';
import Component from '@ember/component';
import layout from './template';

const HISTORY_LIMIT = 10;

function getDefaultConfig(config) {
  switch ( config ) {
  case 'deployment':
    return {
      type:                 'deploymentConfig',
      revisionHistoryLimit: HISTORY_LIMIT,
    };
  case 'daemonSet':
    return {
      type:                 'daemonSetConfig',
      revisionHistoryLimit: HISTORY_LIMIT,
    };
  case 'replicaSet':
    return { type: 'replicaSetConfig' };
  case 'replicationController':
    return { type: 'replicationControllerConfig' };
  case 'statefulSet':
    return {
      type:                 'statefulSetConfig',
      podManagementPolicy:  'OrderedReady',
      revisionHistoryLimit: HISTORY_LIMIT,
      volumeClaimTemplates: [],
    };
  case 'cronJob':
    return {
      type:                       'cronJobConfig',
      concurrencyPolicy:          'Allow',
      failedJobsHistoryLimit:     HISTORY_LIMIT,
      schedule:                   '0 * * * *',
      successfulJobsHistoryLimit: HISTORY_LIMIT,
      jobConfig:                  {},
    };
  case 'job':
    return { type: 'jobConfig' };
  }
}

export default Component.extend({
  layout,
  initialScale:     null,
  isUpgrade:        null,
  isGlobal:         null,
  min:              1,
  max:              1000,
  scaleMode:        null,
  editing:          true,

  userInput:        null,

  canChangeScaleMode: not('isUpgrade'),

  init() {
    this._super(...arguments);
    set(this, 'userInput', `${ get(this, 'initialScale') || 1 }`);
    this.scaleModeChanged();
    if ( get(this, 'scaleMode') !== 'deployment' && !get(this, 'isUpgrade') ) {<commit_msg>0 scale minimum<commit_after>import { computed, observer, get, set } from '@ember/object';
import { not } from '@ember/object/computed';
import Component from '@ember/component';
import layout from './template';

const HISTORY_LIMIT = 10;

function getDefaultConfig(config) {
  switch ( config ) {
  case 'deployment':
    return {
      type:                 'deploymentConfig',
      revisionHistoryLimit: HISTORY_LIMIT,
    };
  case 'daemonSet':
    return {
      type:                 'daemonSetConfig',
      revisionHistoryLimit: HISTORY_LIMIT,
    };
  case 'replicaSet':
    return { type: 'replicaSetConfig' };
  case 'replicationController':
    return { type: 'replicationControllerConfig' };
  case 'statefulSet':
    return {
      type:                 'statefulSetConfig',
      podManagementPolicy:  'OrderedReady',
      revisionHistoryLimit: HISTORY_LIMIT,
      volumeClaimTemplates: [],
    };
  case 'cronJob':
    return {
      type:                       'cronJobConfig',
      concurrencyPolicy:          'Allow',
      failedJobsHistoryLimit:     HISTORY_LIMIT,
      schedule:                   '0 * * * *',
      successfulJobsHistoryLimit: HISTORY_LIMIT,
      jobConfig:                  {},
    };
  case 'job':
    return { type: 'jobConfig' };
  }
}

export default Component.extend({
  layout,
  initialScale:     null,
  isUpgrade:        null,
  isGlobal:         null,
  min:              0,
  max:              1000,
  scaleMode:        null,
  editing:          true,

  userInput:        null,

  canChangeScaleMode: not('isUpgrade'),

  init() {
    this._super(...arguments);

    let initial = get(this, 'initialScale');

    if ( initial === null ) {
      initial = 1;
    }

    set(this, 'userInput', `${ initial }`);
    this.scaleModeChanged();
    if ( get(this, 'scaleMode') !== 'deployment' && !get(this, 'isUpgrade') ) {
{'fraction_non_alphanumeric': 0.12350054525627045, 'fraction_numerical': 0.005179934569247546, 'mean_word_length': 2.267141585040071, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6338117', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1104, 'n_words': 239}