Created
September 13, 2018 19:14
-
-
Save ecowden/21750e2ec3957615183380d857acdafb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// F5PoolSyncer is responsible for ensuring state on the F5 BigIP LTM. It is the glue | |
// that hides and abstracts the LTM from the rest of the code. | |
type F5PoolSyncer interface { | |
EnsurePoolPresent(k8sPool *bigipv1beta1.Pool) (*SyncResult, *bigip.Pool, error) | |
EnsurePoolAbsent(k8sPool *bigipv1beta1.Pool) (*SyncResult, error) | |
EnsureMembersPresent(k8sPool *bigipv1beta1.Pool, endpoints *corev1.Endpoints) (result *SyncResult, err error) | |
} | |
// realPoolSyncer is a concrete implementation of the PoolSyncer interface | |
// TODO this naming is awful; change it | |
type realPoolSyncer struct { | |
f5Syncer | |
} | |
// NewPoolSyncer creates a new F5PoolSyncer | |
func NewPoolSyncer() F5PoolSyncer { | |
return &realPoolSyncer{ | |
f5Syncer: newF5Syncer(), | |
} | |
} | |
func newF5Syncer() f5Syncer { | |
return f5Syncer{ | |
// TODO pull config from args or Secret | |
f5: bigip.NewSession("sndltm-int01.wwt.com", os.Getenv("LTM_USER"), os.Getenv("LTM_PW"), nil), | |
partition: "k8s", | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment