Skip to content

Commit

Permalink
merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kam D Kasravi committed Mar 8, 2019
1 parent d8ce973 commit 97145c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 56 deletions.
1 change: 1 addition & 0 deletions bootstrap/pkg/apis/apps/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const (
USE_BASIC_AUTH CliOption = "use_basic_auth"
OAUTH_ID CliOption = "oauth_id"
OAUTH_SECRET CliOption = "oauth_secret"
DEFAULT_CONFIG CliOption = "default_config"
)

var DefaultPackages = []string{
Expand Down
12 changes: 6 additions & 6 deletions bootstrap/pkg/apis/apps/ksonnet/v1alpha1/application_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ type RegistriesConfigFile struct {
}

type AppConfig struct {
Registries []*RegistryConfig `json:"registries,omitempty"`
Packages []KsPackage `json:"packages,omitempty"`
Components []KsComponent `json:"components,omitempty"`
Parameters []KsParameter `json:"parameters,omitempty"`
Registries []*RegistryConfig `json:"registries,omitempty"`
Packages []KsPackage `json:"packages,omitempty"`
Components []KsComponent `json:"components,omitempty"`
Parameters []KsParameter `json:"parameters,omitempty"`
// Parameters to apply when creating the ksonnet components
ApplyParameters []KsParameter `json:"applyParameters,omitempty"`
ApplyParameters []KsParameter `json:"applyParameters,omitempty"`
}

// KsonnetSpec defines the desired state of Ksonnet
Expand Down Expand Up @@ -160,7 +160,7 @@ type Ksonnet struct {
type KsonnetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Ksonnet `json:"items"`
Items []Ksonnet `json:"items"`
}

func init() {
Expand Down
50 changes: 0 additions & 50 deletions bootstrap/pkg/client/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,56 +560,6 @@ func (gcp *Gcp) generate(options map[string]interface{}) error {
gcp.GcpApp.Spec.Hostname = options[string(kftypes.HOSTNAME)].(string)
} else if gcp.GcpApp.Spec.Hostname == "" {
return fmt.Errorf("hostname is not set in default nor passed.")
=======
}
if options[string(kftypes.DefaultConfig)] == nil {
options[string(kftypes.DefaultConfig)] = configPath
}

if options[string(kftypes.EMAIL)] != nil &&
options[string(kftypes.EMAIL)].(string) != "" {
gcp.GcpApp.Spec.Email = options[string(kftypes.EMAIL)].(string)
} else if gcp.GcpApp.Spec.Email == "" {
return fmt.Errorf("Email is not set in default nor passed.")
} else {
options[string(kftypes.EMAIL)] = gcp.GcpApp.Spec.Email
}
if options[string(kftypes.IPNAME)] != nil &&
options[string(kftypes.IPNAME)].(string) != "" {
gcp.GcpApp.Spec.IpName = options[string(kftypes.IPNAME)].(string)
} else if gcp.GcpApp.Spec.IpName == "" {
return fmt.Errorf("ipName is not set in default nor passed.")
} else {
log.Infof("Using default ipName: %v", gcp.GcpApp.Spec.IpName)
options[string(kftypes.IPNAME)] = gcp.GcpApp.Spec.IpName
}

if gcp.GcpApp.Spec.UseBasicAuth {
options[string(kftypes.USE_BASIC_AUTH)] = true
} else {
options[string(kftypes.USE_BASIC_AUTH)] = false
}
if options[string(kftypes.HOSTNAME)] != nil &&
options[string(kftypes.HOSTNAME)].(string) != "" {
gcp.GcpApp.Spec.Hostname = options[string(kftypes.HOSTNAME)].(string)
} else if gcp.GcpApp.Spec.Hostname == "" {
return fmt.Errorf("hostname is not set in default nor passed.")
} else {
log.Infof("Using default hostname: %v", gcp.GcpApp.Spec.Hostname)
options[string(kftypes.HOSTNAME)] = gcp.GcpApp.Spec.Hostname
}
if options[string(kftypes.ZONE)] != nil {
gcp.GcpApp.Spec.Zone = options[string(kftypes.ZONE)].(string)
}
ks := gcp.Children[kftypes.KSONNET]
if ks != nil {
ksGenerateErr := ks.Generate(kftypes.ALL, options)
if ksGenerateErr != nil {
return fmt.Errorf("gcp generate failed for %v: %v", string(kftypes.KSONNET), ksGenerateErr)
}
} else {
log.Infof("Using default hostname: %v", gcp.GcpApp.Spec.Hostname)
options[string(kftypes.HOSTNAME)] = gcp.GcpApp.Spec.Hostname
}
if options[string(kftypes.ZONE)] != nil {
gcp.GcpApp.Spec.Zone = options[string(kftypes.ZONE)].(string)
Expand Down

0 comments on commit 97145c7

Please sign in to comment.