-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.7.1-alpha.4'
- Loading branch information
Showing
32 changed files
with
1,435 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,65 @@ | ||
import kopf | ||
import logging | ||
|
||
from .helpers import global_logger | ||
import kopf | ||
|
||
from .secretcopier_funcs import reconcile_config | ||
|
||
from .operator_config import OPERATOR_API_GROUP | ||
|
||
logger = logging.getLogger("educates") | ||
|
||
|
||
@kopf.index(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers") | ||
def secretcopier_index(name, body, **_): | ||
def secretcopier_index(name, meta, body, **_): | ||
generation = meta["generation"] | ||
|
||
logger.debug("Add secretcopier %s with generation %s to cache.", name, generation) | ||
|
||
return {(None, name): body} | ||
|
||
|
||
@kopf.on.create(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers") | ||
@kopf.on.resume(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers") | ||
def secretcopier_reconcile_resume(name, meta, body, **_): | ||
generation = meta["generation"] | ||
|
||
logger.info("Secretcopier %s exists with generation %s.", name, generation) | ||
|
||
reconcile_config(name, body) | ||
|
||
|
||
@kopf.on.create(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers") | ||
@kopf.on.update(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers") | ||
@kopf.timer(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers", interval=60.0) | ||
def secretcopier_reconcile(name, body, logger, **_): | ||
with global_logger(logger): | ||
reconcile_config(name, body) | ||
def secretcopier_reconcile_update(name, meta, body, reason, **_): | ||
generation = meta["generation"] | ||
|
||
logger.info( | ||
"Secretcopier %s %sd with generation %s.", name, reason.lower(), generation | ||
) | ||
|
||
reconcile_config(name, body) | ||
|
||
|
||
@kopf.timer( | ||
f"secrets.{OPERATOR_API_GROUP}", | ||
"v1beta1", | ||
"secretcopiers", | ||
initial_delay=30.0, | ||
interval=60.0, | ||
) | ||
def secretcopier_reconcile_timer(name, meta, body, **_): | ||
generation = meta["generation"] | ||
|
||
logger.debug("Reconcile secretcopier %s with generation %s.", name, generation) | ||
|
||
reconcile_config(name, body) | ||
|
||
|
||
@kopf.on.delete( | ||
f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretcopiers", optional=True | ||
) | ||
def secretcopier_delete(name, body, logger, **_): | ||
pass | ||
def secretcopier_delete(name, meta, **_): | ||
generation = meta["generation"] | ||
|
||
logger.info( | ||
"Secretcopier %s with generation %s deleted.", name, generation | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.