Repository: google/ko
Pull request #362 (2021-05-11 07:34:42)

Enable override of daemon publisher local domain
Add a `LocalDomain` field to `PublishOptions`, but no flag (yet?).

This allows use of a domain (base repo) other than `ko.local` for images
that are side-loaded to the local Docker daemon.

An alternative implementation would be to add a boolean field that
indicates that `ko publish` should use the value of the `KO_DOCKER_REPO`
environment variable (or the `DockerRepo` field in `PublishOptions`) as
the base name for images side-loaded to the local Docker daemon. I'd be
happy to get feedback on which option would work best.

codecov-commenter: # [Codecov](https://codecov.io/gh/google/ko/pull/362?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#362](https://codecov.io/gh/google/ko/pull/362?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (03fc792) into [main](https://codecov.io/gh/google/ko/commit/09aea0d50b94c95ab017fea0838a6450018a93db?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (09aea0d) will **increase** coverage by `0.24%`.
> The diff coverage is `73.33%`.

[![Impacted file tree graph](https://codecov.io/gh/google/ko/pull/362/graphs/tree.svg?width=650&height=150&src=pr&token=UhqMbLrA3r&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)](https://codecov.io/gh/google/ko/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

```diff
@@            Coverage Diff             @@
##             main     #362      +/-   ##
==========================================
+ Coverage   38.27%   38.52%   +0.24%     
==========================================
  Files          33       33              
  Lines        1523     1534      +11     
==========================================
+ Hits          583      591       +8     
- Misses        846      848       +2     
- Partials       94       95       +1     
```


| [Impacted Files](https://codecov.io/gh/google/ko/pull/362?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [pkg/commands/resolver.go](https://codecov.io/gh/google/ko/pull/362/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-cGtnL2NvbW1hbmRzL3Jlc29sdmVyLmdv) | `11.60% <0.00%> (-0.07%)` | :arrow_down: |
| [pkg/publish/daemon.go](https://codecov.io/gh/google/ko/pull/362/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-cGtnL3B1Ymxpc2gvZGFlbW9uLmdv) | `37.70% <84.61%> (+8.29%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/ko/pull/362?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/ko/pull/362?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Last update [09aea0d...03fc792](https://codecov.io/gh/google/ko/pull/362?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/.github/workflows/knative-boilerplate.yaml b/.github/workflows/boilerplate.yaml
similarity index 62%
rename from .github/workflows/knative-boilerplate.yaml
rename to .github/workflows/boilerplate.yaml
index c0e648b1..38c77b2d 100644
--- a/.github/workflows/knative-boilerplate.yaml
+++ b/.github/workflows/boilerplate.yaml
@@ -1,25 +1,8 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
 name: Boilerplate
 
 on:
   pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
+    branches: ['main']
 
 jobs:
 
@@ -41,15 +24,11 @@ jobs:
           language: Bash
 
     steps:
-
-      - name: Set up Go 1.15.x
-        uses: actions/setup-go@v2
+      - uses: actions/setup-go@v2
         with:
-          go-version: 1.15.x
-        id: go
+          go-version: 1.16.x
 
-      - name: Check out code
-        uses: actions/checkout@v2
+      - uses: actions/checkout@v2
 
       - name: Install Tools
         run: |
@@ -66,13 +45,8 @@ jobs:
 
           echo "${TEMP_PATH}" >> $GITHUB_PATH
 
-      - id: boilerplate_txt
-        uses: andstor/file-existence-action@v1
-        with:
-          files: ./hack/boilerplate/boilerplate.${{ matrix.extension }}.txt
       - name: ${{ matrix.language }} license boilerplate
         shell: bash
-        if: ${{ steps.boilerplate_txt.outputs.files_exists == 'true' }}
         env:
           REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }}
         run: |
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 00000000..0c2b8d9b
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,21 @@
+name: Build
+
+on:
+  pull_request: 
+    branches: ['main']
+
+jobs:
+
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-go@v2
+        with:
+          go-version: 1.16.x
+
+      - run: |
+          go build ./...
+          go test -run=^$ ./...
diff --git a/.github/workflows/knative-donotsubmit.yaml b/.github/workflows/donotsubmit.yaml
similarity index 58%
rename from .github/workflows/knative-donotsubmit.yaml
rename to .github/workflows/donotsubmit.yaml
index cec5c307..a48c1b33 100644
--- a/.github/workflows/knative-donotsubmit.yaml
+++ b/.github/workflows/donotsubmit.yaml
@@ -1,25 +1,8 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
 name: Do Not Submit
 
 on:
   pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
+    branches: ['main']
 
 jobs:
 
@@ -28,9 +11,7 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - name: Check out code
-        uses: actions/checkout@v2
-
+      - uses: actions/checkout@v2
       - name: Do Not Submit
         shell: bash
         env:
diff --git a/.github/workflows/knative-go-build.yaml b/.github/workflows/knative-go-build.yaml
deleted file mode 100644
index 7bd13004..00000000
--- a/.github/workflows/knative-go-build.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
-name: Build
-
-on:
-  pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
-
-jobs:
-
-  build:
-    name: Build
-    strategy:
-      matrix:
-        go-version: [1.15.x]
-        platform: [ubuntu-latest]
-
-    runs-on: ${{ matrix.platform }}
-
-    steps:
-
-      - name: Set up Go ${{ matrix.go-version }}
-        uses: actions/setup-go@v2
-        with:
-          go-version: ${{ matrix.go-version }}
-        id: go
-
-      - name: Check out code
-        uses: actions/checkout@v2
-
-      - name: Build
-        run: |
-          tags="$(grep -I  -r '// +build' . | \
-                grep -v '^./vendor/' | \
-                grep -v '^./hack/' | \
-                grep -v '^./third_party' | \
-                cut -f3 -d' ' | \
-                sort | uniq | \
-                grep -v '^!' | \
-                tr '\n' ' ')"
-
-          echo "Building with tags: ${tags}"
-          go test -vet=off -tags "${tags}" -run=^$ ./... | grep -v "no test" || true
-
diff --git a/.github/workflows/knative-releasability.yaml b/.github/workflows/knative-releasability.yaml
deleted file mode 100644
index c4f5fb73..00000000
--- a/.github/workflows/knative-releasability.yaml
+++ /dev/null
@@ -1,157 +0,0 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten.
-
-name: 'Releasability'
-
-on:
-  schedule:
-    - cron: '0 1 * * 1-5' # 6am Pacific, weekdays.
-
-  workflow_dispatch:      # Manual trigger.
-    inputs:
-      releaseFamily:
-        description: 'Release? (vX.Y)'
-      slackChannel:
-        description: 'Slack Channel? (release-#)'
-
-jobs:
-  releasability:
-    name: Releasability
-    runs-on: 'ubuntu-latest'
-
-    env:
-      #########################################
-      #   Update this section each release.   #
-      RELEASE: 'v0.23'
-      SLACK_CHANNEL: 'release-23'
-      #########################################
-
-    steps:
-      - name: Defaults
-        run: |
-          # If manual trigger sent releaseFamily and slackChannel, then override them
-          if [[ "${{ github.event.inputs.releaseFamily }}" != "" ]]; then
-            echo "RELEASE=${{ github.event.inputs.releaseFamily }}" >> $GITHUB_ENV
-          fi
-          if [[ "${{ github.event.inputs.slackChannel }}" != "" ]]; then
-            echo "SLACK_CHANNEL=${{ github.event.inputs.slackChannel }}" >> $GITHUB_ENV
-          fi
-          if [[ "${{ secrets.SLACK_WEBHOOK }}" != "" ]]; then
-            echo "SLACK_WEBHOOK=exists" >> $GITHUB_ENV
-          fi
-
-      - name: Set up Go 1.15.x
-        uses: actions/setup-go@v2
-        with:
-          go-version: 1.15.x
-
-      - name: Install Dependencies
-        run: GO111MODULE=on go get knative.dev/test-infra/buoy@main
-
-      - name: Check out code
-        uses: actions/checkout@v2
-
-      - name: Exists
-        id: exists
-        run: |
-          EXISTS=0
-          buoy exists go.mod --release ${RELEASE} --verbose || EXISTS=$?
-          if [[ "$EXISTS" -eq "0" ]]; then
-            EXISTS=true
-          else
-            EXISTS=false
-          fi
-          echo ::set-output name=release-branch::${EXISTS}
-
-      - name: Check
-        if: steps.exists.outputs.release-branch == 'false'
-        run: |
-          # The following pushes the stdout of buoy into $CHECK_MESSAGE
-          CHECK=0
-          echo 'CHECK_MESSAGE<<EOF' >> $GITHUB_ENV
-          buoy check go.mod --release ${RELEASE} --domain knative.dev --verbose >> $GITHUB_ENV 2>&1 || CHECK=$?
-          echo 'EOF' >> $GITHUB_ENV
-
-          # We just captured the return code of the buoy call, test it to see
-          # if we should continue validating. The next steps short circuit if
-          # we already know we are not ready for a release.
-          if [[ "$CHECK" -eq "0"  ]]; then
-            echo 'current=true' >> $GITHUB_ENV
-          else
-            echo 'current=false' >> $GITHUB_ENV
-          fi
-
-      - name: Upgrade
-        if: steps.exists.outputs.release-branch == 'false' && env.current == 'true'
-        run: |
-          # if update deps returns un-successful, then mark current to false.
-          if ! ./hack/update-deps.sh --release ${RELEASE} --upgrade; then
-            echo "VERIFY_MESSAGE=Unable to update deps for ${{ github.repository }}." >> $GITHUB_ENV
-            echo 'current=false' >> $GITHUB_ENV
-          fi
-
-      - name: Verify
-        if: steps.exists.outputs.release-branch == 'false' && env.current == 'true'
-        run: |
-          # If we don't run `git status` before the "git diff-index" it seems
-          # to list every file that's been touched by codegen.
-          git status
-
-          CHANGED="$(git diff-index --name-only HEAD --)"
-
-          # If we see no changes after the upgrade, then we are up to date.
-          if [[ "$CHANGED" == "" ]]; then
-              echo "VERIFY_MESSAGE=${{ github.repository }} up to date." >> $GITHUB_ENV
-          else
-              echo "VERIFY_MESSAGE=${{ github.repository }} is out of date." >> $GITHUB_ENV
-              echo "The following files are changed: $CHANGED"
-              echo 'current=false' >> $GITHUB_ENV
-          fi
-
-      - name: Status GO
-        if: steps.exists.outputs.release-branch == 'false' && env.current == 'true'
-        run: |
-          echo 'SLACK_COLOR=#098e00' >> $GITHUB_ENV
-          echo 'SLACK_TITLE=Releasability for ${{ github.repository }} @ ${{ env.RELEASE }} is GO!' >> $GITHUB_ENV
-
-      - name: Status NO-GO
-        if: steps.exists.outputs.release-branch == 'false' && env.current == 'false'
-        run: |
-          echo 'SLACK_COLOR=#8E1600' >> $GITHUB_ENV
-          echo 'SLACK_TITLE=Releasability for ${{ github.repository }} @ ${{ env.RELEASE }} is NO-GO!' >> $GITHUB_ENV
-
-      - name: Post status to Slack
-        # Note: using env.SLACK_WEBHOOK here because secrets are not allowed in the if block.
-        if: env.SLACK_WEBHOOK != '' && steps.exists.outputs.release-branch == 'false'
-        uses: rtCamp/action-slack-notify@v2.1.0
-        env:
-          SLACK_ICON: http://github.com/knative.png?size=48
-          SLACK_USERNAME: github-actions
-          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
-          MSG_MINIMAL: 'true'
-          SLACK_MESSAGE: |
-            ${{ env.CHECK_MESSAGE }}
-            ${{ env.VERIFY_MESSAGE }}
-            For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
-
-      - name: Fail if NO-GO
-        if: steps.exists.outputs.release-branch == 'false' && env.current == 'false'
-        run: |
-          # When we have figured out that things are NO-GO, we intentionally fail the job
-          # so that the status badge shows up red and we can use the badges to create a
-          # releasability dashboard for all of the repos.
-          exit 1
diff --git a/.github/workflows/knative-release-notes.yaml b/.github/workflows/knative-release-notes.yaml
deleted file mode 100644
index 172eb390..00000000
--- a/.github/workflows/knative-release-notes.yaml
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
-name: 'Release Notes'
-
-on:
-  workflow_dispatch:
-    inputs:
-      branch:
-        description: 'Branch? (main)'
-        required: true
-        default: 'main'
-      start-sha:
-        description: 'Starting SHA? (last tag on branch)'
-      end-sha:
-        description: 'Ending SHA? (latest HEAD)'
-
-jobs:
-  release-notes:
-    name: Release Notes
-    runs-on: 'ubuntu-latest'
-
-    env:
-      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-    steps:
-      - name: Set up Go
-        uses: actions/setup-go@v2
-        with:
-          go-version: 1.16.x
-
-      - name: Install Dependencies
-        run: GO111MODULE=on go get k8s.io/release/cmd/release-notes
-
-      - name: Check out code
-        uses: actions/checkout@v2
-        with:
-          # fetch-depth of 0 indicates all history for all branches and tags.
-          fetch-depth: 0
-
-      # Note: Defaults needs to run after we check out the repo.
-      - name: Defaults
-        run: |
-          echo ORG=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}') >> $GITHUB_ENV
-          echo REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}') >> $GITHUB_ENV
-
-          echo "BRANCH=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
-
-          if [[ "${{ github.event.inputs.start-sha }}" != "" ]]; then
-            echo "START_SHA=${{ github.event.inputs.start-sha }}" >> $GITHUB_ENV
-          else
-            # Default Starting SHA (thanks @dprotaso)
-            export semver=$(git describe --match "v[0-9]*" --abbrev=0)
-            echo "Using ${semver} tag for starting sha."
-            echo START_SHA=$(git rev-list -n 1 "${semver}") >> $GITHUB_ENV
-          fi
-
-          if [[ "${{ github.event.inputs.end-sha }}" != "" ]]; then
-            echo "END_SHA=${{ github.event.inputs.end-sha }}" >> $GITHUB_ENV
-          else
-            # Default Ending SHA (thanks @dprotaso)
-            echo "END_SHA=$(git rev-list -n 1 HEAD)" >> $GITHUB_ENV
-          fi
-
-      - name: Generate Notes
-        run: |
-          # See  https://github.com/kubernetes/release/tree/master/cmd/release-notes for options.
-          # Note: we are setting env vars in the Defaults step.
-          release-notes \
-            --required-author "" \
-            --repo-path       "$(pwd)" \
-            --output          release-notes.md
-
-      - name: Display Notes
-        run: |
-          cat release-notes.md
-
-      - name: Archive Release Notes
-        uses: actions/upload-artifact@v2
-        with:
-          name: release-notes.md
-          path: release-notes.md
diff --git a/.github/workflows/knative-security.yaml b/.github/workflows/knative-security.yaml
deleted file mode 100644
index fbfe531d..00000000
--- a/.github/workflows/knative-security.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
-name: 'Security'
-
-on:
-  push:
-    branches: [ 'main', 'master', 'release-*' ]
-
-  pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
-
-jobs:
-  analyze:
-    name: Analyze
-    runs-on: ubuntu-latest
-
-    steps:
-    - name: Checkout repository
-      uses: actions/checkout@v2
-      with:
-        # We must fetch at least the immediate parents so that if this is
-        # a pull request then we can checkout the head.
-        fetch-depth: 2
-
-    # Initializes the CodeQL tools for scanning.
-    - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
-      with:
-        languages: go
-
-    - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
-
-    - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/knative-stale.yaml b/.github/workflows/knative-stale.yaml
deleted file mode 100644
index 97282697..00000000
--- a/.github/workflows/knative-stale.yaml
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
-name: 'Close stale'
-
-on:
-  schedule:
-  - cron: '0 1 * * *'
-
-jobs:
-  stale:
-    runs-on: 'ubuntu-latest'
-    steps:
-    - uses: 'actions/stale@v3'
-      with:
-        repo-token: '${{ secrets.GITHUB_TOKEN }}' # No need to setup
-
-        stale-issue-message: |-
-          This issue is stale because it has been open for 90 days with no
-          activity. It will automatically close after 30 more days of
-          inactivity. Reopen the issue with `/reopen`. Mark the issue as
-          fresh by adding the comment `/remove-lifecycle stale`.
-        stale-issue-label: 'lifecycle/stale'
-        exempt-issue-labels: 'lifecycle/frozen'
-
-        stale-pr-message: |-
-          This Pull Request is stale because it has been open for 90 days with
-          no activity. It will automatically close after 30 more days of
-          inactivity. Reopen with `/reopen`. Mark as fresh by adding the
-          comment `/remove-lifecycle stale`.
-        stale-pr-label: 'lifecycle/stale'
-        exempt-pr-labels: 'lifecycle/frozen'
-
-        days-before-stale: 90
-        days-before-close: 30
diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml
new file mode 100644
index 00000000..12d7444c
--- /dev/null
+++ b/.github/workflows/stale.yaml
@@ -0,0 +1,30 @@
+name: 'Close stale'
+
+on:
+  schedule:
+  - cron: '0 1 * * *'
+
+jobs:
+  stale:
+    runs-on: 'ubuntu-latest'
+    steps:
+    - uses: 'actions/stale@v3'
+      with:
+        repo-token: ${{ secrets.GITHUB_TOKEN }}
+
+        stale-issue-message: |-
+          This issue is stale because it has been open for 90 days with no
+          activity. It will automatically close after 30 more days of
+          inactivity. Keep frash with the 'lifecycle/frozen' label.
+        stale-issue-label: 'lifecycle/stale'
+        exempt-issue-labels: 'lifecycle/frozen'
+
+        stale-pr-message: |-
+          This Pull Request is stale because it has been open for 90 days with
+          no activity. It will automatically close after 30 more days of
+          inactivity. Keep fresh with the 'lifecycle/frozen' label. 
+        stale-pr-label: 'lifecycle/stale'
+        exempt-pr-labels: 'lifecycle/frozen'
+
+        days-before-stale: 90
+        days-before-close: 30
diff --git a/.github/workflows/knative-style.yaml b/.github/workflows/style.yaml
similarity index 89%
rename from .github/workflows/knative-style.yaml
rename to .github/workflows/style.yaml
index c5770a4b..dda7e58f 100644
--- a/.github/workflows/knative-style.yaml
+++ b/.github/workflows/style.yaml
@@ -1,25 +1,8 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
 name: Code Style
 
 on:
   pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
