Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Oct 8, 2019
1 parent ff10ec1 commit b4d3280
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (a *Properties) validateMasterProfile(isUpdate bool) error {

if m.ImageRef != nil {
if m.Distro != "" {
return errors.New("masterProfile includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously.")
return errors.New("masterProfile includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously")
}
if err := m.ImageRef.validateImageNameAndGroup(); err != nil {
return err
Expand Down Expand Up @@ -504,7 +504,7 @@ func (a *Properties) validateAgentPoolProfiles(isUpdate bool) error {

if agentPoolProfile.ImageRef != nil {
if agentPoolProfile.Distro != "" {
return errors.Errorf("agentPoolProfile %s includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously.", agentPoolProfile.Name)
return errors.Errorf("agentPoolProfile %s includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously", agentPoolProfile.Name)
}
return agentPoolProfile.ImageRef.validateImageNameAndGroup()
}
Expand Down
24 changes: 12 additions & 12 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3382,7 +3382,7 @@ func TestValidateMasterProfileImageRef(t *testing.T) {
},
},
isUpdate: false,
expectedError: errors.New("masterProfile includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously."),
expectedError: errors.New("masterProfile includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously"),
},
"should error when masterProfile includes both an ImageRef and a Distro configuration in update context": {
properties: &Properties{
Expand All @@ -3402,7 +3402,7 @@ func TestValidateMasterProfileImageRef(t *testing.T) {
},
},
isUpdate: true,
expectedError: errors.New("masterProfile includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously."),
expectedError: errors.New("masterProfile includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously"),
},
"should not error when masterProfile includes an ImageRef configuration only": {
properties: &Properties{
Expand Down Expand Up @@ -3518,7 +3518,7 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
Distro: AKSUbuntu1604,
ImageRef: &ImageReference{
Expand All @@ -3532,15 +3532,15 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
},
},
isUpdate: false,
expectedError: errors.Errorf("agentPoolProfile %s includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously.", "foo"),
expectedError: errors.Errorf("agentPoolProfile %s includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously", "foo"),
},
"should error when AgentPoolProfile includes both an ImageRef and a Distro configuration in update context": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
Distro: AKSUbuntu1604,
ImageRef: &ImageReference{
Expand All @@ -3554,15 +3554,15 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
},
},
isUpdate: true,
expectedError: errors.Errorf("agentPoolProfile %s includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously.", "foo"),
expectedError: errors.Errorf("agentPoolProfile %s includes a custom image configuration (imageRef) and an explicit distro configuration, you may use one of these but not both simultaneously", "foo"),
},
"should not error when AgentPoolProfile includes an ImageRef configuration only": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
ImageRef: &ImageReference{
Name: "name",
Expand All @@ -3583,7 +3583,7 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
ImageRef: &ImageReference{
Name: "name",
Expand All @@ -3604,7 +3604,7 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
Distro: AKSUbuntu1604,
},
Expand All @@ -3619,7 +3619,7 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
Distro: AKSUbuntu1604,
},
Expand All @@ -3634,7 +3634,7 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
},
},
Expand All @@ -3648,7 +3648,7 @@ func TestValidateAgentPoolProfilesImageRef(t *testing.T) {
OrchestratorType: Kubernetes,
},
AgentPoolProfiles: []*AgentPoolProfile{
&AgentPoolProfile{
{
Name: "foo",
},
},
Expand Down

0 comments on commit b4d3280

Please sign in to comment.