GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.03k stars 1.62k forks source link

Question about rules_oci integration #9353

Open cyrilhuang opened 7 months ago

cyrilhuang commented 7 months ago

I'm trying to integrate skaffold with rules_oci to replace the deprecated rules_docker, but encountered some problems during testing:

  1. During the original k8s deployment.yaml, I have spec.template.spec.containers[0].image: {{ .Values.image }}, but new skaffold does not insert this value, causing we have to hardcode this value
  2. Does skaffold support oci_image? In the example, we use oci_tarball instead oci_image. But oci_tarball needs repo_tags, which we do not need in out usage. https://github.com/GoogleContainerTools/skaffold/blob/ba3ee3f40ca948677fb9217b943e637c9491fbf5/examples/bazel/BUILD.bazel#L2
  3. After running skaffold run -f skaffold.yaml successfully for the first time, no matter how to change the BUILD file, go_library/go_binary files, skaffolf always reuse the tarball generated in the first time, and do not rebuild the image, even if I intensionly corrupt the BUILD dependencies. `skaffold run -f skaffold-dev.yaml Generating tags...
    • my-repository -> my-repository:latest Checking cache... WARN[0004] Retrieving Bazel dependencies can take a long time the first time subtask=-1 task=Build
    • my-repository: Found Remotely Starting test... Tags used in deployment:`

Expected behavior

Actual behavior

Information

apiVersion: skaffold/v4beta5
kind: Config
build:
  tagPolicy:
    sha256: {}
  artifacts:
  - image: my-repository
    context: ../../../../../../../../
    bazel:
      target: //path/to:target
      args:
      - "--cpu=k8"
deploy:
  kubectl: {}
  helm:
    releases:
      - name: server-dev
        namespace: ns-dev
        chartPath: ../../../charts
        valuesFiles:
          - ../../..charts/values-dev.yaml

Steps to reproduce the behavior

cyrilhuang commented 7 months ago

Not sure if the following log is related: `Generating tags...

No matter what I;ve changed, it's always findind latest tag, while in my previous implementation (skaffold/v2beta5), the log shows that everytime the tag is different in building step. `Generating tags...