+    branches: ['main']
 
 jobs:
 
@@ -40,10 +23,10 @@ jobs:
           importpath: golang.org/x/tools/cmd/goimports
 
     steps:
-      - name: Set up Go 1.15.x
+      - name: Set up Go 1.16.x
         uses: actions/setup-go@v2
         with:
-          go-version: 1.15.x
+          go-version: 1.16.x
         id: go
 
       - name: Check out code
@@ -89,10 +72,10 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - name: Set up Go 1.15.x
+      - name: Set up Go 1.16.x
         uses: actions/setup-go@v2
         with:
-          go-version: 1.15.x
+          go-version: 1.16.x
         id: go
 
       - name: Check out code
diff --git a/.github/workflows/knative-verify.yaml b/.github/workflows/verify.yaml
similarity index 51%
rename from .github/workflows/knative-verify.yaml
rename to .github/workflows/verify.yaml
index 5f20c548..b696f490 100644
--- a/.github/workflows/knative-verify.yaml
+++ b/.github/workflows/verify.yaml
@@ -1,64 +1,35 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
 name: Verify
 
 on:
   pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
+    branches: ['main']
 
 jobs:
 
   verify:
     name: Verify Deps and Codegen
-    strategy:
-      matrix:
-        go-version: [1.15.x]
-        platform: [ubuntu-latest]
-
-    runs-on: ${{ matrix.platform }}
+    runs-on: ubuntu-latest
 
     env:
       GOPATH: ${{ github.workspace }}
 
     steps:
