-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process gtps as soon they are applied #223
process gtps as soon they are applied #223
Conversation
process gtps as soon they are applied Signed-off-by: Shriram Sharma <[email protected]>
admiral/pkg/clusters/types.go
Outdated
@@ -243,3 +247,19 @@ func HandleEventForDeployment(event admiral.EventType, obj *k8sAppsV1.Deployment | |||
// Use the same function as added deployment function to update and put new service entry in place to replace old one | |||
modifyServiceEntryForNewServiceOrPod(event, env, globalIdentifier, remoteRegistry) | |||
} | |||
|
|||
// HandleEventForGlobalTrafficPolicy processes all the events related to GTPs | |||
func HandleEventForGlobalTrafficPolicy(event admiral.EventType, gtp *v1.GlobalTrafficPolicy, remoteRegistry *RemoteRegistry, clusterName string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func HandleEventForGlobalTrafficPolicy(event admiral.EventType, gtp *v1.GlobalTrafficPolicy, remoteRegistry *RemoteRegistry, clusterName string) { | |
func HandleEventForGlobalTrafficPolicy(event admiral.EventType, gtp *v1.GlobalTrafficPolicy, remoteRegistry *RemoteRegistry, clusterName string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't an error for error case would help the function ?
admiral/pkg/clusters/types.go
Outdated
@@ -243,3 +247,19 @@ func HandleEventForDeployment(event admiral.EventType, obj *k8sAppsV1.Deployment | |||
// Use the same function as added deployment function to update and put new service entry in place to replace old one | |||
modifyServiceEntryForNewServiceOrPod(event, env, globalIdentifier, remoteRegistry) | |||
} | |||
|
|||
// HandleEventForGlobalTrafficPolicy processes all the events related to GTPs | |||
func HandleEventForGlobalTrafficPolicy(event admiral.EventType, gtp *v1.GlobalTrafficPolicy, remoteRegistry *RemoteRegistry, clusterName string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a few test cases be added for HandleEventForGlobalTrafficPolicy
?
Signed-off-by: Shriram Sharma <[email protected]>
admiral/pkg/clusters/types.go
Outdated
} | ||
|
||
func (gtp *GlobalTrafficHandler) Updated(obj *v1.GlobalTrafficPolicy) { | ||
log.Infof(LogFormat, "Updated", "globaltrafficpolicy", obj.Name, gtp.ClusterID, "received") | ||
HandleEventForGlobalTrafficPolicy(admiral.Update, obj, gtp.RemoteRegistry, gtp.ClusterID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will an assignment of _ = HandleEventForGlobalTrafficPolicy(..)
help to prevent warning from Github Actions?
Signed-off-by: Shriram Sharma <[email protected]>
Signed-off-by: Shriram Sharma <[email protected]>
Signed-off-by: Shriram Sharma <[email protected]>
Signed-off-by: psikka1 <[email protected]>
Signed-off-by: sa <[email protected]>
Signed-off-by: sa <[email protected]>
Fixes #221 process gtps as soon they are applied
Signed-off-by: Shriram Sharma [email protected]