// This is to make mocking easier in unit tests
This is to make mocking easier in unit tests
// This is to make mocking easier in unit tests
func (o *deleteSvcOpts) emptyECRRepos() error {
	var uniqueRegions []string
	for _, env := range o.environments {
		if !contains(env.Region, uniqueRegions) {
			uniqueRegions = append(uniqueRegions, env.Region)
		}
	}
	repoName := fmt.Sprintf("%s/%s", o.appName, o.name)
	for _, region := range uniqueRegions {
		sess, err := o.sess.DefaultWithRegion(region)
		if err != nil {
			return err
		}
		client := o.getECR(sess)
		if err := client.ClearRepository(repoName); err != nil {
			return err
		}
	}
	return nil
}
func ( o * deleteSvcOpts ) emptyECRRepos ( ) error { var uniqueRegions [ ] string for _ , env := range o . environments { if ! contains ( env . Region , uniqueRegions ) { uniqueRegions = append ( uniqueRegions , env . Region ) } } repoName := fmt . Sprintf ( " " , o . appName , o . name ) for _ , region := range uniqueRegions { sess , err := o . sess . DefaultWithRegion ( region ) if err != nil { return err } client := o . getECR ( sess ) if err := client . ClearRepository ( repoName ) ; err != nil { return err } } return nil }
This is to make mocking easier in unit tests
This is to make mocking easier in unit tests
// TODO: centralized ECR repo name