<commit_before>resource "kubernetes_secret" "ci_config" {
  metadata {
    name = "ci-config"
  }

  data = {
    storage_uri      = var.storage_uri
    deploy_steps     = jsonencode(var.deploy_steps)
    watched_branches = jsonencode(var.watched_branches)
    github_context   = var.github_context
  }
}

resource "kubernetes_secret" "zulip_config" {
  count = fileexists("~/.hail/.zuliprc") ? 1 : 0
  metadata {
    name = "zulip-config"
  }

  data = {
    ".zuliprc" = fileexists("~/.hail/.zuliprc") ? file("~/.hail/.zuliprc") : ""
  }
}

resource "kubernetes_secret" "ci_and_deploy_github_oauth_token" {
  metadata {
    name = "hail-ci-0-1-github-oauth-token"
  }

  data = {
    "oauth-token" = var.ci_and_deploy_github_oauth_token
  }
}

resource "kubernetes_secret" "ci_test_repo_creator_github_oauth_token" {
  metadata {
    name = "hail-ci-0-1-service-account-key"
  }

  data = {
    "user1" = var.ci_test_repo_creator_github_oauth_token
  }
}<commit_msg>[infra] Give Azure batch the same clusterrole it has in GCP (#12134)<commit_after>resource "kubernetes_secret" "ci_config" {
  metadata {
    name = "ci-config"
  }

  data = {
    storage_uri      = var.storage_uri
    deploy_steps     = jsonencode(var.deploy_steps)
    watched_branches = jsonencode(var.watched_branches)
    github_context   = var.github_context
  }
}

resource "kubernetes_secret" "zulip_config" {
  count = fileexists("~/.hail/.zuliprc") ? 1 : 0
  metadata {
    name = "zulip-config"
  }

  data = {
    ".zuliprc" = fileexists("~/.hail/.zuliprc") ? file("~/.hail/.zuliprc") : ""
  }
}

resource "kubernetes_secret" "ci_and_deploy_github_oauth_token" {
  metadata {
    name = "hail-ci-0-1-github-oauth-token"
  }

  data = {
    "oauth-token" = var.ci_and_deploy_github_oauth_token
  }
}

resource "kubernetes_secret" "ci_test_repo_creator_github_oauth_token" {
  metadata {
    name = "hail-ci-0-1-service-account-key"
  }

  data = {
    "user1" = var.ci_test_repo_creator_github_oauth_token
  }
}

# Necessary for batch to access secrets/SAs in test namespaces
resource "kubernetes_cluster_role" "batch" {
  metadata {
    name = "batch"
  }

  rule {
    api_groups = [""]
    resources  = ["secrets", "serviceaccounts"]
    verbs      = ["get", "list"]
  }
}

resource "kubernetes_cluster_role_binding" "batch" {
  metadata {
    name = "batch"
  }
  role_ref {
    kind      = "ClusterRole"
    name      = "batch"
    api_group = "rbac.authorization.k8s.io"
  }
  subject {
    kind      = "ServiceAccount"
    name      = "batch"
    namespace = "default"
  }
}
{'fraction_non_alphanumeric': 0.13315111284654432, 'fraction_numerical': 0.007809449433814916, 'mean_word_length': 3.1256038647342996, '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': '1637765', 'n_tokens_mistral': 1007, 'n_tokens_neox': 967, 'n_words': 148}