Skip to content

Commit

Permalink
Move imagepullsecrets sample to samples/core (#1767)
Browse files Browse the repository at this point in the history
* Remove redundant import.

* Simplify sample_test.yaml by using withItem syntax.

* Simplify sample_test.yaml by using withItem syntax.

* Change dict to str in withItems.

* Add image pull secret sample.

* Move imagepullsecret sample from test dir to sample dir. Waiting on corresponding unit test infra refactoring.

* Update the location of imagepullsecrets so that it can serve as an example.

* Add minimal comments documenting usage.
  • Loading branch information
Jiaxiao Zheng authored and k8s-ci-robot committed Aug 9, 2019
1 parent 1407d86 commit 90b9ad7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
# 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.

"""Toy example demonstrating how to specify imagepullsecrets to access protected
container registry.
"""

import kfp.dsl as dsl
from kubernetes import client as k8s_client
Expand Down Expand Up @@ -47,4 +49,6 @@ def save_most_frequent_word(message: str):
counter = GetFrequentWordOp(
name='get-Frequent',
message=message)
dsl.get_pipeline_conf().set_image_pull_secrets([k8s_client.V1ObjectReference(name="secretA")])
# Call set_image_pull_secrets after get_pipeline_conf().
dsl.get_pipeline_conf()\
.set_image_pull_secrets([k8s_client.V1ObjectReference(name="secretA")])
4 changes: 2 additions & 2 deletions sdk/python/tests/compiler/compiler_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ def test_py_retry(self):
"""Test retry functionality."""
self._test_py_compile_yaml('retry')

def test_py_image_pull_secret(self):
def test_py_image_pull_secrets(self):
"""Test pipeline imagepullsecret."""
self._test_py_compile_yaml('imagepullsecret')
self._test_sample_py_compile_yaml('imagepullsecrets')

def test_py_timeout(self):
"""Test pipeline timeout."""
Expand Down

0 comments on commit 90b9ad7

Please sign in to comment.