-
-    - name: Set up Go ${{ matrix.go-version }}
-      uses: actions/setup-go@v2
+    - uses: actions/setup-go@v2
       with:
-        go-version: ${{ matrix.go-version }}
-      id: go
+        go-version: 1.16.x
+    - name: Check out code onto GOPATH
+      uses: actions/checkout@v2
+      with:
+        path: ./src/${{ github.event.repository.name }}
 
     - name: Install Dependencies
       run: |
-        curl -L https://github.com/google/ko/releases/download/v0.6.0/ko_0.6.0_Linux_x86_64.tar.gz | tar xzf - ko
-        chmod +x ./ko
-        sudo mv ko /usr/local/bin
         go get github.com/google/go-licenses
 
-    - name: Check out code onto GOPATH
-      uses: actions/checkout@v2
-      with:
-        path: ./src/knative.dev/${{ github.event.repository.name }}
-
     - name: Update Codegen
       shell: bash
       run: |
-        pushd ./src/knative.dev/${{ github.event.repository.name }}
+        pushd ./src/${{ github.event.repository.name }}
         [[ ! -f hack/update-codegen.sh ]] || ./hack/update-codegen.sh
         popd
 
@@ -72,7 +43,7 @@ jobs:
           sed ':begin;$!N;s/\n/%0A/;tbegin'
         }
 
