Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed Jul 12, 2024
1 parent 0efc8f0 commit 27b9378
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.25.0-alpha.3
VERSION ?= 0.25.0-alpha.4
# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
Expand Down
9 changes: 3 additions & 6 deletions api/v1alpha1/publishing_strategy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,9 @@ func (gen WorkloadPublishingStrategyUpgrader) Build(ctx context.Context, cl clie
}
} else {
service = &Simple{
ServiceNameOverride: &gen.ServiceName,
ServiceType: &gen.ServiceType,
ServiceNameOverride: &gen.ServiceName,
ServiceType: &gen.ServiceType,
ServicePortsOverride: gen.ServicePortOverrides,
}
}

Expand All @@ -497,10 +498,6 @@ func (gen WorkloadPublishingStrategyUpgrader) Build(ctx context.Context, cl clie
service.NetworkLoadBalancerConfig = gen.NLBSpec
}

if len(gen.ServicePortOverrides) > 0 {
service.ServicePortsOverride = gen.ServicePortOverrides
}

// STEP3: create appropriate strategy if required
if gen.Marin3r != nil {
out = &PublishingStrategy{
Expand Down
10 changes: 3 additions & 7 deletions api/v1alpha1/publishing_strategy_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func TestMapOfEnvoyDynamicConfig_AsList(t *testing.T) {
}
}

func TestWorkloadPublishingStrategyBuilder_Build(t *testing.T) {
func TestWorkloadPublishingStrategyUpgrader_Build(t *testing.T) {
type fields struct {
EndpointName string
ServiceName string
Expand Down Expand Up @@ -379,10 +379,6 @@ func TestWorkloadPublishingStrategyBuilder_Build(t *testing.T) {
Marin3rSidecar: &Marin3rSidecarSpec{
Simple: &Simple{
ServiceType: util.Pointer(ServiceTypeNLB),
ServicePortsOverride: []corev1.ServicePort{
{Name: "port1", Port: 1111, TargetPort: intstr.FromString("port1")},
{Name: "port1", Port: 2222, TargetPort: intstr.FromString("port2")},
},
},
Ports: []SidecarPort{{Name: "port1", Port: 1111}, {Name: "port2", Port: 2222}},
EnvoyDynamicConfig: map[string]EnvoyDynamicConfig{},
Expand Down Expand Up @@ -488,11 +484,11 @@ func TestWorkloadPublishingStrategyBuilder_Build(t *testing.T) {
}
got, err := gen.Build(tt.args.ctx, tt.args.cl)
if (err != nil) != tt.wantErr {
t.Errorf("WorkloadPublishingStrategyBuilder.Build() error = %v, wantErr %v", err, tt.wantErr)
t.Errorf("WorkloadPublishingStrategyUpgrader.Build() error = %v, wantErr %v", err, tt.wantErr)
return
}
if diff := cmp.Diff(got, tt.want); len(diff) > 0 {
t.Errorf("WorkloadPublishingStrategyBuilder.Build() = diff %v", diff)
t.Errorf("WorkloadPublishingStrategyUpgrader.Build() = diff %v", diff)
}
})
}
Expand Down
14 changes: 10 additions & 4 deletions bundle/manifests/saas-operator.clusterserviceversion.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/3scale/saas-operator
newTag: v0.25.0-alpha.3
newTag: v0.25.0-alpha.4
Original file line number Diff line number Diff line change
Expand Up @@ -4168,6 +4168,12 @@ spec:
- description: Override allows to directly specify a string value.
displayName: Override
path: config.accessCode.override
- description: Apicast can be used to pass down apicast endpoints configuration
displayName: Apicast
path: config.apicast
- description: Assets has configuration to access assets in AWS s3
displayName: Assets
path: config.assets
- description: AWS access key
displayName: Access Key
path: config.assets.accessKey
Expand Down
2 changes: 1 addition & 1 deletion pkg/resource_builders/service/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (sd *ServiceDescriptor) Service(prefix, suffix string) *corev1.Service {
}

// Add service ports
if spec.ServicePortsOverride != nil {
if len(spec.ServicePortsOverride) > 0 {
opts.Ports = spec.ServicePortsOverride
} else {
opts.Ports = sd.PortDefinitions
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

const (
version string = "v0.25.0-alpha.3"
version string = "v0.25.0-alpha.4"
)

// Current returns the current marin3r operator version
Expand Down

0 comments on commit 27b9378

Please sign in to comment.