Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/integration-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Clean up disk space
run: |
echo "--- Disk space before cleanup ---"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/code
sudo rm -rf /usr/share/miniconda
sudo rm -rf /usr/share/az_deps
# Remove unused Docker images, containers, networks, and build cache
# The '|| true' prevents the workflow from failing if no items are found to prune.
docker system prune -a --force || true
docker builder prune -a --force || true

echo "--- Disk space after cleanup ---"
df -h

# Retrieve build locations with `go env`
# <https://markphelps.me/posts/speed-up-your-go-builds-with-actions-cache/>
- id: go-cache-paths
Expand Down
5 changes: 5 additions & 0 deletions pkg/skaffold/build/cluster/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type Config interface {
docker.Config

GetKubeContext() string
GetNamespace() string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Config interface embeds kubectl.Config, which already provides a GetKubeNamespace() method. Adding a new GetNamespace() method seems redundant if they both serve the purpose of retrieving the global namespace. Using two different methods for what should be the same value can lead to inconsistencies, for example if kubectl commands use a different namespace than what's passed to the build environment. To avoid API duplication and potential confusion, consider removing this new method and using the existing GetKubeNamespace() from the embedded kubectl.Config interface throughout.

Muted() config.Muted
Mode() config.RunMode
SkipTests() bool
Expand All @@ -60,6 +61,10 @@ type BuilderContext interface {

// NewBuilder creates a new Builder that builds artifacts on cluster.
func NewBuilder(bCtx BuilderContext, buildCfg *latest.ClusterDetails) (*Builder, error) {
// Prioritize global namespace flag if cluster-specific namespace is empty
if buildCfg.Namespace == "" {
buildCfg.Namespace = bCtx.GetNamespace()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To align with the suggestion of removing the new GetNamespace() method from the Config interface, you should use the existing GetKubeNamespace() method here. This ensures consistency and avoids API duplication.

Suggested change
if buildCfg.Namespace == "" {
buildCfg.Namespace = bCtx.GetNamespace()
}
if buildCfg.Namespace == "" {
buildCfg.Namespace = bCtx.GetKubeNamespace()
}

timeout, err := time.ParseDuration(buildCfg.Timeout)
if err != nil {
return nil, fmt.Errorf("parsing timeout: %w", err)
Expand Down
Loading