-        pushd ./src/knative.dev/${{ github.event.repository.name }}
+        pushd ./src/${{ github.event.repository.name }}
         if [[ -z "$(git status --porcelain)" ]]; then
             echo "${{ github.repository }} up to date."
         else
diff --git a/pkg/commands/options/publish.go b/pkg/commands/options/publish.go
index 1888e7e6..597bb686 100644
--- a/pkg/commands/options/publish.go
+++ b/pkg/commands/options/publish.go
@@ -32,6 +32,9 @@ type PublishOptions struct {
 	// In normal ko usage, this is populated with the value of $KO_DOCKER_REPO.
 	DockerRepo string
 
+	// LocalDomain overrides the default domain for images loaded into the local Docker daemon. Use with Local=true.
+	LocalDomain string
+
 	Tags []string
 
 	// Push publishes images to a registry.
diff --git a/pkg/commands/resolver.go b/pkg/commands/resolver.go
index da30485a..e4d5861b 100644
--- a/pkg/commands/resolver.go
+++ b/pkg/commands/resolver.go
@@ -139,7 +139,8 @@ func makePublisher(po *options.PublishOptions) (publish.Interface, error) {
 			// TODO(jonjohnsonjr): I'm assuming that nobody will
 			// use local with other publishers, but that might
 			// not be true.
-			return publish.NewDaemon(namer, po.Tags), nil
+			return publish.NewDaemon(namer, po.Tags,
+				publish.WithLocalDomain(po.LocalDomain))
 		}
 		if repoName == publish.KindDomain {
 			return publish.NewKindPublisher(namer, po.Tags), nil
diff --git a/pkg/publish/daemon.go b/pkg/publish/daemon.go
index 67aa42ea..1b0818a6 100644
--- a/pkg/publish/daemon.go
+++ b/pkg/publish/daemon.go
@@ -1,16 +1,18 @@
-// Copyright 2018 Google LLC All Rights Reserved.
-//
-// Licensed 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.
+/*
+Copyright 2018 Google LLC All Rights Reserved.
+
+Licensed 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.
+*/
 
 package publish
 
@@ -34,13 +36,37 @@ const (
 
 // demon is intentionally misspelled to avoid name collision (and drive Jon nuts).
 type demon struct {
+	base  string
 	namer Namer
 	tags  []string
 }
 
+// DaemonOption is a functional option for NewDaemon.
+type DaemonOption func(*demon) error
+
+// WithLocalDomain is a functional option for overriding the domain used for images that are side-loaded into the daemon.
+func WithLocalDomain(domain string) DaemonOption {
+	return func(i *demon) error {
+		if domain != "" {
+			i.base = domain
+		}
+		return nil
+	}
+}
+
 // NewDaemon returns a new publish.Interface that publishes images to a container daemon.
-func NewDaemon(namer Namer, tags []string) Interface {
-	return &demon{namer, tags}
+func NewDaemon(namer Namer, tags []string, opts ...DaemonOption) (Interface, error) {
+	d := &demon{
+		base:  LocalDomain,
+		namer: namer,
+		tags:  tags,
+	}
+	for _, option := range opts {
+		if err := option(d); err != nil {
+			return nil, err
+		}
+	}
+	return d, nil
 }
 
 // getOpts returns daemon.Options. It's a var to allow it to be overridden during tests.
@@ -99,7 +125,7 @@ func (d *demon) Publish(ctx context.Context, br build.Result, s string) (name.Re
 		return nil, err
 	}
 
-	digestTag, err := name.NewTag(fmt.Sprintf("%s:%s", d.namer(LocalDomain, s), h.Hex))
+	digestTag, err := name.NewTag(fmt.Sprintf("%s:%s", d.namer(d.base, s), h.Hex))
 	if err != nil {
 		return nil, err
 	}
@@ -112,7 +138,7 @@ func (d *demon) Publish(ctx context.Context, br build.Result, s string) (name.Re
 
 	for _, tagName := range d.tags {
 		log.Printf("Adding tag %v", tagName)
-		tag, err := name.NewTag(fmt.Sprintf("%s:%s", d.namer(LocalDomain, s), tagName))
+		tag, err := name.NewTag(fmt.Sprintf("%s:%s", d.namer(d.base, s), tagName))
 		if err != nil {
 			return nil, err
 		}


Test patch:
diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml
index 5429b1c0..423b0e94 100644
--- a/.github/workflows/kind-e2e.yaml
+++ b/.github/workflows/kind-e2e.yaml
@@ -2,7 +2,7 @@ name: KinD e2e tests
 
 on:
   pull_request:
-    branches: [ 'master' ]
+    branches: ['main']
 
 defaults:
   run:
@@ -47,10 +47,9 @@ jobs:
       KO_DOCKER_REPO: registry.local:5000/knative
 
     steps:
-    - name: Set up Go 1.15.x
-      uses: actions/setup-go@v2
+    - uses: actions/setup-go@v2
       with:
-        go-version: 1.15.x
+        go-version: 1.16.x
 
     - name: Check out code onto GOPATH
       uses: actions/checkout@v2
diff --git a/.github/workflows/knative-go-test.yaml b/.github/workflows/knative-go-test.yaml
deleted file mode 100644
index 965df1e7..00000000
--- a/.github/workflows/knative-go-test.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
-
-name: Test
-
-on:
-
-  push:
-    branches: [ 'main', 'master' ]
-
-  pull_request:
-    branches: [ 'main', 'master', 'release-*' ]
-
-jobs:
-
-  test:
-    name: Unit Tests
-    strategy:
-      matrix:
-        go-version: [1.15.x]
-        platform: [ubuntu-latest]
-
-    runs-on: ${{ matrix.platform }}
-
-    steps:
-
-      - name: Set up Go ${{ matrix.go-version }}
-        uses: actions/setup-go@v2
-        with:
-          go-version: ${{ matrix.go-version }}
-        id: go
-
-      - name: Check out code
-        uses: actions/checkout@v2
-
-      - name: Check for .codecov.yaml
-        id: codecov-enabled
-        uses: andstor/file-existence-action@v1
-        with:
-          files: .codecov.yaml
-
-      - if: steps.codecov-enabled.outputs.files_exists == 'true'
-        name: Produce Go Coverage
-        run: echo 'COVER_OPTS=-coverprofile=coverage.txt -covermode=atomic' >> $GITHUB_ENV
-
-      - name: Test
-        run: go test -race $COVER_OPTS ./...
-
-      - if: steps.codecov-enabled.outputs.files_exists == 'true'
-        name: Codecov
-        uses: codecov/codecov-action@v1
diff --git a/.github/workflows/modules-integration-test.yaml b/.github/workflows/modules-integration-test.yaml
index 737431e2..b81b8755 100644
--- a/.github/workflows/modules-integration-test.yaml
+++ b/.github/workflows/modules-integration-test.yaml
@@ -1,26 +1,8 @@
-# Copyright 2020 The Knative Authors.
-#
-# Licensed 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.
-
-# This file is automagically synced here from github.com/knative-sandbox/.github
-# repo by knobots: https://github.com/mattmoor/knobots and will be overwritten.
-
 name: Integration Test
 
 on:
-
   pull_request:
-    branches: [ 'master' ]
+    branches: ['main']
 
 jobs:
 
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 00000000..1fa408b4
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,23 @@
+name: Test
+
+on:
+  push:
+    branches: ['main']
+  pull_request:
+    branches: ['main']
+
+jobs:
+
+  test:
+    name: Unit Tests
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-go@v2
+        with:
+          go-version: 1.16.x
+
+      - run: go test -coverprofile=coverage.txt -covermode=atomic -race ./...
+
+      - uses: codecov/codecov-action@v1
diff --git a/pkg/publish/daemon_test.go b/pkg/publish/daemon_test.go
index f0f1c425..dfc5975f 100644
--- a/pkg/publish/daemon_test.go
+++ b/pkg/publish/daemon_test.go
@@ -1,16 +1,18 @@
-// Copyright 2018 Google LLC All Rights Reserved.
-//
-// Licensed 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.
+/*
+Copyright 2018 Google LLC All Rights Reserved.
+
+Licensed 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.
+*/
 
 package publish
 
@@ -60,7 +62,11 @@ func TestDaemon(t *testing.T) {
 		t.Fatalf("random.Image() = %v", err)
 	}
 
-	def := NewDaemon(md5Hash, []string{})
+	def, err := NewDaemon(md5Hash, []string{})
+	if err != nil {
+		t.Fatalf("NewDaemon() = %v", err)
+	}
+
 	if d, err := def.Publish(context.Background(), img, importpath); err != nil {
 		t.Errorf("Publish() = %v", err)
 	} else if got, want := d.String(), md5Hash("ko.local", importpath); !strings.HasPrefix(got, want) {
@@ -77,7 +83,11 @@ func TestDaemonTags(t *testing.T) {
 		t.Fatalf("random.Image() = %v", err)
 	}
 
-	def := NewDaemon(md5Hash, []string{"v2.0.0", "v1.2.3", "production"})
+	def, err := NewDaemon(md5Hash, []string{"v2.0.0", "v1.2.3", "production"})
+	if err != nil {
+		t.Fatalf("NewDaemon() = %v", err)
+	}
+
 	if d, err := def.Publish(context.Background(), img, importpath); err != nil {
 		t.Errorf("Publish() = %v", err)
 	} else if got, want := d.String(), md5Hash("ko.local", importpath); !strings.HasPrefix(got, want) {
@@ -92,3 +102,25 @@ func TestDaemonTags(t *testing.T) {
 		}
 	}
 }
+
+func TestDaemonDomain(t *testing.T) {
+	Tags = nil
+
+	importpath := "github.com/google/ko"
+	img, err := random.Image(1024, 1)
+	if err != nil {
+		t.Fatalf("random.Image() = %v", err)
+	}
+
+	localDomain := "registry.example.com/repository"
+	def, err := NewDaemon(md5Hash, []string{}, WithLocalDomain(localDomain))
+	if err != nil {
+		t.Fatalf("NewDaemon() = %v", err)
+	}
+
+	if d, err := def.Publish(context.Background(), img, importpath); err != nil {
+		t.Errorf("Publish() = %v", err)
+	} else if got, want := d.String(), md5Hash(localDomain, importpath); !strings.HasPrefix(got, want) {
+		t.Errorf("Publish() = %v, wanted prefix %v", got, want)
+	}
+}