Skip to content

Commit

Permalink
Delete platform-specific specs from configv1 (#5300)
Browse files Browse the repository at this point in the history
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
  • Loading branch information
Warashi authored Oct 31, 2024
1 parent ad3c877 commit 04eb2fc
Show file tree
Hide file tree
Showing 41 changed files with 82 additions and 2,084 deletions.
41 changes: 0 additions & 41 deletions pkg/configv1/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ package config
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"strings"

"github.com/pipe-cd/pipecd/pkg/model"
Expand Down Expand Up @@ -303,23 +301,6 @@ func (a *AnalysisStageOptions) Validate() error {
return nil
}

// ScriptRunStageOptions contains all configurable values for a SCRIPT_RUN stage.
type ScriptRunStageOptions struct {
Env map[string]string `json:"env"`
Run string `json:"run"`
Timeout Duration `json:"timeout" default:"6h"`
OnRollback string `json:"onRollback"`
SkipOn SkipOptions `json:"skipOn,omitempty"`
}

// Validate checks the required fields of ScriptRunStageOptions.
func (s *ScriptRunStageOptions) Validate() error {
if s.Run == "" {
return fmt.Errorf("SCRIPT_RUN stage requires run field")
}
return nil
}

type AnalysisTemplateRef struct {
Name string `json:"name"`
AppArgs map[string]string `json:"appArgs"`
Expand Down Expand Up @@ -571,25 +552,3 @@ func (dd *DriftDetection) Validate() error {
}
return nil
}

func LoadApplication(repoPath, configRelPath string, appKind model.ApplicationKind) (*GenericApplicationSpec, error) {
absPath := filepath.Join(repoPath, configRelPath)

cfg, err := LoadFromYAML(absPath)
if err != nil {
if os.IsNotExist(err) {
return nil, fmt.Errorf("application config file %s was not found in Git", configRelPath)
}
return nil, err
}
if kind, ok := cfg.Kind.ToApplicationKind(); !ok || kind != appKind {
return nil, fmt.Errorf("invalid application kind in the application config file, got: %s, expected: %s", kind, appKind)
}

spec, ok := cfg.GetGenericApplication()
if !ok {
return nil, fmt.Errorf("unsupported application kind: %s", appKind)
}

return &spec, nil
}
53 changes: 0 additions & 53 deletions pkg/configv1/application_cloudrun.go

This file was deleted.

77 changes: 0 additions & 77 deletions pkg/configv1/application_cloudrun_test.go

This file was deleted.

162 changes: 0 additions & 162 deletions pkg/configv1/application_ecs.go

This file was deleted.

Loading

0 comments on commit 04eb2fc

Please sign in to comment.