You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gi...@apache.org on 2026/05/23 01:52:55 UTC
(superset-kubernetes-operator) 01/01: Deployed 0f51c6c with MkDocs version: 1.6.1
This is an automated email from the ASF dual-hosted git repository.
github-actions[bot] pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/superset-kubernetes-operator.git
commit d18c6b4a58e904cb0140faf1aecbbe8bfa962175
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Sat May 23 01:52:48 2026 +0000
Deployed 0f51c6c with MkDocs version: 1.6.1
---
.nojekyll | 0
404.html | 991 +++
architecture/internals/index.html | 2416 +++++++
architecture/overview/index.html | 1799 ++++++
assets/images/favicon.png | Bin 0 -> 1870 bytes
assets/javascripts/bundle.79ae519e.min.js | 16 +
assets/javascripts/bundle.79ae519e.min.js.map | 7 +
assets/javascripts/lunr/min/lunr.ar.min.js | 1 +
assets/javascripts/lunr/min/lunr.da.min.js | 18 +
assets/javascripts/lunr/min/lunr.de.min.js | 18 +
assets/javascripts/lunr/min/lunr.du.min.js | 18 +
assets/javascripts/lunr/min/lunr.el.min.js | 1 +
assets/javascripts/lunr/min/lunr.es.min.js | 18 +
assets/javascripts/lunr/min/lunr.fi.min.js | 18 +
assets/javascripts/lunr/min/lunr.fr.min.js | 18 +
assets/javascripts/lunr/min/lunr.he.min.js | 1 +
assets/javascripts/lunr/min/lunr.hi.min.js | 1 +
assets/javascripts/lunr/min/lunr.hu.min.js | 18 +
assets/javascripts/lunr/min/lunr.hy.min.js | 1 +
assets/javascripts/lunr/min/lunr.it.min.js | 18 +
assets/javascripts/lunr/min/lunr.ja.min.js | 1 +
assets/javascripts/lunr/min/lunr.jp.min.js | 1 +
assets/javascripts/lunr/min/lunr.kn.min.js | 1 +
assets/javascripts/lunr/min/lunr.ko.min.js | 1 +
assets/javascripts/lunr/min/lunr.multi.min.js | 1 +
assets/javascripts/lunr/min/lunr.nl.min.js | 18 +
assets/javascripts/lunr/min/lunr.no.min.js | 18 +
assets/javascripts/lunr/min/lunr.pt.min.js | 18 +
assets/javascripts/lunr/min/lunr.ro.min.js | 18 +
assets/javascripts/lunr/min/lunr.ru.min.js | 18 +
assets/javascripts/lunr/min/lunr.sa.min.js | 1 +
.../lunr/min/lunr.stemmer.support.min.js | 1 +
assets/javascripts/lunr/min/lunr.sv.min.js | 18 +
assets/javascripts/lunr/min/lunr.ta.min.js | 1 +
assets/javascripts/lunr/min/lunr.te.min.js | 1 +
assets/javascripts/lunr/min/lunr.th.min.js | 1 +
assets/javascripts/lunr/min/lunr.tr.min.js | 18 +
assets/javascripts/lunr/min/lunr.vi.min.js | 1 +
assets/javascripts/lunr/min/lunr.zh.min.js | 1 +
assets/javascripts/lunr/tinyseg.js | 206 +
assets/javascripts/lunr/wordcut.js | 6708 ++++++++++++++++++++
assets/javascripts/workers/search.2c215733.min.js | 42 +
.../javascripts/workers/search.2c215733.min.js.map | 7 +
assets/stylesheets/main.484c7ddc.min.css | 1 +
assets/stylesheets/main.484c7ddc.min.css.map | 1 +
assets/stylesheets/palette.ab4e12ef.min.css | 1 +
assets/stylesheets/palette.ab4e12ef.min.css.map | 1 +
contributing/development-guidelines/index.html | 2190 +++++++
contributing/development-setup/index.html | 1692 +++++
contributing/releasing/index.html | 1423 +++++
getting-started/index.html | 1285 ++++
index.html | 1293 ++++
reference/api-reference/index.html | 5608 ++++++++++++++++
reference/downloads/index.html | 1427 +++++
reference/security/index.html | 1926 ++++++
search/search_index.json | 1 +
sitemap.xml | 63 +
sitemap.xml.gz | Bin 0 -> 368 bytes
stylesheets/extra.css | 30 +
user-guide/configuration/index.html | 3210 ++++++++++
user-guide/installation/index.html | 1525 +++++
user-guide/lifecycle/index.html | 2627 ++++++++
user-guide/migration/index.html | 1927 ++++++
user-guide/networking-and-monitoring/index.html | 1554 +++++
64 files changed, 40264 insertions(+)
diff --git a/.nojekyll b/.nojekyll
new file mode 100644
index 0000000..e69de29
diff --git a/404.html b/404.html
new file mode 100644
index 0000000..78700a2
--- /dev/null
+++ b/404.html
@@ -0,0 +1,991 @@
+
+<!doctype html>
+<html lang="en" class="no-js">
+ <head>
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <meta name="description" content="Kubernetes operator for deploying and managing Apache Superset">
+
+
+
+
+
+
+
+
+
+ <link rel="icon" href="/superset-kubernetes-operator/assets/images/favicon.png">
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
+
+
+
+ <title>Apache Superset Kubernetes Operator</title>
+
+
+
+ <link rel="stylesheet" href="/superset-kubernetes-operator/assets/stylesheets/main.484c7ddc.min.css">
+
+
+ <link rel="stylesheet" href="/superset-kubernetes-operator/assets/stylesheets/palette.ab4e12ef.min.css">
+
+
+
+
+
+
+
+
+
+
+
+
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
+ <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
+
+
+
+ <link rel="stylesheet" href="/superset-kubernetes-operator/stylesheets/extra.css">
+
+ <script>__md_scope=new URL("/superset-kubernetes-operator/",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
+
+
+
+
+
+ </head>
+
+
+
+
+
+
+
+
+
+ <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo">
+
+
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
+ <label class="md-overlay" for="__drawer"></label>
+ <div data-md-component="skip">
+
+ </div>
+ <div data-md-component="announce">
+
+ </div>
+
+
+
+
+
+
+<header class="md-header md-header--shadow" data-md-component="header">
+ <nav class="md-header__inner md-grid" aria-label="Header">
+ <a href="/superset-kubernetes-operator/." title="Apache Superset Kubernetes Operator" class="md-header__button md-logo" aria-label="Apache Superset Kubernetes Operator" data-md-component="logo">
+
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
+
+ </a>
+ <label class="md-header__button md-icon" for="__drawer">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
+ </label>
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
+ <span class="md-ellipsis">
+ Apache Superset Kubernetes Operator
+ </span>
+ </div>
+ <div class="md-header__topic" data-md-component="header-topic">
+ <span class="md-ellipsis">
+
+
+
+ </span>
+ </div>
+ </div>
+ </div>
+
+
+ <form class="md-header__option" data-md-component="palette">
+
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
+
+ <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
+ </label>
+
+
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
+
+ <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
+ </label>
+
+
+</form>
+
+
+
+ <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.get [...]
+
+
+
+
+
+ <label class="md-header__button md-icon" for="__search">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
+ </label>
+ <div class="md-search" data-md-component="search" role="dialog">
+ <label class="md-search__overlay" for="__search"></label>
+ <div class="md-search__inner" role="search">
+ <form class="md-search__form" name="search">
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
+ <label class="md-search__icon md-icon" for="__search">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
+ </label>
+ <nav class="md-search__options" aria-label="Search">
+
+ <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
+ </button>
+ </nav>
+
+ </form>
+ <div class="md-search__output">
+ <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
+ <div class="md-search-result" data-md-component="search-result">
+ <div class="md-search-result__meta">
+ Initializing search
+ </div>
+ <ol class="md-search-result__list" role="presentation"></ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+
+ <div class="md-header__source">
+ <a href="https://github.com/apache/superset-kubernetes-operator" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 [...]
+ </div>
+ <div class="md-source__repository">
+ apache/superset-kubernetes-operator
+ </div>
+</a>
+ </div>
+
+ </nav>
+
+</header>
+
+ <div class="md-container" data-md-component="container">
+
+
+
+
+
+
+ <main class="md-main" data-md-component="main">
+ <div class="md-main__inner md-grid">
+
+
+
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+
+
+<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
+ <label class="md-nav__title" for="__drawer">
+ <a href="/superset-kubernetes-operator/." title="Apache Superset Kubernetes Operator" class="md-nav__button md-logo" aria-label="Apache Superset Kubernetes Operator" data-md-component="logo">
+
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
+
+ </a>
+ Apache Superset Kubernetes Operator
+ </label>
+
+ <div class="md-nav__source">
+ <a href="https://github.com/apache/superset-kubernetes-operator" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 [...]
+ </div>
+ <div class="md-source__repository">
+ apache/superset-kubernetes-operator
+ </div>
+</a>
+ </div>
+
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/." class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Home
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/getting-started/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Getting Started
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
+
+
+ <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ User Guide
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_3">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ User Guide
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/user-guide/installation/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Installation
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/user-guide/configuration/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Configuration
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/user-guide/lifecycle/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Lifecycle
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/user-guide/networking-and-monitoring/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Networking & Monitoring
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/user-guide/migration/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Migration from Helm Chart
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
+
+
+ <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Architecture
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_4">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Architecture
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/architecture/overview/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Overview
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/architecture/internals/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Internals
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
+
+
+ <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Reference
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_5">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Reference
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/reference/api-reference/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ API Reference
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/reference/downloads/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Downloads
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/reference/security/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Security
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
+
+
+ <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Contributing
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_6">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Contributing
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/contributing/development-setup/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Development Setup
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/contributing/development-guidelines/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Development Guidelines
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="/superset-kubernetes-operator/contributing/releasing/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Releasing
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+ </ul>
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-content" data-md-component="content">
+
+ <article class="md-content__inner md-typeset">
+
+ <h1>404 - Not found</h1>
+
+ </article>
+ </div>
+
+
+<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
+ </div>
+
+ <button type="button" class="md-top md-icon" data-md-component="top" hidden>
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
+ Back to top
+</button>
+
+ </main>
+
+ <footer class="md-footer">
+
+ <div class="md-footer-meta md-typeset">
+ <div class="md-footer-meta__inner md-grid">
+ <div class="md-copyright">
+
+
+ Made with
+ <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
+ Material for MkDocs
+ </a>
+
+</div>
+
+ </div>
+ </div>
+</footer>
+
+ </div>
+ <div class="md-dialog" data-md-component="dialog">
+ <div class="md-dialog__inner md-typeset"></div>
+ </div>
+
+
+
+
+
+ <script id="__config" type="application/json">{"annotate": null, "base": "/superset-kubernetes-operator/", "features": ["content.code.copy", "navigation.sections", "navigation.expand", "navigation.top", "search.highlight"], "search": "/superset-kubernetes-operator/assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search [...]
+
+
+ <script src="/superset-kubernetes-operator/assets/javascripts/bundle.79ae519e.min.js"></script>
+
+ <script src="https://unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
+
+
+ </body>
+</html>
\ No newline at end of file
diff --git a/architecture/internals/index.html b/architecture/internals/index.html
new file mode 100644
index 0000000..522b362
--- /dev/null
+++ b/architecture/internals/index.html
@@ -0,0 +1,2416 @@
+
+<!doctype html>
+<html lang="en" class="no-js">
+ <head>
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <meta name="description" content="Kubernetes operator for deploying and managing Apache Superset">
+
+
+
+ <link rel="canonical" href="https://apache.github.io/superset-kubernetes-operator/architecture/internals/">
+
+
+ <link rel="prev" href="../overview/">
+
+
+ <link rel="next" href="../../reference/api-reference/">
+
+
+
+
+
+ <link rel="icon" href="../../assets/images/favicon.png">
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
+
+
+
+ <title>Internals - Apache Superset Kubernetes Operator</title>
+
+
+
+ <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
+
+
+ <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
+
+
+
+
+
+
+
+
+
+
+
+
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
+ <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
+
+
+
+ <link rel="stylesheet" href="../../stylesheets/extra.css">
+
+ <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
+
+
+
+
+
+ </head>
+
+
+
+
+
+
+
+
+
+ <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo">
+
+
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
+ <label class="md-overlay" for="__drawer"></label>
+ <div data-md-component="skip">
+
+
+ <a href="#internals-reconciliation-runtime" class="md-skip">
+ Skip to content
+ </a>
+
+ </div>
+ <div data-md-component="announce">
+
+ </div>
+
+
+
+
+
+
+<header class="md-header md-header--shadow" data-md-component="header">
+ <nav class="md-header__inner md-grid" aria-label="Header">
+ <a href="../.." title="Apache Superset Kubernetes Operator" class="md-header__button md-logo" aria-label="Apache Superset Kubernetes Operator" data-md-component="logo">
+
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
+
+ </a>
+ <label class="md-header__button md-icon" for="__drawer">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
+ </label>
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
+ <span class="md-ellipsis">
+ Apache Superset Kubernetes Operator
+ </span>
+ </div>
+ <div class="md-header__topic" data-md-component="header-topic">
+ <span class="md-ellipsis">
+
+ Internals
+
+ </span>
+ </div>
+ </div>
+ </div>
+
+
+ <form class="md-header__option" data-md-component="palette">
+
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
+
+ <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
+ </label>
+
+
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
+
+ <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
+ </label>
+
+
+</form>
+
+
+
+ <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.get [...]
+
+
+
+
+
+ <label class="md-header__button md-icon" for="__search">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
+ </label>
+ <div class="md-search" data-md-component="search" role="dialog">
+ <label class="md-search__overlay" for="__search"></label>
+ <div class="md-search__inner" role="search">
+ <form class="md-search__form" name="search">
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
+ <label class="md-search__icon md-icon" for="__search">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
+ </label>
+ <nav class="md-search__options" aria-label="Search">
+
+ <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
+ </button>
+ </nav>
+
+ </form>
+ <div class="md-search__output">
+ <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
+ <div class="md-search-result" data-md-component="search-result">
+ <div class="md-search-result__meta">
+ Initializing search
+ </div>
+ <ol class="md-search-result__list" role="presentation"></ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+
+ <div class="md-header__source">
+ <a href="https://github.com/apache/superset-kubernetes-operator" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 [...]
+ </div>
+ <div class="md-source__repository">
+ apache/superset-kubernetes-operator
+ </div>
+</a>
+ </div>
+
+ </nav>
+
+</header>
+
+ <div class="md-container" data-md-component="container">
+
+
+
+
+
+
+ <main class="md-main" data-md-component="main">
+ <div class="md-main__inner md-grid">
+
+
+
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+
+
+<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
+ <label class="md-nav__title" for="__drawer">
+ <a href="../.." title="Apache Superset Kubernetes Operator" class="md-nav__button md-logo" aria-label="Apache Superset Kubernetes Operator" data-md-component="logo">
+
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
+
+ </a>
+ Apache Superset Kubernetes Operator
+ </label>
+
+ <div class="md-nav__source">
+ <a href="https://github.com/apache/superset-kubernetes-operator" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 [...]
+ </div>
+ <div class="md-source__repository">
+ apache/superset-kubernetes-operator
+ </div>
+</a>
+ </div>
+
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../.." class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Home
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../getting-started/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Getting Started
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
+
+
+ <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ User Guide
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_3">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ User Guide
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/installation/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Installation
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/configuration/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Configuration
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/lifecycle/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Lifecycle
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/networking-and-monitoring/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Networking & Monitoring
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/migration/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Migration from Helm Chart
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
+
+
+
+ <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked>
+
+
+ <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Architecture
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="true">
+ <label class="md-nav__title" for="__nav_4">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Architecture
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../overview/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Overview
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active">
+
+ <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
+
+
+
+
+
+ <label class="md-nav__link md-nav__link--active" for="__toc">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Internals
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <a href="./" class="md-nav__link md-nav__link--active">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Internals
+
+
+
+ </span>
+
+
+
+ </a>
+
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#reconciliation-lifecycle" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Reconciliation Lifecycle
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Reconciliation Lifecycle">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#phase-1-preflight" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 1: Preflight
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-2-shared-resources" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 2: Shared Resources
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-3-lifecycle-tasks" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 3: Lifecycle Tasks
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-4-component-reconciliation" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 4: Component Reconciliation
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-5-status-aggregation" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 5: Status Aggregation
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#component-resource-pattern" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Component Resource Pattern
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Component Resource Pattern">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#why-configmaps" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Why ConfigMaps
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ownership-and-checksum-flow" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Ownership and Checksum Flow
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#what-each-component-creates" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ What Each Component Creates
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#deployment-builder" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Deployment Builder
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#idempotent-reconciliation" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Idempotent Reconciliation
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#labels-and-annotations" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Labels and Annotations
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Labels and Annotations">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#operator-managed-labels" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Operator-Managed Labels
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#orphan-cleanup" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Orphan Cleanup
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#checksum-driven-rollouts" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Checksum-Driven Rollouts
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Checksum-Driven Rollouts">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#how-it-works" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ How It Works
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#checksum-types" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Checksum Types
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#garbage-collection" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Garbage Collection
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#maintenance-page-parent-owned-service-selector-switch" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Maintenance Page (Parent-Owned Service Selector Switch)
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Maintenance Page (Parent-Owned Service Selector Switch)">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#problem" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Problem
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#solution-parent-owned-web-server-service" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Solution: Parent-Owned Web-Server Service
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#why-parent-owned-service" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Why Parent-Owned Service
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#alternatives-considered" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Alternatives Considered
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#status-and-conditions" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Status and Conditions
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Status and Conditions">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#parent-status" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Parent Status
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#parent-phase" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Parent Phase
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#component-status" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Component Status
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#error-handling-summary" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Error Handling Summary
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
+
+
+ <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Reference
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_5">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Reference
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../reference/api-reference/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ API Reference
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../reference/downloads/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Downloads
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../reference/security/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Security
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
+
+
+ <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Contributing
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_6">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Contributing
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../contributing/development-setup/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Development Setup
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../contributing/development-guidelines/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Development Guidelines
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../contributing/releasing/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Releasing
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+ </ul>
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#reconciliation-lifecycle" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Reconciliation Lifecycle
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Reconciliation Lifecycle">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#phase-1-preflight" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 1: Preflight
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-2-shared-resources" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 2: Shared Resources
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-3-lifecycle-tasks" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 3: Lifecycle Tasks
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-4-component-reconciliation" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 4: Component Reconciliation
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#phase-5-status-aggregation" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Phase 5: Status Aggregation
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#component-resource-pattern" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Component Resource Pattern
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Component Resource Pattern">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#why-configmaps" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Why ConfigMaps
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ownership-and-checksum-flow" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Ownership and Checksum Flow
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#what-each-component-creates" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ What Each Component Creates
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#deployment-builder" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Deployment Builder
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#idempotent-reconciliation" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Idempotent Reconciliation
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#labels-and-annotations" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Labels and Annotations
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Labels and Annotations">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#operator-managed-labels" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Operator-Managed Labels
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#orphan-cleanup" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Orphan Cleanup
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#checksum-driven-rollouts" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Checksum-Driven Rollouts
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Checksum-Driven Rollouts">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#how-it-works" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ How It Works
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#checksum-types" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Checksum Types
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#garbage-collection" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Garbage Collection
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#maintenance-page-parent-owned-service-selector-switch" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Maintenance Page (Parent-Owned Service Selector Switch)
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Maintenance Page (Parent-Owned Service Selector Switch)">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#problem" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Problem
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#solution-parent-owned-web-server-service" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Solution: Parent-Owned Web-Server Service
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#why-parent-owned-service" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Why Parent-Owned Service
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#alternatives-considered" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Alternatives Considered
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#status-and-conditions" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Status and Conditions
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Status and Conditions">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#parent-status" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Parent Status
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#parent-phase" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Parent Phase
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#component-status" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Component Status
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#error-handling-summary" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Error Handling Summary
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-content" data-md-component="content">
+
+ <article class="md-content__inner md-typeset">
+
+
+
+
+
+
+
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<h1 id="internals-reconciliation-runtime">Internals — Reconciliation & Runtime<a class="headerlink" href="#internals-reconciliation-runtime" title="Permanent link">¶</a></h1>
+<p>This document describes how the operator behaves at runtime: the
+reconciliation lifecycle, parent-owned resource reconciliation, status reporting, and
+resource cleanup. For the structural overview (CRD hierarchy, configuration
+model, config rendering), see <a href="../overview/">Architecture</a>. For the full lifecycle
+task reference (pod state machine, retry semantics, upgrade modes), see
+<a href="../../user-guide/lifecycle/">Lifecycle</a>.</p>
+<hr />
+<h2 id="reconciliation-lifecycle">Reconciliation Lifecycle<a class="headerlink" href="#reconciliation-lifecycle" title="Permanent link">¶</a></h2>
+<p>When a <code>Superset</code> CR is created or updated, the parent controller runs through
+five sequential phases:</p>
+<ol>
+<li><strong>Preflight</strong> — Fetch the Superset CR, check the suspend flag</li>
+<li><strong>Shared Resources</strong> — ServiceAccount</li>
+<li><strong>Lifecycle Tasks</strong> — Run parent-owned task Jobs and update <code>status.lifecycle</code></li>
+<li><strong>Component Reconciliation</strong> — Resolve shared spec (top-level + per-component) into flat runtime specs, create/update/delete parent-owned Kubernetes resources, reconcile networking/monitoring/network policies</li>
+<li><strong>Status Aggregation</strong> — Read workload state, update <code>status.components</code>, set conditions and phase</li>
+</ol>
+<h3 id="phase-1-preflight">Phase 1: Preflight<a class="headerlink" href="#phase-1-preflight" title="Permanent link">¶</a></h3>
+<p>The controller fetches the <code>Superset</code> CR. If it no longer exists, the
+reconciler returns gracefully — Kubernetes garbage collection handles cleanup
+via owner references.</p>
+<p>If <code>spec.suspend</code> is <code>true</code>, the controller sets the <code>Suspended</code> condition to
+<code>True</code>, updates status, and returns immediately. No task Jobs run, no component
+resources are created or updated, and no resources are deleted. This allows
+users to pause reconciliation without removing the CR.</p>
+<h3 id="phase-2-shared-resources">Phase 2: Shared Resources<a class="headerlink" href="#phase-2-shared-resources" title="Permanent link">¶</a></h3>
+<p><strong>ServiceAccount</strong> — Created if <code>spec.serviceAccount.create</code> is true (the
+default). Uses the name from <code>spec.serviceAccount.name</code> or falls back to the
+parent CR name. Owned by the parent CR and garbage-collected on parent deletion.</p>
+<h3 id="phase-3-lifecycle-tasks">Phase 3: Lifecycle Tasks<a class="headerlink" href="#phase-3-lifecycle-tasks" title="Permanent link">¶</a></h3>
+<p>The parent controller runs deterministic lifecycle task Jobs:
+<code>{parentName}-clone</code>, <code>{parentName}-migrate</code>, <code>{parentName}-rotate</code>, and
+<code>{parentName}-init</code>. Durable task state lives on the parent
+<code>status.lifecycle</code> field, so a completed task is still visible after successful
+Jobs and Pods are removed by retention policy.</p>
+<p>Tasks run sequentially: clone → migrate → rotate → init. Each task can be independently
+disabled via <code>disabled: true</code>. Clone also supports periodic re-execution via
+<code>cronSchedule</code>. Checksums cascade downstream: a re-clone forces re-migrate,
+which forces re-rotate, which forces re-init.</p>
+<p>When a pending task requires drain (<code>requiresDrain: true</code>, the default for
+clone, migrate, and rotate), the operator deletes component Deployments, HPAs,
+PDBs, and routable Services before running that task, but only when at least one
+configured component has desired replicas greater than zero. Tasks whose current
+checksum is already complete do not contribute to the drain decision. The parent
+verifies all component pods have terminated before proceeding to task execution.
+This ensures no application pods access the metastore during schema changes. If
+<code>maintenancePage</code> is configured, the parent brings up a maintenance Deployment
+and switches the web-server Service selector before draining. After tasks
+complete, Phase 4 recreates all components fresh.</p>
+<p>Components do not deploy until all enabled lifecycle tasks complete (or lifecycle is
+explicitly disabled via <code>spec.lifecycle.disabled: true</code>). If a task is in
+progress or has failed, <code>Reconcile()</code> returns early with a requeue, skipping
+Phase 4.</p>
+<p>For the full lifecycle reference including pod state machine, retry/backoff
+semantics, upgrade modes, and drain verification, see
+<a href="../../user-guide/lifecycle/">Lifecycle</a>.</p>
+<h3 id="phase-4-component-reconciliation">Phase 4: Component Reconciliation<a class="headerlink" href="#phase-4-component-reconciliation" title="Permanent link">¶</a></h3>
+<p>For each of the six deployment components, the parent controller:</p>
+<ol>
+<li>Checks if the component is enabled (field present in spec)</li>
+<li>If disabled, deletes the parent-owned resources for that component</li>
+<li>If enabled:<ul>
+<li>Renders component-appropriate <code>superset_config.py</code> from the parent's
+ <code>secretKey</code>/<code>secretKeyFrom</code>, <code>metastore</code>, <code>config</code>, and per-component
+ <code>config</code> fields via <code>RenderConfig()</code></li>
+<li>Collects secret env vars: when <code>secretKeyFrom</code>, <code>metastore.uriFrom</code>, or
+ <code>metastore.passwordFrom</code> are set, the operator produces env vars with
+ <code>valueFrom.secretKeyRef</code> pointing at the referenced Secret. In dev mode,
+ inline values produce plain <code>value</code> env vars instead.
+ Always injects <code>SUPERSET_OPERATOR__INSTANCE_NAME</code> (the parent CR name) so
+ raw <code>spec.config</code> Python can reference the instance — for example to
+ compute instance-scoped Celery queue names that won't collide across
+ Superset CRs sharing a broker.</li>
+<li>Resolves the shared spec (top-level + per-component) into a
+ flat <code>FlatComponentSpec</code> via <code>ResolveComponentSpec()</code></li>
+<li>Computes a config checksum from shared inputs and rendered config</li>
+<li>Creates or updates the component ConfigMap, Deployment, Service, HPA, and PDB</li>
+</ul>
+</li>
+</ol>
+<p>After components, the controller reconciles cluster-scoped resources:
+networking (Ingress or HTTPRoute), monitoring (ServiceMonitor), and network
+policies (one NetworkPolicy per enabled component).</p>
+<h3 id="phase-5-status-aggregation">Phase 5: Status Aggregation<a class="headerlink" href="#phase-5-status-aggregation" title="Permanent link">¶</a></h3>
+<p>The controller reads each enabled component's Deployment status, checks the
+expected supporting resources, and aggregates the result into the parent status.
+Each component reports a phase, ready count, replica details, image, config
+checksum, and observed resource list.</p>
+<p>During lifecycle and maintenance return, status still reflects observed
+component workloads. If the maintenance page is active, only the web-server
+component is treated as not ready because the web-server Service is still routed
+to maintenance; non-web components such as Celery workers report their actual
+Deployment readiness.</p>
+<table>
+<thead>
+<tr>
+<th>All components ready</th>
+<th>Phase</th>
+<th>Available condition</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Yes</td>
+<td><code>Running</code></td>
+<td><code>True</code></td>
+</tr>
+<tr>
+<td>No</td>
+<td><code>Degraded</code></td>
+<td><code>False</code></td>
+</tr>
+</tbody>
+</table>
+<hr />
+<h2 id="component-resource-pattern">Component Resource Pattern<a class="headerlink" href="#component-resource-pattern" title="Permanent link">¶</a></h2>
+<p>The parent controller reconciles each component through table-driven component
+descriptors and shared resource helpers. This keeps per-component variation
+explicit while avoiding intermediate CRDs in the public API.</p>
+<p><strong>Scalable components</strong> (WebServer, CeleryWorker, CeleryFlower, WebsocketServer,
+McpServer) manage a Deployment and support replicas, HPA, and PDB. Their specs
+embed <code>ScalableComponentSpec</code>, which has <code>DeploymentTemplate</code>, <code>PodTemplate</code>,
+and scaling fields.</p>
+<p><strong>Singleton components</strong> (lifecycle tasks and CeleryBeat) run exactly one instance.
+Lifecycle tasks are Jobs with operator-managed retry logic (uses <code>PodTemplate</code> only).
+CeleryBeat uses a Deployment but forces <code>replicas: 1</code> (has both
+<code>DeploymentTemplate</code> and <code>PodTemplate</code> but no scaling fields).</p>
+<p>All deployment components follow the same pattern: reconcile ConfigMap (if
+applicable), reconcile Deployment, reconcile Service (if the component exposes
+a port), reconcile scaling (HPA + PDB for scalable components), and project
+status onto the parent. Lifecycle task reconciliation creates a ConfigMap when
+needed and manages deterministic Jobs directly.</p>
+<h3 id="why-configmaps">Why ConfigMaps<a class="headerlink" href="#why-configmaps" title="Permanent link">¶</a></h3>
+<p>Superset imports <code>superset_config</code> as a standard Python module, which means the
+config must exist as a <code>.py</code> file on the filesystem. A ConfigMap volume mount is
+the standard Kubernetes mechanism for projecting files into containers:</p>
+<ul>
+<li><strong>Python import requirement</strong> — <code>superset_config.py</code> must be a real file on
+ disk; environment variables and downward API projections cannot serve as
+ importable Python modules</li>
+<li><strong>Operability</strong> — <code>kubectl get cm</code> shows exactly what config each component is
+ running, making debugging straightforward</li>
+<li><strong>Clean pod manifests</strong> — Without ConfigMaps, the rendered Python config
+ would need to be inlined on the pod spec (as annotations or env vars),
+ making Deployment manifests difficult to read. ConfigMaps keep pod specs
+ focused on container configuration</li>
+</ul>
+<h3 id="ownership-and-checksum-flow">Ownership and Checksum Flow<a class="headerlink" href="#ownership-and-checksum-flow" title="Permanent link">¶</a></h3>
+<p>ConfigMaps are created and owned by the parent Superset controller. This means:</p>
+<ul>
+<li>ConfigMaps are written by the same controller that renders their content</li>
+<li>The parent is the single writer of config content</li>
+<li>Component Deployments mount ConfigMaps by conventional name</li>
+</ul>
+<p>The parent computes a config checksum and stamps it directly on component
+Deployment pod templates to trigger rolling restarts when config changes. This design follows the
+principle that the checksum should be computed by whoever writes the data — since
+the parent renders and writes the ConfigMap, it is the authority on when content
+changed.</p>
+<h3 id="what-each-component-creates">What Each Component Creates<a class="headerlink" href="#what-each-component-creates" title="Permanent link">¶</a></h3>
+<table>
+<thead>
+<tr>
+<th>Component</th>
+<th>ConfigMap</th>
+<th>Workload</th>
+<th>Service</th>
+<th>HPA</th>
+<th>PDB</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Clone (task)</td>
+<td>—</td>
+<td>Job (database tool)</td>
+<td>—</td>
+<td>—</td>
+<td>—</td>
+</tr>
+<tr>
+<td>Migrate (task)</td>
+<td>superset_config.py</td>
+<td>Job</td>
+<td>—</td>
+<td>—</td>
+<td>—</td>
+</tr>
+<tr>
+<td>Rotate (task)</td>
+<td>superset_config.py</td>
+<td>Job</td>
+<td>—</td>
+<td>—</td>
+<td>—</td>
+</tr>
+<tr>
+<td>Init (task)</td>
+<td>superset_config.py</td>
+<td>Job</td>
+<td>—</td>
+<td>—</td>
+<td>—</td>
+</tr>
+<tr>
+<td>WebServer</td>
+<td>superset_config.py</td>
+<td>Deployment (gunicorn)</td>
+<td>port 8088</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+<tr>
+<td>CeleryWorker</td>
+<td>superset_config.py</td>
+<td>Deployment (celery worker)</td>
+<td>—</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+<tr>
+<td>CeleryBeat</td>
+<td>superset_config.py</td>
+<td>Deployment (celery beat)</td>
+<td>—</td>
+<td>—</td>
+<td>—</td>
+</tr>
+<tr>
+<td>CeleryFlower</td>
+<td>superset_config.py</td>
+<td>Deployment (celery flower)</td>
+<td>port 5555</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+<tr>
+<td>WebsocketServer</td>
+<td>—</td>
+<td>Deployment (node.js)</td>
+<td>port 8080</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+<tr>
+<td>McpServer</td>
+<td>superset_config.py</td>
+<td>Deployment (fastmcp)</td>
+<td>port 8088</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+</tbody>
+</table>
+<p><strong>CeleryBeat</strong> is a singleton — the controller forces <code>replicas: 1</code> regardless
+of the spec, and does not create an HPA or PDB.</p>
+<p><strong>WebsocketServer</strong> is Node.js-based and does not get a <code>superset_config.py</code>
+ConfigMap.</p>
+<h3 id="deployment-builder">Deployment Builder<a class="headerlink" href="#deployment-builder" title="Permanent link">¶</a></h3>
+<p>All deployment component reconcilers delegate to <code>buildDeploymentSpec()</code>, which constructs a
+complete Deployment spec from the flat <code>FlatComponentSpec</code> and a
+component-specific <code>DeploymentConfig</code>:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kd">type</span><span class="w"> </span><span class="nx">DeploymentConfig</span><span class="w"> </span><span class="kd">struct</span><span class="w"> </span><span class="p">{</span>
+<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="w"> </span><span class="nx">ContainerName</span><span class="w"> </span><span class="kt">string</span><span class="w"> </span><span class="c1">// e.g., "superset-web-server"</span>
+<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span><span class="nx">DefaultCommand</span><span class="w"> </span><span class="p">[]</span><span class="kt">string</span><span class="w"> </span><span class="c1">// e.g., ["/usr/bin/run-server.sh"]</span>
+<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="nx">DefaultArgs</span><span class="w"> </span><span class="p">[]</span><span class="kt">string</span><span class="w"> </span><span class="c1">// optional</span>
+<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="w"> </span><span class="nx">DefaultPorts</span><span class="w"> </span><span class="p">[]</span><span class="nx">corev1</span><span class="p">.</span><span class="nx">ContainerPort</span><span class="w"> </span><span class="c1">// e.g., [{Name: "http", Port: 8088}]</span>
+<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="w"> </span><span class="nx">ForceReplicas</span><span class="w"> </span><span class="o">*</span><span class="kt">int32</span><span class="w"> </span><span class="c1">// non-nil only for beat (=1)</span>
+<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="p">}</span>
+</code></pre></div>
+<p><strong>Replicas resolution order:</strong></p>
+<ol>
+<li><code>ForceReplicas</code> (beat singleton) — always wins</li>
+<li><code>nil</code> if HPA is configured — HPA manages scaling</li>
+<li><code>spec.Replicas</code> otherwise</li>
+</ol>
+<h3 id="idempotent-reconciliation">Idempotent Reconciliation<a class="headerlink" href="#idempotent-reconciliation" title="Permanent link">¶</a></h3>
+<p>All resource creation uses <code>controllerutil.CreateOrUpdate()</code>: creates the
+resource if it doesn't exist, updates it if the spec has drifted. This makes
+every reconciliation cycle safe to re-run.</p>
+<hr />
+<h2 id="labels-and-annotations">Labels and Annotations<a class="headerlink" href="#labels-and-annotations" title="Permanent link">¶</a></h2>
+<p>The operator sets reserved labels on parent-owned resources and NetworkPolicies
+for resource discovery and cleanup.</p>
+<h3 id="operator-managed-labels">Operator-Managed Labels<a class="headerlink" href="#operator-managed-labels" title="Permanent link">¶</a></h3>
+<table>
+<thead>
+<tr>
+<th>Label</th>
+<th>Value</th>
+<th>Purpose</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>app.kubernetes.io/name</code></td>
+<td><code>superset</code></td>
+<td>Application identity</td>
+</tr>
+<tr>
+<td><code>app.kubernetes.io/component</code></td>
+<td>Component type (e.g., <code>web-server</code>)</td>
+<td>Component type filtering</td>
+</tr>
+<tr>
+<td><code>superset.apache.org/parent</code></td>
+<td>Parent Superset CR name</td>
+<td>Parent-scoped discovery</td>
+</tr>
+</tbody>
+</table>
+<p>These labels are set by the operator on every reconciliation and <strong>cannot be
+overridden</strong> — operator-managed labels are applied last, taking precedence over
+any existing values.</p>
+<p>Component resources use the standard <code>app.kubernetes.io/*</code> labels with
+<code>app.kubernetes.io/instance</code> set to the component instance name, currently the
+parent <code>Superset</code> name, for selector matching.</p>
+<h3 id="orphan-cleanup">Orphan Cleanup<a class="headerlink" href="#orphan-cleanup" title="Permanent link">¶</a></h3>
+<p>When a component is removed from the parent spec, the parent reconciler invokes
+the component descriptor's cleanup path, which deletes the component's
+parent-owned resources (Deployment, Service, ConfigMap, HPA, PDB) by their
+deterministic <code>{parent}-{component}</code> names. The parent CR's owner references
+also cascade-delete the same resources if the CR itself is deleted.</p>
+<p>Operator-managed labels remain available on parent-owned resources for human
+discovery — e.g. <code>kubectl get deploy,svc,cm,hpa,pdb -l
+app.kubernetes.io/instance=<parent></code> lists every parent-owned workload.</p>
+<hr />
+<h2 id="checksum-driven-rollouts">Checksum-Driven Rollouts<a class="headerlink" href="#checksum-driven-rollouts" title="Permanent link">¶</a></h2>
+<p>Config changes must trigger pod restarts for the new config to take effect.
+The operator achieves this through <strong>checksum annotations</strong> on the pod template.</p>
+<h3 id="how-it-works">How It Works<a class="headerlink" href="#how-it-works" title="Permanent link">¶</a></h3>
+<ol>
+<li>Parent controller computes checksums while rendering component config</li>
+<li>The checksum is stamped on the Deployment pod template annotation</li>
+<li>When a checksum changes, the pod template changes, and Kubernetes triggers a
+ rolling restart</li>
+</ol>
+<h3 id="checksum-types">Checksum Types<a class="headerlink" href="#checksum-types" title="Permanent link">¶</a></h3>
+<table>
+<thead>
+<tr>
+<th>Annotation</th>
+<th>Source</th>
+<th>Scope</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>superset.apache.org/config-checksum</code></td>
+<td>Rendered superset_config.py</td>
+<td>Per-component</td>
+</tr>
+</tbody>
+</table>
+<p><strong>Per-component isolation:</strong> Changing a component's <code>config</code> only
+changes that component's config checksum -- only its pods restart. Other
+components are unaffected.</p>
+<p><strong>Secret safety:</strong> In prod mode, operator-managed secret values (<code>secretKeyFrom</code>,
+<code>metastore.uriFrom</code>, <code>metastore.passwordFrom</code>, <code>valkey.passwordFrom</code>) are never
+read by the operator and therefore never appear in checksums, annotations, or
+ConfigMaps. In dev mode, inline secret values (<code>secretKey</code>, <code>metastore.password</code>,
+<code>valkey.password</code>) influence the shared config checksum (as a hash, not
+plaintext) because changes to these values must trigger a rollout.</p>
+<hr />
+<h2 id="garbage-collection">Garbage Collection<a class="headerlink" href="#garbage-collection" title="Permanent link">¶</a></h2>
+<p>The operator uses Kubernetes owner references for automatic cleanup. The parent
+<code>Superset</code> CR owns component Deployments, Services, ConfigMaps, HPAs, PDBs,
+lifecycle task Jobs, the web-server Service, networking resources,
+ServiceMonitor, and NetworkPolicies. Deleting the parent cascades to all owned
+resources. Removing a component from the parent spec (e.g. deleting
+<code>spec.celeryWorker</code>) deletes that component's resources.</p>
+<hr />
+<h2 id="maintenance-page-parent-owned-service-selector-switch">Maintenance Page (Parent-Owned Service Selector Switch)<a class="headerlink" href="#maintenance-page-parent-owned-service-selector-switch" title="Permanent link">¶</a></h2>
+<p>When <code>spec.lifecycle.maintenancePage</code> is set, the operator serves a maintenance
+page during drain and lifecycle tasks. The page is only started when a task
+that will run requires drain, at least one configured component has desired
+replicas greater than zero, and an existing web-server workload is present.
+This section documents the design decision behind the traffic switchover
+mechanism.</p>
+<h3 id="problem">Problem<a class="headerlink" href="#problem" title="Permanent link">¶</a></h3>
+<p>During drain, component Deployments and Pods are removed. Without intervention,
+users experience connection errors instead of a friendly maintenance message.</p>
+<h3 id="solution-parent-owned-web-server-service">Solution: Parent-Owned Web-Server Service<a class="headerlink" href="#solution-parent-owned-web-server-service" title="Permanent link">¶</a></h3>
+<p>The parent controller owns the web-server Service directly. During lifecycle
+drain, the parent:</p>
+<ol>
+<li>Creates a maintenance Deployment (parent-owned) running a lightweight HTTP
+ server (nginx:alpine by default or a user-provided image).</li>
+<li>Switches the web-server Service's selector to match the maintenance-page pod
+ labels, instantly routing traffic to maintenance pods.</li>
+<li>Drains all component workloads, but the Service is unaffected because it
+ belongs to the parent.</li>
+<li>Runs lifecycle tasks (clone → migrate → rotate → init).</li>
+<li>After tasks complete and the web-server Deployment is recreated, waits for the
+ web-server Deployment to become ready.</li>
+<li>Switches the Service selector back to the web-server pod labels.</li>
+<li>Deletes the maintenance Deployment and its ConfigMap.</li>
+</ol>
+<h3 id="why-parent-owned-service">Why Parent-Owned Service<a class="headerlink" href="#why-parent-owned-service" title="Permanent link">¶</a></h3>
+<ul>
+<li>Service selector changes propagate in ~1 second via the endpoints controller,
+ giving instant traffic switchover regardless of ingress implementation</li>
+<li>Works for all access patterns: Ingress, Gateway API, direct Service</li>
+<li>No orphan deletion complexity — the Service is always owned by the parent, so
+ drain never affects it</li>
+<li>The same parent controller owns both Service selector switches and component
+ rollout state</li>
+</ul>
+<blockquote>
+<p><strong>Note for developers using <code>kubectl port-forward</code>:</strong> port-forward establishes a
+tunnel to a specific pod, not through the Service selector. When that pod is
+deleted during drain, the tunnel breaks with a "lost connection to pod" error.
+This does not affect Ingress/Gateway users — they route through EndpointSlices
+and see seamless transitions. Restart port-forward to reconnect to the
+maintenance pod.</p>
+</blockquote>
+<h3 id="alternatives-considered">Alternatives Considered<a class="headerlink" href="#alternatives-considered" title="Permanent link">¶</a></h3>
+<p><strong>Separate component owner + selector patch</strong>: Preserved the Service while
+deleting the web-server workload owner, then patched the selector. Rejected
+because splitting ownership made drain ordering and re-adoption fragile.</p>
+<p><strong>Separate maintenance Service + Ingress/HTTPRoute backend swap</strong>: Architecturally
+pure (clean separation, no interaction with web-server resources), but rejected
+because Ingress/HTTPRoute propagation latency varies significantly by controller
+implementation — from ~1s (Envoy-based) to 1-3 minutes (cloud load balancers like
+GCP/AWS). This creates an unacceptable error window where users hit the draining
+backend. Also doesn't work for users without networking configured.</p>
+<hr />
+<h2 id="status-and-conditions">Status and Conditions<a class="headerlink" href="#status-and-conditions" title="Permanent link">¶</a></h2>
+<h3 id="parent-status">Parent Status<a class="headerlink" href="#parent-status" title="Permanent link">¶</a></h3>
+<p>The parent <code>Superset</code> CR reports aggregate status:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="nt">status</span><span class="p">:</span>
+<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Running</span>
+<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a><span class="w"> </span><span class="nt">observedGeneration</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
+<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="w"> </span><span class="nt">version</span><span class="p">:</span><span class="w"> </span><span class="s">"latest"</span>
+<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="w"> </span><span class="nt">ready</span><span class="p">:</span><span class="w"> </span><span class="s">"7/7"</span>
+<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a><span class="w"> </span><span class="nt">components</span><span class="p">:</span>
+<a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="w"> </span><span class="nt">webServer</span><span class="p">:</span>
+<a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a><span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Ready</span>
+<a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a><span class="w"> </span><span class="nt">ready</span><span class="p">:</span><span class="w"> </span><span class="s">"2/2"</span>
+<a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a><span class="w"> </span><span class="nt">ref</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Deployment/example-web-server</span>
+<a id="__codelineno-1-11" name="__codelineno-1-11" href="#__codelineno-1-11"></a><span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">apache/superset:latest</span>
+<a id="__codelineno-1-12" name="__codelineno-1-12" href="#__codelineno-1-12"></a><span class="w"> </span><span class="nt">replicas</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">2</span>
+<a id="__codelineno-1-13" name="__codelineno-1-13" href="#__codelineno-1-13"></a><span class="w"> </span><span class="nt">readyReplicas</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">2</span>
+<a id="__codelineno-1-14" name="__codelineno-1-14" href="#__codelineno-1-14"></a><span class="w"> </span><span class="nt">resources</span><span class="p">:</span>
+<a id="__codelineno-1-15" name="__codelineno-1-15" href="#__codelineno-1-15"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Deployment</span>
+<a id="__codelineno-1-16" name="__codelineno-1-16" href="#__codelineno-1-16"></a><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-web-server</span>
+<a id="__codelineno-1-17" name="__codelineno-1-17" href="#__codelineno-1-17"></a><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Present</span>
+<a id="__codelineno-1-18" name="__codelineno-1-18" href="#__codelineno-1-18"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Service</span>
+<a id="__codelineno-1-19" name="__codelineno-1-19" href="#__codelineno-1-19"></a><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-web-server</span>
+<a id="__codelineno-1-20" name="__codelineno-1-20" href="#__codelineno-1-20"></a><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Present</span>
+<a id="__codelineno-1-21" name="__codelineno-1-21" href="#__codelineno-1-21"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ConfigMap</span>
+<a id="__codelineno-1-22" name="__codelineno-1-22" href="#__codelineno-1-22"></a><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example-web-server-config</span>
+<a id="__codelineno-1-23" name="__codelineno-1-23" href="#__codelineno-1-23"></a><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Present</span>
+<a id="__codelineno-1-24" name="__codelineno-1-24" href="#__codelineno-1-24"></a><span class="w"> </span><span class="nt">celeryWorker</span><span class="p">:</span>
+<a id="__codelineno-1-25" name="__codelineno-1-25" href="#__codelineno-1-25"></a><span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Ready</span>
+<a id="__codelineno-1-26" name="__codelineno-1-26" href="#__codelineno-1-26"></a><span class="w"> </span><span class="nt">ready</span><span class="p">:</span><span class="w"> </span><span class="s">"4/4"</span>
+<a id="__codelineno-1-27" name="__codelineno-1-27" href="#__codelineno-1-27"></a><span class="w"> </span><span class="nt">celeryBeat</span><span class="p">:</span>
+<a id="__codelineno-1-28" name="__codelineno-1-28" href="#__codelineno-1-28"></a><span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Ready</span>
+<a id="__codelineno-1-29" name="__codelineno-1-29" href="#__codelineno-1-29"></a><span class="w"> </span><span class="nt">ready</span><span class="p">:</span><span class="w"> </span><span class="s">"1/1"</span>
+<a id="__codelineno-1-30" name="__codelineno-1-30" href="#__codelineno-1-30"></a><span class="w"> </span><span class="nt">lifecycle</span><span class="p">:</span>
+<a id="__codelineno-1-31" name="__codelineno-1-31" href="#__codelineno-1-31"></a><span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Complete</span>
+<a id="__codelineno-1-32" name="__codelineno-1-32" href="#__codelineno-1-32"></a><span class="w"> </span><span class="nt">migrate</span><span class="p">:</span>
+<a id="__codelineno-1-33" name="__codelineno-1-33" href="#__codelineno-1-33"></a><span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Complete</span>
+<a id="__codelineno-1-34" name="__codelineno-1-34" href="#__codelineno-1-34"></a><span class="w"> </span><span class="nt">ref</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Job/example-migrate</span>
+<a id="__codelineno-1-35" name="__codelineno-1-35" href="#__codelineno-1-35"></a><span class="w"> </span><span class="nt">desiredChecksum</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sha256:...</span>
+<a id="__codelineno-1-36" name="__codelineno-1-36" href="#__codelineno-1-36"></a><span class="w"> </span><span class="nt">completedChecksum</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sha256:...</span>
+<a id="__codelineno-1-37" name="__codelineno-1-37" href="#__codelineno-1-37"></a><span class="w"> </span><span class="nt">conditions</span><span class="p">:</span>
+<a id="__codelineno-1-38" name="__codelineno-1-38" href="#__codelineno-1-38"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Available</span>
+<a id="__codelineno-1-39" name="__codelineno-1-39" href="#__codelineno-1-39"></a><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="s">"True"</span>
+<a id="__codelineno-1-40" name="__codelineno-1-40" href="#__codelineno-1-40"></a><span class="w"> </span><span class="nt">reason</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">AllComponentsReady</span>
+<a id="__codelineno-1-41" name="__codelineno-1-41" href="#__codelineno-1-41"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">LifecycleComplete</span>
+<a id="__codelineno-1-42" name="__codelineno-1-42" href="#__codelineno-1-42"></a><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="s">"True"</span>
+<a id="__codelineno-1-43" name="__codelineno-1-43" href="#__codelineno-1-43"></a><span class="w"> </span><span class="nt">reason</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">LifecycleComplete</span>
+<a id="__codelineno-1-44" name="__codelineno-1-44" href="#__codelineno-1-44"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Suspended</span>
+<a id="__codelineno-1-45" name="__codelineno-1-45" href="#__codelineno-1-45"></a><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="s">"False"</span>
+</code></pre></div>
+<h3 id="parent-phase">Parent Phase<a class="headerlink" href="#parent-phase" title="Permanent link">¶</a></h3>
+<p>The top-level <code>status.phase</code> reflects the overall instance state:</p>
+<table>
+<thead>
+<tr>
+<th>Phase</th>
+<th>Meaning</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>Initializing</code></td>
+<td>First deployment — lifecycle tasks running for the first time</td>
+</tr>
+<tr>
+<td><code>Upgrading</code></td>
+<td>Image change detected — lifecycle tasks running against new version</td>
+</tr>
+<tr>
+<td><code>Running</code></td>
+<td>All enabled components are ready and lifecycle is complete</td>
+</tr>
+<tr>
+<td><code>Degraded</code></td>
+<td>One or more components are not fully ready</td>
+</tr>
+<tr>
+<td><code>Suspended</code></td>
+<td><code>spec.suspend: true</code> — all reconciliation paused</td>
+</tr>
+<tr>
+<td><code>Blocked</code></td>
+<td>Downgrade detected — lifecycle tasks will not run (manual intervention required)</td>
+</tr>
+<tr>
+<td><code>AwaitingApproval</code></td>
+<td>Supervised upgrade mode — waiting for approval annotation before proceeding</td>
+</tr>
+</tbody>
+</table>
+<p>Drain progress is reported on <code>status.lifecycle.phase=Draining</code>; it does not
+replace the top-level parent phase.</p>
+<p>After lifecycle tasks complete, <code>status.lifecycle.phase=Restoring</code> covers the
+component rollout and maintenance switchback window. The lifecycle phase becomes
+<code>Complete</code> only after enabled components report ready.</p>
+<h3 id="component-status">Component Status<a class="headerlink" href="#component-status" title="Permanent link">¶</a></h3>
+<p>Each enabled component reports status under <code>status.components</code>:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="nt">status</span><span class="p">:</span>
+<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="nt">components</span><span class="p">:</span>
+<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="w"> </span><span class="nt">webServer</span><span class="p">:</span>
+<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a><span class="w"> </span><span class="nt">phase</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Progressing</span>
+<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a><span class="w"> </span><span class="nt">ready</span><span class="p">:</span><span class="w"> </span><span class="s">"1/3"</span>
+<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a><span class="w"> </span><span class="nt">replicas</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
+<a id="__codelineno-2-7" name="__codelineno-2-7" href="#__codelineno-2-7"></a><span class="w"> </span><span class="nt">readyReplicas</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
+<a id="__codelineno-2-8" name="__codelineno-2-8" href="#__codelineno-2-8"></a><span class="w"> </span><span class="nt">updatedReplicas</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
+<a id="__codelineno-2-9" name="__codelineno-2-9" href="#__codelineno-2-9"></a><span class="w"> </span><span class="nt">availableReplicas</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
+<a id="__codelineno-2-10" name="__codelineno-2-10" href="#__codelineno-2-10"></a><span class="w"> </span><span class="nt">message</span><span class="p">:</span><span class="w"> </span><span class="s">"1</span><span class="nv"> </span><span class="s">of</span><span class="nv"> </span><span class="s">3</span><span class="nv"> </span><span class="s">replicas</span><span class="nv"> </span><span class="s">are</span><span class="nv"> </span><span class="s">ready"</span>
+</code></pre></div>
+<p><strong>Component phase states:</strong></p>
+<table>
+<thead>
+<tr>
+<th>Phase</th>
+<th>Meaning</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>Pending</code></td>
+<td>Expected Deployment has not been observed yet</td>
+</tr>
+<tr>
+<td><code>Progressing</code></td>
+<td>Deployment exists and some rollout progress is visible</td>
+</tr>
+<tr>
+<td><code>Ready</code></td>
+<td>Desired replicas are ready, updated, and available</td>
+</tr>
+<tr>
+<td><code>Unavailable</code></td>
+<td>Deployment exists but no ready replicas are available or rollout has exceeded progress deadline</td>
+</tr>
+<tr>
+<td><code>Drained</code></td>
+<td>Component reconciliation is paused while lifecycle tasks run and the workload has been removed</td>
+</tr>
+</tbody>
+</table>
+<hr />
+<h2 id="error-handling-summary">Error Handling Summary<a class="headerlink" href="#error-handling-summary" title="Permanent link">¶</a></h2>
+<table>
+<thead>
+<tr>
+<th>Scenario</th>
+<th>Behavior</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Superset CR deleted during reconcile</td>
+<td>Graceful return (not found)</td>
+</tr>
+<tr>
+<td>Init pod fails</td>
+<td>Retry with backoff up to maxRetries, then permanent failure</td>
+</tr>
+<tr>
+<td>Init pod times out</td>
+<td>Counts as failed attempt, same retry logic</td>
+</tr>
+<tr>
+<td>Resource creation fails</td>
+<td>Error propagated, reconcile retried by controller-runtime</td>
+</tr>
+<tr>
+<td>Optional CRD missing (Gateway API, ServiceMonitor)</td>
+<td>Log and continue — feature disabled gracefully</td>
+</tr>
+<tr>
+<td>Referenced Secret values change</td>
+<td>Pods see new values only after restart; update <code>forceReload</code> to trigger rollout</td>
+</tr>
+<tr>
+<td>Component removed from spec</td>
+<td>Parent-owned resources for that component are deleted</td>
+</tr>
+<tr>
+<td>Suspend enabled</td>
+<td>All reconciliation paused, no resources created or deleted</td>
+</tr>
+</tbody>
+</table>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </article>
+ </div>
+
+
+<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
+ </div>
+
+ <button type="button" class="md-top md-icon" data-md-component="top" hidden>
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
+ Back to top
+</button>
+
+ </main>
+
+ <footer class="md-footer">
+
+ <div class="md-footer-meta md-typeset">
+ <div class="md-footer-meta__inner md-grid">
+ <div class="md-copyright">
+
+
+ Made with
+ <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
+ Material for MkDocs
+ </a>
+
+</div>
+
+ </div>
+ </div>
+</footer>
+
+ </div>
+ <div class="md-dialog" data-md-component="dialog">
+ <div class="md-dialog__inner md-typeset"></div>
+ </div>
+
+
+
+
+
+ <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["content.code.copy", "navigation.sections", "navigation.expand", "navigation.top", "search.highlight"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "sear [...]
+
+
+ <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
+
+ <script src="https://unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
+
+
+ </body>
+</html>
\ No newline at end of file
diff --git a/architecture/overview/index.html b/architecture/overview/index.html
new file mode 100644
index 0000000..bb820e7
--- /dev/null
+++ b/architecture/overview/index.html
@@ -0,0 +1,1799 @@
+
+<!doctype html>
+<html lang="en" class="no-js">
+ <head>
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <meta name="description" content="Kubernetes operator for deploying and managing Apache Superset">
+
+
+
+ <link rel="canonical" href="https://apache.github.io/superset-kubernetes-operator/architecture/overview/">
+
+
+ <link rel="prev" href="../../user-guide/migration/">
+
+
+ <link rel="next" href="../internals/">
+
+
+
+
+
+ <link rel="icon" href="../../assets/images/favicon.png">
+ <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
+
+
+
+ <title>Overview - Apache Superset Kubernetes Operator</title>
+
+
+
+ <link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
+
+
+ <link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
+
+
+
+
+
+
+
+
+
+
+
+
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
+ <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
+
+
+
+ <link rel="stylesheet" href="../../stylesheets/extra.css">
+
+ <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
+
+
+
+
+
+ </head>
+
+
+
+
+
+
+
+
+
+ <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo">
+
+
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
+ <label class="md-overlay" for="__drawer"></label>
+ <div data-md-component="skip">
+
+
+ <a href="#architecture-overview" class="md-skip">
+ Skip to content
+ </a>
+
+ </div>
+ <div data-md-component="announce">
+
+ </div>
+
+
+
+
+
+
+<header class="md-header md-header--shadow" data-md-component="header">
+ <nav class="md-header__inner md-grid" aria-label="Header">
+ <a href="../.." title="Apache Superset Kubernetes Operator" class="md-header__button md-logo" aria-label="Apache Superset Kubernetes Operator" data-md-component="logo">
+
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
+
+ </a>
+ <label class="md-header__button md-icon" for="__drawer">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
+ </label>
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
+ <span class="md-ellipsis">
+ Apache Superset Kubernetes Operator
+ </span>
+ </div>
+ <div class="md-header__topic" data-md-component="header-topic">
+ <span class="md-ellipsis">
+
+ Overview
+
+ </span>
+ </div>
+ </div>
+ </div>
+
+
+ <form class="md-header__option" data-md-component="palette">
+
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
+
+ <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
+ </label>
+
+
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
+
+ <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
+ </label>
+
+
+</form>
+
+
+
+ <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.get [...]
+
+
+
+
+
+ <label class="md-header__button md-icon" for="__search">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
+ </label>
+ <div class="md-search" data-md-component="search" role="dialog">
+ <label class="md-search__overlay" for="__search"></label>
+ <div class="md-search__inner" role="search">
+ <form class="md-search__form" name="search">
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
+ <label class="md-search__icon md-icon" for="__search">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
+ </label>
+ <nav class="md-search__options" aria-label="Search">
+
+ <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
+ </button>
+ </nav>
+
+ </form>
+ <div class="md-search__output">
+ <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
+ <div class="md-search-result" data-md-component="search-result">
+ <div class="md-search-result__meta">
+ Initializing search
+ </div>
+ <ol class="md-search-result__list" role="presentation"></ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+
+ <div class="md-header__source">
+ <a href="https://github.com/apache/superset-kubernetes-operator" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 [...]
+ </div>
+ <div class="md-source__repository">
+ apache/superset-kubernetes-operator
+ </div>
+</a>
+ </div>
+
+ </nav>
+
+</header>
+
+ <div class="md-container" data-md-component="container">
+
+
+
+
+
+
+ <main class="md-main" data-md-component="main">
+ <div class="md-main__inner md-grid">
+
+
+
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+
+
+<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
+ <label class="md-nav__title" for="__drawer">
+ <a href="../.." title="Apache Superset Kubernetes Operator" class="md-nav__button md-logo" aria-label="Apache Superset Kubernetes Operator" data-md-component="logo">
+
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
+
+ </a>
+ Apache Superset Kubernetes Operator
+ </label>
+
+ <div class="md-nav__source">
+ <a href="https://github.com/apache/superset-kubernetes-operator" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 [...]
+ </div>
+ <div class="md-source__repository">
+ apache/superset-kubernetes-operator
+ </div>
+</a>
+ </div>
+
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../.." class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Home
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../getting-started/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Getting Started
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
+
+
+ <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ User Guide
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_3">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ User Guide
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/installation/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Installation
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/configuration/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Configuration
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/lifecycle/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Lifecycle
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/networking-and-monitoring/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Networking & Monitoring
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../user-guide/migration/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Migration from Helm Chart
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
+
+
+
+ <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked>
+
+
+ <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Architecture
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="true">
+ <label class="md-nav__title" for="__nav_4">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Architecture
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active">
+
+ <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
+
+
+
+
+
+ <label class="md-nav__link md-nav__link--active" for="__toc">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Overview
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <a href="./" class="md-nav__link md-nav__link--active">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Overview
+
+
+
+ </span>
+
+
+
+ </a>
+
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#single-superset-crd-architecture" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Single Superset CRD Architecture
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Single Superset CRD Architecture">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#why-one-crd" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Why one CRD?
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#how-it-works" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ How it works
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#api-shape" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ API Shape
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#configuration-model" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Configuration Model
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Configuration Model">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#example-how-resources-resolve-for-celeryworker" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Example: How resources resolve for celeryWorker
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#example-how-env-vars-resolve-for-webserver" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Example: How env vars resolve for webServer
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#configuration-philosophy-typed-fields-vs-raw-python" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Configuration Philosophy: Typed Fields vs. Raw Python
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#config-rendering-pipeline" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Config Rendering Pipeline
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Config Rendering Pipeline">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#how-config-is-built" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ How config is built
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#secret-handling" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Secret Handling
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#config-mount-structure" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Config Mount Structure
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#checksum-driven-rollouts" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Checksum-Driven Rollouts
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#resource-ownership" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Resource Ownership
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../internals/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Internals
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
+
+
+ <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Reference
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_5">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Reference
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../reference/api-reference/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ API Reference
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../reference/downloads/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Downloads
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../reference/security/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Security
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
+
+
+ <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Contributing
+
+
+
+ </span>
+
+
+
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
+ <label class="md-nav__title" for="__nav_6">
+ <span class="md-nav__icon md-icon"></span>
+
+
+ Contributing
+
+
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../contributing/development-setup/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Development Setup
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../contributing/development-guidelines/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Development Guidelines
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../contributing/releasing/" class="md-nav__link">
+
+
+
+ <span class="md-ellipsis">
+
+
+ Releasing
+
+
+
+ </span>
+
+
+
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+
+ </li>
+
+
+
+ </ul>
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#single-superset-crd-architecture" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Single Superset CRD Architecture
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Single Superset CRD Architecture">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#why-one-crd" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Why one CRD?
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#how-it-works" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ How it works
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#api-shape" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ API Shape
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#configuration-model" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Configuration Model
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Configuration Model">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#example-how-resources-resolve-for-celeryworker" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Example: How resources resolve for celeryWorker
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#example-how-env-vars-resolve-for-webserver" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Example: How env vars resolve for webServer
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#configuration-philosophy-typed-fields-vs-raw-python" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Configuration Philosophy: Typed Fields vs. Raw Python
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#config-rendering-pipeline" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Config Rendering Pipeline
+
+ </span>
+ </a>
+
+ <nav class="md-nav" aria-label="Config Rendering Pipeline">
+ <ul class="md-nav__list">
+
+ <li class="md-nav__item">
+ <a href="#how-config-is-built" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ How config is built
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#secret-handling" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Secret Handling
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#config-mount-structure" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Config Mount Structure
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+ </nav>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#checksum-driven-rollouts" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Checksum-Driven Rollouts
+
+ </span>
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#resource-ownership" class="md-nav__link">
+ <span class="md-ellipsis">
+
+ Resource Ownership
+
+ </span>
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-content" data-md-component="content">
+
+ <article class="md-content__inner md-typeset">
+
+
+
+
+
+
+
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<h1 id="architecture-overview">Architecture Overview<a class="headerlink" href="#architecture-overview" title="Permanent link">¶</a></h1>
+<p>For runtime behavior details — reconciliation lifecycle, parent-owned resource
+management, and status reporting — see <a href="../internals/">Internals</a>. For lifecycle
+task orchestration (migrations, upgrades, drain strategies), see
+<a href="../../user-guide/lifecycle/">Lifecycle</a>.</p>
+<h2 id="single-superset-crd-architecture">Single Superset CRD Architecture<a class="headerlink" href="#single-superset-crd-architecture" title="Permanent link">¶</a></h2>
+<p>The operator exposes one user-facing CRD: <code>Superset</code>. A single <code>Superset</code>
+resource defines the complete deployment. The parent controller resolves shared
+top-level configuration and per-component overrides into concrete Kubernetes
+resources: Deployments, Services, ConfigMaps, HPAs, PDBs, lifecycle task Jobs,
+networking, monitoring, and NetworkPolicies.</p>
+<h3 id="why-one-crd">Why one CRD?<a class="headerlink" href="#why-one-crd" title="Permanent link">¶</a></h3>
+<p><code>Superset</code> is the reconciliation boundary for one Superset installation. The
+runtime components do not have independent desired state: they share instance
+configuration, secret material, database migration ordering, drain/maintenance
+behavior, rollout gates, and aggregate readiness. A lifecycle task can block or
+replace every component, and a component rollout may depend on lifecycle state
+that only the parent can evaluate.</p>
+<p>Because of that coupling, separate component CRDs would mostly expose internal
+controller decomposition as Kubernetes APIs. They would imply that components
+can be created, updated, or observed as independently managed custom resources,
+even though the controller cannot safely reconcile them without the parent's
+configuration, lifecycle, and rollout context.</p>
+<p>A single CRD matches the actual ownership model:</p>
+<ul>
+<li>Users declare one desired state: the <code>Superset</code> resource.</li>
+<li>The controller reconciles Deployments, Services, ConfigMaps, HPAs, PDBs,
+ lifecycle task Jobs, networking, monitoring, and NetworkPolicies as
+ parent-owned secondary resources.</li>
+<li>The <code>Superset</code> status subresource is the canonical visibility surface for
+ component readiness, resource references, lifecycle task progress, and
+ failure messages.</li>
+</ul>
+<p>This keeps the public API small, avoids partially managed intermediate custom
+resources, and makes <code>kubectl describe superset <name></code> the place to inspect the
+state of the whole installation.</p>
+<p>The implementation remains modular internally. Component descriptors,
+deployment defaults, config rendering, lifecycle task orchestration, resource
+reconciliation, and status projection are separated in code and covered by
+focused tests. The single CRD is an API and ownership decision, not a mandate for
+one monolithic controller implementation.</p>
+<h3 id="how-it-works">How it works<a class="headerlink" href="#how-it-works" title="Permanent link">¶</a></h3>
+<p>For each enabled component, the parent controller renders any needed
+<code>superset_config.py</code>, merges top-level and per-component templates into a flat
+runtime spec, reconciles the parent-owned Kubernetes resources, and projects
+workload state back into <code>status.components</code>.</p>
+<p>Lifecycle tasks follow the same model: the parent resolves the task Job Pod spec,
+creates a parent-owned ConfigMap when needed, runs a parent-owned Job, and
+stores durable task state in <code>status.lifecycle</code>.</p>
+<hr />
+<h2 id="api-shape">API Shape<a class="headerlink" href="#api-shape" title="Permanent link">¶</a></h2>
+<p>Users create one top-level resource:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">superset.apache.org/v1alpha1</span>
+<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Superset</span>
+<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="nt">metadata</span><span class="p">:</span>
+<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">my-superset</span>
+<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="nt">spec</span><span class="p">:</span>
+<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="w"> </span><span class="nt">image</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nt"> tag</span><span class="p">:</span><span class="w"> </span><span class="s">"latest"</span><span class="w"> </span><span class="p p-Indicator">}</span>
+<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="w"> </span><span class="nt">environment</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Development</span>
+<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="w"> </span><span class="nt">secretKey</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">thisIsNotSecure_changeInProduction!</span>
+<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="w"> </span><span class="nt">metastore</span><span class="p">:</span>
+<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="w"> </span><span class="nt">uri</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">postgresql+psycopg2://superset:superset@postgres:5432/superset</span>
+</code></pre></div>
+<p>Components fall into two runtime categories:</p>
+<p><strong>Scalable components</strong> support replicas, HPA, and PodDisruptionBudgets:</p>
+<table>
+<thead>
+<tr>
+<th>Parent field</th>
+<th>Suffix</th>
+<th>Creates</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>webServer</code></td>
+<td><code>-web-server</code></td>
+<td>Deployment, Service, ConfigMap, HPA, PDB</td>
+</tr>
+<tr>
+<td><code>celeryWorker</code></td>
+<td><code>-celery-worker</code></td>
+<td>Deployment, ConfigMap, HPA, PDB</td>
+</tr>
+<tr>
+<td><code>celeryFlower</code></td>
+<td><code>-celery-flower</code></td>
+<td>Deployment, Service, ConfigMap, HPA, PDB</td>
+</tr>
+<tr>
+<td><code>websocketServer</code></td>
+<td><code>-websocket-server</code></td>
+<td>Deployment, Service, HPA, PDB</td>
+</tr>
+<tr>
+<td><code>mcpServer</code></td>
+<td><code>-mcp-server</code></td>
+<td>Deployment, Service, ConfigMap, HPA, PDB</td>
+</tr>
+</tbody>
+</table>
+<p><strong>Singleton components</strong> run exactly one instance and don't support scaling:</p>
+<table>
+<thead>
+<tr>
+<th>Parent field</th>
+<th>Suffix</th>
+<th>Creates</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>lifecycle</code></td>
+<td><code>-clone</code>, <code>-migrate</code>, <code>-rotate</code>, <code>-init</code></td>
+<td>Jobs, ConfigMap for Superset-image tasks</td>
+</tr>
+<tr>
+<td><code>celeryBeat</code></td>
+<td><code>-celery-beat</code></td>
+<td>Deployment, ConfigMap</td>
+</tr>
+</tbody>
+</table>
+<p><strong>Presence = enabled</strong>: Setting <code>celeryWorker: {}</code> deploys workers with
+defaults. Omitting <code>celeryWorker</code> entirely means no workers. No
+<code>enabled: true/false</code> toggles. The exception is lifecycle tasks, which are
+enabled by default even when <code>spec.lifecycle</code> is nil; disable them explicitly
+with <code>spec.lifecycle.disabled: true</code>.</p>
+<hr />
+<h2 id="configuration-model">Configuration Model<a class="headerlink" href="#configuration-model" title="Permanent link">¶</a></h2>
+<p>All Deployment, Pod, and container configuration flows through two sibling
+template fields:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>deploymentTemplate → DeploymentSpec-level (strategy, revisionHistoryLimit, ...)
+<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>podTemplate → PodSpec-level (affinity, tolerations, volumes, ...)
+<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>└── container → Container-level (resources, env, probes, ...)
+</code></pre></div>
+<p><strong>Top-level <code>deploymentTemplate</code> and <code>podTemplate</code></strong> provide defaults
+inherited by all components. <strong>Per-component</strong> values are field-level merged
+with the top-level — only specify what's different. Scaling fields
+(<code>replicas</code>, <code>autoscaling</code>, <code>podDisruptionBudget</code>) are outside the templates
+since they interact with operator logic (HPA, Beat singleton).</p>
+<p>Merge semantics per field type:</p>
+<ul>
+<li><strong>Scalars/structs</strong> (resources, affinity, securityContext, probes, etc.) — component wins if set</li>
+<li><strong>Named collections</strong> (env, volumes, volumeMounts, sidecars) — merge by name, component wins on conflict</li>
+<li><strong>Maps</strong> (annotations, labels, nodeSelector) — merge by key, component wins on conflict</li>
+<li><strong>Unnamed collections</strong> (tolerations, topologySpreadConstraints) — append</li>
+<li><strong>command/args</strong> — component-only, not inherited from top-level</li>
+<li><strong>Operator-managed labels</strong> (<code>app.kubernetes.io/*</code>) — applied last, cannot be overridden</li>
+</ul>
+<p>Lifecycle tasks use <code>podTemplate</code> only (no <code>deploymentTemplate</code>) since they
+create Jobs, not Deployments. See the <a href="../../user-guide/configuration/#deployment-template">Configuration guide</a> for
+the full field reference and examples.</p>
+<h3 id="example-how-resources-resolve-for-celeryworker">Example: How resources resolve for celeryWorker<a class="headerlink" href="#example-how-resources-resolve-for-celeryworker" title="Permanent link">¶</a></h3>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="nt">spec</span><span class="p">:</span>
+<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="nt">podTemplate</span><span class="p">:</span>
+<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="w"> </span><span class="nt">container</span><span class="p">:</span>
+<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a><span class="w"> </span><span class="nt">resources</span><span class="p">:</span>
+<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a><span class="w"> </span><span class="nt">limits</span><span class="p">:</span>
+<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a><span class="w"> </span><span class="nt">cpu</span><span class="p">:</span><span class="w"> </span><span class="s">"2"</span>
+<a id="__codelineno-2-7" name="__codelineno-2-7" href="#__codelineno-2-7"></a><span class="w"> </span><span class="nt">memory</span><span class="p">:</span><span class="w"> </span><span class="s">"4Gi"</span>
+<a id="__codelineno-2-8" name="__codelineno-2-8" href="#__codelineno-2-8"></a><span class="w"> </span><span class="nt">celeryWorker</span><span class="p">:</span>
+<a id="__codelineno-2-9" name="__codelineno-2-9" href="#__codelineno-2-9"></a><span class="w"> </span><span class="nt">podTemplate</span><span class="p">:</span>
+<a id="__codelineno-2-10" name="__codelineno-2-10" href="#__codelineno-2-10"></a><span class="w"> </span><span class="nt">container</span><span class="p">:</span>
+<a id="__codelineno-2-11" name="__codelineno-2-11" href="#__codelineno-2-11"></a><span class="w"> </span><span class="nt">resources</span><span class="p">:</span>
+<a id="__codelineno-2-12" name="__codelineno-2-12" href="#__codelineno-2-12"></a><span class="w"> </span><span class="nt">limits</span><span class="p">:</span>
+<a id="__codelineno-2-13" name="__codelineno-2-13" href="#__codelineno-2-13"></a><span class="w"> </span><span class="nt">cpu</span><span class="p">:</span><span class="w"> </span><span class="s">"8"</span><span class="w"> </span><span class="c1"># component replaces entire resources struct</span>
+</code></pre></div>
+<p>Result on the celery worker Deployment: <code>resources.limits = {cpu: "8"}</code>
+(resources is a scalar/struct field — component replaces entirely).</p>
+<h3 id="example-how-env-vars-resolve-for-webserver">Example: How env vars resolve for webServer<a class="headerlink" href="#example-how-env-vars-resolve-for-webserver" title="Permanent link">¶</a></h3>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nt">spec</span><span class="p">:</span>
+<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="w"> </span><span class="nt">podTemplate</span><span class="p">:</span>
+<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span><span class="nt">container</span><span class="p">:</span>
+<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span><span class="nt">env</span><span class="p">:</span>
+<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="nv">LOG_LEVEL</span><span class="p p-Indicator">,</span><span class="nt"> value</span><span class="p">:</span><span class="w"> </span><span class="nv">INFO</span><span class="p p-Indicator">}</span>
+<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="w"> </span><span class="nt">webServer</span><span class="p">:</span>
+<a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="w"> </span><span class="nt">podTemplate</span><span class="p">:</span>
+<a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="w"> </span><span class="nt">container</span><span class="p">:</span>
+<a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="w"> </span><span class="nt">env</span><span class="p">:</span>
+<a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="nv">GUNICORN_WORKERS</span><span class="p p-Indicator">,</span><span class="nt"> value</span><span class="p">:</span><span class="w"> </span><span class="s">"4"</span><span class="p p [...]
+</code></pre></div>
+<p>Result on the web server Deployment: both env vars present.</p>
+<hr />
+<h2 id="configuration-philosophy-typed-fields-vs-raw-python">Configuration Philosophy: Typed Fields vs. Raw Python<a class="headerlink" href="#configuration-philosophy-typed-fields-vs-raw-python" title="Permanent link">¶</a></h2>
+<p>Superset is configured through <code>superset_config.py</code> — a Python module that exposes hundreds of knobs across Flask, Flask-AppBuilder, Celery, caching, security, and Superset itself. Mirroring every one of those knobs as a typed CRD field would turn the operator into a partial Superset fork, balloon CRD size, and lag behind upstream changes. Hiding everything behind a single Python blob, on the other hand, gives up the validation, discoverability, and operator-side reasoning [...]
+<p>The operator splits the difference:</p>
+<ul>
+<li>
+<p><strong>Typed CRD fields</strong> are reserved for settings where the operator adds clear value: anything tied to Kubernetes resources (images, ports, replicas, autoscaling), anything sourced from Secrets (<code>secretKey</code>, metastore credentials, Valkey passwords), and any setting that the operator can validate, render uniformly, or wire up across components (metastore URIs, Valkey-driven cache and Celery backends, lifecycle gating). Typed fields earn their place because they ca [...]
+</li>
+<li>
+<p><strong>Raw Python in <code>spec.config</code> and <code>spec.<component>.config</code></strong> is the default home for everything else: feature flags beyond a curated set, custom security managers, OAuth providers, thumbnail executors, custom Celery routes, beat schedules, task annotations, and anything else that is naturally a Python expression or class. Admins are comfortable writing Python in <code>superset_config.py</code>; forcing those settings through YAML schemas tends [...]
+</li>
+</ul>
+<p>To make Python-side configuration ergonomic, the operator exposes a few resolved values as env vars (<code>SUPERSET_OPERATOR__INSTANCE_NAME</code>, <code>SUPERSET_OPERATOR__VALKEY_HOST</code>, etc.) so admins can reference them from raw Python without templating. Operator-rendered objects like the <code>CeleryConfig</code> class are regular Python — admins extend them by mutating attributes, subclassing, or replacing the assignment outright.</p>
+<p>This split is intentionally a moving boundary. As specific knobs prove to be widely used, frequently misconfigured, or worth cross-component validation, they migrate from raw Python into typed CRD fields. The starting position favors raw Python; promotions are made deliberately and case by case. The first promotions are <code>spec.featureFlags</code> (a <code>map[string]bool</code> rendering <code>FEATURE_FLAGS = {...}</code>) and <code>spec.celery.imports</code> (the Celery worker im [...]
+<hr />
+<h2 id="config-rendering-pipeline">Config Rendering Pipeline<a class="headerlink" href="#config-rendering-pipeline" title="Permanent link">¶</a></h2>
+<p>The operator generates per-component <code>superset_config.py</code> files by
+<strong>concatenating</strong> three sections in order. Both <code>spec.config</code> (base) and
+<code>spec.<component>.config</code> (component) are appended — they are not mutually
+exclusive. If both are set, the component receives all three sections:</p>
+<h3 id="how-config-is-built">How config is built<a class="headerlink" href="#how-config-is-built" title="Permanent link">¶</a></h3>
+<ol>
+<li><strong>Operator-generated configs</strong> — <code>SECRET_KEY</code> rendered from the
+ <code>SUPERSET_OPERATOR__SECRET_KEY</code> env var, <code>SQLALCHEMY_DATABASE_URI</code> rendered
+ from operator-internal env vars (both passthrough and structured metastore
+ modes), plus <code>SUPERSET_WEBSERVER_PORT</code> for the web server.</li>
+<li><strong>SQLAlchemy engine options</strong> — <code>SQLALCHEMY_ENGINE_OPTIONS</code> dict, computed
+ per component from the resolved <code>sqlaEngineOptions</code> preset and the
+ component's worker/thread configuration (Gunicorn workers × threads for
+ the web server, Celery concurrency for workers). Presets range from
+ <code>conservative</code> (NullPool) through <code>balanced</code> (pool_size=1, max_overflow=-1)
+ to <code>aggressive</code> (pool_size=workers×threads). See
+ <a href="../../user-guide/configuration/#sqlalchemy-engine-options">SQLAlchemy Engine Options</a> for details.</li>
+<li><strong>Valkey cache config</strong> — When <code>spec.valkey</code> is set, the operator renders
+ <code>CACHE_CONFIG</code>, <code>DATA_CACHE_CONFIG</code>, <code>FILTER_STATE_CACHE_CONFIG</code>,
+ <code>EXPLORE_FORM_DATA_CACHE_CONFIG</code>, <code>THUMBNAIL_CACHE_CONFIG</code>,
+ <code>CeleryConfig</code>, and <code>RESULTS_BACKEND</code> backed by Valkey. Connection details
+ are read from <code>SUPERSET_OPERATOR__VALKEY_*</code> env vars at Python runtime.
+ SSL/mTLS cert paths are baked directly into the rendered config.</li>
+<li><strong>Base config (<code>spec.config</code>)</strong> — Raw Python from the top-level <code>config</code>
+ field, shared by all Python components. Appended after operator-generated
+ configs.</li>
+<li><strong>Component config (<code>spec.<component>.config</code>)</strong> — Raw Python from the
+ per-component <code>config</code> field. Appended last, so it can override anything
+ above.</li>
+</ol>
+<p>For example, given a structured metastore configuration:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="nt">spec</span><span class="p">:</span>
+<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="w"> </span><span class="nt">metastore</span><span class="p">:</span>
+<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="w"> </span><span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">db.example.com</span>
+<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="w"> </span><span class="nt">database</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">superset</span>
+<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="w"> </span><span class="nt">username</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">superset</span>
+<a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><span class="w"> </span><span class="nt">passwordFrom</span><span class="p">:</span>
+<a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">db-credentials</span>
+<a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="w"> </span><span class="nt">key</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">password</span>
+<a id="__codelineno-4-9" name="__codelineno-4-9" href="#__codelineno-4-9"></a><span class="w"> </span><span class="nt">config</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">|</span>
+<a id="__codelineno-4-10" name="__codelineno-4-10" href="#__codelineno-4-10"></a><span class="w"> </span><span class="no">FEATURE_FLAGS = {"DASHBOARD_RBAC": True}</span>
+<a id="__codelineno-4-11" name="__codelineno-4-11" href="#__codelineno-4-11"></a><span class="w"> </span><span class="nt">celeryWorker</span><span class="p">:</span>
+<a id="__codelineno-4-12" name="__codelineno-4-12" href="#__codelineno-4-12"></a><span class="w"> </span><span class="nt">config</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">|</span>
+<a id="__codelineno-4-13" name="__codelineno-4-13" href="#__codelineno-4-13"></a><span class="w"> </span><span class="no">CELERY_ANNOTATIONS = {"tasks.add": {"rate_limit": "10/s"}}</span>
+</code></pre></div>
+<p>The celery worker's <code>superset_config.py</code> contains all three sections:</p>
+<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="c1"># Operator-generated configs</span>
+<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a><span class="n">SQLALCHEMY_DATABASE_URI</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"postgresql+psycopg2://..."</span> <span class="c1"># assembled from env vars</span>
+<a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a>
+<a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="c1"># Base config (spec.config)</span>
+<a id="__codelineno-5-5" name="__codelineno-5-5" href="#__codelineno-5-5"></a><span class="n">FEATURE_FLAGS</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"DASHBOARD_RBAC"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span>
+<a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a>
+<a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="c1"># Component config</span>
+<a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="n">CELERY_ANNOTATIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"tasks.add"</span><span class="p">:</span> <span class="p">{</span><span class="s2">"rate_limit"</span><span class="p">:</span> <span class="s2">"10/s"</span><span class="p">}}</span>
+</code></pre></div>
+<p>Note: All operator-managed settings (<code>SECRET_KEY</code>, <code>SQLALCHEMY_DATABASE_URI</code>,
+web server port) are rendered into the config file from operator-internal
+<code>SUPERSET_OPERATOR__*</code> env vars. Both passthrough and structured metastore
+modes render <code>SQLALCHEMY_DATABASE_URI</code> from <code>SUPERSET_OPERATOR__DB_URI</code>
+(passthrough) or <code>SUPERSET_OPERATOR__DB_*</code> (structured).</p>
+<table>
+<thead>
+<tr>
+<th>Config section</th>
+<th>WebServer</th>
+<th>CeleryWorker</th>
+<th>CeleryBeat</th>
+<th>CeleryFlower</th>
+<th>McpServer</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>SECRET_KEY</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr>
+<td>Passthrough DB URI</td>
+<td>if set</td>
+<td>if set</td>
+<td>if set</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+<tr>
+<td>Structured DB URI (f-string)</td>
+<td>if set</td>
+<td>if set</td>
+<td>if set</td>
+<td>if set</td>
+<td>if set</td>
+</tr>
+<tr>
+<td>Web server port (8088)</td>
+<td>yes</td>
+<td></td>
+<td></td>
+<td></td>
+<td></td>
+</tr>
+<tr>
+<td>Top-level config</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr>
+<td>Per-component config</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+</tbody>
+</table>
+<p><strong>WebsocketServer</strong> is Node.js-based -- it does NOT get <code>superset_config.py</code>.</p>
+<h3 id="secret-handling">Secret Handling<a class="headerlink" href="#secret-handling" title="Permanent link">¶</a></h3>
+<p>In <strong>dev mode</strong> (<code>environment: Development</code>), <code>secretKey</code>, <code>metastore.uri</code>, and
+<code>metastore.password</code> can be set as plain strings directly in the CR. The
+operator injects them as environment variables on the container spec.</p>
+<p>In <strong>prod mode</strong> (<code>environment: Production</code>, the default), CRD validation rejects
+these inline fields. Instead, use the <code>*From</code> fields to reference Kubernetes
+Secrets:</p>
+<ul>
+<li><code>secretKeyFrom</code> — references a Secret key for the Flask secret key</li>
+<li><code>metastore.uriFrom</code> — references a Secret key for the full database URI</li>
+<li><code>metastore.passwordFrom</code> — references a Secret key for the database password (structured mode)</li>
+</ul>
+<p>The operator injects the corresponding env vars (<code>SUPERSET_OPERATOR__SECRET_KEY</code>,
+<code>SUPERSET_OPERATOR__DB_URI</code>, <code>SUPERSET_OPERATOR__DB_PASS</code>) with
+<code>valueFrom.secretKeyRef</code> pointing at the referenced Secret. Secret values
+never appear in ConfigMaps or CRD status fields.</p>
+<h3 id="config-mount-structure">Config Mount Structure<a class="headerlink" href="#config-mount-structure" title="Permanent link">¶</a></h3>
+<ul>
+<li><code>/app/pythonpath/</code> — ConfigMap with <code>superset_config.py</code></li>
+</ul>
+<hr />
+<h2 id="checksum-driven-rollouts">Checksum-Driven Rollouts<a class="headerlink" href="#checksum-driven-rollouts" title="Permanent link">¶</a></h2>
+<p>The parent computes a per-component config checksum and stamps it on the
+component Deployment pod template. When the checksum changes (due to config or
+secret reference changes on the CR), Kubernetes triggers a rolling restart of the affected
+component. Note: rotating a referenced Secret's value without changing the
+CR does not trigger a rollout — use
+<a href="../../user-guide/configuration/#force-reload">Force Reload</a> for this case. See
+<a href="../internals/#checksum-driven-rollouts">Internals</a> for the full checksum
+table and per-component isolation details.</p>
+<hr />
+<h2 id="resource-ownership">Resource Ownership<a class="headerlink" href="#resource-ownership" title="Permanent link">¶</a></h2>
+<p>All resources use Kubernetes owner references for automatic cleanup. The parent
+<code>Superset</code> CR owns component Deployments, Services, ConfigMaps, HPAs, PDBs,
+lifecycle task Jobs, networking resources (Ingress/HTTPRoute), ServiceMonitor,
+and NetworkPolicies. Deleting the parent cascades to everything. Removing a
+component from the parent spec deletes the resources for that component.</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </article>
+ </div>
+
+
+<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
+ </div>
+
+ <button type="button" class="md-top md-icon" data-md-component="top" hidden>
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
+ Back to top
+</button>
+
+ </main>
+
+ <footer class="md-footer">
+
+ <div class="md-footer-meta md-typeset">
+ <div class="md-footer-meta__inner md-grid">
+ <div class="md-copyright">
+
+
+ Made with
+ <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
+ Material for MkDocs
+ </a>
+
+</div>
+
+ </div>
+ </div>
+</footer>
+
+ </div>
+ <div class="md-dialog" data-md-component="dialog">
+ <div class="md-dialog__inner md-typeset"></div>
+ </div>
+
+
+
+
+
+ <script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["content.code.copy", "navigation.sections", "navigation.expand", "navigation.top", "search.highlight"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "sear [...]
+
+
+ <script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
+
+ <script src="https://unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
+
+
+ </body>
+</html>
\ No newline at end of file
diff --git a/assets/images/favicon.png b/assets/images/favicon.png
new file mode 100644
index 0000000..1cf13b9
Binary files /dev/null and b/assets/images/favicon.png differ
diff --git a/assets/javascripts/bundle.79ae519e.min.js b/assets/javascripts/bundle.79ae519e.min.js
new file mode 100644
index 0000000..3df3e5e
--- /dev/null
+++ b/assets/javascripts/bundle.79ae519e.min.js
@@ -0,0 +1,16 @@
+"use strict";(()=>{var Zi=Object.create;var _r=Object.defineProperty;var ea=Object.getOwnPropertyDescriptor;var ta=Object.getOwnPropertyNames,Bt=Object.getOwnPropertySymbols,ra=Object.getPrototypeOf,Ar=Object.prototype.hasOwnProperty,bo=Object.prototype.propertyIsEnumerable;var ho=(e,t,r)=>t in e?_r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))Ar.call(t,r)&&ho(e,r,t[r]);if(Bt)for(var r of Bt(t))bo.call(t,r)&&ho(e,r,t[r]);return e};var v [...]
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var qa=/["'&<>]/;Rn.exports=Ka;function Ka(e){var t=""+e,r=qa.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}s!==i&&(n+=t.substring(s,i)),s=i+1,n+=o}return s!==i?n+t.substring(s,i):n}});var ao=Cr((Nt,io)=>{/*!
+ * clipboard.js v2.0.11
+ * https://clipboardjs.com/
+ *
+ * Licensed MIT © Zeno Rocha
+ */(function(t,r){typeof Nt=="object"&&typeof io=="object"?io.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Nt=="object"?Nt.ClipboardJS=r():t.ClipboardJS=r()})(Nt,function(){return(function(){var e={686:(function(o,n,i){"use strict";i.d(n,{default:function(){return Xi}});var s=i(279),a=i.n(s),c=i(370),p=i.n(c),l=i(817),f=i.n(l);function u(q){try{return document.execCommand(q)}catch(C){return!1}}var d=function(C){var _=f()(C);return u("cut"),_},v=d;function S(q){va [...]
+`+r.map(function(o,n){return n+1+") "+o.toString()}).join(`
+ `):"",this.name="UnsubscriptionError",this.errors=r}});function Ze(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var qe=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=Oe(s),c=a.next();!c.done;c=a.next()){var p=c.value;p.remove(this)}}catch(S){t={error:S}} [...]
+//# sourceMappingURL=bundle.79ae519e.min.js.map
+
diff --git a/assets/javascripts/bundle.79ae519e.min.js.map b/assets/javascripts/bundle.79ae519e.min.js.map
new file mode 100644
index 0000000..5cf0289
--- /dev/null
+++ b/assets/javascripts/bundle.79ae519e.min.js.map
@@ -0,0 +1,7 @@
+{
+ "version": 3,
+ "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/escape-html/index.js", "node_modules/clipboard/dist/clipboard.js", "src/templates/assets/javascripts/bundle.ts", "node_modules/tslib/tslib.es6.mjs", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subsc [...]
+ "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-vis [...]
+ "mappings": "2rCAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,EAAC,SAAUC,EAAQC,EAAS,CAC1B,OAAOH,IAAY,UAAY,OAAOC,IAAW,YAAcE,EAAQ,EACvE,OAAO,QAAW,YAAc,OAAO,IAAM,OAAOA,CAAO,EAC1DA,EAAQ,CACX,GAAEH,IAAO,UAAY,CAAE,aASrB,SAASI,EAA0BC,EAAO,CACxC,IAAIC,EAAmB,GACnBC,EAA0B,GAC1BC,EAAiC,KAEjCC,EAAsB,CACxB,KAAM,GACN,OAAQ,GACR,IAAK,GACL,IAAK,GACL,MAAO,GACP,SAAU,GACV,OAAQ,GACR,KAAM,GACN,MAAO,GACP,KAAM,GACN,KAAM,GACN,SAAU,GACV,iBAAkB,EACpB,EAOA,SAASC,EAAmBC,EAAI,CAC9B,MACE,GAAAA,GACAA,IAAO,UACPA,EAAG,WAAa,QAC [...]
+ "names": ["require_focus_visible", "__commonJSMin", "exports", "module", "global", "factory", "applyFocusVisiblePolyfill", "scope", "hadKeyboardEvent", "hadFocusVisibleRecently", "hadFocusVisibleRecentlyTimeout", "inputTypesAllowlist", "isValidFocusTarget", "el", "focusTriggersKeyboardModality", "type", "tagName", "addFocusVisibleClass", "removeFocusVisibleClass", "onKeyDown", "e", "onPointerDown", "onFocus", "onBlur", "onVisibilityChange", "addInitialPointerMoveListeners", "onInitialP [...]
+}
diff --git a/assets/javascripts/lunr/min/lunr.ar.min.js b/assets/javascripts/lunr/min/lunr.ar.min.js
new file mode 100644
index 0000000..9b06c26
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ar.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ar=function(){this.pipeline.reset(),this.pipeline.add(e.ar.trimmer,e.ar.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.da.min.js b/assets/javascripts/lunr/min/lunr.da.min.js
new file mode 100644
index 0000000..b9d8509
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.da.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Danish` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.de.min.js b/assets/javascripts/lunr/min/lunr.de.min.js
new file mode 100644
index 0000000..f3b5c10
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.de.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `German` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.de=function(){this.pipeline.reset(),this.pipeline.add(e.de.trimmer,e.de.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.du.min.js b/assets/javascripts/lunr/min/lunr.du.min.js
new file mode 100644
index 0000000..49a0f3f
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.du.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Dutch` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");console.warn('[Lunr Languages] Please use the "nl" instead of the "du". The "nl" c [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.el.min.js b/assets/javascripts/lunr/min/lunr.el.min.js
new file mode 100644
index 0000000..ace017b
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.el.min.js
@@ -0,0 +1 @@
+!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.el=function(){this.pipeline.reset(),void 0===this.searchPipeline&&this.pipeline. [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.es.min.js b/assets/javascripts/lunr/min/lunr.es.min.js
new file mode 100644
index 0000000..2989d34
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.es.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Spanish` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,s){"function"==typeof define&&define.amd?define(s):"object"==typeof exports?module.exports=s():s()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.es=function(){this.pipeline.reset(),this.pipeline.add(e.es.trimmer,e.es.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.fi.min.js b/assets/javascripts/lunr/min/lunr.fi.min.js
new file mode 100644
index 0000000..29f5dfc
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.fi.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Finnish` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(i,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(i.lunr)}(this,function(){return function(i){if(void 0===i)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===i.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");i.fi=function(){this.pipeline.reset(),this.pipeline.add(i.fi.trimmer,i.fi.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.fr.min.js b/assets/javascripts/lunr/min/lunr.fr.min.js
new file mode 100644
index 0000000..68cd009
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.fr.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `French` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.fr=function(){this.pipeline.reset(),this.pipeline.add(e.fr.trimmer,e.fr.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.he.min.js b/assets/javascripts/lunr/min/lunr.he.min.js
new file mode 100644
index 0000000..b863d3e
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.he.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.he=function(){this.pipeline.reset(),this.pipeline.add(e.he.trimmer,e.he.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.hi.min.js b/assets/javascripts/lunr/min/lunr.hi.min.js
new file mode 100644
index 0000000..7dbc414
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.hi.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hi=function(){this.pipeline.reset(),this.pipeline.add(e.hi.trimmer,e.hi.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.hu.min.js b/assets/javascripts/lunr/min/lunr.hu.min.js
new file mode 100644
index 0000000..ed9d909
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.hu.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Hungarian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hu=function(){this.pipeline.reset(),this.pipeline.add(e.hu.trimmer,e.hu.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.hy.min.js b/assets/javascripts/lunr/min/lunr.hy.min.js
new file mode 100644
index 0000000..b37f792
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.hy.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hy=function(){this.pipeline.reset(),this.pipeline.add(e.hy.trimmer,e.hy.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.it.min.js b/assets/javascripts/lunr/min/lunr.it.min.js
new file mode 100644
index 0000000..344b6a3
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.it.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Italian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.it=function(){this.pipeline.reset(),this.pipeline.add(e.it.trimmer,e.it.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ja.min.js b/assets/javascripts/lunr/min/lunr.ja.min.js
new file mode 100644
index 0000000..5f254eb
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ja.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e. [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.jp.min.js b/assets/javascripts/lunr/min/lunr.jp.min.js
new file mode 100644
index 0000000..c055eba
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.jp.min.js
@@ -0,0 +1 @@
+module.exports=require("./lunr.ja");
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.kn.min.js b/assets/javascripts/lunr/min/lunr.kn.min.js
new file mode 100644
index 0000000..1cef9be
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.kn.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.kn=function(){this.pipeline.reset(),this.pipeline.add(e.kn.trimmer,e.kn.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ko.min.js b/assets/javascripts/lunr/min/lunr.ko.min.js
new file mode 100644
index 0000000..eaf9dab
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ko.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ko=function(){this.pipeline.reset(),this.pipeline.add(e.ko.trimmer,e.ko.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.multi.min.js b/assets/javascripts/lunr/min/lunr.multi.min.js
new file mode 100644
index 0000000..7debad0
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.multi.min.js
@@ -0,0 +1 @@
+!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var t=Array.prototype.slice.call(arguments),i=t.join("-"),r="",n=[],s=[],p=0;p<t.length;++p)"en"==t[p]?(r+="\\w",n.unshift(e.stopWordFilter),n.push(e.stemmer),s.push(e.stemmer)):(r+=e[t[p]].wordCharacters,e[t[p]].stopWordFilter&&n.unshift(e[t[p]].stopWordFilter),e[t[p]].stemmer&&(n.push(e[t[p]].stemmer),s [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.nl.min.js b/assets/javascripts/lunr/min/lunr.nl.min.js
new file mode 100644
index 0000000..c4a2535
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.nl.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Dutch` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(r,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.nl=function(){this.pipeline.reset(),this.pipeline.add(r.nl.trimmer,r.nl.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.no.min.js b/assets/javascripts/lunr/min/lunr.no.min.js
new file mode 100644
index 0000000..92bc7e4
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.no.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Norwegian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.pt.min.js b/assets/javascripts/lunr/min/lunr.pt.min.js
new file mode 100644
index 0000000..6c16996
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.pt.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Portuguese` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ro.min.js b/assets/javascripts/lunr/min/lunr.ro.min.js
new file mode 100644
index 0000000..7277140
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ro.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Romanian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ru.min.js b/assets/javascripts/lunr/min/lunr.ru.min.js
new file mode 100644
index 0000000..186cc48
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ru.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Russian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ru=function(){this.pipeline.reset(),this.pipeline.add(e.ru.trimmer,e.ru.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.sa.min.js b/assets/javascripts/lunr/min/lunr.sa.min.js
new file mode 100644
index 0000000..50ee564
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.sa.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sa=function(){this.pipeline.reset(),this.pipeline.add(e.sa.trimmer,e.sa.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.stemmer.support.min.js b/assets/javascripts/lunr/min/lunr.stemmer.support.min.js
new file mode 100644
index 0000000..abd4475
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.stemmer.support.min.js
@@ -0,0 +1 @@
+!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.met [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.sv.min.js b/assets/javascripts/lunr/min/lunr.sv.min.js
new file mode 100644
index 0000000..3e5eb64
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.sv.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Swedish` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ta.min.js b/assets/javascripts/lunr/min/lunr.ta.min.js
new file mode 100644
index 0000000..a644bed
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ta.min.js
@@ -0,0 +1 @@
+!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ta=function(){this.pipeline.reset(),this.pipeline.add(e.ta.trimmer,e.ta.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.te.min.js b/assets/javascripts/lunr/min/lunr.te.min.js
new file mode 100644
index 0000000..9fa7a93
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.te.min.js
@@ -0,0 +1 @@
+!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.te=function(){this.pipeline.reset(),this.pipeline.add(e.te.trimmer,e.te.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.th.min.js b/assets/javascripts/lunr/min/lunr.th.min.js
new file mode 100644
index 0000000..dee3aac
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.th.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e. [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.tr.min.js b/assets/javascripts/lunr/min/lunr.tr.min.js
new file mode 100644
index 0000000..563f6ec
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.tr.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Turkish` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWord [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.vi.min.js b/assets/javascripts/lunr/min/lunr.vi.min.js
new file mode 100644
index 0000000..22aed28
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.vi.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.t [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.zh.min.js b/assets/javascripts/lunr/min/lunr.zh.min.js
new file mode 100644
index 0000000..fda66e9
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.zh.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r(require("@node-rs/jieba")):r()(e.lunr)}(this,function(e){return function(r,t){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==r.version[0];r.zh=function(){this.pipeline. [...]
\ No newline at end of file
diff --git a/assets/javascripts/lunr/tinyseg.js b/assets/javascripts/lunr/tinyseg.js
new file mode 100644
index 0000000..167fa6d
--- /dev/null
+++ b/assets/javascripts/lunr/tinyseg.js
@@ -0,0 +1,206 @@
+/**
+ * export the module via AMD, CommonJS or as a browser global
+ * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
+ */
+;(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(factory)
+ } else if (typeof exports === 'object') {
+ /**
+ * Node. Does not work with strict CommonJS, but
+ * only CommonJS-like environments that support module.exports,
+ * like Node.
+ */
+ module.exports = factory()
+ } else {
+ // Browser globals (root is window)
+ factory()(root.lunr);
+ }
+}(this, function () {
+ /**
+ * Just return a value to define the module export.
+ * This example returns an object, but the module
+ * can return a function as the exported value.
+ */
+
+ return function(lunr) {
+ // TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
+ // (c) 2008 Taku Kudo <ta...@chasen.org>
+ // TinySegmenter is freely distributable under the terms of a new BSD licence.
+ // For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
+
+ function TinySegmenter() {
+ var patterns = {
+ "[一二三四五六七八九十百千万億兆]":"M",
+ "[一-龠々〆ヵヶ]":"H",
+ "[ぁ-ん]":"I",
+ "[ァ-ヴーア-ン゙ー]":"K",
+ "[a-zA-Za-zA-Z]":"A",
+ "[0-90-9]":"N"
+ }
+ this.chartype_ = [];
+ for (var i in patterns) {
+ var regexp = new RegExp(i);
+ this.chartype_.push([regexp, patterns[i]]);
+ }
+
+ this.BIAS__ = -332
+ this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378};
+ this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920};
+ this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266};
+ this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352};
+ this.BP2__ = {"BO":60,"OO":-1762};
+ this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
+ this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146};
+ this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699};
+ this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
+ this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741," [...]
+ this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1 [...]
+ this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":65 [...]
+ this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
+ this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
+ this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393};
+ this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
+ this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
+ this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
+ this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
+ this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156};
+ this.TW1__ = {"につい":-4681,"東京都":2026};
+ this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216};
+ this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287};
+ this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865};
+ this.UC1__ = {"A":484,"K":93,"M":645,"O":-505};
+ this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
+ this.UC3__ = {"A":-1370,"I":2311};
+ this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
+ this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
+ this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
+ this.UP1__ = {"O":-214};
+ this.UP2__ = {"B":69,"O":935};
+ this.UP3__ = {"B":189};
+ this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
+ this.UQ2__ = {"BH":216,"BI":113,"OK":1759};
+ this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212};
+ this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135};
+ this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978, [...]
+ this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":277 [...]
+ this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":14 [...]
+ this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区 [...]
+ this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496};
+
+ return this;
+ }
+ TinySegmenter.prototype.ctype_ = function(str) {
+ for (var i in this.chartype_) {
+ if (str.match(this.chartype_[i][0])) {
+ return this.chartype_[i][1];
+ }
+ }
+ return "O";
+ }
+
+ TinySegmenter.prototype.ts_ = function(v) {
+ if (v) { return v; }
+ return 0;
+ }
+
+ TinySegmenter.prototype.segment = function(input) {
+ if (input == null || input == undefined || input == "") {
+ return [];
+ }
+ var result = [];
+ var seg = ["B3","B2","B1"];
+ var ctype = ["O","O","O"];
+ var o = input.split("");
+ for (i = 0; i < o.length; ++i) {
+ seg.push(o[i]);
+ ctype.push(this.ctype_(o[i]))
+ }
+ seg.push("E1");
+ seg.push("E2");
+ seg.push("E3");
+ ctype.push("O");
+ ctype.push("O");
+ ctype.push("O");
+ var word = seg[3];
+ var p1 = "U";
+ var p2 = "U";
+ var p3 = "U";
+ for (var i = 4; i < seg.length - 3; ++i) {
+ var score = this.BIAS__;
+ var w1 = seg[i-3];
+ var w2 = seg[i-2];
+ var w3 = seg[i-1];
+ var w4 = seg[i];
+ var w5 = seg[i+1];
+ var w6 = seg[i+2];
+ var c1 = ctype[i-3];
+ var c2 = ctype[i-2];
+ var c3 = ctype[i-1];
+ var c4 = ctype[i];
+ var c5 = ctype[i+1];
+ var c6 = ctype[i+2];
+ score += this.ts_(this.UP1__[p1]);
+ score += this.ts_(this.UP2__[p2]);
+ score += this.ts_(this.UP3__[p3]);
+ score += this.ts_(this.BP1__[p1 + p2]);
+ score += this.ts_(this.BP2__[p2 + p3]);
+ score += this.ts_(this.UW1__[w1]);
+ score += this.ts_(this.UW2__[w2]);
+ score += this.ts_(this.UW3__[w3]);
+ score += this.ts_(this.UW4__[w4]);
+ score += this.ts_(this.UW5__[w5]);
+ score += this.ts_(this.UW6__[w6]);
+ score += this.ts_(this.BW1__[w2 + w3]);
+ score += this.ts_(this.BW2__[w3 + w4]);
+ score += this.ts_(this.BW3__[w4 + w5]);
+ score += this.ts_(this.TW1__[w1 + w2 + w3]);
+ score += this.ts_(this.TW2__[w2 + w3 + w4]);
+ score += this.ts_(this.TW3__[w3 + w4 + w5]);
+ score += this.ts_(this.TW4__[w4 + w5 + w6]);
+ score += this.ts_(this.UC1__[c1]);
+ score += this.ts_(this.UC2__[c2]);
+ score += this.ts_(this.UC3__[c3]);
+ score += this.ts_(this.UC4__[c4]);
+ score += this.ts_(this.UC5__[c5]);
+ score += this.ts_(this.UC6__[c6]);
+ score += this.ts_(this.BC1__[c2 + c3]);
+ score += this.ts_(this.BC2__[c3 + c4]);
+ score += this.ts_(this.BC3__[c4 + c5]);
+ score += this.ts_(this.TC1__[c1 + c2 + c3]);
+ score += this.ts_(this.TC2__[c2 + c3 + c4]);
+ score += this.ts_(this.TC3__[c3 + c4 + c5]);
+ score += this.ts_(this.TC4__[c4 + c5 + c6]);
+ // score += this.ts_(this.TC5__[c4 + c5 + c6]);
+ score += this.ts_(this.UQ1__[p1 + c1]);
+ score += this.ts_(this.UQ2__[p2 + c2]);
+ score += this.ts_(this.UQ3__[p3 + c3]);
+ score += this.ts_(this.BQ1__[p2 + c2 + c3]);
+ score += this.ts_(this.BQ2__[p2 + c3 + c4]);
+ score += this.ts_(this.BQ3__[p3 + c2 + c3]);
+ score += this.ts_(this.BQ4__[p3 + c3 + c4]);
+ score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]);
+ score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]);
+ score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]);
+ score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]);
+ var p = "O";
+ if (score > 0) {
+ result.push(word);
+ word = "";
+ p = "B";
+ }
+ p1 = p2;
+ p2 = p3;
+ p3 = p;
+ word += seg[i];
+ }
+ result.push(word);
+
+ return result;
+ }
+
+ lunr.TinySegmenter = TinySegmenter;
+ };
+
+}));
\ No newline at end of file
diff --git a/assets/javascripts/lunr/wordcut.js b/assets/javascripts/lunr/wordcut.js
new file mode 100644
index 0000000..0d898c9
--- /dev/null
+++ b/assets/javascripts/lunr/wordcut.js
@@ -0,0 +1,6708 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.lunr || (g.lunr = {})).wordcut = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(! [...]
+var _ = require("underscore");
+
+var Acceptors = {
+ creators: null,
+ current: null,
+ tag: null,
+
+ init: function() {
+ this.creators = [];
+ this.current = [];
+ this.tag = {};
+ },
+
+ reset: function() {
+ this.current = [];
+ this.tag = {}
+ },
+
+ transit: function(ch) {
+ var self = this;
+
+ self.creators.forEach(function(creator) {
+ var acceptor = creator.createAcceptor(self.tag);
+ if (acceptor)
+ self.current.push(acceptor);
+ });
+
+ var _current = [];
+ self.tag = {};
+
+ for (var i = 0; i < self.current.length; i++) {
+ var _acceptor = self.current[i]
+ , acceptor = _acceptor.transit(ch);
+
+ if (!acceptor.isError) {
+ _current.push(acceptor);
+ self.tag[acceptor.tag] = acceptor;
+ }
+ }
+ self.current = _current;
+
+ },
+
+ getFinalAcceptors: function() {
+ return this.current.filter(function(acceptor) {
+ return acceptor.isFinal;
+ });
+ }
+};
+
+module.exports = function() {
+ var acceptors = _.clone(Acceptors);
+ acceptors.init();
+ return acceptors;
+};
+
+},{"underscore":25}],2:[function(require,module,exports){
+(function (__dirname){
+
+var LEFT = 0;
+var RIGHT = 1;
+var path = require("path");
+var glob = require("glob");
+
+var WordcutDict = {
+
+
+ init: function (dictPathFile, withDefault, words) {
+ withDefault = withDefault || false
+ var defaultDict = path.normalize(__dirname + "/..") + "/data/tdict-*.txt";
+ this.dict=[]
+ var dictPathIsDefined = dictPathFile !== undefined
+ var dictPath = (withDefault || !dictPathIsDefined) ? [defaultDict]: [];
+ var dictPathFile = dictPathFile || defaultDict
+
+ if(dictPathIsDefined){
+ if (Array.isArray(dictPathFile)) {
+ dictPath.concat.apply(dictPath, dictPathFile);
+ } else {
+ dictPath.push(dictPathFile)
+ }
+ }
+
+ this.addFiles(dictPath, false)
+
+ if(words!==undefined){
+ this.addWords(words, false)
+ }
+ this.finalizeDict();
+ },
+
+ addWords: function(words, finalize){
+ finalize = finalize===undefined || finalize;
+ this.dict.push.apply(this.dict, words)
+ if(finalize){
+ this.finalizeDict();
+ }
+ },
+
+ finalizeDict: function(){
+ this.dict = this.sortuniq(this.dict);
+ },
+
+ addFiles: function(files, finalize){
+ finalize = finalize===undefined || finalize;
+
+ for (var i = 0; i < 1; i++) {
+ var words = "ก.ก.\nก.ก.น.\nก.ข.ค.\nก.ค.\nก.จ.\nก.ช.น.\nก.ฌ.\nก.ต.\nก.ต.ง.\nก.ต.ช.\nก.ตร.\nก.ท.\nก.น.ช.\nก.บช.\nก.บถ.\nก.ป.ส.\nก.พ.\nก.ม.\nก.ย.\nก.ร.\nก.ล.ต.\nก.ว.\nก.ศ.ว.\nก.ส.ท.\nก.ส.ธ.\nก.ส.อ.\nก.อ.\nกก.ตชด.\nกก.ตร.น.\nกก.ภ.จว.\nกก.รสช.\nกกบ.ขส.ทบ.\nกกล.รพน.\nกง.กห.\nกง.ทบ.\nกง.ทร.\nกซข.ป.\nกซม.ป.\nกทม.กรุงเทพมหานคร\nกบ.ทบ.\nกป.สป.\nกพ.ทบ.\nกพ.ทร.\nกพ.ทหาร\nกร.ทบ.\nกรป.กลาง\nกรอ.พอ.\nกศ.ด.\nกศ.บ.\nกศ.บป.\nกศ.ม.\nกษ.ด.\nกษ.บ.\nกษ.ม.\nกส.ด.\nกส.ทบ.\nกส.บ.\nกส.ม.\nกอ.ปค.\nกอ.รพน.\nก [...]
+ .split(/[\r\n]+/)
+ .filter(function (w) {
+ return w.length > 1;
+ })
+ this.addWords(words, false)
+ }
+ if(finalize){
+ this.finalizeDict();
+ }
+ },
+
+ dictSeek: function (l, r, ch, strOffset, pos) {
+ var ans = null;
+ while (l <= r) {
+ var m = Math.floor((l + r) / 2),
+ dict_item = this.dict[m],
+ len = dict_item.length;
+ if (len <= strOffset) {
+ l = m + 1;
+ } else {
+ var ch_ = dict_item[strOffset];
+ if (ch_ < ch) {
+ l = m + 1;
+ } else if (ch_ > ch) {
+ r = m - 1;
+ } else {
+ ans = m;
+ if (pos == LEFT) {
+ r = m - 1;
+ } else {
+ l = m + 1;
+ }
+ }
+ }
+ }
+ return ans;
+ },
+
+ isFinal: function (acceptor) {
+ return this.dict[acceptor.l].length == acceptor.strOffset;
+ },
+
+ createAcceptor: function () {
+ return {
+ l: 0,
+ r: this.dict.length - 1,
+ strOffset: 0,
+ isFinal: false,
+ dict: this,
+ transit: function (ch) {
+ return this.dict.transit(this, ch);
+ },
+ isError: false,
+ tag: "DICT",
+ w: 1,
+ type: "DICT"
+ };
+ },
+
+ transit: function (acceptor, ch) {
+ var l = this.dictSeek(acceptor.l,
+ acceptor.r,
+ ch,
+ acceptor.strOffset,
+ LEFT);
+ if (l !== null) {
+ var r = this.dictSeek(l,
+ acceptor.r,
+ ch,
+ acceptor.strOffset,
+ RIGHT);
+ acceptor.l = l;
+ acceptor.r = r;
+ acceptor.strOffset++;
+ acceptor.isFinal = this.isFinal(acceptor);
+ } else {
+ acceptor.isError = true;
+ }
+ return acceptor;
+ },
+
+ sortuniq: function(a){
+ return a.sort().filter(function(item, pos, arr){
+ return !pos || item != arr[pos - 1];
+ })
+ },
+
+ flatten: function(a){
+ //[[1,2],[3]] -> [1,2,3]
+ return [].concat.apply([], a);
+ }
+};
+module.exports = WordcutDict;
+
+}).call(this,"/dist/tmp")
+},{"glob":16,"path":22}],3:[function(require,module,exports){
+var WordRule = {
+ createAcceptor: function(tag) {
+ if (tag["WORD_RULE"])
+ return null;
+
+ return {strOffset: 0,
+ isFinal: false,
+ transit: function(ch) {
+ var lch = ch.toLowerCase();
+ if (lch >= "a" && lch <= "z") {
+ this.isFinal = true;
+ this.strOffset++;
+ } else {
+ this.isError = true;
+ }
+ return this;
+ },
+ isError: false,
+ tag: "WORD_RULE",
+ type: "WORD_RULE",
+ w: 1};
+ }
+};
+
+var NumberRule = {
+ createAcceptor: function(tag) {
+ if (tag["NUMBER_RULE"])
+ return null;
+
+ return {strOffset: 0,
+ isFinal: false,
+ transit: function(ch) {
+ if (ch >= "0" && ch <= "9") {
+ this.isFinal = true;
+ this.strOffset++;
+ } else {
+ this.isError = true;
+ }
+ return this;
+ },
+ isError: false,
+ tag: "NUMBER_RULE",
+ type: "NUMBER_RULE",
+ w: 1};
+ }
+};
+
+var SpaceRule = {
+ tag: "SPACE_RULE",
+ createAcceptor: function(tag) {
+
+ if (tag["SPACE_RULE"])
+ return null;
+
+ return {strOffset: 0,
+ isFinal: false,
+ transit: function(ch) {
+ if (ch == " " || ch == "\t" || ch == "\r" || ch == "\n" ||
+ ch == "\u00A0" || ch=="\u2003"//nbsp and emsp
+ ) {
+ this.isFinal = true;
+ this.strOffset++;
+ } else {
+ this.isError = true;
+ }
+ return this;
+ },
+ isError: false,
+ tag: SpaceRule.tag,
+ w: 1,
+ type: "SPACE_RULE"};
+ }
+}
+
+var SingleSymbolRule = {
+ tag: "SINSYM",
+ createAcceptor: function(tag) {
+ return {strOffset: 0,
+ isFinal: false,
+ transit: function(ch) {
+ if (this.strOffset == 0 && ch.match(/^[\@\(\)\/\,\-\."`]$/)) {
+ this.isFinal = true;
+ this.strOffset++;
+ } else {
+ this.isError = true;
+ }
+ return this;
+ },
+ isError: false,
+ tag: "SINSYM",
+ w: 1,
+ type: "SINSYM"};
+ }
+}
+
+
+var LatinRules = [WordRule, SpaceRule, SingleSymbolRule, NumberRule];
+
+module.exports = LatinRules;
+
+},{}],4:[function(require,module,exports){
+var _ = require("underscore")
+ , WordcutCore = require("./wordcut_core");
+var PathInfoBuilder = {
+
+ /*
+ buildByPartAcceptors: function(path, acceptors, i) {
+ var
+ var genInfos = partAcceptors.reduce(function(genInfos, acceptor) {
+
+ }, []);
+
+ return genInfos;
+ }
+ */
+
+ buildByAcceptors: function(path, finalAcceptors, i) {
+ var self = this;
+ var infos = finalAcceptors.map(function(acceptor) {
+ var p = i - acceptor.strOffset + 1
+ , _info = path[p];
+
+ var info = {p: p,
+ mw: _info.mw + (acceptor.mw === undefined ? 0 : acceptor.mw),
+ w: acceptor.w + _info.w,
+ unk: (acceptor.unk ? acceptor.unk : 0) + _info.unk,
+ type: acceptor.type};
+
+ if (acceptor.type == "PART") {
+ for(var j = p + 1; j <= i; j++) {
+ path[j].merge = p;
+ }
+ info.merge = p;
+ }
+
+ return info;
+ });
+ return infos.filter(function(info) { return info; });
+ },
+
+ fallback: function(path, leftBoundary, text, i) {
+ var _info = path[leftBoundary];
+ if (text[i].match(/[\u0E48-\u0E4E]/)) {
+ if (leftBoundary != 0)
+ leftBoundary = path[leftBoundary].p;
+ return {p: leftBoundary,
+ mw: 0,
+ w: 1 + _info.w,
+ unk: 1 + _info.unk,
+ type: "UNK"};
+/* } else if(leftBoundary > 0 && path[leftBoundary].type !== "UNK") {
+ leftBoundary = path[leftBoundary].p;
+ return {p: leftBoundary,
+ w: 1 + _info.w,
+ unk: 1 + _info.unk,
+ type: "UNK"}; */
+ } else {
+ return {p: leftBoundary,
+ mw: _info.mw,
+ w: 1 + _info.w,
+ unk: 1 + _info.unk,
+ type: "UNK"};
+ }
+ },
+
+ build: function(path, finalAcceptors, i, leftBoundary, text) {
+ var basicPathInfos = this.buildByAcceptors(path, finalAcceptors, i);
+ if (basicPathInfos.length > 0) {
+ return basicPathInfos;
+ } else {
+ return [this.fallback(path, leftBoundary, text, i)];
+ }
+ }
+};
+
+module.exports = function() {
+ return _.clone(PathInfoBuilder);
+}
+
+},{"./wordcut_core":8,"underscore":25}],5:[function(require,module,exports){
+var _ = require("underscore");
+
+
+var PathSelector = {
+ selectPath: function(paths) {
+ var path = paths.reduce(function(selectedPath, path) {
+ if (selectedPath == null) {
+ return path;
+ } else {
+ if (path.unk < selectedPath.unk)
+ return path;
+ if (path.unk == selectedPath.unk) {
+ if (path.mw < selectedPath.mw)
+ return path
+ if (path.mw == selectedPath.mw) {
+ if (path.w < selectedPath.w)
+ return path;
+ }
+ }
+ return selectedPath;
+ }
+ }, null);
+ return path;
+ },
+
+ createPath: function() {
+ return [{p:null, w:0, unk:0, type: "INIT", mw:0}];
+ }
+};
+
+module.exports = function() {
+ return _.clone(PathSelector);
+};
+
+},{"underscore":25}],6:[function(require,module,exports){
+function isMatch(pat, offset, ch) {
+ if (pat.length <= offset)
+ return false;
+ var _ch = pat[offset];
+ return _ch == ch ||
+ (_ch.match(/[กข]/) && ch.match(/[ก-ฮ]/)) ||
+ (_ch.match(/[มบ]/) && ch.match(/[ก-ฮ]/)) ||
+ (_ch.match(/\u0E49/) && ch.match(/[\u0E48-\u0E4B]/));
+}
+
+var Rule0 = {
+ pat: "เหก็ม",
+ createAcceptor: function(tag) {
+ return {strOffset: 0,
+ isFinal: false,
+ transit: function(ch) {
+ if (isMatch(Rule0.pat, this.strOffset,ch)) {
+ this.isFinal = (this.strOffset + 1 == Rule0.pat.length);
+ this.strOffset++;
+ } else {
+ this.isError = true;
+ }
+ return this;
+ },
+ isError: false,
+ tag: "THAI_RULE",
+ type: "THAI_RULE",
+ w: 1};
+ }
+};
+
+var PartRule = {
+ createAcceptor: function(tag) {
+ return {strOffset: 0,
+ patterns: [
+ "แก", "เก", "ก้", "กก์", "กา", "กี", "กิ", "กืก"
+ ],
+ isFinal: false,
+ transit: function(ch) {
+ var offset = this.strOffset;
+ this.patterns = this.patterns.filter(function(pat) {
+ return isMatch(pat, offset, ch);
+ });
+
+ if (this.patterns.length > 0) {
+ var len = 1 + offset;
+ this.isFinal = this.patterns.some(function(pat) {
+ return pat.length == len;
+ });
+ this.strOffset++;
+ } else {
+ this.isError = true;
+ }
+ return this;
+ },
+ isError: false,
+ tag: "PART",
+ type: "PART",
+ unk: 1,
+ w: 1};
+ }
+};
+
+var ThaiRules = [Rule0, PartRule];
+
+module.exports = ThaiRules;
+
+},{}],7:[function(require,module,exports){
+var sys = require("sys")
+ , WordcutDict = require("./dict")
+ , WordcutCore = require("./wordcut_core")
+ , PathInfoBuilder = require("./path_info_builder")
+ , PathSelector = require("./path_selector")
+ , Acceptors = require("./acceptors")
+ , latinRules = require("./latin_rules")
+ , thaiRules = require("./thai_rules")
+ , _ = require("underscore");
+
+
+var Wordcut = Object.create(WordcutCore);
+Wordcut.defaultPathInfoBuilder = PathInfoBuilder;
+Wordcut.defaultPathSelector = PathSelector;
+Wordcut.defaultAcceptors = Acceptors;
+Wordcut.defaultLatinRules = latinRules;
+Wordcut.defaultThaiRules = thaiRules;
+Wordcut.defaultDict = WordcutDict;
+
+
+Wordcut.initNoDict = function(dict_path) {
+ var self = this;
+ self.pathInfoBuilder = new self.defaultPathInfoBuilder;
+ self.pathSelector = new self.defaultPathSelector;
+ self.acceptors = new self.defaultAcceptors;
+ self.defaultLatinRules.forEach(function(rule) {
+ self.acceptors.creators.push(rule);
+ });
+ self.defaultThaiRules.forEach(function(rule) {
+ self.acceptors.creators.push(rule);
+ });
+};
+
+Wordcut.init = function(dict_path, withDefault, additionalWords) {
+ withDefault = withDefault || false;
+ this.initNoDict();
+ var dict = _.clone(this.defaultDict);
+ dict.init(dict_path, withDefault, additionalWords);
+ this.acceptors.creators.push(dict);
+};
+
+module.exports = Wordcut;
+
+},{"./acceptors":1,"./dict":2,"./latin_rules":3,"./path_info_builder":4,"./path_selector":5,"./thai_rules":6,"./wordcut_core":8,"sys":28,"underscore":25}],8:[function(require,module,exports){
+var WordcutCore = {
+
+ buildPath: function(text) {
+ var self = this
+ , path = self.pathSelector.createPath()
+ , leftBoundary = 0;
+ self.acceptors.reset();
+ for (var i = 0; i < text.length; i++) {
+ var ch = text[i];
+ self.acceptors.transit(ch);
+
+ var possiblePathInfos = self
+ .pathInfoBuilder
+ .build(path,
+ self.acceptors.getFinalAcceptors(),
+ i,
+ leftBoundary,
+ text);
+ var selectedPath = self.pathSelector.selectPath(possiblePathInfos)
+
+ path.push(selectedPath);
+ if (selectedPath.type !== "UNK") {
+ leftBoundary = i;
+ }
+ }
+ return path;
+ },
+
+ pathToRanges: function(path) {
+ var e = path.length - 1
+ , ranges = [];
+
+ while (e > 0) {
+ var info = path[e]
+ , s = info.p;
+
+ if (info.merge !== undefined && ranges.length > 0) {
+ var r = ranges[ranges.length - 1];
+ r.s = info.merge;
+ s = r.s;
+ } else {
+ ranges.push({s:s, e:e});
+ }
+ e = s;
+ }
+ return ranges.reverse();
+ },
+
+ rangesToText: function(text, ranges, delimiter) {
+ return ranges.map(function(r) {
+ return text.substring(r.s, r.e);
+ }).join(delimiter);
+ },
+
+ cut: function(text, delimiter) {
+ var path = this.buildPath(text)
+ , ranges = this.pathToRanges(path);
+ return this
+ .rangesToText(text, ranges,
+ (delimiter === undefined ? "|" : delimiter));
+ },
+
+ cutIntoRanges: function(text, noText) {
+ var path = this.buildPath(text)
+ , ranges = this.pathToRanges(path);
+
+ if (!noText) {
+ ranges.forEach(function(r) {
+ r.text = text.substring(r.s, r.e);
+ });
+ }
+ return ranges;
+ },
+
+ cutIntoArray: function(text) {
+ var path = this.buildPath(text)
+ , ranges = this.pathToRanges(path);
+
+ return ranges.map(function(r) {
+ return text.substring(r.s, r.e)
+ });
+ }
+};
+
+module.exports = WordcutCore;
+
+},{}],9:[function(require,module,exports){
+// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
+//
+// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
+//
+// Originally from narwhal.js (http://narwhaljs.org)
+// Copyright (c) 2009 Thomas Robinson <280north.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the 'Software'), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// when used in node, this will actually load the util module we depend on
+// versus loading the builtin util module as happens otherwise
+// this is a bug in node module loading as far as I am concerned
+var util = require('util/');
+
+var pSlice = Array.prototype.slice;
+var hasOwn = Object.prototype.hasOwnProperty;
+
+// 1. The assert module provides functions that throw
+// AssertionError's when particular conditions are not met. The
+// assert module must conform to the following interface.
+
+var assert = module.exports = ok;
+
+// 2. The AssertionError is defined in assert.
+// new assert.AssertionError({ message: message,
+// actual: actual,
+// expected: expected })
+
+assert.AssertionError = function AssertionError(options) {
+ this.name = 'AssertionError';
+ this.actual = options.actual;
+ this.expected = options.expected;
+ this.operator = options.operator;
+ if (options.message) {
+ this.message = options.message;
+ this.generatedMessage = false;
+ } else {
+ this.message = getMessage(this);
+ this.generatedMessage = true;
+ }
+ var stackStartFunction = options.stackStartFunction || fail;
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, stackStartFunction);
+ }
+ else {
+ // non v8 browsers so we can have a stacktrace
+ var err = new Error();
+ if (err.stack) {
+ var out = err.stack;
+
+ // try to strip useless frames
+ var fn_name = stackStartFunction.name;
+ var idx = out.indexOf('\n' + fn_name);
+ if (idx >= 0) {
+ // once we have located the function frame
+ // we need to strip out everything before it (and its line)
+ var next_line = out.indexOf('\n', idx + 1);
+ out = out.substring(next_line + 1);
+ }
+
+ this.stack = out;
+ }
+ }
+};
+
+// assert.AssertionError instanceof Error
+util.inherits(assert.AssertionError, Error);
+
+function replacer(key, value) {
+ if (util.isUndefined(value)) {
+ return '' + value;
+ }
+ if (util.isNumber(value) && !isFinite(value)) {
+ return value.toString();
+ }
+ if (util.isFunction(value) || util.isRegExp(value)) {
+ return value.toString();
+ }
+ return value;
+}
+
+function truncate(s, n) {
+ if (util.isString(s)) {
+ return s.length < n ? s : s.slice(0, n);
+ } else {
+ return s;
+ }
+}
+
+function getMessage(self) {
+ return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
+ self.operator + ' ' +
+ truncate(JSON.stringify(self.expected, replacer), 128);
+}
+
+// At present only the three keys mentioned above are used and
+// understood by the spec. Implementations or sub modules can pass
+// other keys to the AssertionError's constructor - they will be
+// ignored.
+
+// 3. All of the following functions must throw an AssertionError
+// when a corresponding condition is not met, with a message that
+// may be undefined if not provided. All assertion methods provide
+// both the actual and expected values to the assertion error for
+// display purposes.
+
+function fail(actual, expected, message, operator, stackStartFunction) {
+ throw new assert.AssertionError({
+ message: message,
+ actual: actual,
+ expected: expected,
+ operator: operator,
+ stackStartFunction: stackStartFunction
+ });
+}
+
+// EXTENSION! allows for well behaved errors defined elsewhere.
+assert.fail = fail;
+
+// 4. Pure assertion tests whether a value is truthy, as determined
+// by !!guard.
+// assert.ok(guard, message_opt);
+// This statement is equivalent to assert.equal(true, !!guard,
+// message_opt);. To test strictly for the value true, use
+// assert.strictEqual(true, guard, message_opt);.
+
+function ok(value, message) {
+ if (!value) fail(value, true, message, '==', assert.ok);
+}
+assert.ok = ok;
+
+// 5. The equality assertion tests shallow, coercive equality with
+// ==.
+// assert.equal(actual, expected, message_opt);
+
+assert.equal = function equal(actual, expected, message) {
+ if (actual != expected) fail(actual, expected, message, '==', assert.equal);
+};
+
+// 6. The non-equality assertion tests for whether two objects are not equal
+// with != assert.notEqual(actual, expected, message_opt);
+
+assert.notEqual = function notEqual(actual, expected, message) {
+ if (actual == expected) {
+ fail(actual, expected, message, '!=', assert.notEqual);
+ }
+};
+
+// 7. The equivalence assertion tests a deep equality relation.
+// assert.deepEqual(actual, expected, message_opt);
+
+assert.deepEqual = function deepEqual(actual, expected, message) {
+ if (!_deepEqual(actual, expected)) {
+ fail(actual, expected, message, 'deepEqual', assert.deepEqual);
+ }
+};
+
+function _deepEqual(actual, expected) {
+ // 7.1. All identical values are equivalent, as determined by ===.
+ if (actual === expected) {
+ return true;
+
+ } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
+ if (actual.length != expected.length) return false;
+
+ for (var i = 0; i < actual.length; i++) {
+ if (actual[i] !== expected[i]) return false;
+ }
+
+ return true;
+
+ // 7.2. If the expected value is a Date object, the actual value is
+ // equivalent if it is also a Date object that refers to the same time.
+ } else if (util.isDate(actual) && util.isDate(expected)) {
+ return actual.getTime() === expected.getTime();
+
+ // 7.3 If the expected value is a RegExp object, the actual value is
+ // equivalent if it is also a RegExp object with the same source and
+ // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
+ } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
+ return actual.source === expected.source &&
+ actual.global === expected.global &&
+ actual.multiline === expected.multiline &&
+ actual.lastIndex === expected.lastIndex &&
+ actual.ignoreCase === expected.ignoreCase;
+
+ // 7.4. Other pairs that do not both pass typeof value == 'object',
+ // equivalence is determined by ==.
+ } else if (!util.isObject(actual) && !util.isObject(expected)) {
+ return actual == expected;
+
+ // 7.5 For all other Object pairs, including Array objects, equivalence is
+ // determined by having the same number of owned properties (as verified
+ // with Object.prototype.hasOwnProperty.call), the same set of keys
+ // (although not necessarily the same order), equivalent values for every
+ // corresponding key, and an identical 'prototype' property. Note: this
+ // accounts for both named and indexed properties on Arrays.
+ } else {
+ return objEquiv(actual, expected);
+ }
+}
+
+function isArguments(object) {
+ return Object.prototype.toString.call(object) == '[object Arguments]';
+}
+
+function objEquiv(a, b) {
+ if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
+ return false;
+ // an identical 'prototype' property.
+ if (a.prototype !== b.prototype) return false;
+ // if one is a primitive, the other must be same
+ if (util.isPrimitive(a) || util.isPrimitive(b)) {
+ return a === b;
+ }
+ var aIsArgs = isArguments(a),
+ bIsArgs = isArguments(b);
+ if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
+ return false;
+ if (aIsArgs) {
+ a = pSlice.call(a);
+ b = pSlice.call(b);
+ return _deepEqual(a, b);
+ }
+ var ka = objectKeys(a),
+ kb = objectKeys(b),
+ key, i;
+ // having the same number of owned properties (keys incorporates
+ // hasOwnProperty)
+ if (ka.length != kb.length)
+ return false;
+ //the same set of keys (although not necessarily the same order),
+ ka.sort();
+ kb.sort();
+ //~~~cheap key test
+ for (i = ka.length - 1; i >= 0; i--) {
+ if (ka[i] != kb[i])
+ return false;
+ }
+ //equivalent values for every corresponding key, and
+ //~~~possibly expensive deep test
+ for (i = ka.length - 1; i >= 0; i--) {
+ key = ka[i];
+ if (!_deepEqual(a[key], b[key])) return false;
+ }
+ return true;
+}
+
+// 8. The non-equivalence assertion tests for any deep inequality.
+// assert.notDeepEqual(actual, expected, message_opt);
+
+assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
+ if (_deepEqual(actual, expected)) {
+ fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
+ }
+};
+
+// 9. The strict equality assertion tests strict equality, as determined by ===.
+// assert.strictEqual(actual, expected, message_opt);
+
+assert.strictEqual = function strictEqual(actual, expected, message) {
+ if (actual !== expected) {
+ fail(actual, expected, message, '===', assert.strictEqual);
+ }
+};
+
+// 10. The strict non-equality assertion tests for strict inequality, as
+// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
+
+assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
+ if (actual === expected) {
+ fail(actual, expected, message, '!==', assert.notStrictEqual);
+ }
+};
+
+function expectedException(actual, expected) {
+ if (!actual || !expected) {
+ return false;
+ }
+
+ if (Object.prototype.toString.call(expected) == '[object RegExp]') {
+ return expected.test(actual);
+ } else if (actual instanceof expected) {
+ return true;
+ } else if (expected.call({}, actual) === true) {
+ return true;
+ }
+
+ return false;
+}
+
+function _throws(shouldThrow, block, expected, message) {
+ var actual;
+
+ if (util.isString(expected)) {
+ message = expected;
+ expected = null;
+ }
+
+ try {
+ block();
+ } catch (e) {
+ actual = e;
+ }
+
+ message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
+ (message ? ' ' + message : '.');
+
+ if (shouldThrow && !actual) {
+ fail(actual, expected, 'Missing expected exception' + message);
+ }
+
+ if (!shouldThrow && expectedException(actual, expected)) {
+ fail(actual, expected, 'Got unwanted exception' + message);
+ }
+
+ if ((shouldThrow && actual && expected &&
+ !expectedException(actual, expected)) || (!shouldThrow && actual)) {
+ throw actual;
+ }
+}
+
+// 11. Expected to throw an error:
+// assert.throws(block, Error_opt, message_opt);
+
+assert.throws = function(block, /*optional*/error, /*optional*/message) {
+ _throws.apply(this, [true].concat(pSlice.call(arguments)));
+};
+
+// EXTENSION! This is annoying to write outside this module.
+assert.doesNotThrow = function(block, /*optional*/message) {
+ _throws.apply(this, [false].concat(pSlice.call(arguments)));
+};
+
+assert.ifError = function(err) { if (err) {throw err;}};
+
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) {
+ if (hasOwn.call(obj, key)) keys.push(key);
+ }
+ return keys;
+};
+
+},{"util/":28}],10:[function(require,module,exports){
+'use strict';
+module.exports = balanced;
+function balanced(a, b, str) {
+ if (a instanceof RegExp) a = maybeMatch(a, str);
+ if (b instanceof RegExp) b = maybeMatch(b, str);
+
+ var r = range(a, b, str);
+
+ return r && {
+ start: r[0],
+ end: r[1],
+ pre: str.slice(0, r[0]),
+ body: str.slice(r[0] + a.length, r[1]),
+ post: str.slice(r[1] + b.length)
+ };
+}
+
+function maybeMatch(reg, str) {
+ var m = str.match(reg);
+ return m ? m[0] : null;
+}
+
+balanced.range = range;
+function range(a, b, str) {
+ var begs, beg, left, right, result;
+ var ai = str.indexOf(a);
+ var bi = str.indexOf(b, ai + 1);
+ var i = ai;
+
+ if (ai >= 0 && bi > 0) {
+ begs = [];
+ left = str.length;
+
+ while (i >= 0 && !result) {
+ if (i == ai) {
+ begs.push(i);
+ ai = str.indexOf(a, i + 1);
+ } else if (begs.length == 1) {
+ result = [ begs.pop(), bi ];
+ } else {
+ beg = begs.pop();
+ if (beg < left) {
+ left = beg;
+ right = bi;
+ }
+
+ bi = str.indexOf(b, i + 1);
+ }
+
+ i = ai < bi && ai >= 0 ? ai : bi;
+ }
+
+ if (begs.length) {
+ result = [ left, right ];
+ }
+ }
+
+ return result;
+}
+
+},{}],11:[function(require,module,exports){
+var concatMap = require('concat-map');
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+ return parseInt(str, 10) == str
+ ? parseInt(str, 10)
+ : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+ return str.split('\\\\').join(escSlash)
+ .split('\\{').join(escOpen)
+ .split('\\}').join(escClose)
+ .split('\\,').join(escComma)
+ .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+ return str.split(escSlash).join('\\')
+ .split(escOpen).join('{')
+ .split(escClose).join('}')
+ .split(escComma).join(',')
+ .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+ if (!str)
+ return [''];
+
+ var parts = [];
+ var m = balanced('{', '}', str);
+
+ if (!m)
+ return str.split(',');
+
+ var pre = m.pre;
+ var body = m.body;
+ var post = m.post;
+ var p = pre.split(',');
+
+ p[p.length-1] += '{' + body + '}';
+ var postParts = parseCommaParts(post);
+ if (post.length) {
+ p[p.length-1] += postParts.shift();
+ p.push.apply(p, postParts);
+ }
+
+ parts.push.apply(parts, p);
+
+ return parts;
+}
+
+function expandTop(str) {
+ if (!str)
+ return [];
+
+ // I don't know why Bash 4.3 does this, but it does.
+ // Anything starting with {} will have the first two bytes preserved
+ // but *only* at the top level, so {},a}b will not expand to anything,
+ // but a{},b}c will be expanded to [a}c,abc].
+ // One could argue that this is a bug in Bash, but since the goal of
+ // this module is to match Bash's rules, we escape a leading {}
+ if (str.substr(0, 2) === '{}') {
+ str = '\\{\\}' + str.substr(2);
+ }
+
+ return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function identity(e) {
+ return e;
+}
+
+function embrace(str) {
+ return '{' + str + '}';
+}
+function isPadded(el) {
+ return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+ return i <= y;
+}
+function gte(i, y) {
+ return i >= y;
+}
+
+function expand(str, isTop) {
+ var expansions = [];
+
+ var m = balanced('{', '}', str);
+ if (!m || /\$$/.test(m.pre)) return [str];
+
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+ var isSequence = isNumericSequence || isAlphaSequence;
+ var isOptions = m.body.indexOf(',') >= 0;
+ if (!isSequence && !isOptions) {
+ // {a},b}
+ if (m.post.match(/,.*\}/)) {
+ str = m.pre + '{' + m.body + escClose + m.post;
+ return expand(str);
+ }
+ return [str];
+ }
+
+ var n;
+ if (isSequence) {
+ n = m.body.split(/\.\./);
+ } else {
+ n = parseCommaParts(m.body);
+ if (n.length === 1) {
+ // x{{a,b}}y ==> x{a}y x{b}y
+ n = expand(n[0], false).map(embrace);
+ if (n.length === 1) {
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+ return post.map(function(p) {
+ return m.pre + n[0] + p;
+ });
+ }
+ }
+ }
+
+ // at this point, n is the parts, and we know it's not a comma set
+ // with a single entry.
+
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
+ var pre = m.pre;
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+
+ var N;
+
+ if (isSequence) {
+ var x = numeric(n[0]);
+ var y = numeric(n[1]);
+ var width = Math.max(n[0].length, n[1].length)
+ var incr = n.length == 3
+ ? Math.abs(numeric(n[2]))
+ : 1;
+ var test = lte;
+ var reverse = y < x;
+ if (reverse) {
+ incr *= -1;
+ test = gte;
+ }
+ var pad = n.some(isPadded);
+
+ N = [];
+
+ for (var i = x; test(i, y); i += incr) {
+ var c;
+ if (isAlphaSequence) {
+ c = String.fromCharCode(i);
+ if (c === '\\')
+ c = '';
+ } else {
+ c = String(i);
+ if (pad) {
+ var need = width - c.length;
+ if (need > 0) {
+ var z = new Array(need + 1).join('0');
+ if (i < 0)
+ c = '-' + z + c.slice(1);
+ else
+ c = z + c;
+ }
+ }
+ }
+ N.push(c);
+ }
+ } else {
+ N = concatMap(n, function(el) { return expand(el, false) });
+ }
+
+ for (var j = 0; j < N.length; j++) {
+ for (var k = 0; k < post.length; k++) {
+ var expansion = pre + N[j] + post[k];
+ if (!isTop || isSequence || expansion)
+ expansions.push(expansion);
+ }
+ }
+
+ return expansions;
+}
+
+
+},{"balanced-match":10,"concat-map":13}],12:[function(require,module,exports){
+
+},{}],13:[function(require,module,exports){
+module.exports = function (xs, fn) {
+ var res = [];
+ for (var i = 0; i < xs.length; i++) {
+ var x = fn(xs[i], i);
+ if (isArray(x)) res.push.apply(res, x);
+ else res.push(x);
+ }
+ return res;
+};
+
+var isArray = Array.isArray || function (xs) {
+ return Object.prototype.toString.call(xs) === '[object Array]';
+};
+
+},{}],14:[function(require,module,exports){
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+function EventEmitter() {
+ this._events = this._events || {};
+ this._maxListeners = this._maxListeners || undefined;
+}
+module.exports = EventEmitter;
+
+// Backwards-compat with node 0.10.x
+EventEmitter.EventEmitter = EventEmitter;
+
+EventEmitter.prototype._events = undefined;
+EventEmitter.prototype._maxListeners = undefined;
+
+// By default EventEmitters will print a warning if more than 10 listeners are
+// added to it. This is a useful default which helps finding memory leaks.
+EventEmitter.defaultMaxListeners = 10;
+
+// Obviously not all Emitters should be limited to 10. This function allows
+// that to be increased. Set to zero for unlimited.
+EventEmitter.prototype.setMaxListeners = function(n) {
+ if (!isNumber(n) || n < 0 || isNaN(n))
+ throw TypeError('n must be a positive number');
+ this._maxListeners = n;
+ return this;
+};
+
+EventEmitter.prototype.emit = function(type) {
+ var er, handler, len, args, i, listeners;
+
+ if (!this._events)
+ this._events = {};
+
+ // If there is no 'error' event listener then throw.
+ if (type === 'error') {
+ if (!this._events.error ||
+ (isObject(this._events.error) && !this._events.error.length)) {
+ er = arguments[1];
+ if (er instanceof Error) {
+ throw er; // Unhandled 'error' event
+ }
+ throw TypeError('Uncaught, unspecified "error" event.');
+ }
+ }
+
+ handler = this._events[type];
+
+ if (isUndefined(handler))
+ return false;
+
+ if (isFunction(handler)) {
+ switch (arguments.length) {
+ // fast cases
+ case 1:
+ handler.call(this);
+ break;
+ case 2:
+ handler.call(this, arguments[1]);
+ break;
+ case 3:
+ handler.call(this, arguments[1], arguments[2]);
+ break;
+ // slower
+ default:
+ len = arguments.length;
+ args = new Array(len - 1);
+ for (i = 1; i < len; i++)
+ args[i - 1] = arguments[i];
+ handler.apply(this, args);
+ }
+ } else if (isObject(handler)) {
+ len = arguments.length;
+ args = new Array(len - 1);
+ for (i = 1; i < len; i++)
+ args[i - 1] = arguments[i];
+
+ listeners = handler.slice();
+ len = listeners.length;
+ for (i = 0; i < len; i++)
+ listeners[i].apply(this, args);
+ }
+
+ return true;
+};
+
+EventEmitter.prototype.addListener = function(type, listener) {
+ var m;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events)
+ this._events = {};
+
+ // To avoid recursion in the case that type === "newListener"! Before
+ // adding it to the listeners, first emit "newListener".
+ if (this._events.newListener)
+ this.emit('newListener', type,
+ isFunction(listener.listener) ?
+ listener.listener : listener);
+
+ if (!this._events[type])
+ // Optimize the case of one listener. Don't need the extra array object.
+ this._events[type] = listener;
+ else if (isObject(this._events[type]))
+ // If we've already got an array, just append.
+ this._events[type].push(listener);
+ else
+ // Adding the second element, need to change to array.
+ this._events[type] = [this._events[type], listener];
+
+ // Check for listener leak
+ if (isObject(this._events[type]) && !this._events[type].warned) {
+ var m;
+ if (!isUndefined(this._maxListeners)) {
+ m = this._maxListeners;
+ } else {
+ m = EventEmitter.defaultMaxListeners;
+ }
+
+ if (m && m > 0 && this._events[type].length > m) {
+ this._events[type].warned = true;
+ console.error('(node) warning: possible EventEmitter memory ' +
+ 'leak detected. %d listeners added. ' +
+ 'Use emitter.setMaxListeners() to increase limit.',
+ this._events[type].length);
+ if (typeof console.trace === 'function') {
+ // not supported in IE 10
+ console.trace();
+ }
+ }
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+EventEmitter.prototype.once = function(type, listener) {
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ var fired = false;
+
+ function g() {
+ this.removeListener(type, g);
+
+ if (!fired) {
+ fired = true;
+ listener.apply(this, arguments);
+ }
+ }
+
+ g.listener = listener;
+ this.on(type, g);
+
+ return this;
+};
+
+// emits a 'removeListener' event iff the listener was removed
+EventEmitter.prototype.removeListener = function(type, listener) {
+ var list, position, length, i;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events || !this._events[type])
+ return this;
+
+ list = this._events[type];
+ length = list.length;
+ position = -1;
+
+ if (list === listener ||
+ (isFunction(list.listener) && list.listener === listener)) {
+ delete this._events[type];
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+
+ } else if (isObject(list)) {
+ for (i = length; i-- > 0;) {
+ if (list[i] === listener ||
+ (list[i].listener && list[i].listener === listener)) {
+ position = i;
+ break;
+ }
+ }
+
+ if (position < 0)
+ return this;
+
+ if (list.length === 1) {
+ list.length = 0;
+ delete this._events[type];
+ } else {
+ list.splice(position, 1);
+ }
+
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.removeAllListeners = function(type) {
+ var key, listeners;
+
+ if (!this._events)
+ return this;
+
+ // not listening for removeListener, no need to emit
+ if (!this._events.removeListener) {
+ if (arguments.length === 0)
+ this._events = {};
+ else if (this._events[type])
+ delete this._events[type];
+ return this;
+ }
+
+ // emit removeListener for all listeners on all events
+ if (arguments.length === 0) {
+ for (key in this._events) {
+ if (key === 'removeListener') continue;
+ this.removeAllListeners(key);
+ }
+ this.removeAllListeners('removeListener');
+ this._events = {};
+ return this;
+ }
+
+ listeners = this._events[type];
+
+ if (isFunction(listeners)) {
+ this.removeListener(type, listeners);
+ } else {
+ // LIFO order
+ while (listeners.length)
+ this.removeListener(type, listeners[listeners.length - 1]);
+ }
+ delete this._events[type];
+
+ return this;
+};
+
+EventEmitter.prototype.listeners = function(type) {
+ var ret;
+ if (!this._events || !this._events[type])
+ ret = [];
+ else if (isFunction(this._events[type]))
+ ret = [this._events[type]];
+ else
+ ret = this._events[type].slice();
+ return ret;
+};
+
+EventEmitter.listenerCount = function(emitter, type) {
+ var ret;
+ if (!emitter._events || !emitter._events[type])
+ ret = 0;
+ else if (isFunction(emitter._events[type]))
+ ret = 1;
+ else
+ ret = emitter._events[type].length;
+ return ret;
+};
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+
+},{}],15:[function(require,module,exports){
+(function (process){
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+ return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+ return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+ return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+ self.ignore = options.ignore || []
+
+ if (!Array.isArray(self.ignore))
+ self.ignore = [self.ignore]
+
+ if (self.ignore.length) {
+ self.ignore = self.ignore.map(ignoreMap)
+ }
+}
+
+function ignoreMap (pattern) {
+ var gmatcher = null
+ if (pattern.slice(-3) === '/**') {
+ var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+ gmatcher = new Minimatch(gpattern)
+ }
+
+ return {
+ matcher: new Minimatch(pattern),
+ gmatcher: gmatcher
+ }
+}
+
+function setopts (self, pattern, options) {
+ if (!options)
+ options = {}
+
+ // base-matching: just use globstar for that.
+ if (options.matchBase && -1 === pattern.indexOf("/")) {
+ if (options.noglobstar) {
+ throw new Error("base matching requires globstar")
+ }
+ pattern = "**/" + pattern
+ }
+
+ self.silent = !!options.silent
+ self.pattern = pattern
+ self.strict = options.strict !== false
+ self.realpath = !!options.realpath
+ self.realpathCache = options.realpathCache || Object.create(null)
+ self.follow = !!options.follow
+ self.dot = !!options.dot
+ self.mark = !!options.mark
+ self.nodir = !!options.nodir
+ if (self.nodir)
+ self.mark = true
+ self.sync = !!options.sync
+ self.nounique = !!options.nounique
+ self.nonull = !!options.nonull
+ self.nosort = !!options.nosort
+ self.nocase = !!options.nocase
+ self.stat = !!options.stat
+ self.noprocess = !!options.noprocess
+
+ self.maxLength = options.maxLength || Infinity
+ self.cache = options.cache || Object.create(null)
+ self.statCache = options.statCache || Object.create(null)
+ self.symlinks = options.symlinks || Object.create(null)
+
+ setupIgnores(self, options)
+
+ self.changedCwd = false
+ var cwd = process.cwd()
+ if (!ownProp(options, "cwd"))
+ self.cwd = cwd
+ else {
+ self.cwd = options.cwd
+ self.changedCwd = path.resolve(options.cwd) !== cwd
+ }
+
+ self.root = options.root || path.resolve(self.cwd, "/")
+ self.root = path.resolve(self.root)
+ if (process.platform === "win32")
+ self.root = self.root.replace(/\\/g, "/")
+
+ self.nomount = !!options.nomount
+
+ // disable comments and negation unless the user explicitly
+ // passes in false as the option.
+ options.nonegate = options.nonegate === false ? false : true
+ options.nocomment = options.nocomment === false ? false : true
+ deprecationWarning(options)
+
+ self.minimatch = new Minimatch(pattern, options)
+ self.options = self.minimatch.options
+}
+
+// TODO(isaacs): remove entirely in v6
+// exported to reset in tests
+exports.deprecationWarned
+function deprecationWarning(options) {
+ if (!options.nonegate || !options.nocomment) {
+ if (process.noDeprecation !== true && !exports.deprecationWarned) {
+ var msg = 'glob WARNING: comments and negation will be disabled in v6'
+ if (process.throwDeprecation)
+ throw new Error(msg)
+ else if (process.traceDeprecation)
+ console.trace(msg)
+ else
+ console.error(msg)
+
+ exports.deprecationWarned = true
+ }
+ }
+}
+
+function finish (self) {
+ var nou = self.nounique
+ var all = nou ? [] : Object.create(null)
+
+ for (var i = 0, l = self.matches.length; i < l; i ++) {
+ var matches = self.matches[i]
+ if (!matches || Object.keys(matches).length === 0) {
+ if (self.nonull) {
+ // do like the shell, and spit out the literal glob
+ var literal = self.minimatch.globSet[i]
+ if (nou)
+ all.push(literal)
+ else
+ all[literal] = true
+ }
+ } else {
+ // had matches
+ var m = Object.keys(matches)
+ if (nou)
+ all.push.apply(all, m)
+ else
+ m.forEach(function (m) {
+ all[m] = true
+ })
+ }
+ }
+
+ if (!nou)
+ all = Object.keys(all)
+
+ if (!self.nosort)
+ all = all.sort(self.nocase ? alphasorti : alphasort)
+
+ // at *some* point we statted all of these
+ if (self.mark) {
+ for (var i = 0; i < all.length; i++) {
+ all[i] = self._mark(all[i])
+ }
+ if (self.nodir) {
+ all = all.filter(function (e) {
+ return !(/\/$/.test(e))
+ })
+ }
+ }
+
+ if (self.ignore.length)
+ all = all.filter(function(m) {
+ return !isIgnored(self, m)
+ })
+
+ self.found = all
+}
+
+function mark (self, p) {
+ var abs = makeAbs(self, p)
+ var c = self.cache[abs]
+ var m = p
+ if (c) {
+ var isDir = c === 'DIR' || Array.isArray(c)
+ var slash = p.slice(-1) === '/'
+
+ if (isDir && !slash)
+ m += '/'
+ else if (!isDir && slash)
+ m = m.slice(0, -1)
+
+ if (m !== p) {
+ var mabs = makeAbs(self, m)
+ self.statCache[mabs] = self.statCache[abs]
+ self.cache[mabs] = self.cache[abs]
+ }
+ }
+
+ return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+ var abs = f
+ if (f.charAt(0) === '/') {
+ abs = path.join(self.root, f)
+ } else if (isAbsolute(f) || f === '') {
+ abs = f
+ } else if (self.changedCwd) {
+ abs = path.resolve(self.cwd, f)
+ } else {
+ abs = path.resolve(f)
+ }
+ return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+ if (!self.ignore.length)
+ return false
+
+ return self.ignore.some(function(item) {
+ return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+ })
+}
+
+function childrenIgnored (self, path) {
+ if (!self.ignore.length)
+ return false
+
+ return self.ignore.some(function(item) {
+ return !!(item.gmatcher && item.gmatcher.match(path))
+ })
+}
+
+}).call(this,require('_process'))
+},{"_process":24,"minimatch":20,"path":22,"path-is-absolute":23}],16:[function(require,module,exports){
+(function (process){
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together. This is PREFIX.
+// If there is no more remaining, then stat(PREFIX) and
+// add to matches if it succeeds. END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+// set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+// If fail, END
+//
+// with ENTRIES
+// If pattern[n] is GLOBSTAR
+// // handle the case where the globstar match is empty
+// // by pruning it out, and testing the resulting pattern
+// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+// // handle other cases.
+// for ENTRY in ENTRIES (not dotfiles)
+// // attach globstar + tail onto the entry
+// // Mark that this entry is a globstar match
+// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+// else // not globstar
+// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+// Test ENTRY against pattern[n]
+// If fails, continue
+// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+// Cache all stats and readdirs results to minimize syscall. Since all
+// we ever care about is existence and directory-ness, we can just keep
+// `true` for files, and [children,...] for directories, or `false` for
+// things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+ if (typeof options === 'function') cb = options, options = {}
+ if (!options) options = {}
+
+ if (options.sync) {
+ if (cb)
+ throw new TypeError('callback provided to sync glob')
+ return globSync(pattern, options)
+ }
+
+ return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+glob.hasMagic = function (pattern, options_) {
+ var options = util._extend({}, options_)
+ options.noprocess = true
+
+ var g = new Glob(pattern, options)
+ var set = g.minimatch.set
+ if (set.length > 1)
+ return true
+
+ for (var j = 0; j < set[0].length; j++) {
+ if (typeof set[0][j] !== 'string')
+ return true
+ }
+
+ return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+ if (typeof options === 'function') {
+ cb = options
+ options = null
+ }
+
+ if (options && options.sync) {
+ if (cb)
+ throw new TypeError('callback provided to sync glob')
+ return new GlobSync(pattern, options)
+ }
+
+ if (!(this instanceof Glob))
+ return new Glob(pattern, options, cb)
+
+ setopts(this, pattern, options)
+ this._didRealPath = false
+
+ // process each pattern in the minimatch set
+ var n = this.minimatch.set.length
+
+ // The matches are stored as {<filename>: true,...} so that
+ // duplicates are automagically pruned.
+ // Later, we do an Object.keys() on these.
+ // Keep them as a list so we can fill in when nonull is set.
+ this.matches = new Array(n)
+
+ if (typeof cb === 'function') {
+ cb = once(cb)
+ this.on('error', cb)
+ this.on('end', function (matches) {
+ cb(null, matches)
+ })
+ }
+
+ var self = this
+ var n = this.minimatch.set.length
+ this._processing = 0
+ this.matches = new Array(n)
+
+ this._emitQueue = []
+ this._processQueue = []
+ this.paused = false
+
+ if (this.noprocess)
+ return this
+
+ if (n === 0)
+ return done()
+
+ for (var i = 0; i < n; i ++) {
+ this._process(this.minimatch.set[i], i, false, done)
+ }
+
+ function done () {
+ --self._processing
+ if (self._processing <= 0)
+ self._finish()
+ }
+}
+
+Glob.prototype._finish = function () {
+ assert(this instanceof Glob)
+ if (this.aborted)
+ return
+
+ if (this.realpath && !this._didRealpath)
+ return this._realpath()
+
+ common.finish(this)
+ this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+ if (this._didRealpath)
+ return
+
+ this._didRealpath = true
+
+ var n = this.matches.length
+ if (n === 0)
+ return this._finish()
+
+ var self = this
+ for (var i = 0; i < this.matches.length; i++)
+ this._realpathSet(i, next)
+
+ function next () {
+ if (--n === 0)
+ self._finish()
+ }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+ var matchset = this.matches[index]
+ if (!matchset)
+ return cb()
+
+ var found = Object.keys(matchset)
+ var self = this
+ var n = found.length
+
+ if (n === 0)
+ return cb()
+
+ var set = this.matches[index] = Object.create(null)
+ found.forEach(function (p, i) {
+ // If there's a problem with the stat, then it means that
+ // one or more of the links in the realpath couldn't be
+ // resolved. just return the abs value in that case.
+ p = self._makeAbs(p)
+ fs.realpath(p, self.realpathCache, function (er, real) {
+ if (!er)
+ set[real] = true
+ else if (er.syscall === 'stat')
+ set[p] = true
+ else
+ self.emit('error', er) // srsly wtf right here
+
+ if (--n === 0) {
+ self.matches[index] = set
+ cb()
+ }
+ })
+ })
+}
+
+Glob.prototype._mark = function (p) {
+ return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+ return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+ this.aborted = true
+ this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+ if (!this.paused) {
+ this.paused = true
+ this.emit('pause')
+ }
+}
+
+Glob.prototype.resume = function () {
+ if (this.paused) {
+ this.emit('resume')
+ this.paused = false
+ if (this._emitQueue.length) {
+ var eq = this._emitQueue.slice(0)
+ this._emitQueue.length = 0
+ for (var i = 0; i < eq.length; i ++) {
+ var e = eq[i]
+ this._emitMatch(e[0], e[1])
+ }
+ }
+ if (this._processQueue.length) {
+ var pq = this._processQueue.slice(0)
+ this._processQueue.length = 0
+ for (var i = 0; i < pq.length; i ++) {
+ var p = pq[i]
+ this._processing--
+ this._process(p[0], p[1], p[2], p[3])
+ }
+ }
+ }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+ assert(this instanceof Glob)
+ assert(typeof cb === 'function')
+
+ if (this.aborted)
+ return
+
+ this._processing++
+ if (this.paused) {
+ this._processQueue.push([pattern, index, inGlobStar, cb])
+ return
+ }
+
+ //console.error('PROCESS %d', this._processing, pattern)
+
+ // Get the first [n] parts of pattern that are all strings.
+ var n = 0
+ while (typeof pattern[n] === 'string') {
+ n ++
+ }
+ // now n is the index of the first one that is *not* a string.
+
+ // see if there's anything else
+ var prefix
+ switch (n) {
+ // if not, then this is rather simple
+ case pattern.length:
+ this._processSimple(pattern.join('/'), index, cb)
+ return
+
+ case 0:
+ // pattern *starts* with some non-trivial item.
+ // going to readdir(cwd), but not include the prefix in matches.
+ prefix = null
+ break
+
+ default:
+ // pattern has some string bits in the front.
+ // whatever it starts with, whether that's 'absolute' like /foo/bar,
+ // or 'relative' like '../baz'
+ prefix = pattern.slice(0, n).join('/')
+ break
+ }
+
+ var remain = pattern.slice(n)
+
+ // get the list of entries.
+ var read
+ if (prefix === null)
+ read = '.'
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+ if (!prefix || !isAbsolute(prefix))
+ prefix = '/' + prefix
+ read = prefix
+ } else
+ read = prefix
+
+ var abs = this._makeAbs(read)
+
+ //if ignored, skip _processing
+ if (childrenIgnored(this, read))
+ return cb()
+
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
+ if (isGlobStar)
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+ else
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+ var self = this
+ this._readdir(abs, inGlobStar, function (er, entries) {
+ return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+ })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+ // if the abs isn't a dir, then nothing can match!
+ if (!entries)
+ return cb()
+
+ // It will only match dot entries if it starts with a dot, or if
+ // dot is set. Stuff like @(.foo|.bar) isn't allowed.
+ var pn = remain[0]
+ var negate = !!this.minimatch.negate
+ var rawGlob = pn._glob
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+ var matchedEntries = []
+ for (var i = 0; i < entries.length; i++) {
+ var e = entries[i]
+ if (e.charAt(0) !== '.' || dotOk) {
+ var m
+ if (negate && !prefix) {
+ m = !e.match(pn)
+ } else {
+ m = e.match(pn)
+ }
+ if (m)
+ matchedEntries.push(e)
+ }
+ }
+
+ //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+ var len = matchedEntries.length
+ // If there are no matched entries, then nothing matches.
+ if (len === 0)
+ return cb()
+
+ // if this is the last remaining pattern bit, then no need for
+ // an additional stat *unless* the user has specified mark or
+ // stat explicitly. We know they exist, since readdir returned
+ // them.
+
+ if (remain.length === 1 && !this.mark && !this.stat) {
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ if (prefix) {
+ if (prefix !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+
+ if (e.charAt(0) === '/' && !this.nomount) {
+ e = path.join(this.root, e)
+ }
+ this._emitMatch(index, e)
+ }
+ // This was the last one, and no stats were needed
+ return cb()
+ }
+
+ // now test all matched entries as stand-ins for that part
+ // of the pattern.
+ remain.shift()
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ var newPattern
+ if (prefix) {
+ if (prefix !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+ this._process([e].concat(remain), index, inGlobStar, cb)
+ }
+ cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+ if (this.aborted)
+ return
+
+ if (this.matches[index][e])
+ return
+
+ if (isIgnored(this, e))
+ return
+
+ if (this.paused) {
+ this._emitQueue.push([index, e])
+ return
+ }
+
+ var abs = this._makeAbs(e)
+
+ if (this.nodir) {
+ var c = this.cache[abs]
+ if (c === 'DIR' || Array.isArray(c))
+ return
+ }
+
+ if (this.mark)
+ e = this._mark(e)
+
+ this.matches[index][e] = true
+
+ var st = this.statCache[abs]
+ if (st)
+ this.emit('stat', e, st)
+
+ this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+ if (this.aborted)
+ return
+
+ // follow all symlinked directories forever
+ // just proceed as if this is a non-globstar situation
+ if (this.follow)
+ return this._readdir(abs, false, cb)
+
+ var lstatkey = 'lstat\0' + abs
+ var self = this
+ var lstatcb = inflight(lstatkey, lstatcb_)
+
+ if (lstatcb)
+ fs.lstat(abs, lstatcb)
+
+ function lstatcb_ (er, lstat) {
+ if (er)
+ return cb()
+
+ var isSym = lstat.isSymbolicLink()
+ self.symlinks[abs] = isSym
+
+ // If it's not a symlink or a dir, then it's definitely a regular file.
+ // don't bother doing a readdir in that case.
+ if (!isSym && !lstat.isDirectory()) {
+ self.cache[abs] = 'FILE'
+ cb()
+ } else
+ self._readdir(abs, false, cb)
+ }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+ if (this.aborted)
+ return
+
+ cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+ if (!cb)
+ return
+
+ //console.error('RD %j %j', +inGlobStar, abs)
+ if (inGlobStar && !ownProp(this.symlinks, abs))
+ return this._readdirInGlobStar(abs, cb)
+
+ if (ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+ if (!c || c === 'FILE')
+ return cb()
+
+ if (Array.isArray(c))
+ return cb(null, c)
+ }
+
+ var self = this
+ fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+ return function (er, entries) {
+ if (er)
+ self._readdirError(abs, er, cb)
+ else
+ self._readdirEntries(abs, entries, cb)
+ }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+ if (this.aborted)
+ return
+
+ // if we haven't asked to stat everything, then just
+ // assume that everything in there exists, so we can avoid
+ // having to stat it a second time.
+ if (!this.mark && !this.stat) {
+ for (var i = 0; i < entries.length; i ++) {
+ var e = entries[i]
+ if (abs === '/')
+ e = abs + e
+ else
+ e = abs + '/' + e
+ this.cache[e] = true
+ }
+ }
+
+ this.cache[abs] = entries
+ return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+ if (this.aborted)
+ return
+
+ // handle errors, and cache the information
+ switch (er.code) {
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+ case 'ENOTDIR': // totally normal. means it *does* exist.
+ this.cache[this._makeAbs(f)] = 'FILE'
+ break
+
+ case 'ENOENT': // not terribly unusual
+ case 'ELOOP':
+ case 'ENAMETOOLONG':
+ case 'UNKNOWN':
+ this.cache[this._makeAbs(f)] = false
+ break
+
+ default: // some unusual error. Treat as failure.
+ this.cache[this._makeAbs(f)] = false
+ if (this.strict) {
+ this.emit('error', er)
+ // If the error is handled, then we abort
+ // if not, we threw out of here
+ this.abort()
+ }
+ if (!this.silent)
+ console.error('glob error', er)
+ break
+ }
+
+ return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+ var self = this
+ this._readdir(abs, inGlobStar, function (er, entries) {
+ self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+ })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+ //console.error('pgs2', prefix, remain[0], entries)
+
+ // no entries means not a dir, so it can never have matches
+ // foo.txt/** doesn't match foo.txt
+ if (!entries)
+ return cb()
+
+ // test without the globstar, and with every child both below
+ // and replacing the globstar.
+ var remainWithoutGlobStar = remain.slice(1)
+ var gspref = prefix ? [ prefix ] : []
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+ // the noGlobStar pattern exits the inGlobStar state
+ this._process(noGlobStar, index, false, cb)
+
+ var isSym = this.symlinks[abs]
+ var len = entries.length
+
+ // If it's a symlink, and we're in a globstar, then stop
+ if (isSym && inGlobStar)
+ return cb()
+
+ for (var i = 0; i < len; i++) {
+ var e = entries[i]
+ if (e.charAt(0) === '.' && !this.dot)
+ continue
+
+ // these two cases enter the inGlobStar state
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+ this._process(instead, index, true, cb)
+
+ var below = gspref.concat(entries[i], remain)
+ this._process(below, index, true, cb)
+ }
+
+ cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+ // XXX review this. Shouldn't it be doing the mounting etc
+ // before doing stat? kinda weird?
+ var self = this
+ this._stat(prefix, function (er, exists) {
+ self._processSimple2(prefix, index, er, exists, cb)
+ })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+ //console.error('ps2', prefix, exists)
+
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ // If it doesn't exist, then just mark the lack of results
+ if (!exists)
+ return cb()
+
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
+ var trail = /[\/\\]$/.test(prefix)
+ if (prefix.charAt(0) === '/') {
+ prefix = path.join(this.root, prefix)
+ } else {
+ prefix = path.resolve(this.root, prefix)
+ if (trail)
+ prefix += '/'
+ }
+ }
+
+ if (process.platform === 'win32')
+ prefix = prefix.replace(/\\/g, '/')
+
+ // Mark this as a match
+ this._emitMatch(index, prefix)
+ cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+ var abs = this._makeAbs(f)
+ var needDir = f.slice(-1) === '/'
+
+ if (f.length > this.maxLength)
+ return cb()
+
+ if (!this.stat && ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+
+ if (Array.isArray(c))
+ c = 'DIR'
+
+ // It exists, but maybe not how we need it
+ if (!needDir || c === 'DIR')
+ return cb(null, c)
+
+ if (needDir && c === 'FILE')
+ return cb()
+
+ // otherwise we have to stat, because maybe c=true
+ // if we know it exists, but not what it is.
+ }
+
+ var exists
+ var stat = this.statCache[abs]
+ if (stat !== undefined) {
+ if (stat === false)
+ return cb(null, stat)
+ else {
+ var type = stat.isDirectory() ? 'DIR' : 'FILE'
+ if (needDir && type === 'FILE')
+ return cb()
+ else
+ return cb(null, type, stat)
+ }
+ }
+
+ var self = this
+ var statcb = inflight('stat\0' + abs, lstatcb_)
+ if (statcb)
+ fs.lstat(abs, statcb)
+
+ function lstatcb_ (er, lstat) {
+ if (lstat && lstat.isSymbolicLink()) {
+ // If it's a symlink, then treat it as the target, unless
+ // the target does not exist, then treat it as a file.
+ return fs.stat(abs, function (er, stat) {
+ if (er)
+ self._stat2(f, abs, null, lstat, cb)
+ else
+ self._stat2(f, abs, er, stat, cb)
+ })
+ } else {
+ self._stat2(f, abs, er, lstat, cb)
+ }
+ }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+ if (er) {
+ this.statCache[abs] = false
+ return cb()
+ }
+
+ var needDir = f.slice(-1) === '/'
+ this.statCache[abs] = stat
+
+ if (abs.slice(-1) === '/' && !stat.isDirectory())
+ return cb(null, false, stat)
+
+ var c = stat.isDirectory() ? 'DIR' : 'FILE'
+ this.cache[abs] = this.cache[abs] || c
+
+ if (needDir && c !== 'DIR')
+ return cb()
+
+ return cb(null, c, stat)
+}
+
+}).call(this,require('_process'))
+},{"./common.js":15,"./sync.js":17,"_process":24,"assert":9,"events":14,"fs":12,"inflight":18,"inherits":19,"minimatch":20,"once":21,"path":22,"path-is-absolute":23,"util":28}],17:[function(require,module,exports){
+(function (process){
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+ if (typeof options === 'function' || arguments.length === 3)
+ throw new TypeError('callback provided to sync glob\n'+
+ 'See: https://github.com/isaacs/node-glob/issues/167')
+
+ return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+ if (!pattern)
+ throw new Error('must provide pattern')
+
+ if (typeof options === 'function' || arguments.length === 3)
+ throw new TypeError('callback provided to sync glob\n'+
+ 'See: https://github.com/isaacs/node-glob/issues/167')
+
+ if (!(this instanceof GlobSync))
+ return new GlobSync(pattern, options)
+
+ setopts(this, pattern, options)
+
+ if (this.noprocess)
+ return this
+
+ var n = this.minimatch.set.length
+ this.matches = new Array(n)
+ for (var i = 0; i < n; i ++) {
+ this._process(this.minimatch.set[i], i, false)
+ }
+ this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+ assert(this instanceof GlobSync)
+ if (this.realpath) {
+ var self = this
+ this.matches.forEach(function (matchset, index) {
+ var set = self.matches[index] = Object.create(null)
+ for (var p in matchset) {
+ try {
+ p = self._makeAbs(p)
+ var real = fs.realpathSync(p, self.realpathCache)
+ set[real] = true
+ } catch (er) {
+ if (er.syscall === 'stat')
+ set[self._makeAbs(p)] = true
+ else
+ throw er
+ }
+ }
+ })
+ }
+ common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+ assert(this instanceof GlobSync)
+
+ // Get the first [n] parts of pattern that are all strings.
+ var n = 0
+ while (typeof pattern[n] === 'string') {
+ n ++
+ }
+ // now n is the index of the first one that is *not* a string.
+
+ // See if there's anything else
+ var prefix
+ switch (n) {
+ // if not, then this is rather simple
+ case pattern.length:
+ this._processSimple(pattern.join('/'), index)
+ return
+
+ case 0:
+ // pattern *starts* with some non-trivial item.
+ // going to readdir(cwd), but not include the prefix in matches.
+ prefix = null
+ break
+
+ default:
+ // pattern has some string bits in the front.
+ // whatever it starts with, whether that's 'absolute' like /foo/bar,
+ // or 'relative' like '../baz'
+ prefix = pattern.slice(0, n).join('/')
+ break
+ }
+
+ var remain = pattern.slice(n)
+
+ // get the list of entries.
+ var read
+ if (prefix === null)
+ read = '.'
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+ if (!prefix || !isAbsolute(prefix))
+ prefix = '/' + prefix
+ read = prefix
+ } else
+ read = prefix
+
+ var abs = this._makeAbs(read)
+
+ //if ignored, skip processing
+ if (childrenIgnored(this, read))
+ return
+
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
+ if (isGlobStar)
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+ else
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+ var entries = this._readdir(abs, inGlobStar)
+
+ // if the abs isn't a dir, then nothing can match!
+ if (!entries)
+ return
+
+ // It will only match dot entries if it starts with a dot, or if
+ // dot is set. Stuff like @(.foo|.bar) isn't allowed.
+ var pn = remain[0]
+ var negate = !!this.minimatch.negate
+ var rawGlob = pn._glob
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+ var matchedEntries = []
+ for (var i = 0; i < entries.length; i++) {
+ var e = entries[i]
+ if (e.charAt(0) !== '.' || dotOk) {
+ var m
+ if (negate && !prefix) {
+ m = !e.match(pn)
+ } else {
+ m = e.match(pn)
+ }
+ if (m)
+ matchedEntries.push(e)
+ }
+ }
+
+ var len = matchedEntries.length
+ // If there are no matched entries, then nothing matches.
+ if (len === 0)
+ return
+
+ // if this is the last remaining pattern bit, then no need for
+ // an additional stat *unless* the user has specified mark or
+ // stat explicitly. We know they exist, since readdir returned
+ // them.
+
+ if (remain.length === 1 && !this.mark && !this.stat) {
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ if (prefix) {
+ if (prefix.slice(-1) !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+
+ if (e.charAt(0) === '/' && !this.nomount) {
+ e = path.join(this.root, e)
+ }
+ this.matches[index][e] = true
+ }
+ // This was the last one, and no stats were needed
+ return
+ }
+
+ // now test all matched entries as stand-ins for that part
+ // of the pattern.
+ remain.shift()
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ var newPattern
+ if (prefix)
+ newPattern = [prefix, e]
+ else
+ newPattern = [e]
+ this._process(newPattern.concat(remain), index, inGlobStar)
+ }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+ var abs = this._makeAbs(e)
+ if (this.mark)
+ e = this._mark(e)
+
+ if (this.matches[index][e])
+ return
+
+ if (this.nodir) {
+ var c = this.cache[this._makeAbs(e)]
+ if (c === 'DIR' || Array.isArray(c))
+ return
+ }
+
+ this.matches[index][e] = true
+ if (this.stat)
+ this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+ // follow all symlinked directories forever
+ // just proceed as if this is a non-globstar situation
+ if (this.follow)
+ return this._readdir(abs, false)
+
+ var entries
+ var lstat
+ var stat
+ try {
+ lstat = fs.lstatSync(abs)
+ } catch (er) {
+ // lstat failed, doesn't exist
+ return null
+ }
+
+ var isSym = lstat.isSymbolicLink()
+ this.symlinks[abs] = isSym
+
+ // If it's not a symlink or a dir, then it's definitely a regular file.
+ // don't bother doing a readdir in that case.
+ if (!isSym && !lstat.isDirectory())
+ this.cache[abs] = 'FILE'
+ else
+ entries = this._readdir(abs, false)
+
+ return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+ var entries
+
+ if (inGlobStar && !ownProp(this.symlinks, abs))
+ return this._readdirInGlobStar(abs)
+
+ if (ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+ if (!c || c === 'FILE')
+ return null
+
+ if (Array.isArray(c))
+ return c
+ }
+
+ try {
+ return this._readdirEntries(abs, fs.readdirSync(abs))
+ } catch (er) {
+ this._readdirError(abs, er)
+ return null
+ }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+ // if we haven't asked to stat everything, then just
+ // assume that everything in there exists, so we can avoid
+ // having to stat it a second time.
+ if (!this.mark && !this.stat) {
+ for (var i = 0; i < entries.length; i ++) {
+ var e = entries[i]
+ if (abs === '/')
+ e = abs + e
+ else
+ e = abs + '/' + e
+ this.cache[e] = true
+ }
+ }
+
+ this.cache[abs] = entries
+
+ // mark and cache dir-ness
+ return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+ // handle errors, and cache the information
+ switch (er.code) {
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+ case 'ENOTDIR': // totally normal. means it *does* exist.
+ this.cache[this._makeAbs(f)] = 'FILE'
+ break
+
+ case 'ENOENT': // not terribly unusual
+ case 'ELOOP':
+ case 'ENAMETOOLONG':
+ case 'UNKNOWN':
+ this.cache[this._makeAbs(f)] = false
+ break
+
+ default: // some unusual error. Treat as failure.
+ this.cache[this._makeAbs(f)] = false
+ if (this.strict)
+ throw er
+ if (!this.silent)
+ console.error('glob error', er)
+ break
+ }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+ var entries = this._readdir(abs, inGlobStar)
+
+ // no entries means not a dir, so it can never have matches
+ // foo.txt/** doesn't match foo.txt
+ if (!entries)
+ return
+
+ // test without the globstar, and with every child both below
+ // and replacing the globstar.
+ var remainWithoutGlobStar = remain.slice(1)
+ var gspref = prefix ? [ prefix ] : []
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+ // the noGlobStar pattern exits the inGlobStar state
+ this._process(noGlobStar, index, false)
+
+ var len = entries.length
+ var isSym = this.symlinks[abs]
+
+ // If it's a symlink, and we're in a globstar, then stop
+ if (isSym && inGlobStar)
+ return
+
+ for (var i = 0; i < len; i++) {
+ var e = entries[i]
+ if (e.charAt(0) === '.' && !this.dot)
+ continue
+
+ // these two cases enter the inGlobStar state
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+ this._process(instead, index, true)
+
+ var below = gspref.concat(entries[i], remain)
+ this._process(below, index, true)
+ }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+ // XXX review this. Shouldn't it be doing the mounting etc
+ // before doing stat? kinda weird?
+ var exists = this._stat(prefix)
+
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ // If it doesn't exist, then just mark the lack of results
+ if (!exists)
+ return
+
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
+ var trail = /[\/\\]$/.test(prefix)
+ if (prefix.charAt(0) === '/') {
+ prefix = path.join(this.root, prefix)
+ } else {
+ prefix = path.resolve(this.root, prefix)
+ if (trail)
+ prefix += '/'
+ }
+ }
+
+ if (process.platform === 'win32')
+ prefix = prefix.replace(/\\/g, '/')
+
+ // Mark this as a match
+ this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+ var abs = this._makeAbs(f)
+ var needDir = f.slice(-1) === '/'
+
+ if (f.length > this.maxLength)
+ return false
+
+ if (!this.stat && ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+
+ if (Array.isArray(c))
+ c = 'DIR'
+
+ // It exists, but maybe not how we need it
+ if (!needDir || c === 'DIR')
+ return c
+
+ if (needDir && c === 'FILE')
+ return false
+
+ // otherwise we have to stat, because maybe c=true
+ // if we know it exists, but not what it is.
+ }
+
+ var exists
+ var stat = this.statCache[abs]
+ if (!stat) {
+ var lstat
+ try {
+ lstat = fs.lstatSync(abs)
+ } catch (er) {
+ return false
+ }
+
+ if (lstat.isSymbolicLink()) {
+ try {
+ stat = fs.statSync(abs)
+ } catch (er) {
+ stat = lstat
+ }
+ } else {
+ stat = lstat
+ }
+ }
+
+ this.statCache[abs] = stat
+
+ var c = stat.isDirectory() ? 'DIR' : 'FILE'
+ this.cache[abs] = this.cache[abs] || c
+
+ if (needDir && c !== 'DIR')
+ return false
+
+ return c
+}
+
+GlobSync.prototype._mark = function (p) {
+ return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+ return common.makeAbs(this, f)
+}
+
+}).call(this,require('_process'))
+},{"./common.js":15,"./glob.js":16,"_process":24,"assert":9,"fs":12,"minimatch":20,"path":22,"path-is-absolute":23,"util":28}],18:[function(require,module,exports){
+(function (process){
+var wrappy = require('wrappy')
+var reqs = Object.create(null)
+var once = require('once')
+
+module.exports = wrappy(inflight)
+
+function inflight (key, cb) {
+ if (reqs[key]) {
+ reqs[key].push(cb)
+ return null
+ } else {
+ reqs[key] = [cb]
+ return makeres(key)
+ }
+}
+
+function makeres (key) {
+ return once(function RES () {
+ var cbs = reqs[key]
+ var len = cbs.length
+ var args = slice(arguments)
+
+ // XXX It's somewhat ambiguous whether a new callback added in this
+ // pass should be queued for later execution if something in the
+ // list of callbacks throws, or if it should just be discarded.
+ // However, it's such an edge case that it hardly matters, and either
+ // choice is likely as surprising as the other.
+ // As it happens, we do go ahead and schedule it for later execution.
+ try {
+ for (var i = 0; i < len; i++) {
+ cbs[i].apply(null, args)
+ }
+ } finally {
+ if (cbs.length > len) {
+ // added more in the interim.
+ // de-zalgo, just in case, but don't call again.
+ cbs.splice(0, len)
+ process.nextTick(function () {
+ RES.apply(null, args)
+ })
+ } else {
+ delete reqs[key]
+ }
+ }
+ })
+}
+
+function slice (args) {
+ var length = args.length
+ var array = []
+
+ for (var i = 0; i < length; i++) array[i] = args[i]
+ return array
+}
+
+}).call(this,require('_process'))
+},{"_process":24,"once":21,"wrappy":29}],19:[function(require,module,exports){
+if (typeof Object.create === 'function') {
+ // implementation from standard node.js 'util' module
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ };
+} else {
+ // old school shim for old browsers
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+}
+
+},{}],20:[function(require,module,exports){
+module.exports = minimatch
+minimatch.Minimatch = Minimatch
+
+var path = { sep: '/' }
+try {
+ path = require('path')
+} catch (er) {}
+
+var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
+var expand = require('brace-expansion')
+
+var plTypes = {
+ '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
+ '?': { open: '(?:', close: ')?' },
+ '+': { open: '(?:', close: ')+' },
+ '*': { open: '(?:', close: ')*' },
+ '@': { open: '(?:', close: ')' }
+}
+
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+var qmark = '[^/]'
+
+// * => any number of characters
+var star = qmark + '*?'
+
+// ** when dots are allowed. Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
+
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
+
+// characters that need to be escaped in RegExp.
+var reSpecials = charSet('().*{}+?[]^$\\!')
+
+// "abc" -> { a:true, b:true, c:true }
+function charSet (s) {
+ return s.split('').reduce(function (set, c) {
+ set[c] = true
+ return set
+ }, {})
+}
+
+// normalizes slashes.
+var slashSplit = /\/+/
+
+minimatch.filter = filter
+function filter (pattern, options) {
+ options = options || {}
+ return function (p, i, list) {
+ return minimatch(p, pattern, options)
+ }
+}
+
+function ext (a, b) {
+ a = a || {}
+ b = b || {}
+ var t = {}
+ Object.keys(b).forEach(function (k) {
+ t[k] = b[k]
+ })
+ Object.keys(a).forEach(function (k) {
+ t[k] = a[k]
+ })
+ return t
+}
+
+minimatch.defaults = function (def) {
+ if (!def || !Object.keys(def).length) return minimatch
+
+ var orig = minimatch
+
+ var m = function minimatch (p, pattern, options) {
+ return orig.minimatch(p, pattern, ext(def, options))
+ }
+
+ m.Minimatch = function Minimatch (pattern, options) {
+ return new orig.Minimatch(pattern, ext(def, options))
+ }
+
+ return m
+}
+
+Minimatch.defaults = function (def) {
+ if (!def || !Object.keys(def).length) return Minimatch
+ return minimatch.defaults(def).Minimatch
+}
+
+function minimatch (p, pattern, options) {
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob pattern string required')
+ }
+
+ if (!options) options = {}
+
+ // shortcut: comments match nothing.
+ if (!options.nocomment && pattern.charAt(0) === '#') {
+ return false
+ }
+
+ // "" only matches ""
+ if (pattern.trim() === '') return p === ''
+
+ return new Minimatch(pattern, options).match(p)
+}
+
+function Minimatch (pattern, options) {
+ if (!(this instanceof Minimatch)) {
+ return new Minimatch(pattern, options)
+ }
+
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob pattern string required')
+ }
+
+ if (!options) options = {}
+ pattern = pattern.trim()
+
+ // windows support: need to use /, not \
+ if (path.sep !== '/') {
+ pattern = pattern.split(path.sep).join('/')
+ }
+
+ this.options = options
+ this.set = []
+ this.pattern = pattern
+ this.regexp = null
+ this.negate = false
+ this.comment = false
+ this.empty = false
+
+ // make the set of regexps etc.
+ this.make()
+}
+
+Minimatch.prototype.debug = function () {}
+
+Minimatch.prototype.make = make
+function make () {
+ // don't do it more than once.
+ if (this._made) return
+
+ var pattern = this.pattern
+ var options = this.options
+
+ // empty patterns and comments match nothing.
+ if (!options.nocomment && pattern.charAt(0) === '#') {
+ this.comment = true
+ return
+ }
+ if (!pattern) {
+ this.empty = true
+ return
+ }
+
+ // step 1: figure out negation, etc.
+ this.parseNegate()
+
+ // step 2: expand braces
+ var set = this.globSet = this.braceExpand()
+
+ if (options.debug) this.debug = console.error
+
+ this.debug(this.pattern, set)
+
+ // step 3: now we have a set, so turn each one into a series of path-portion
+ // matching patterns.
+ // These will be regexps, except in the case of "**", which is
+ // set to the GLOBSTAR object for globstar behavior,
+ // and will not contain any / characters
+ set = this.globParts = set.map(function (s) {
+ return s.split(slashSplit)
+ })
+
+ this.debug(this.pattern, set)
+
+ // glob --> regexps
+ set = set.map(function (s, si, set) {
+ return s.map(this.parse, this)
+ }, this)
+
+ this.debug(this.pattern, set)
+
+ // filter out everything that didn't compile properly.
+ set = set.filter(function (s) {
+ return s.indexOf(false) === -1
+ })
+
+ this.debug(this.pattern, set)
+
+ this.set = set
+}
+
+Minimatch.prototype.parseNegate = parseNegate
+function parseNegate () {
+ var pattern = this.pattern
+ var negate = false
+ var options = this.options
+ var negateOffset = 0
+
+ if (options.nonegate) return
+
+ for (var i = 0, l = pattern.length
+ ; i < l && pattern.charAt(i) === '!'
+ ; i++) {
+ negate = !negate
+ negateOffset++
+ }
+
+ if (negateOffset) this.pattern = pattern.substr(negateOffset)
+ this.negate = negate
+}
+
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+minimatch.braceExpand = function (pattern, options) {
+ return braceExpand(pattern, options)
+}
+
+Minimatch.prototype.braceExpand = braceExpand
+
+function braceExpand (pattern, options) {
+ if (!options) {
+ if (this instanceof Minimatch) {
+ options = this.options
+ } else {
+ options = {}
+ }
+ }
+
+ pattern = typeof pattern === 'undefined'
+ ? this.pattern : pattern
+
+ if (typeof pattern === 'undefined') {
+ throw new TypeError('undefined pattern')
+ }
+
+ if (options.nobrace ||
+ !pattern.match(/\{.*\}/)) {
+ // shortcut. no need to expand.
+ return [pattern]
+ }
+
+ return expand(pattern)
+}
+
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion. Otherwise, any series
+// of * is equivalent to a single *. Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+Minimatch.prototype.parse = parse
+var SUBPARSE = {}
+function parse (pattern, isSub) {
+ if (pattern.length > 1024 * 64) {
+ throw new TypeError('pattern is too long')
+ }
+
+ var options = this.options
+
+ // shortcuts
+ if (!options.noglobstar && pattern === '**') return GLOBSTAR
+ if (pattern === '') return ''
+
+ var re = ''
+ var hasMagic = !!options.nocase
+ var escaping = false
+ // ? => one single character
+ var patternListStack = []
+ var negativeLists = []
+ var stateChar
+ var inClass = false
+ var reClassStart = -1
+ var classStart = -1
+ // . and .. never match anything that doesn't start with .,
+ // even when options.dot is set.
+ var patternStart = pattern.charAt(0) === '.' ? '' // anything
+ // not (start or / followed by . or .. followed by / or end)
+ : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
+ : '(?!\\.)'
+ var self = this
+
+ function clearStateChar () {
+ if (stateChar) {
+ // we had some state-tracking character
+ // that wasn't consumed by this pass.
+ switch (stateChar) {
+ case '*':
+ re += star
+ hasMagic = true
+ break
+ case '?':
+ re += qmark
+ hasMagic = true
+ break
+ default:
+ re += '\\' + stateChar
+ break
+ }
+ self.debug('clearStateChar %j %j', stateChar, re)
+ stateChar = false
+ }
+ }
+
+ for (var i = 0, len = pattern.length, c
+ ; (i < len) && (c = pattern.charAt(i))
+ ; i++) {
+ this.debug('%s\t%s %s %j', pattern, i, re, c)
+
+ // skip over any that are escaped.
+ if (escaping && reSpecials[c]) {
+ re += '\\' + c
+ escaping = false
+ continue
+ }
+
+ switch (c) {
+ case '/':
+ // completely not allowed, even escaped.
+ // Should already be path-split by now.
+ return false
+
+ case '\\':
+ clearStateChar()
+ escaping = true
+ continue
+
+ // the various stateChar values
+ // for the "extglob" stuff.
+ case '?':
+ case '*':
+ case '+':
+ case '@':
+ case '!':
+ this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
+
+ // all of those are literals inside a class, except that
+ // the glob [!a] means [^a] in regexp
+ if (inClass) {
+ this.debug(' in class')
+ if (c === '!' && i === classStart + 1) c = '^'
+ re += c
+ continue
+ }
+
+ // if we already have a stateChar, then it means
+ // that there was something like ** or +? in there.
+ // Handle the stateChar, then proceed with this one.
+ self.debug('call clearStateChar %j', stateChar)
+ clearStateChar()
+ stateChar = c
+ // if extglob is disabled, then +(asdf|foo) isn't a thing.
+ // just clear the statechar *now*, rather than even diving into
+ // the patternList stuff.
+ if (options.noext) clearStateChar()
+ continue
+
+ case '(':
+ if (inClass) {
+ re += '('
+ continue
+ }
+
+ if (!stateChar) {
+ re += '\\('
+ continue
+ }
+
+ patternListStack.push({
+ type: stateChar,
+ start: i - 1,
+ reStart: re.length,
+ open: plTypes[stateChar].open,
+ close: plTypes[stateChar].close
+ })
+ // negation is (?:(?!js)[^/]*)
+ re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
+ this.debug('plType %j %j', stateChar, re)
+ stateChar = false
+ continue
+
+ case ')':
+ if (inClass || !patternListStack.length) {
+ re += '\\)'
+ continue
+ }
+
+ clearStateChar()
+ hasMagic = true
+ var pl = patternListStack.pop()
+ // negation is (?:(?!js)[^/]*)
+ // The others are (?:<pattern>)<type>
+ re += pl.close
+ if (pl.type === '!') {
+ negativeLists.push(pl)
+ }
+ pl.reEnd = re.length
+ continue
+
+ case '|':
+ if (inClass || !patternListStack.length || escaping) {
+ re += '\\|'
+ escaping = false
+ continue
+ }
+
+ clearStateChar()
+ re += '|'
+ continue
+
+ // these are mostly the same in regexp and glob
+ case '[':
+ // swallow any state-tracking char before the [
+ clearStateChar()
+
+ if (inClass) {
+ re += '\\' + c
+ continue
+ }
+
+ inClass = true
+ classStart = i
+ reClassStart = re.length
+ re += c
+ continue
+
+ case ']':
+ // a right bracket shall lose its special
+ // meaning and represent itself in
+ // a bracket expression if it occurs
+ // first in the list. -- POSIX.2 2.8.3.2
+ if (i === classStart + 1 || !inClass) {
+ re += '\\' + c
+ escaping = false
+ continue
+ }
+
+ // handle the case where we left a class open.
+ // "[z-a]" is valid, equivalent to "\[z-a\]"
+ if (inClass) {
+ // split where the last [ was, make sure we don't have
+ // an invalid re. if so, re-walk the contents of the
+ // would-be class to re-translate any characters that
+ // were passed through as-is
+ // TODO: It would probably be faster to determine this
+ // without a try/catch and a new RegExp, but it's tricky
+ // to do safely. For now, this is safe and works.
+ var cs = pattern.substring(classStart + 1, i)
+ try {
+ RegExp('[' + cs + ']')
+ } catch (er) {
+ // not a valid class!
+ var sp = this.parse(cs, SUBPARSE)
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
+ hasMagic = hasMagic || sp[1]
+ inClass = false
+ continue
+ }
+ }
+
+ // finish up the class.
+ hasMagic = true
+ inClass = false
+ re += c
+ continue
+
+ default:
+ // swallow any state char that wasn't consumed
+ clearStateChar()
+
+ if (escaping) {
+ // no need
+ escaping = false
+ } else if (reSpecials[c]
+ && !(c === '^' && inClass)) {
+ re += '\\'
+ }
+
+ re += c
+
+ } // switch
+ } // for
+
+ // handle the case where we left a class open.
+ // "[abc" is valid, equivalent to "\[abc"
+ if (inClass) {
+ // split where the last [ was, and escape it
+ // this is a huge pita. We now have to re-walk
+ // the contents of the would-be class to re-translate
+ // any characters that were passed through as-is
+ cs = pattern.substr(classStart + 1)
+ sp = this.parse(cs, SUBPARSE)
+ re = re.substr(0, reClassStart) + '\\[' + sp[0]
+ hasMagic = hasMagic || sp[1]
+ }
+
+ // handle the case where we had a +( thing at the *end*
+ // of the pattern.
+ // each pattern list stack adds 3 chars, and we need to go through
+ // and escape any | chars that were passed through as-is for the regexp.
+ // Go through and escape them, taking care not to double-escape any
+ // | chars that were already escaped.
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
+ var tail = re.slice(pl.reStart + pl.open.length)
+ this.debug('setting tail', re, pl)
+ // maybe some even number of \, then maybe 1 \, followed by a |
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
+ if (!$2) {
+ // the | isn't already escaped, so escape it.
+ $2 = '\\'
+ }
+
+ // need to escape all those slashes *again*, without escaping the
+ // one that we need for escaping the | character. As it works out,
+ // escaping an even number of slashes can be done by simply repeating
+ // it exactly after itself. That's why this trick works.
+ //
+ // I am sorry that you have to see this.
+ return $1 + $1 + $2 + '|'
+ })
+
+ this.debug('tail=%j\n %s', tail, tail, pl, re)
+ var t = pl.type === '*' ? star
+ : pl.type === '?' ? qmark
+ : '\\' + pl.type
+
+ hasMagic = true
+ re = re.slice(0, pl.reStart) + t + '\\(' + tail
+ }
+
+ // handle trailing things that only matter at the very end.
+ clearStateChar()
+ if (escaping) {
+ // trailing \\
+ re += '\\\\'
+ }
+
+ // only need to apply the nodot start if the re starts with
+ // something that could conceivably capture a dot
+ var addPatternStart = false
+ switch (re.charAt(0)) {
+ case '.':
+ case '[':
+ case '(': addPatternStart = true
+ }
+
+ // Hack to work around lack of negative lookbehind in JS
+ // A pattern like: *.!(x).!(y|z) needs to ensure that a name
+ // like 'a.xyz.yz' doesn't match. So, the first negative
+ // lookahead, has to look ALL the way ahead, to the end of
+ // the pattern.
+ for (var n = negativeLists.length - 1; n > -1; n--) {
+ var nl = negativeLists[n]
+
+ var nlBefore = re.slice(0, nl.reStart)
+ var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
+ var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
+ var nlAfter = re.slice(nl.reEnd)
+
+ nlLast += nlAfter
+
+ // Handle nested stuff like *(*.js|!(*.json)), where open parens
+ // mean that we should *not* include the ) in the bit that is considered
+ // "after" the negated section.
+ var openParensBefore = nlBefore.split('(').length - 1
+ var cleanAfter = nlAfter
+ for (i = 0; i < openParensBefore; i++) {
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
+ }
+ nlAfter = cleanAfter
+
+ var dollar = ''
+ if (nlAfter === '' && isSub !== SUBPARSE) {
+ dollar = '$'
+ }
+ var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
+ re = newRe
+ }
+
+ // if the re is not "" at this point, then we need to make sure
+ // it doesn't match against an empty path part.
+ // Otherwise a/* will match a/, which it should not.
+ if (re !== '' && hasMagic) {
+ re = '(?=.)' + re
+ }
+
+ if (addPatternStart) {
+ re = patternStart + re
+ }
+
+ // parsing just a piece of a larger pattern.
+ if (isSub === SUBPARSE) {
+ return [re, hasMagic]
+ }
+
+ // skip the regexp for non-magical patterns
+ // unescape anything in it, though, so that it'll be
+ // an exact match against a file etc.
+ if (!hasMagic) {
+ return globUnescape(pattern)
+ }
+
+ var flags = options.nocase ? 'i' : ''
+ try {
+ var regExp = new RegExp('^' + re + '$', flags)
+ } catch (er) {
+ // If it was an invalid regular expression, then it can't match
+ // anything. This trick looks for a character after the end of
+ // the string, which is of course impossible, except in multi-line
+ // mode, but it's not a /m regex.
+ return new RegExp('$.')
+ }
+
+ regExp._glob = pattern
+ regExp._src = re
+
+ return regExp
+}
+
+minimatch.makeRe = function (pattern, options) {
+ return new Minimatch(pattern, options || {}).makeRe()
+}
+
+Minimatch.prototype.makeRe = makeRe
+function makeRe () {
+ if (this.regexp || this.regexp === false) return this.regexp
+
+ // at this point, this.set is a 2d array of partial
+ // pattern strings, or "**".
+ //
+ // It's better to use .match(). This function shouldn't
+ // be used, really, but it's pretty convenient sometimes,
+ // when you just want to work with a regex.
+ var set = this.set
+
+ if (!set.length) {
+ this.regexp = false
+ return this.regexp
+ }
+ var options = this.options
+
+ var twoStar = options.noglobstar ? star
+ : options.dot ? twoStarDot
+ : twoStarNoDot
+ var flags = options.nocase ? 'i' : ''
+
+ var re = set.map(function (pattern) {
+ return pattern.map(function (p) {
+ return (p === GLOBSTAR) ? twoStar
+ : (typeof p === 'string') ? regExpEscape(p)
+ : p._src
+ }).join('\\\/')
+ }).join('|')
+
+ // must match entire pattern
+ // ending in a * or ** will make it less strict.
+ re = '^(?:' + re + ')$'
+
+ // can match anything, as long as it's not this.
+ if (this.negate) re = '^(?!' + re + ').*$'
+
+ try {
+ this.regexp = new RegExp(re, flags)
+ } catch (ex) {
+ this.regexp = false
+ }
+ return this.regexp
+}
+
+minimatch.match = function (list, pattern, options) {
+ options = options || {}
+ var mm = new Minimatch(pattern, options)
+ list = list.filter(function (f) {
+ return mm.match(f)
+ })
+ if (mm.options.nonull && !list.length) {
+ list.push(pattern)
+ }
+ return list
+}
+
+Minimatch.prototype.match = match
+function match (f, partial) {
+ this.debug('match', f, this.pattern)
+ // short-circuit in the case of busted things.
+ // comments, etc.
+ if (this.comment) return false
+ if (this.empty) return f === ''
+
+ if (f === '/' && partial) return true
+
+ var options = this.options
+
+ // windows: need to use /, not \
+ if (path.sep !== '/') {
+ f = f.split(path.sep).join('/')
+ }
+
+ // treat the test path as a set of pathparts.
+ f = f.split(slashSplit)
+ this.debug(this.pattern, 'split', f)
+
+ // just ONE of the pattern sets in this.set needs to match
+ // in order for it to be valid. If negating, then just one
+ // match means that we have failed.
+ // Either way, return on the first hit.
+
+ var set = this.set
+ this.debug(this.pattern, 'set', set)
+
+ // Find the basename of the path by looking for the last non-empty segment
+ var filename
+ var i
+ for (i = f.length - 1; i >= 0; i--) {
+ filename = f[i]
+ if (filename) break
+ }
+
+ for (i = 0; i < set.length; i++) {
+ var pattern = set[i]
+ var file = f
+ if (options.matchBase && pattern.length === 1) {
+ file = [filename]
+ }
+ var hit = this.matchOne(file, pattern, partial)
+ if (hit) {
+ if (options.flipNegate) return true
+ return !this.negate
+ }
+ }
+
+ // didn't get any hits. this is success if it's a negative
+ // pattern, failure otherwise.
+ if (options.flipNegate) return false
+ return this.negate
+}
+
+// set partial to true to test if, for example,
+// "/a/b" matches the start of "/*/b/*/d"
+// Partial means, if you run out of file before you run
+// out of pattern, then that's fine, as long as all
+// the parts match.
+Minimatch.prototype.matchOne = function (file, pattern, partial) {
+ var options = this.options
+
+ this.debug('matchOne',
+ { 'this': this, file: file, pattern: pattern })
+
+ this.debug('matchOne', file.length, pattern.length)
+
+ for (var fi = 0,
+ pi = 0,
+ fl = file.length,
+ pl = pattern.length
+ ; (fi < fl) && (pi < pl)
+ ; fi++, pi++) {
+ this.debug('matchOne loop')
+ var p = pattern[pi]
+ var f = file[fi]
+
+ this.debug(pattern, p, f)
+
+ // should be impossible.
+ // some invalid regexp stuff in the set.
+ if (p === false) return false
+
+ if (p === GLOBSTAR) {
+ this.debug('GLOBSTAR', [pattern, p, f])
+
+ // "**"
+ // a/**/b/**/c would match the following:
+ // a/b/x/y/z/c
+ // a/x/y/z/b/c
+ // a/b/x/b/x/c
+ // a/b/c
+ // To do this, take the rest of the pattern after
+ // the **, and see if it would match the file remainder.
+ // If so, return success.
+ // If not, the ** "swallows" a segment, and try again.
+ // This is recursively awful.
+ //
+ // a/**/b/**/c matching a/b/x/y/z/c
+ // - a matches a
+ // - doublestar
+ // - matchOne(b/x/y/z/c, b/**/c)
+ // - b matches b
+ // - doublestar
+ // - matchOne(x/y/z/c, c) -> no
+ // - matchOne(y/z/c, c) -> no
+ // - matchOne(z/c, c) -> no
+ // - matchOne(c, c) yes, hit
+ var fr = fi
+ var pr = pi + 1
+ if (pr === pl) {
+ this.debug('** at the end')
+ // a ** at the end will just swallow the rest.
... 30769 lines suppressed ...