Skip to content

Commit 04eb2fc

Browse files
authored
Delete platform-specific specs from configv1 (#5300)
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
1 parent ad3c877 commit 04eb2fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+82
-2084
lines changed

pkg/configv1/application.go

-41
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ package config
1717
import (
1818
"encoding/json"
1919
"fmt"
20-
"os"
21-
"path/filepath"
2220
"strings"
2321

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

306-
// ScriptRunStageOptions contains all configurable values for a SCRIPT_RUN stage.
307-
type ScriptRunStageOptions struct {
308-
Env map[string]string `json:"env"`
309-
Run string `json:"run"`
310-
Timeout Duration `json:"timeout" default:"6h"`
311-
OnRollback string `json:"onRollback"`
312-
SkipOn SkipOptions `json:"skipOn,omitempty"`
313-
}
314-
315-
// Validate checks the required fields of ScriptRunStageOptions.
316-
func (s *ScriptRunStageOptions) Validate() error {
317-
if s.Run == "" {
318-
return fmt.Errorf("SCRIPT_RUN stage requires run field")
319-
}
320-
return nil
321-
}
322-
323304
type AnalysisTemplateRef struct {
324305
Name string `json:"name"`
325306
AppArgs map[string]string `json:"appArgs"`
@@ -571,25 +552,3 @@ func (dd *DriftDetection) Validate() error {
571552
}
572553
return nil
573554
}
574-
575-
func LoadApplication(repoPath, configRelPath string, appKind model.ApplicationKind) (*GenericApplicationSpec, error) {
576-
absPath := filepath.Join(repoPath, configRelPath)
577-
578-
cfg, err := LoadFromYAML(absPath)
579-
if err != nil {
580-
if os.IsNotExist(err) {
581-
return nil, fmt.Errorf("application config file %s was not found in Git", configRelPath)
582-
}
583-
return nil, err
584-
}
585-
if kind, ok := cfg.Kind.ToApplicationKind(); !ok || kind != appKind {
586-
return nil, fmt.Errorf("invalid application kind in the application config file, got: %s, expected: %s", kind, appKind)
587-
}
588-
589-
spec, ok := cfg.GetGenericApplication()
590-
if !ok {
591-
return nil, fmt.Errorf("unsupported application kind: %s", appKind)
592-
}
593-
594-
return &spec, nil
595-
}

pkg/configv1/application_cloudrun.go

-53
This file was deleted.

pkg/configv1/application_cloudrun_test.go

-77
This file was deleted.

pkg/configv1/application_ecs.go

-162
This file was deleted.

0 commit comments

Comments
 (0)