(objects, apply=apply)
| 142 | """ |
| 143 | |
| 144 | def create_with(objects, apply=apply): |
| 145 | failures = [] |
| 146 | k8s_objects = [] |
| 147 | for yml_document in objects: |
| 148 | if yml_document is None: |
| 149 | continue |
| 150 | try: |
| 151 | created = create_from_dict( |
| 152 | k8s_client, |
| 153 | yml_document, |
| 154 | verbose, |
| 155 | namespace=namespace, |
| 156 | apply=apply, |
| 157 | **kwargs, |
| 158 | ) |
| 159 | k8s_objects.append(created) |
| 160 | except FailToCreateError as failure: |
| 161 | failures.extend(failure.api_exceptions) |
| 162 | if failures: |
| 163 | raise FailToCreateError(failures) |
| 164 | return k8s_objects |
| 165 | |
| 166 | class Loader(yaml.loader.SafeLoader): |
| 167 | yaml_implicit_resolvers = yaml.loader.SafeLoader.yaml_implicit_resolvers.copy() |
no test coverage detected