Skip to content

Commit 4509087

Browse files
authored
Merge pull request #748 from sjberman/cherrypick-747
Cherrypick 733, 747
2 parents 96aa4e3 + bffdca6 commit 4509087

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

cmd/k8s-bigip-ctlr/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ func init() {
292292
_init()
293293
}
294294

295+
func hasCommonPartition(partitions []string) bool {
296+
for _, x := range partitions {
297+
if x == "Common" {
298+
return true
299+
}
300+
}
301+
return false
302+
}
303+
295304
func verifyArgs() error {
296305
*logLevel = strings.ToUpper(*logLevel)
297306
logErr := initLogger(*logLevel)
@@ -305,6 +314,11 @@ func verifyArgs() error {
305314

306315
if len(*bigIPPartitions) == 0 {
307316
return fmt.Errorf("missing a BIG-IP partition")
317+
} else if len(*bigIPPartitions) > 0 {
318+
err := hasCommonPartition(*bigIPPartitions)
319+
if false != err {
320+
return fmt.Errorf("Common cannot be one of the specified partitions.")
321+
}
308322
}
309323

310324
if (len(*bigIPURL) == 0 || len(*bigIPUsername) == 0 ||

cmd/k8s-bigip-ctlr/main_test.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,38 @@ var _ = Describe("Main Tests", func() {
253253
Expect(isNodePort).To(BeFalse())
254254
})
255255

256+
It("verifies Common not in list of partitions", func() {
257+
defer _init()
258+
os.Args = []string{
259+
"./bin/k8s-bigip-ctlr",
260+
"--namespace=testing",
261+
"--bigip-partition=velcro1",
262+
"--bigip-partition=velcro2",
263+
"--bigip-password=admin",
264+
"--bigip-url=bigip.example.com",
265+
"--bigip-username=admin",
266+
"--vs-snat-pool-name=test-snat-pool"}
267+
flags.Parse(os.Args)
268+
argError := verifyArgs()
269+
Expect(argError).To(BeNil())
270+
hasCommon := hasCommonPartition(*bigIPPartitions)
271+
Expect(hasCommon).To(BeFalse())
272+
273+
os.Args = []string{
274+
"./bin/k8s-bigip-ctlr",
275+
"--namespace=testing",
276+
"--bigip-partition=velcro1",
277+
"--bigip-partition=Common",
278+
"--bigip-partition=velcro2",
279+
"--bigip-password=admin",
280+
"--bigip-url=bigip.example.com",
281+
"--bigip-username=admin",
282+
"--vs-snat-pool-name=test-snat-pool"}
283+
flags.Parse(os.Args)
284+
hasCommon = hasCommonPartition(*bigIPPartitions)
285+
Expect(hasCommon).To(BeTrue())
286+
})
287+
256288
It("verifies args labels", func() {
257289
defer _init()
258290
os.Args = []string{

docs/README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,15 @@ Supported Route Annotations
740740
| virtual-server.f5.com/rewrite-target-url | string | Optional | URL host, path, or host and path to be rewritten. | N/A | |
741741
+-----------------------------------------------+-------------+-----------+-----------------------------------------------------------------------------------+-------------+-----------------------------------------+
742742

743+
.. important::
744+
745+
For edge (client) termination, a Route **must** include **either** the certificate/key literal information
746+
in the Route Spec, **or** the clientssl annotation. For re-encrypt (server) termination, a Route **must** include
747+
**either** the destinationCaCertificate literal information in the Route Spec, **or** the serverssl annotation,
748+
in addition to the edge rules listed previously. If you want to use the configuration parameters
749+
`default-clientssl` or `default-serverssl` profiles for a Route, then specify those profile names in the
750+
Route annotations in addition to the controller configuration.
751+
743752
Please see the example configuration files for more details.
744753

745754
.. _conf examples:

docs/RELEASE-NOTES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ v1.6.1
66

77
Bug Fixes
88
`````````
9+
* :issues:`486` - User cannot configure the controller to manage the Common partition.
910
* :issues:`743` - Controller doesn't temporarily remove entire BIG-IP configs after deleting a single service.
11+
* :issues:`746` - Log messages and documentation added to ensure Route profile configuration is clear.
1012

1113
v1.6.0
1214
------

pkg/appmanager/profiles.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ func (appMgr *Manager) setClientSslProfile(
127127
appMgr.customProfiles.profs[skey] = cp
128128
profRef.Partition = cp.Partition
129129
profRef.Name = cp.Name
130+
} else {
131+
log.Warningf("No profile information supplied for Route '%v'", route.ObjectMeta.Name)
132+
return
130133
}
131134
if add := rsCfg.Virtual.AddOrUpdateProfile(profRef); add {
132135
// Remove annotation profile if it exists

0 commit comments

Comments
 (0)